{
  "miscs": [
    {
      "textRaw": "About this documentation",
      "name": "About this documentation",
      "introduced_in": "v0.10.0",
      "type": "misc",
      "desc": "<p>Welcome to the official API reference documentation for Node.js!</p>\n<p>Node.js is a JavaScript runtime built on the <a href=\"https://v8.dev/\">V8 JavaScript engine</a>.</p>",
      "miscs": [
        {
          "textRaw": "Contributing",
          "name": "contributing",
          "type": "misc",
          "desc": "<p>Report errors in this documentation in <a href=\"https://github.com/nodejs/node/issues/new\">the issue tracker</a>. See\n<a href=\"https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md\">the contributing guide</a> for directions on how to submit pull requests.</p>",
          "displayName": "Contributing"
        },
        {
          "textRaw": "Stability index",
          "name": "Stability index",
          "type": "misc",
          "desc": "<p>Throughout the documentation are indications of a section's stability. Some APIs\nare so proven and so relied upon that they are unlikely to ever change at all.\nOthers are brand new and experimental, or known to be hazardous.</p>\n<p>The stability indexes are as follows:</p>\n<blockquote>\n<p><a href=\"documentation.html#stability-index\">Stability: 0</a> - Deprecated. The feature may emit warnings. Backward\ncompatibility is not guaranteed.</p>\n</blockquote>\n<blockquote>\n<p>Stability: 1 - Experimental. The feature is not subject to\n<a href=\"https://semver.org/\">semantic versioning</a> rules. Non-backward compatible changes or removal may\noccur in any future release. Use of the feature is not recommended in\nproduction environments.</p>\n<p>Experimental features are subdivided into stages:</p>\n<ul>\n<li>1.0 - Early development. Experimental features at this stage are unfinished\nand subject to substantial change.</li>\n<li>1.1 - Active development. Experimental features at this stage are nearing\nminimum viability.</li>\n<li>1.2 - Release candidate. Experimental features at this stage are hopefully\nready to become stable. No further breaking changes are anticipated but may\nstill occur in response to user feedback or the features' underlying\nspecification development. We encourage user testing and feedback so that\nwe can know that this feature is ready to be marked as stable.</li>\n</ul>\n<p>Experimental features leave the experimental status typically either by\ngraduating to stable, or are removed without a deprecation cycle.</p>\n</blockquote>\n<blockquote>\n<p>Stability: 2 - Stable. Compatibility with the npm ecosystem is a high\npriority.</p>\n</blockquote>\n<blockquote>\n<p>Stability: 3 - Legacy. Although this feature is unlikely to be removed and is\nstill covered by semantic versioning guarantees, it is no longer actively\nmaintained, and other alternatives are available.</p>\n</blockquote>\n<p>Features are marked as legacy rather than being deprecated if their use does no\nharm, and they are widely relied upon within the npm ecosystem. Bugs found in\nlegacy features are unlikely to be fixed.</p>\n<p>Use caution when making use of Experimental features, particularly when\nauthoring libraries. Users may not be aware that experimental features are being\nused. Bugs or behavior changes may surprise users when Experimental API\nmodifications occur. To avoid surprises, use of an Experimental feature may need\na command-line flag. Experimental features may also emit a <a href=\"process.html#event-warning\">warning</a>.</p>"
        },
        {
          "textRaw": "Stability overview",
          "name": "stability_overview",
          "type": "misc",
          "displayName": "Stability overview"
        },
        {
          "textRaw": "JSON output",
          "name": "json_output",
          "type": "misc",
          "meta": {
            "added": [
              "v0.6.12"
            ],
            "changes": []
          },
          "desc": "<p>Every <code>.html</code> document has a corresponding <code>.json</code> document. This is for IDEs\nand other utilities that consume the documentation.</p>",
          "displayName": "JSON output"
        },
        {
          "textRaw": "System calls and man pages",
          "name": "system_calls_and_man_pages",
          "type": "misc",
          "desc": "<p>Node.js functions which wrap a system call will document that. The docs link\nto the corresponding man pages which describe how the system call works.</p>\n<p>Most Unix system calls have Windows analogues. Still, behavior differences may\nbe unavoidable.</p>",
          "displayName": "System calls and man pages"
        }
      ],
      "source": "doc/api/documentation.md"
    },
    {
      "textRaw": "Usage and example",
      "name": "Usage and example",
      "introduced_in": "v0.10.0",
      "type": "misc",
      "miscs": [
        {
          "textRaw": "Usage",
          "name": "usage",
          "type": "misc",
          "desc": "<p><code>node [options] [V8 options] [script.js | -e \"script\" | - ] [arguments]</code></p>\n<p>Please see the <a href=\"cli.html#options\">Command-line options</a> document for more information.</p>",
          "displayName": "Usage"
        },
        {
          "textRaw": "Example",
          "name": "example",
          "type": "misc",
          "desc": "<p>An example of a <a href=\"http.html\">web server</a> written with Node.js which responds with\n<code>'Hello, World!'</code>:</p>\n<p>Commands in this document start with <code>$</code> or <code>></code> to replicate how they would\nappear in a user's terminal. Do not include the <code>$</code> and <code>></code> characters. They are\nthere to show the start of each command.</p>\n<p>Lines that don't start with <code>$</code> or <code>></code> character show the output of the previous\ncommand.</p>\n<p>First, make sure to have downloaded and installed Node.js. See\n<a href=\"https://nodejs.org/en/download/package-manager/\">Installing Node.js via package manager</a> for further install information.</p>\n<p>Now, create an empty project folder called <code>projects</code>, then navigate into it.</p>\n<p>Linux and Mac:</p>\n<pre><code class=\"language-bash\">mkdir ~/projects\ncd ~/projects\n</code></pre>\n<p>Windows CMD:</p>\n<pre><code class=\"language-powershell\">mkdir %USERPROFILE%\\projects\ncd %USERPROFILE%\\projects\n</code></pre>\n<p>Windows PowerShell:</p>\n<pre><code class=\"language-powershell\">mkdir $env:USERPROFILE\\projects\ncd $env:USERPROFILE\\projects\n</code></pre>\n<p>Next, create a new source file in the <code>projects</code>\nfolder and call it <code>hello-world.js</code>.</p>\n<p>Open <code>hello-world.js</code> in any preferred text editor and\npaste in the following content:</p>\n<pre><code class=\"language-js\">const http = require('node:http');\n\nconst hostname = '127.0.0.1';\nconst port = 3000;\n\nconst server = http.createServer((req, res) => {\n  res.statusCode = 200;\n  res.setHeader('Content-Type', 'text/plain');\n  res.end('Hello, World!\\n');\n});\n\nserver.listen(port, hostname, () => {\n  console.log(`Server running at http://${hostname}:${port}/`);\n});\n</code></pre>\n<p>Save the file. Then, in the terminal window, to run the <code>hello-world.js</code> file,\nenter:</p>\n<pre><code class=\"language-bash\">node hello-world.js\n</code></pre>\n<p>Output like this should appear in the terminal:</p>\n<pre><code class=\"language-console\">Server running at http://127.0.0.1:3000/\n</code></pre>\n<p>Now, open any preferred web browser and visit <code>http://127.0.0.1:3000</code>.</p>\n<p>If the browser displays the string <code>Hello, World!</code>, that indicates\nthe server is working.</p>",
          "displayName": "Example"
        }
      ],
      "source": "doc/api/synopsis.md"
    },
    {
      "textRaw": "C++ addons",
      "name": "C++ addons",
      "introduced_in": "v0.10.0",
      "type": "misc",
      "desc": "<p><em>Addons</em> are dynamically-linked shared objects that can be loaded via the\n<a href=\"modules.html#requireid\"><code>require()</code></a> function as ordinary Node.js modules.\nAddons provide a foreign function interface between JavaScript and native code.</p>\n<p>There are three options for implementing addons:</p>\n<ul>\n<li><a href=\"n-api.html\">Node-API</a> (recommended)</li>\n<li><code>nan</code> (<a href=\"https://github.com/nodejs/nan\">Native Abstractions for Node.js</a>)</li>\n<li>direct use of internal V8, libuv, and Node.js libraries</li>\n</ul>\n<p>This rest of this document focuses on the latter, requiring\nknowledge of multiple components and APIs:</p>\n<ul>\n<li>\n<p><a href=\"https://v8.dev/\">V8</a>: the C++ library Node.js uses to provide the\nJavaScript implementation. It provides the mechanisms for creating objects,\ncalling functions, etc. The V8's API is documented mostly in the\n<code>v8.h</code> header file (<code>deps/v8/include/v8.h</code> in the Node.js source\ntree), and is also available <a href=\"https://v8docs.nodesource.com/\">online</a>.</p>\n</li>\n<li>\n<p><a href=\"https://github.com/libuv/libuv\"><code>libuv</code></a>: The C library that implements the Node.js event loop, its worker\nthreads and all of the asynchronous behaviors of the platform. It also\nserves as a cross-platform abstraction library, giving easy, POSIX-like\naccess across all major operating systems to many common system tasks, such\nas interacting with the file system, sockets, timers, and system events. libuv\nalso provides a threading abstraction similar to POSIX threads for\nmore sophisticated asynchronous addons that need to move beyond the\nstandard event loop. Addon authors should\navoid blocking the event loop with I/O or other time-intensive tasks by\noffloading work via libuv to non-blocking system operations, worker threads,\nor a custom use of libuv threads.</p>\n</li>\n<li>\n<p>Internal Node.js libraries: Node.js itself exports C++ APIs that addons can\nuse, the most important of which is the <code>node::ObjectWrap</code> class.</p>\n</li>\n<li>\n<p>Other statically linked libraries (including OpenSSL): These\nother libraries are located in the <code>deps/</code> directory in the Node.js source\ntree. Only the libuv, OpenSSL, V8, and zlib symbols are purposefully\nre-exported by Node.js and may be used to various extents by addons. See\n<a href=\"#linking-to-libraries-included-with-nodejs\">Linking to libraries included with Node.js</a> for additional information.</p>\n</li>\n</ul>\n<p>All of the following examples are available for <a href=\"https://github.com/nodejs/node-addon-examples\">download</a> and may\nbe used as the starting-point for an addon.</p>",
      "miscs": [
        {
          "textRaw": "Hello world",
          "name": "hello_world",
          "type": "misc",
          "desc": "<p>This \"Hello world\" example is a simple addon, written in C++, that is the\nequivalent of the following JavaScript code:</p>\n<pre><code class=\"language-js\">module.exports.hello = () => 'world';\n</code></pre>\n<p>First, create the file <code>hello.cc</code>:</p>\n<pre><code class=\"language-cpp\">// hello.cc\n#include &#x3C;node.h>\n\nnamespace demo {\n\nusing v8::FunctionCallbackInfo;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::NewStringType;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\nvoid Method(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n  args.GetReturnValue().Set(String::NewFromUtf8(\n      isolate, \"world\", NewStringType::kNormal).ToLocalChecked());\n}\n\nvoid Initialize(Local&#x3C;Object> exports) {\n  NODE_SET_METHOD(exports, \"hello\", Method);\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, Initialize) // N.B.: no semi-colon, this is not a function\n\n}  // namespace demo\n</code></pre>\n<p>On most platforms, the following <code>Makefile</code> can get us started:</p>\n<pre><code class=\"language-bash\">NODEJS_DEV_ROOT ?= $(shell dirname \"$$(command -v node)\")/..\nCXXFLAGS = -std=c++23 -I$(NODEJS_DEV_ROOT)/include/node -fPIC -shared -Wl,-undefined,dynamic_lookup\n\nhello.node: hello.cc\n\t$(CXX) $(CXXFLAGS) -o $@ $&#x3C;\n</code></pre>\n<p>Then running the following commands will compile and run the code:</p>\n<pre><code class=\"language-console\">$ make\n$ node -p 'require(\"./hello.node\").hello()'\nworld\n</code></pre>\n<p>To integrate with the npm ecosystem, see the <a href=\"#building\">Building</a> section.</p>",
          "modules": [
            {
              "textRaw": "Context-aware addons",
              "name": "context-aware_addons",
              "type": "module",
              "desc": "<p>Addons defined with <code>NODE_MODULE()</code> can not be loaded in multiple contexts or\nmultiple threads at the same time.</p>\n<p>There are environments in which Node.js addons may need to be loaded multiple\ntimes in multiple contexts. For example, the <a href=\"https://electronjs.org/\">Electron</a> runtime runs multiple\ninstances of Node.js in a single process. Each instance will have its own\n<code>require()</code> cache, and thus each instance will need a native addon to behave\ncorrectly when loaded via <code>require()</code>. This means that the addon\nmust support multiple initializations.</p>\n<p>A context-aware addon can be constructed by using the macro\n<code>NODE_MODULE_INITIALIZER</code>, which expands to the name of a function which Node.js\nwill expect to find when it loads an addon. An addon can thus be initialized as\nin the following example:</p>\n<pre><code class=\"language-cpp\">using namespace v8;\n\nextern \"C\" NODE_MODULE_EXPORT void\nNODE_MODULE_INITIALIZER(Local&#x3C;Object> exports,\n                        Local&#x3C;Value> module,\n                        Local&#x3C;Context> context) {\n  /* Perform addon initialization steps here. */\n}\n</code></pre>\n<p>Another option is to use the macro <code>NODE_MODULE_INIT()</code>, which will also\nconstruct a context-aware addon. Unlike <code>NODE_MODULE()</code>, which is used to\nconstruct an addon around a given addon initializer function,\n<code>NODE_MODULE_INIT()</code> serves as the declaration of such an initializer to be\nfollowed by a function body.</p>\n<p>The following three variables may be used inside the function body following an\ninvocation of <code>NODE_MODULE_INIT()</code>:</p>\n<ul>\n<li><code>Local&#x3C;Object> exports</code>,</li>\n<li><code>Local&#x3C;Value> module</code>, and</li>\n<li><code>Local&#x3C;Context> context</code></li>\n</ul>\n<p>Building a context-aware addon requires careful management of global static data\nto ensure stability and correctness. Since the addon may be loaded multiple\ntimes, potentially even from different threads, any global static data stored\nin the addon must be properly protected, and must not contain any persistent\nreferences to JavaScript objects. The reason for this is that JavaScript\nobjects are only valid in one context, and will likely cause a crash when\naccessed from the wrong context or from a different thread than the one on which\nthey were created.</p>\n<p>The context-aware addon can be structured to avoid global static data by\nperforming the following steps:</p>\n<ul>\n<li>Define a class which will hold per-addon-instance data and which has a static\nmember of the form\n<pre><code class=\"language-cpp\">static void DeleteInstance(void* data) {\n  // Cast `data` to an instance of the class and delete it.\n}\n</code></pre>\n</li>\n<li>Heap-allocate an instance of this class in the addon initializer. This can be\naccomplished using the <code>new</code> keyword.</li>\n<li>Call <code>node::AddEnvironmentCleanupHook()</code>, passing it the above-created\ninstance and a pointer to <code>DeleteInstance()</code>. This will ensure the instance is\ndeleted when the environment is torn down.</li>\n<li>Store the instance of the class in a <code>v8::External</code>, and</li>\n<li>Pass the <code>v8::External</code> to all methods exposed to JavaScript by passing it\nto <code>v8::FunctionTemplate::New()</code> or <code>v8::Function::New()</code> which creates the\nnative-backed JavaScript functions. The third parameter of\n<code>v8::FunctionTemplate::New()</code> or <code>v8::Function::New()</code>  accepts the\n<code>v8::External</code> and makes it available in the native callback using the\n<code>v8::FunctionCallbackInfo::Data()</code> method.</li>\n</ul>\n<p>This will ensure that the per-addon-instance data reaches each binding that can\nbe called from JavaScript. The per-addon-instance data must also be passed into\nany asynchronous callbacks the addon may create.</p>\n<p>The following example illustrates the implementation of a context-aware addon:</p>\n<pre><code class=\"language-cpp\">#include &#x3C;node.h>\n\nusing namespace v8;\n\nclass AddonData {\n public:\n  explicit AddonData(Isolate* isolate):\n      call_count(0) {\n    // Ensure this per-addon-instance data is deleted at environment cleanup.\n    node::AddEnvironmentCleanupHook(isolate, DeleteInstance, this);\n  }\n\n  // Per-addon data.\n  int call_count;\n\n  static void DeleteInstance(void* data) {\n    delete static_cast&#x3C;AddonData*>(data);\n  }\n};\n\nstatic void Method(const v8::FunctionCallbackInfo&#x3C;v8::Value>&#x26; info) {\n  // Retrieve the per-addon-instance data.\n  AddonData* data =\n      reinterpret_cast&#x3C;AddonData*>(info.Data().As&#x3C;External>()->Value());\n  data->call_count++;\n  info.GetReturnValue().Set((double)data->call_count);\n}\n\n// Initialize this addon to be context-aware.\nNODE_MODULE_INIT(/* exports, module, context */) {\n  Isolate* isolate = Isolate::GetCurrent();\n\n  // Create a new instance of `AddonData` for this instance of the addon and\n  // tie its life cycle to that of the Node.js environment.\n  AddonData* data = new AddonData(isolate);\n\n  // Wrap the data in a `v8::External` so we can pass it to the method we\n  // expose.\n  Local&#x3C;External> external = External::New(isolate, data);\n\n  // Expose the method `Method` to JavaScript, and make sure it receives the\n  // per-addon-instance data we created above by passing `external` as the\n  // third parameter to the `FunctionTemplate` constructor.\n  exports->Set(context,\n               String::NewFromUtf8(isolate, \"method\").ToLocalChecked(),\n               FunctionTemplate::New(isolate, Method, external)\n                  ->GetFunction(context).ToLocalChecked()).FromJust();\n}\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Worker support",
                  "name": "worker_support",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v14.8.0",
                          "v12.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/34572",
                        "description": "Cleanup hooks may now be asynchronous."
                      }
                    ]
                  },
                  "desc": "<p>In order to be loaded from multiple Node.js environments,\nsuch as a main thread and a Worker thread, an add-on needs to either:</p>\n<ul>\n<li>Be an <a href=\"n-api.html\">Node-API</a> addon.</li>\n<li>Be declared as context-aware using <code>NODE_MODULE_INIT()</code> as described above.</li>\n</ul>\n<p>In order to support <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads, addons need to clean up any resources\nthey may have allocated when such a thread exits. This can be achieved through\nthe usage of the <code>AddEnvironmentCleanupHook()</code> function:</p>\n<pre><code class=\"language-cpp\">void AddEnvironmentCleanupHook(v8::Isolate* isolate,\n                               void (*fun)(void* arg),\n                               void* arg);\n</code></pre>\n<p>This function adds a hook that will run before a given Node.js instance shuts\ndown. If necessary, such hooks can be removed before they are run using\n<code>RemoveEnvironmentCleanupHook()</code>, which has the same signature. Callbacks are\nrun in last-in first-out order.</p>\n<p>If necessary, there is an additional pair of <code>AddEnvironmentCleanupHook()</code>\nand <code>RemoveEnvironmentCleanupHook()</code> overloads, where the cleanup hook takes a\ncallback function. This can be used for shutting down asynchronous resources,\nsuch as any libuv handles registered by the addon.</p>\n<p>The following <code>addon.cc</code> uses <code>AddEnvironmentCleanupHook</code>:</p>\n<pre><code class=\"language-cpp\">// addon.cc\n#include &#x3C;node.h>\n#include &#x3C;assert.h>\n#include &#x3C;stdlib.h>\n\nusing node::AddEnvironmentCleanupHook;\nusing v8::HandleScope;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Object;\n\n// Note: In a real-world application, do not rely on static/global data.\nstatic char cookie[] = \"yum yum\";\nstatic int cleanup_cb1_called = 0;\nstatic int cleanup_cb2_called = 0;\n\nstatic void cleanup_cb1(void* arg) {\n  Isolate* isolate = static_cast&#x3C;Isolate*>(arg);\n  HandleScope scope(isolate);\n  Local&#x3C;Object> obj = Object::New(isolate);\n  assert(!obj.IsEmpty());  // assert VM is still alive\n  assert(obj->IsObject());\n  cleanup_cb1_called++;\n}\n\nstatic void cleanup_cb2(void* arg) {\n  assert(arg == static_cast&#x3C;void*>(cookie));\n  cleanup_cb2_called++;\n}\n\nstatic void sanity_check(void*) {\n  assert(cleanup_cb1_called == 1);\n  assert(cleanup_cb2_called == 1);\n}\n\n// Initialize this addon to be context-aware.\nNODE_MODULE_INIT(/* exports, module, context */) {\n  Isolate* isolate = Isolate::GetCurrent();\n\n  AddEnvironmentCleanupHook(isolate, sanity_check, nullptr);\n  AddEnvironmentCleanupHook(isolate, cleanup_cb2, cookie);\n  AddEnvironmentCleanupHook(isolate, cleanup_cb1, isolate);\n}\n</code></pre>\n<p>Test in JavaScript by running:</p>\n<pre><code class=\"language-js\">// test.js\nrequire('./build/Release/addon');\n</code></pre>",
                  "displayName": "Worker support"
                }
              ],
              "displayName": "Context-aware addons"
            },
            {
              "textRaw": "Building",
              "name": "building",
              "type": "module",
              "desc": "<p>Once the source code has been written, it must be compiled into the binary\n<code>addon.node</code> file. To do so, create a file called <code>binding.gyp</code> in the\ntop-level of the project describing the build configuration of the module\nusing a JSON-like format. This file is used by <a href=\"https://github.com/nodejs/node-gyp\"><code>node-gyp</code></a>, a tool written\nspecifically to compile Node.js addons.</p>\n<pre><code class=\"language-json\">{\n  \"targets\": [\n    {\n      \"target_name\": \"addon\",\n      \"sources\": [ \"hello.cc\" ]\n    }\n  ]\n}\n</code></pre>\n<p>A version of the <code>node-gyp</code> utility is bundled and distributed with\nNode.js as part of <code>npm</code>. This version is not made directly available for\ndevelopers to use and is intended only to support the ability to use the\n<code>npm install</code> command to compile and install addons. Developers who wish to\nuse <code>node-gyp</code> directly can install it using the command\n<code>npm install -g node-gyp</code>. See the <code>node-gyp</code> <a href=\"https://github.com/nodejs/node-gyp#installation\">installation instructions</a> for\nmore information, including platform-specific requirements.</p>\n<p>Once the <code>binding.gyp</code> file has been created, use <code>node-gyp configure</code> to\ngenerate the appropriate project build files for the current platform. This\nwill generate either a <code>Makefile</code> (on Unix platforms) or a <code>vcxproj</code> file\n(on Windows) in the <code>build/</code> directory.</p>\n<p>Next, invoke the <code>node-gyp build</code> command to generate the compiled <code>addon.node</code>\nfile. This will be put into the <code>build/Release/</code> directory.</p>\n<p>When using <code>npm install</code> to install a Node.js addon, npm uses its own bundled\nversion of <code>node-gyp</code> to perform this same set of actions, generating a\ncompiled version of the addon for the user's platform on demand.</p>\n<p>Once built, the binary addon can be used from within Node.js by pointing\n<a href=\"modules.html#requireid\"><code>require()</code></a> to the built <code>addon.node</code> module:</p>\n<pre><code class=\"language-js\">// hello.js\nconst addon = require('./build/Release/addon');\n\nconsole.log(addon.hello());\n// Prints: 'world'\n</code></pre>\n<p>Because the exact path to the compiled addon binary can vary depending on how\nit is compiled (i.e. sometimes it may be in <code>./build/Debug/</code>), addons can use\nthe <a href=\"https://github.com/TooTallNate/node-bindings\">bindings</a> package to load the compiled module.</p>\n<p>While the <code>bindings</code> package implementation is more sophisticated in how it\nlocates addon modules, it is essentially using a <code>try…catch</code> pattern similar to:</p>\n<pre><code class=\"language-js\">try {\n  return require('./build/Release/addon.node');\n} catch (err) {\n  return require('./build/Debug/addon.node');\n}\n</code></pre>",
              "displayName": "Building"
            },
            {
              "textRaw": "Linking to libraries included with Node.js",
              "name": "linking_to_libraries_included_with_node.js",
              "type": "module",
              "desc": "<p>Node.js uses statically linked libraries such as V8, libuv, and OpenSSL. All\naddons are required to link to V8 and may link to any of the other dependencies\nas well. Typically, this is as simple as including the appropriate\n<code>#include &#x3C;...></code> statements (e.g. <code>#include &#x3C;v8.h></code>) and <code>node-gyp</code> will locate\nthe appropriate headers automatically. However, there are a few caveats to be\naware of:</p>\n<ul>\n<li>\n<p>When <code>node-gyp</code> runs, it will detect the specific release version of Node.js\nand download either the full source tarball or just the headers. If the full\nsource is downloaded, addons will have complete access to the full set of\nNode.js dependencies. However, if only the Node.js headers are downloaded,\nthen only the symbols exported by Node.js will be available.</p>\n</li>\n<li>\n<p><code>node-gyp</code> can be run using the <code>--nodedir</code> flag pointing at a local Node.js\nsource image. Using this option, the addon will have access to the full set of\ndependencies.</p>\n</li>\n</ul>",
              "displayName": "Linking to libraries included with Node.js"
            },
            {
              "textRaw": "Loading addons using `require()`",
              "name": "loading_addons_using_`require()`",
              "type": "module",
              "desc": "<p>The filename extension of the compiled addon binary is <code>.node</code> (as opposed\nto <code>.dll</code> or <code>.so</code>). The <a href=\"modules.html#requireid\"><code>require()</code></a> function is written to look for\nfiles with the <code>.node</code> file extension and initialize those as dynamically-linked\nlibraries.</p>\n<p>When calling <a href=\"modules.html#requireid\"><code>require()</code></a>, the <code>.node</code> extension can usually be\nomitted and Node.js will still find and initialize the addon. One caveat,\nhowever, is that Node.js will first attempt to locate and load modules or\nJavaScript files that happen to share the same base name. For instance, if\nthere is a file <code>addon.js</code> in the same directory as the binary <code>addon.node</code>,\nthen <a href=\"modules.html#requireid\"><code>require('addon')</code></a> will give precedence to the <code>addon.js</code> file\nand load it instead.</p>",
              "displayName": "Loading addons using `require()`"
            },
            {
              "textRaw": "Loading addons using `import`",
              "name": "loading_addons_using_`import`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.6.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>You can use the <a href=\"cli.html#--experimental-addon-modules\"><code>--experimental-addon-modules</code></a> flag to enable support for\nboth static <code>import</code> and dynamic <code>import()</code> to load binary addons.</p>\n<p>If we reuse the Hello World example from earlier, you could do:</p>\n<pre><code class=\"language-mjs\">// hello.mjs\nimport myAddon from './hello.node';\n// N.B.: import {hello} from './hello.node' would not work\n\nconsole.log(myAddon.hello());\n</code></pre>\n<pre><code class=\"language-console\">$ node --experimental-addon-modules hello.mjs\nworld\n</code></pre>",
              "displayName": "Loading addons using `import`"
            }
          ],
          "displayName": "Hello world"
        },
        {
          "textRaw": "Native abstractions for Node.js",
          "name": "native_abstractions_for_node.js",
          "type": "misc",
          "desc": "<p>Each of the examples illustrated in this document directly use the\nNode.js and V8 APIs for implementing addons. The V8 API can, and has, changed\ndramatically from one V8 release to the next (and one major Node.js release to\nthe next). With each change, addons may need to be updated and recompiled in\norder to continue functioning. The Node.js release schedule is designed to\nminimize the frequency and impact of such changes but there is little that\nNode.js can do to ensure stability of the V8 APIs.</p>\n<p>The <a href=\"https://github.com/nodejs/nan\">Native Abstractions for Node.js</a> (or <code>nan</code>) provide a set of tools that\naddon developers are recommended to use to keep compatibility between past and\nfuture releases of V8 and Node.js. See the <code>nan</code> <a href=\"https://github.com/nodejs/nan/tree/HEAD/examples/\">examples</a> for an\nillustration of how it can be used.</p>",
          "displayName": "Native abstractions for Node.js"
        },
        {
          "textRaw": "Node-API",
          "name": "node-api",
          "type": "misc",
          "stability": 2,
          "stabilityText": "Stable",
          "desc": "<p>See <a href=\"n-api.html\">C/C++ addons with Node-API</a>.</p>",
          "displayName": "Node-API"
        },
        {
          "textRaw": "Addon examples",
          "name": "addon_examples",
          "type": "misc",
          "desc": "<p>Following are some example addons intended to help developers get started. The\nexamples use the V8 APIs. Refer to the online <a href=\"https://v8docs.nodesource.com/\">V8 reference</a>\nfor help with the various V8 calls, and V8's <a href=\"https://v8.dev/docs/embed\">Embedder's Guide</a> for an\nexplanation of several concepts used such as handles, scopes, function\ntemplates, etc.</p>\n<p>Each of these examples using the following <code>binding.gyp</code> file:</p>\n<pre><code class=\"language-json\">{\n  \"targets\": [\n    {\n      \"target_name\": \"addon\",\n      \"sources\": [ \"addon.cc\" ]\n    }\n  ]\n}\n</code></pre>\n<p>In cases where there is more than one <code>.cc</code> file, simply add the additional\nfilename to the <code>sources</code> array:</p>\n<pre><code class=\"language-json\">\"sources\": [\"addon.cc\", \"myexample.cc\"]\n</code></pre>\n<p>Once the <code>binding.gyp</code> file is ready, the example addons can be configured and\nbuilt using <code>node-gyp</code>:</p>\n<pre><code class=\"language-bash\">node-gyp configure build\n</code></pre>",
          "modules": [
            {
              "textRaw": "Function arguments",
              "name": "function_arguments",
              "type": "module",
              "desc": "<p>Addons will typically expose objects and functions that can be accessed from\nJavaScript running within Node.js. When functions are invoked from JavaScript,\nthe input arguments and return value must be mapped to and from the C/C++\ncode.</p>\n<p>The following example illustrates how to read function arguments passed from\nJavaScript and how to return a result:</p>\n<pre><code class=\"language-cpp\">// addon.cc\n#include &#x3C;node.h>\n\nnamespace demo {\n\nusing v8::Exception;\nusing v8::FunctionCallbackInfo;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Number;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\n// This is the implementation of the \"add\" method\n// Input arguments are passed using the\n// const FunctionCallbackInfo&#x3C;Value>&#x26; args struct\nvoid Add(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n\n  // Check the number of arguments passed.\n  if (args.Length() &#x3C; 2) {\n    // Throw an Error that is passed back to JavaScript\n    isolate->ThrowException(Exception::TypeError(\n        String::NewFromUtf8(isolate,\n                            \"Wrong number of arguments\").ToLocalChecked()));\n    return;\n  }\n\n  // Check the argument types\n  if (!args[0]->IsNumber() || !args[1]->IsNumber()) {\n    isolate->ThrowException(Exception::TypeError(\n        String::NewFromUtf8(isolate,\n                            \"Wrong arguments\").ToLocalChecked()));\n    return;\n  }\n\n  // Perform the operation\n  double value =\n      args[0].As&#x3C;Number>()->Value() + args[1].As&#x3C;Number>()->Value();\n  Local&#x3C;Number> num = Number::New(isolate, value);\n\n  // Set the return value (using the passed in\n  // FunctionCallbackInfo&#x3C;Value>&#x26;)\n  args.GetReturnValue().Set(num);\n}\n\nvoid Init(Local&#x3C;Object> exports) {\n  NODE_SET_METHOD(exports, \"add\", Add);\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, Init)\n\n}  // namespace demo\n</code></pre>\n<p>Once compiled, the example addon can be required and used from within Node.js:</p>\n<pre><code class=\"language-js\">// test.js\nconst addon = require('./build/Release/addon');\n\nconsole.log('This should be eight:', addon.add(3, 5));\n</code></pre>",
              "displayName": "Function arguments"
            },
            {
              "textRaw": "Callbacks",
              "name": "callbacks",
              "type": "module",
              "desc": "<p>It is common practice within addons to pass JavaScript functions to a C++\nfunction and execute them from there. The following example illustrates how\nto invoke such callbacks:</p>\n<pre><code class=\"language-cpp\">// addon.cc\n#include &#x3C;node.h>\n\nnamespace demo {\n\nusing v8::Context;\nusing v8::Function;\nusing v8::FunctionCallbackInfo;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Null;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\nvoid RunCallback(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n  Local&#x3C;Function> cb = Local&#x3C;Function>::Cast(args[0]);\n  const unsigned argc = 1;\n  Local&#x3C;Value> argv[argc] = {\n      String::NewFromUtf8(isolate,\n                          \"hello world\").ToLocalChecked() };\n  cb->Call(context, Null(isolate), argc, argv).ToLocalChecked();\n}\n\nvoid Init(Local&#x3C;Object> exports, Local&#x3C;Object> module) {\n  NODE_SET_METHOD(module, \"exports\", RunCallback);\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, Init)\n\n}  // namespace demo\n</code></pre>\n<p>This example uses a two-argument form of <code>Init()</code> that receives the full\n<code>module</code> object as the second argument. This allows the addon to completely\noverwrite <code>exports</code> with a single function instead of adding the function as a\nproperty of <code>exports</code>.</p>\n<p>To test it, run the following JavaScript:</p>\n<pre><code class=\"language-js\">// test.js\nconst addon = require('./build/Release/addon');\n\naddon((msg) => {\n  console.log(msg);\n// Prints: 'hello world'\n});\n</code></pre>\n<p>In this example, the callback function is invoked synchronously.</p>",
              "displayName": "Callbacks"
            },
            {
              "textRaw": "Object factory",
              "name": "object_factory",
              "type": "module",
              "desc": "<p>Addons can create and return new objects from within a C++ function as\nillustrated in the following example. An object is created and returned with a\nproperty <code>msg</code> that echoes the string passed to <code>createObject()</code>:</p>\n<pre><code class=\"language-cpp\">// addon.cc\n#include &#x3C;node.h>\n\nnamespace demo {\n\nusing v8::Context;\nusing v8::FunctionCallbackInfo;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\nvoid CreateObject(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n\n  Local&#x3C;Object> obj = Object::New(isolate);\n  obj->Set(context,\n           String::NewFromUtf8(isolate,\n                               \"msg\").ToLocalChecked(),\n                               args[0]->ToString(context).ToLocalChecked())\n           .FromJust();\n\n  args.GetReturnValue().Set(obj);\n}\n\nvoid Init(Local&#x3C;Object> exports, Local&#x3C;Object> module) {\n  NODE_SET_METHOD(module, \"exports\", CreateObject);\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, Init)\n\n}  // namespace demo\n</code></pre>\n<p>To test it in JavaScript:</p>\n<pre><code class=\"language-js\">// test.js\nconst addon = require('./build/Release/addon');\n\nconst obj1 = addon('hello');\nconst obj2 = addon('world');\nconsole.log(obj1.msg, obj2.msg);\n// Prints: 'hello world'\n</code></pre>",
              "displayName": "Object factory"
            },
            {
              "textRaw": "Function factory",
              "name": "function_factory",
              "type": "module",
              "desc": "<p>Another common scenario is creating JavaScript functions that wrap C++\nfunctions and returning those back to JavaScript:</p>\n<pre><code class=\"language-cpp\">// addon.cc\n#include &#x3C;node.h>\n\nnamespace demo {\n\nusing v8::Context;\nusing v8::Function;\nusing v8::FunctionCallbackInfo;\nusing v8::FunctionTemplate;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\nvoid MyFunction(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n  args.GetReturnValue().Set(String::NewFromUtf8(\n      isolate, \"hello world\").ToLocalChecked());\n}\n\nvoid CreateFunction(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n  Local&#x3C;FunctionTemplate> tpl = FunctionTemplate::New(isolate, MyFunction);\n  Local&#x3C;Function> fn = tpl->GetFunction(context).ToLocalChecked();\n\n  // omit this to make it anonymous\n  fn->SetName(String::NewFromUtf8(\n      isolate, \"theFunction\").ToLocalChecked());\n\n  args.GetReturnValue().Set(fn);\n}\n\nvoid Init(Local&#x3C;Object> exports, Local&#x3C;Object> module) {\n  NODE_SET_METHOD(module, \"exports\", CreateFunction);\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, Init)\n\n}  // namespace demo\n</code></pre>\n<p>To test:</p>\n<pre><code class=\"language-js\">// test.js\nconst addon = require('./build/Release/addon');\n\nconst fn = addon();\nconsole.log(fn());\n// Prints: 'hello world'\n</code></pre>",
              "displayName": "Function factory"
            },
            {
              "textRaw": "Wrapping C++ objects",
              "name": "wrapping_c++_objects",
              "type": "module",
              "desc": "<p>It is also possible to wrap C++ objects/classes in a way that allows new\ninstances to be created using the JavaScript <code>new</code> operator:</p>\n<pre><code class=\"language-cpp\">// addon.cc\n#include &#x3C;node.h>\n#include \"myobject.h\"\n\nnamespace demo {\n\nusing v8::Local;\nusing v8::Object;\n\nvoid InitAll(Local&#x3C;Object> exports) {\n  MyObject::Init(exports);\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, InitAll)\n\n}  // namespace demo\n</code></pre>\n<p>Then, in <code>myobject.h</code>, the wrapper class inherits from <code>node::ObjectWrap</code>:</p>\n<pre><code class=\"language-cpp\">// myobject.h\n#ifndef MYOBJECT_H\n#define MYOBJECT_H\n\n#include &#x3C;node.h>\n#include &#x3C;node_object_wrap.h>\n\nnamespace demo {\n\nclass MyObject : public node::ObjectWrap {\n public:\n  static void Init(v8::Local&#x3C;v8::Object> exports);\n\n private:\n  explicit MyObject(double value = 0);\n  ~MyObject();\n\n  static void New(const v8::FunctionCallbackInfo&#x3C;v8::Value>&#x26; args);\n  static void PlusOne(const v8::FunctionCallbackInfo&#x3C;v8::Value>&#x26; args);\n\n  double value_;\n};\n\n}  // namespace demo\n\n#endif\n</code></pre>\n<p>In <code>myobject.cc</code>, implement the various methods that are to be exposed.\nIn the following code, the method <code>plusOne()</code> is exposed by adding it to the\nconstructor's prototype:</p>\n<pre><code class=\"language-cpp\">// myobject.cc\n#include \"myobject.h\"\n\nnamespace demo {\n\nusing v8::Context;\nusing v8::Function;\nusing v8::FunctionCallbackInfo;\nusing v8::FunctionTemplate;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Number;\nusing v8::Object;\nusing v8::ObjectTemplate;\nusing v8::String;\nusing v8::Value;\n\nMyObject::MyObject(double value) : value_(value) {\n}\n\nMyObject::~MyObject() {\n}\n\nvoid MyObject::Init(Local&#x3C;Object> exports) {\n  Isolate* isolate = Isolate::GetCurrent();\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n\n  Local&#x3C;ObjectTemplate> addon_data_tpl = ObjectTemplate::New(isolate);\n  addon_data_tpl->SetInternalFieldCount(1);  // 1 field for the MyObject::New()\n  Local&#x3C;Object> addon_data =\n      addon_data_tpl->NewInstance(context).ToLocalChecked();\n\n  // Prepare constructor template\n  Local&#x3C;FunctionTemplate> tpl = FunctionTemplate::New(isolate, New, addon_data);\n  tpl->SetClassName(String::NewFromUtf8(isolate, \"MyObject\").ToLocalChecked());\n  tpl->InstanceTemplate()->SetInternalFieldCount(1);\n\n  // Prototype\n  NODE_SET_PROTOTYPE_METHOD(tpl, \"plusOne\", PlusOne);\n\n  Local&#x3C;Function> constructor = tpl->GetFunction(context).ToLocalChecked();\n  addon_data->SetInternalField(0, constructor);\n  exports->Set(context, String::NewFromUtf8(\n      isolate, \"MyObject\").ToLocalChecked(),\n      constructor).FromJust();\n}\n\nvoid MyObject::New(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n\n  if (args.IsConstructCall()) {\n    // Invoked as constructor: `new MyObject(...)`\n    double value = args[0]->IsUndefined() ?\n        0 : args[0]->NumberValue(context).FromMaybe(0);\n    MyObject* obj = new MyObject(value);\n    obj->Wrap(args.This());\n    args.GetReturnValue().Set(args.This());\n  } else {\n    // Invoked as plain function `MyObject(...)`, turn into construct call.\n    const int argc = 1;\n    Local&#x3C;Value> argv[argc] = { args[0] };\n    Local&#x3C;Function> cons =\n        args.Data().As&#x3C;Object>()->GetInternalField(0)\n            .As&#x3C;Value>().As&#x3C;Function>();\n    Local&#x3C;Object> result =\n        cons->NewInstance(context, argc, argv).ToLocalChecked();\n    args.GetReturnValue().Set(result);\n  }\n}\n\nvoid MyObject::PlusOne(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n\n  MyObject* obj = ObjectWrap::Unwrap&#x3C;MyObject>(args.This());\n  obj->value_ += 1;\n\n  args.GetReturnValue().Set(Number::New(isolate, obj->value_));\n}\n\n}  // namespace demo\n</code></pre>\n<p>To build this example, the <code>myobject.cc</code> file must be added to the\n<code>binding.gyp</code>:</p>\n<pre><code class=\"language-json\">{\n  \"targets\": [\n    {\n      \"target_name\": \"addon\",\n      \"sources\": [\n        \"addon.cc\",\n        \"myobject.cc\"\n      ]\n    }\n  ]\n}\n</code></pre>\n<p>Test it with:</p>\n<pre><code class=\"language-js\">// test.js\nconst addon = require('./build/Release/addon');\n\nconst obj = new addon.MyObject(10);\nconsole.log(obj.plusOne());\n// Prints: 11\nconsole.log(obj.plusOne());\n// Prints: 12\nconsole.log(obj.plusOne());\n// Prints: 13\n</code></pre>\n<p>The destructor for a wrapper object will run when the object is\ngarbage-collected. For destructor testing, there are command-line flags that\ncan be used to make it possible to force garbage collection. These flags are\nprovided by the underlying V8 JavaScript engine. They are subject to change\nor removal at any time. They are not documented by Node.js or V8, and they\nshould never be used outside of testing.</p>\n<p>During shutdown of the process or worker threads destructors are not called\nby the JS engine. Therefore it's the responsibility of the user to track\nthese objects and ensure proper destruction to avoid resource leaks.</p>",
              "displayName": "Wrapping C++ objects"
            },
            {
              "textRaw": "Factory of wrapped objects",
              "name": "factory_of_wrapped_objects",
              "type": "module",
              "desc": "<p>Alternatively, it is possible to use a factory pattern to avoid explicitly\ncreating object instances using the JavaScript <code>new</code> operator:</p>\n<pre><code class=\"language-js\">const obj = addon.createObject();\n// instead of:\n// const obj = new addon.Object();\n</code></pre>\n<p>First, the <code>createObject()</code> method is implemented in <code>addon.cc</code>:</p>\n<pre><code class=\"language-cpp\">// addon.cc\n#include &#x3C;node.h>\n#include \"myobject.h\"\n\nnamespace demo {\n\nusing v8::FunctionCallbackInfo;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\nvoid CreateObject(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  MyObject::NewInstance(args);\n}\n\nvoid InitAll(Local&#x3C;Object> exports, Local&#x3C;Object> module) {\n  MyObject::Init();\n\n  NODE_SET_METHOD(module, \"exports\", CreateObject);\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, InitAll)\n\n}  // namespace demo\n</code></pre>\n<p>In <code>myobject.h</code>, the static method <code>NewInstance()</code> is added to handle\ninstantiating the object. This method takes the place of using <code>new</code> in\nJavaScript:</p>\n<pre><code class=\"language-cpp\">// myobject.h\n#ifndef MYOBJECT_H\n#define MYOBJECT_H\n\n#include &#x3C;node.h>\n#include &#x3C;node_object_wrap.h>\n\nnamespace demo {\n\nclass MyObject : public node::ObjectWrap {\n public:\n  static void Init();\n  static void NewInstance(const v8::FunctionCallbackInfo&#x3C;v8::Value>&#x26; args);\n\n private:\n  explicit MyObject(double value = 0);\n  ~MyObject();\n\n  static void New(const v8::FunctionCallbackInfo&#x3C;v8::Value>&#x26; args);\n  static void PlusOne(const v8::FunctionCallbackInfo&#x3C;v8::Value>&#x26; args);\n  static v8::Global&#x3C;v8::Function> constructor;\n  double value_;\n};\n\n}  // namespace demo\n\n#endif\n</code></pre>\n<p>The implementation in <code>myobject.cc</code> is similar to the previous example:</p>\n<pre><code class=\"language-cpp\">// myobject.cc\n#include &#x3C;node.h>\n#include \"myobject.h\"\n\nnamespace demo {\n\nusing node::AddEnvironmentCleanupHook;\nusing v8::Context;\nusing v8::Function;\nusing v8::FunctionCallbackInfo;\nusing v8::FunctionTemplate;\nusing v8::Global;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Number;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\n// Warning! This is not thread-safe, this addon cannot be used for worker\n// threads.\nGlobal&#x3C;Function> MyObject::constructor;\n\nMyObject::MyObject(double value) : value_(value) {\n}\n\nMyObject::~MyObject() {\n}\n\nvoid MyObject::Init() {\n  Isolate* isolate = Isolate::GetCurrent();\n  // Prepare constructor template\n  Local&#x3C;FunctionTemplate> tpl = FunctionTemplate::New(isolate, New);\n  tpl->SetClassName(String::NewFromUtf8(isolate, \"MyObject\").ToLocalChecked());\n  tpl->InstanceTemplate()->SetInternalFieldCount(1);\n\n  // Prototype\n  NODE_SET_PROTOTYPE_METHOD(tpl, \"plusOne\", PlusOne);\n\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n  constructor.Reset(isolate, tpl->GetFunction(context).ToLocalChecked());\n\n  AddEnvironmentCleanupHook(isolate, [](void*) {\n    constructor.Reset();\n  }, nullptr);\n}\n\nvoid MyObject::New(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n\n  if (args.IsConstructCall()) {\n    // Invoked as constructor: `new MyObject(...)`\n    double value = args[0]->IsUndefined() ?\n        0 : args[0]->NumberValue(context).FromMaybe(0);\n    MyObject* obj = new MyObject(value);\n    obj->Wrap(args.This());\n    args.GetReturnValue().Set(args.This());\n  } else {\n    // Invoked as plain function `MyObject(...)`, turn into construct call.\n    const int argc = 1;\n    Local&#x3C;Value> argv[argc] = { args[0] };\n    Local&#x3C;Function> cons = Local&#x3C;Function>::New(isolate, constructor);\n    Local&#x3C;Object> instance =\n        cons->NewInstance(context, argc, argv).ToLocalChecked();\n    args.GetReturnValue().Set(instance);\n  }\n}\n\nvoid MyObject::NewInstance(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n\n  const unsigned argc = 1;\n  Local&#x3C;Value> argv[argc] = { args[0] };\n  Local&#x3C;Function> cons = Local&#x3C;Function>::New(isolate, constructor);\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n  Local&#x3C;Object> instance =\n      cons->NewInstance(context, argc, argv).ToLocalChecked();\n\n  args.GetReturnValue().Set(instance);\n}\n\nvoid MyObject::PlusOne(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n\n  MyObject* obj = ObjectWrap::Unwrap&#x3C;MyObject>(args.This());\n  obj->value_ += 1;\n\n  args.GetReturnValue().Set(Number::New(isolate, obj->value_));\n}\n\n}  // namespace demo\n</code></pre>\n<p>Once again, to build this example, the <code>myobject.cc</code> file must be added to the\n<code>binding.gyp</code>:</p>\n<pre><code class=\"language-json\">{\n  \"targets\": [\n    {\n      \"target_name\": \"addon\",\n      \"sources\": [\n        \"addon.cc\",\n        \"myobject.cc\"\n      ]\n    }\n  ]\n}\n</code></pre>\n<p>Test it with:</p>\n<pre><code class=\"language-js\">// test.js\nconst createObject = require('./build/Release/addon');\n\nconst obj = createObject(10);\nconsole.log(obj.plusOne());\n// Prints: 11\nconsole.log(obj.plusOne());\n// Prints: 12\nconsole.log(obj.plusOne());\n// Prints: 13\n\nconst obj2 = createObject(20);\nconsole.log(obj2.plusOne());\n// Prints: 21\nconsole.log(obj2.plusOne());\n// Prints: 22\nconsole.log(obj2.plusOne());\n// Prints: 23\n</code></pre>",
              "displayName": "Factory of wrapped objects"
            },
            {
              "textRaw": "Passing wrapped objects around",
              "name": "passing_wrapped_objects_around",
              "type": "module",
              "desc": "<p>In addition to wrapping and returning C++ objects, it is possible to pass\nwrapped objects around by unwrapping them with the Node.js helper function\n<code>node::ObjectWrap::Unwrap</code>. The following examples shows a function <code>add()</code>\nthat can take two <code>MyObject</code> objects as input arguments:</p>\n<pre><code class=\"language-cpp\">// addon.cc\n#include &#x3C;node.h>\n#include &#x3C;node_object_wrap.h>\n#include \"myobject.h\"\n\nnamespace demo {\n\nusing v8::Context;\nusing v8::FunctionCallbackInfo;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Number;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\nvoid CreateObject(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  MyObject::NewInstance(args);\n}\n\nvoid Add(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n\n  MyObject* obj1 = node::ObjectWrap::Unwrap&#x3C;MyObject>(\n      args[0]->ToObject(context).ToLocalChecked());\n  MyObject* obj2 = node::ObjectWrap::Unwrap&#x3C;MyObject>(\n      args[1]->ToObject(context).ToLocalChecked());\n\n  double sum = obj1->value() + obj2->value();\n  args.GetReturnValue().Set(Number::New(isolate, sum));\n}\n\nvoid InitAll(Local&#x3C;Object> exports) {\n  MyObject::Init();\n\n  NODE_SET_METHOD(exports, \"createObject\", CreateObject);\n  NODE_SET_METHOD(exports, \"add\", Add);\n}\n\nNODE_MODULE(NODE_GYP_MODULE_NAME, InitAll)\n\n}  // namespace demo\n</code></pre>\n<p>In <code>myobject.h</code>, a new public method is added to allow access to private values\nafter unwrapping the object.</p>\n<pre><code class=\"language-cpp\">// myobject.h\n#ifndef MYOBJECT_H\n#define MYOBJECT_H\n\n#include &#x3C;node.h>\n#include &#x3C;node_object_wrap.h>\n\nnamespace demo {\n\nclass MyObject : public node::ObjectWrap {\n public:\n  static void Init();\n  static void NewInstance(const v8::FunctionCallbackInfo&#x3C;v8::Value>&#x26; args);\n  inline double value() const { return value_; }\n\n private:\n  explicit MyObject(double value = 0);\n  ~MyObject();\n\n  static void New(const v8::FunctionCallbackInfo&#x3C;v8::Value>&#x26; args);\n  static v8::Global&#x3C;v8::Function> constructor;\n  double value_;\n};\n\n}  // namespace demo\n\n#endif\n</code></pre>\n<p>The implementation of <code>myobject.cc</code> remains similar to the previous version:</p>\n<pre><code class=\"language-cpp\">// myobject.cc\n#include &#x3C;node.h>\n#include \"myobject.h\"\n\nnamespace demo {\n\nusing node::AddEnvironmentCleanupHook;\nusing v8::Context;\nusing v8::Function;\nusing v8::FunctionCallbackInfo;\nusing v8::FunctionTemplate;\nusing v8::Global;\nusing v8::Isolate;\nusing v8::Local;\nusing v8::Object;\nusing v8::String;\nusing v8::Value;\n\n// Warning! This is not thread-safe, this addon cannot be used for worker\n// threads.\nGlobal&#x3C;Function> MyObject::constructor;\n\nMyObject::MyObject(double value) : value_(value) {\n}\n\nMyObject::~MyObject() {\n}\n\nvoid MyObject::Init() {\n  Isolate* isolate = Isolate::GetCurrent();\n  // Prepare constructor template\n  Local&#x3C;FunctionTemplate> tpl = FunctionTemplate::New(isolate, New);\n  tpl->SetClassName(String::NewFromUtf8(isolate, \"MyObject\").ToLocalChecked());\n  tpl->InstanceTemplate()->SetInternalFieldCount(1);\n\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n  constructor.Reset(isolate, tpl->GetFunction(context).ToLocalChecked());\n\n  AddEnvironmentCleanupHook(isolate, [](void*) {\n    constructor.Reset();\n  }, nullptr);\n}\n\nvoid MyObject::New(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n\n  if (args.IsConstructCall()) {\n    // Invoked as constructor: `new MyObject(...)`\n    double value = args[0]->IsUndefined() ?\n        0 : args[0]->NumberValue(context).FromMaybe(0);\n    MyObject* obj = new MyObject(value);\n    obj->Wrap(args.This());\n    args.GetReturnValue().Set(args.This());\n  } else {\n    // Invoked as plain function `MyObject(...)`, turn into construct call.\n    const int argc = 1;\n    Local&#x3C;Value> argv[argc] = { args[0] };\n    Local&#x3C;Function> cons = Local&#x3C;Function>::New(isolate, constructor);\n    Local&#x3C;Object> instance =\n        cons->NewInstance(context, argc, argv).ToLocalChecked();\n    args.GetReturnValue().Set(instance);\n  }\n}\n\nvoid MyObject::NewInstance(const FunctionCallbackInfo&#x3C;Value>&#x26; args) {\n  Isolate* isolate = args.GetIsolate();\n\n  const unsigned argc = 1;\n  Local&#x3C;Value> argv[argc] = { args[0] };\n  Local&#x3C;Function> cons = Local&#x3C;Function>::New(isolate, constructor);\n  Local&#x3C;Context> context = isolate->GetCurrentContext();\n  Local&#x3C;Object> instance =\n      cons->NewInstance(context, argc, argv).ToLocalChecked();\n\n  args.GetReturnValue().Set(instance);\n}\n\n}  // namespace demo\n</code></pre>\n<p>Test it with:</p>\n<pre><code class=\"language-js\">// test.js\nconst addon = require('./build/Release/addon');\n\nconst obj1 = addon.createObject(10);\nconst obj2 = addon.createObject(20);\nconst result = addon.add(obj1, obj2);\n\nconsole.log(result);\n// Prints: 30\n</code></pre>",
              "displayName": "Passing wrapped objects around"
            }
          ],
          "displayName": "Addon examples"
        }
      ],
      "source": "doc/api/addons.md"
    },
    {
      "textRaw": "Node-API",
      "name": "Node-API",
      "introduced_in": "v8.0.0",
      "type": "misc",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>Node-API (formerly N-API) is an API for building native Addons. It is\nindependent from the underlying JavaScript runtime (for example, V8) and is\nmaintained as part of Node.js itself. This API will be Application Binary\nInterface (ABI) stable across versions of Node.js. It is intended to insulate\naddons from changes in the underlying JavaScript engine and allow modules\ncompiled for one major version to run on later major versions of Node.js without\nrecompilation. The <a href=\"https://nodejs.org/en/docs/guides/abi-stability/\">ABI Stability</a> guide provides a more in-depth explanation.</p>\n<p>Addons are built/packaged with the same approach/tools outlined in the section\ntitled <a href=\"addons.html\">C++ Addons</a>. The only difference is the set of APIs that are used by\nthe native code. Instead of using the V8 or <a href=\"https://github.com/nodejs/nan\">Native Abstractions for Node.js</a>\nAPIs, the functions available in Node-API are used.</p>\n<p>APIs exposed by Node-API are generally used to create and manipulate\nJavaScript values. Concepts and operations generally map to ideas specified\nin the ECMA-262 Language Specification. The APIs have the following\nproperties:</p>\n<ul>\n<li>All Node-API calls return a status code of type <code>napi_status</code>. This\nstatus indicates whether the API call succeeded or failed.</li>\n<li>The API's return value is passed via an out parameter.</li>\n<li>All JavaScript values are abstracted behind an opaque type named\n<code>napi_value</code>.</li>\n<li>In case of an error status code, additional information can be obtained\nusing <code>napi_get_last_error_info</code>. More information can be found in the error\nhandling section <a href=\"#error-handling\">Error handling</a>.</li>\n</ul>",
      "miscs": [
        {
          "textRaw": "Writing addons in various programming languages",
          "name": "writing_addons_in_various_programming_languages",
          "type": "misc",
          "desc": "<p>Node-API is a C API that ensures ABI stability across Node.js versions\nand different compiler levels. With this stability guarantee, it is possible\nto write addons in other programming languages on top of Node-API. Refer\nto <a href=\"https://github.com/nodejs/abi-stable-node/blob/doc/node-api-engine-bindings.md\">language and engine bindings</a> for more programming languages and engines\nsupport details.</p>\n<p><a href=\"https://github.com/nodejs/node-addon-api\"><code>node-addon-api</code></a> is the official C++ binding that provides a more efficient way to\nwrite C++ code that calls Node-API. This wrapper is a header-only library that offers an inlinable C++ API.\nBinaries built with <code>node-addon-api</code> will depend on the symbols of the Node-API\nC-based functions exported by Node.js. The following code snippet is an example\nof <code>node-addon-api</code>:</p>\n<pre><code class=\"language-cpp\">Object obj = Object::New(env);\nobj[\"foo\"] = String::New(env, \"bar\");\n</code></pre>\n<p>The above <code>node-addon-api</code> C++ code is equivalent to the following C-based\nNode-API code:</p>\n<pre><code class=\"language-cpp\">napi_status status;\nnapi_value object, string;\nstatus = napi_create_object(env, &#x26;object);\nif (status != napi_ok) {\n  napi_throw_error(env, ...);\n  return;\n}\n\nstatus = napi_create_string_utf8(env, \"bar\", NAPI_AUTO_LENGTH, &#x26;string);\nif (status != napi_ok) {\n  napi_throw_error(env, ...);\n  return;\n}\n\nstatus = napi_set_named_property(env, object, \"foo\", string);\nif (status != napi_ok) {\n  napi_throw_error(env, ...);\n  return;\n}\n</code></pre>\n<p>The end result is that the addon only uses the exported C APIs. Even though\nthe addon is written in C++, it still gets the benefits of the ABI stability\nprovided by the C Node-API.</p>\n<p>When using <code>node-addon-api</code> instead of the C APIs, start with the API <a href=\"https://github.com/nodejs/node-addon-api#api-documentation\">docs</a>\nfor <code>node-addon-api</code>.</p>\n<p>The <a href=\"https://nodejs.github.io/node-addon-examples/\">Node-API Resource</a> offers\nan excellent orientation and tips for developers just getting started with\nNode-API and <code>node-addon-api</code>. Additional media resources can be found on the\n<a href=\"https://github.com/nodejs/abi-stable-node/blob/HEAD/node-api-media.md\">Node-API Media</a> page.</p>",
          "displayName": "Writing addons in various programming languages"
        },
        {
          "textRaw": "Implications of ABI stability",
          "name": "implications_of_abi_stability",
          "type": "misc",
          "desc": "<p>Although Node-API provides an ABI stability guarantee, other parts of Node.js do\nnot, and any external libraries used from the addon may not. In particular,\nnone of the following APIs provide an ABI stability guarantee across major\nversions:</p>\n<ul>\n<li>\n<p>the Node.js C++ APIs available via any of</p>\n<pre><code class=\"language-cpp\">#include &#x3C;node.h>\n#include &#x3C;node_buffer.h>\n#include &#x3C;node_version.h>\n#include &#x3C;node_object_wrap.h>\n</code></pre>\n</li>\n<li>\n<p>the libuv APIs which are also included with Node.js and available via</p>\n<pre><code class=\"language-cpp\">#include &#x3C;uv.h>\n</code></pre>\n</li>\n<li>\n<p>the V8 API available via</p>\n<pre><code class=\"language-cpp\">#include &#x3C;v8.h>\n</code></pre>\n</li>\n</ul>\n<p>Thus, for an addon to remain ABI-compatible across Node.js major versions, it\nmust use Node-API exclusively by restricting itself to using</p>\n<pre><code class=\"language-c\">#include &#x3C;node_api.h>\n</code></pre>\n<p>and by checking, for all external libraries that it uses, that the external\nlibrary makes ABI stability guarantees similar to Node-API.</p>",
          "modules": [
            {
              "textRaw": "Enum values in ABI stability",
              "name": "enum_values_in_abi_stability",
              "type": "module",
              "desc": "<p>All enum data types defined in Node-API should be considered as a fixed size\n<code>int32_t</code> value. Bit flag enum types should be explicitly documented, and they\nwork with bit operators like bit-OR (<code>|</code>) as a bit value. Unless otherwise\ndocumented, an enum type should be considered to be extensible.</p>\n<p>A new enum value will be added at the end of the enum definition. An enum value\nwill not be removed or renamed.</p>\n<p>For an enum type returned from a Node-API function, or provided as an out\nparameter of a Node-API function, the value is an integer value and an addon\nshould handle unknown values. New values are allowed to be introduced without\na version guard. For example, when checking <code>napi_status</code> in switch statements,\nan addon should include a default branch, as new status codes may be introduced\nin newer Node.js versions.</p>\n<p>For an enum type used in an in-parameter, the result of passing an unknown\ninteger value to Node-API functions is undefined unless otherwise documented.\nA new value is added with a version guard to indicate the Node-API version in\nwhich it was introduced. For example, <code>napi_get_all_property_names</code> can be\nextended with new enum value of <code>napi_key_filter</code>.</p>\n<p>For an enum type used in both in-parameters and out-parameters, new values are\nallowed to be introduced without a version guard.</p>",
              "displayName": "Enum values in ABI stability"
            }
          ],
          "displayName": "Implications of ABI stability"
        },
        {
          "textRaw": "Building",
          "name": "building",
          "type": "misc",
          "desc": "<p>Unlike modules written in JavaScript, developing and deploying Node.js\nnative addons using Node-API requires an additional set of tools. Besides the\nbasic tools required to develop for Node.js, the native addon developer\nrequires a toolchain that can compile C and C++ code into a binary. In\naddition, depending upon how the native addon is deployed, the <em>user</em> of\nthe native addon will also need to have a C/C++ toolchain installed.</p>\n<p>For Linux developers, the necessary C/C++ toolchain packages are readily\navailable. <a href=\"https://gcc.gnu.org\">GCC</a> is widely used in the Node.js community to build and\ntest across a variety of platforms. For many developers, the <a href=\"https://llvm.org\">LLVM</a>\ncompiler infrastructure is also a good choice.</p>\n<p>For Mac developers, <a href=\"https://developer.apple.com/xcode/\">Xcode</a> offers all the required compiler tools.\nHowever, it is not necessary to install the entire Xcode IDE. The following\ncommand installs the necessary toolchain:</p>\n<pre><code class=\"language-bash\">xcode-select --install\n</code></pre>\n<p>For Windows developers, <a href=\"https://visualstudio.microsoft.com\">Visual Studio</a> offers all the required compiler\ntools. However, it is not necessary to install the entire Visual Studio\nIDE. The following command installs the necessary toolchain:</p>\n<pre><code class=\"language-bash\">npm install --global windows-build-tools\n</code></pre>\n<p>The sections below describe the additional tools available for developing\nand deploying Node.js native addons.</p>",
          "modules": [
            {
              "textRaw": "Build tools",
              "name": "build_tools",
              "type": "module",
              "desc": "<p>Both the tools listed here require that <em>users</em> of the native\naddon have a C/C++ toolchain installed in order to successfully install\nthe native addon.</p>",
              "modules": [
                {
                  "textRaw": "node-gyp",
                  "name": "node-gyp",
                  "type": "module",
                  "desc": "<p><a href=\"https://github.com/nodejs/node-gyp\">node-gyp</a> is a build system based on the <a href=\"https://github.com/nodejs/gyp-next\">gyp-next</a> fork of\nGoogle's <a href=\"https://gyp.gsrc.io\">GYP</a> tool and comes bundled with npm. GYP, and therefore node-gyp,\nrequires that Python be installed.</p>\n<p>Historically, node-gyp has been the tool of choice for building native\naddons. It has widespread adoption and documentation. However, some\ndevelopers have run into limitations in node-gyp.</p>",
                  "displayName": "node-gyp"
                },
                {
                  "textRaw": "CMake.js",
                  "name": "cmake.js",
                  "type": "module",
                  "desc": "<p><a href=\"https://github.com/cmake-js/cmake-js\">CMake.js</a> is an alternative build system based on <a href=\"https://cmake.org\">CMake</a>.</p>\n<p>CMake.js is a good choice for projects that already use CMake or for\ndevelopers affected by limitations in node-gyp. <a href=\"https://github.com/nodejs/node-addon-examples/tree/main/src/8-tooling/build_with_cmake\"><code>build_with_cmake</code></a> is an\nexample of a CMake-based native addon project.</p>",
                  "displayName": "CMake.js"
                }
              ],
              "displayName": "Build tools"
            },
            {
              "textRaw": "Uploading precompiled binaries",
              "name": "uploading_precompiled_binaries",
              "type": "module",
              "desc": "<p>The three tools listed here permit native addon developers and maintainers\nto create and upload binaries to public or private servers. These tools are\ntypically integrated with CI/CD build systems like <a href=\"https://travis-ci.org\">Travis CI</a> and\n<a href=\"https://www.appveyor.com\">AppVeyor</a> to build and upload binaries for a variety of platforms and\narchitectures. These binaries are then available for download by users who\ndo not need to have a C/C++ toolchain installed.</p>",
              "modules": [
                {
                  "textRaw": "node-pre-gyp",
                  "name": "node-pre-gyp",
                  "type": "module",
                  "desc": "<p><a href=\"https://github.com/mapbox/node-pre-gyp\">node-pre-gyp</a> is a tool based on node-gyp that adds the ability to\nupload binaries to a server of the developer's choice. node-pre-gyp has\nparticularly good support for uploading binaries to Amazon S3.</p>",
                  "displayName": "node-pre-gyp"
                },
                {
                  "textRaw": "prebuild",
                  "name": "prebuild",
                  "type": "module",
                  "desc": "<p><a href=\"https://github.com/prebuild/prebuild\">prebuild</a> is a tool that supports builds using either node-gyp or\nCMake.js. Unlike node-pre-gyp which supports a variety of servers, prebuild\nuploads binaries only to <a href=\"https://help.github.com/en/github/administering-a-repository/about-releases\">GitHub releases</a>. prebuild is a good choice for\nGitHub projects using CMake.js.</p>",
                  "displayName": "prebuild"
                },
                {
                  "textRaw": "prebuildify",
                  "name": "prebuildify",
                  "type": "module",
                  "desc": "<p><a href=\"https://github.com/prebuild/prebuildify\">prebuildify</a> is a tool based on node-gyp. The advantage of prebuildify is\nthat the built binaries are bundled with the native addon when it's\nuploaded to npm. The binaries are downloaded from npm and are immediately\navailable to the module user when the native addon is installed.</p>",
                  "displayName": "prebuildify"
                }
              ],
              "displayName": "Uploading precompiled binaries"
            }
          ],
          "displayName": "Building"
        },
        {
          "textRaw": "Usage",
          "name": "usage",
          "type": "misc",
          "desc": "<p>In order to use the Node-API functions, include the file <a href=\"https://github.com/nodejs/node/blob/HEAD/src/node_api.h\"><code>node_api.h</code></a> which\nis located in the src directory in the node development tree:</p>\n<pre><code class=\"language-c\">#include &#x3C;node_api.h>\n</code></pre>\n<p>This will opt into the default <code>NAPI_VERSION</code> for the given release of Node.js.\nIn order to ensure compatibility with specific versions of Node-API, the version\ncan be specified explicitly when including the header:</p>\n<pre><code class=\"language-c\">#define NAPI_VERSION 3\n#include &#x3C;node_api.h>\n</code></pre>\n<p>This restricts the Node-API surface to just the functionality that was available\nin the specified (and earlier) versions.</p>\n<p>Some of the Node-API surface is experimental and requires explicit opt-in:</p>\n<pre><code class=\"language-c\">#define NAPI_EXPERIMENTAL\n#include &#x3C;node_api.h>\n</code></pre>\n<p>In this case the entire API surface, including any experimental APIs, will be\navailable to the module code.</p>\n<p>Occasionally, experimental features are introduced that affect already-released\nand stable APIs. These features can be disabled by an opt-out:</p>\n<pre><code class=\"language-c\">#define NAPI_EXPERIMENTAL\n#define NODE_API_EXPERIMENTAL_&#x3C;FEATURE_NAME>_OPT_OUT\n#include &#x3C;node_api.h>\n</code></pre>\n<p>where <code>&#x3C;FEATURE_NAME></code> is the name of an experimental feature that affects both\nexperimental and stable APIs.</p>",
          "displayName": "Usage"
        },
        {
          "textRaw": "Node-API version matrix",
          "name": "node-api_version_matrix",
          "type": "misc",
          "desc": "<p>Up until version 9, Node-API versions were additive and versioned\nindependently from Node.js. This meant that any version was\nan extension to the previous version in that it had all of\nthe APIs from the previous version with some additions. Each\nNode.js version only supported a single Node-API version.\nFor example v18.15.0 supports only Node-API version 8. ABI stability was\nachieved because 8 was a strict superset of all previous versions.</p>\n<p>As of version 9, while Node-API versions continue to be versioned\nindependently, an add-on that ran with Node-API version 9 may need\ncode updates to run with Node-API version 10. ABI stability\nis maintained, however, because Node.js versions that support\nNode-API versions higher than 8 will support all versions\nbetween 8 and the highest version they support and will default\nto providing the version 8 APIs unless an add-on opts into a\nhigher Node-API version. This approach provides the flexibility\nof better optimizing existing Node-API functions while\nmaintaining ABI stability. Existing add-ons can continue to run without\nrecompilation using an earlier version of Node-API. If an add-on\nneeds functionality from a newer Node-API version, changes to existing\ncode and recompilation will be needed to use those new functions anyway.</p>\n<p>In versions of Node.js that support Node-API version 9 and later, defining\n<code>NAPI_VERSION=X</code> and using the existing add-on initialization macros\nwill bake in the requested Node-API version that will be used at runtime\ninto the add-on. If <code>NAPI_VERSION</code> is not set it will default to 8.</p>\n<p>This table may not be up to date in older streams, the most up to date\ninformation is in the latest API documentation in:\n<a href=\"https://nodejs.org/docs/latest/api/n-api.html#node-api-version-matrix\">Node-API version matrix</a></p>\n<!-- For accessibility purposes, this table needs row headers. That means we\n     can't do it in markdown. Hence, the raw HTML. -->\n<table>\n  <tr>\n    <th>Node-API version</th>\n    <th scope=\"col\">Supported In</th>\n  </tr>\n  <tr>\n    <th scope=\"row\">10</th>\n    <td>v22.14.0+, 23.6.0+ and all later versions</td>\n  </tr>\n  <tr>\n    <th scope=\"row\">9</th>\n    <td>v18.17.0+, 20.3.0+, 21.0.0 and all later versions</td>\n  </tr>\n  <tr>\n    <th scope=\"row\">8</th>\n    <td>v12.22.0+, v14.17.0+, v15.12.0+, 16.0.0 and all later versions</td>\n  </tr>\n  <tr>\n    <th scope=\"row\">7</th>\n    <td>v10.23.0+, v12.19.0+, v14.12.0+, 15.0.0 and all later versions</td>\n  </tr>\n  <tr>\n    <th scope=\"row\">6</th>\n    <td>v10.20.0+, v12.17.0+, 14.0.0 and all later versions</td>\n  </tr>\n  <tr>\n    <th scope=\"row\">5</th>\n    <td>v10.17.0+, v12.11.0+, 13.0.0 and all later versions</td>\n  </tr>\n  <tr>\n    <th scope=\"row\">4</th>\n    <td>v10.16.0+, v11.8.0+, 12.0.0 and all later versions</td>\n  </tr>\n  </tr>\n    <tr>\n    <th scope=\"row\">3</th>\n    <td>v6.14.2*, 8.11.2+, v9.11.0+*, 10.0.0 and all later versions</td>\n  </tr>\n  <tr>\n    <th scope=\"row\">2</th>\n    <td>v8.10.0+*, v9.3.0+*, 10.0.0 and all later versions</td>\n  </tr>\n  <tr>\n    <th scope=\"row\">1</th>\n    <td>v8.6.0+**, v9.0.0+*, 10.0.0 and all later versions</td>\n  </tr>\n</table>\n<p>* Node-API was experimental.</p>\n<p>** Node.js 8.0.0 included Node-API as experimental. It was released as\nNode-API version 1 but continued to evolve until Node.js 8.6.0. The API is\ndifferent in versions prior to Node.js 8.6.0. We recommend Node-API version 3 or\nlater.</p>\n<p>Each API documented for Node-API will have a header named <code>added in:</code>, and APIs\nwhich are stable will have the additional header <code>Node-API version:</code>.\nAPIs are directly usable when using a Node.js version which supports\nthe Node-API version shown in <code>Node-API version:</code> or higher.\nWhen using a Node.js version that does not support the\n<code>Node-API version:</code> listed or if there is no <code>Node-API version:</code> listed,\nthen the API will only be available if\n<code>#define NAPI_EXPERIMENTAL</code> precedes the inclusion of <code>node_api.h</code>\nor <code>js_native_api.h</code>. If an API appears not to be available on\na version of Node.js which is later than the one shown in <code>added in:</code> then\nthis is most likely the reason for the apparent absence.</p>\n<p>The Node-APIs associated strictly with accessing ECMAScript features from native\ncode can be found separately in <code>js_native_api.h</code> and <code>js_native_api_types.h</code>.\nThe APIs defined in these headers are included in <code>node_api.h</code> and\n<code>node_api_types.h</code>. The headers are structured in this way in order to allow\nimplementations of Node-API outside of Node.js. For those implementations the\nNode.js specific APIs may not be applicable.</p>\n<p>The Node.js-specific parts of an addon can be separated from the code that\nexposes the actual functionality to the JavaScript environment so that the\nlatter may be used with multiple implementations of Node-API. In the example\nbelow, <code>addon.c</code> and <code>addon.h</code> refer only to <code>js_native_api.h</code>. This ensures\nthat <code>addon.c</code> can be reused to compile against either the Node.js\nimplementation of Node-API or any implementation of Node-API outside of Node.js.</p>\n<p><code>addon_node.c</code> is a separate file that contains the Node.js specific entry point\nto the addon and which instantiates the addon by calling into <code>addon.c</code> when the\naddon is loaded into a Node.js environment.</p>\n<pre><code class=\"language-c\">// addon.h\n#ifndef _ADDON_H_\n#define _ADDON_H_\n#include &#x3C;js_native_api.h>\nnapi_value create_addon(napi_env env);\n#endif  // _ADDON_H_\n</code></pre>\n<pre><code class=\"language-c\">// addon.c\n#include \"addon.h\"\n\n#define NODE_API_CALL(env, call)                                  \\\n  do {                                                            \\\n    napi_status status = (call);                                  \\\n    if (status != napi_ok) {                                      \\\n      const napi_extended_error_info* error_info = NULL;          \\\n      napi_get_last_error_info((env), &#x26;error_info);               \\\n      const char* err_message = error_info->error_message;        \\\n      bool is_pending;                                            \\\n      napi_is_exception_pending((env), &#x26;is_pending);              \\\n      /* If an exception is already pending, don't rethrow it */  \\\n      if (!is_pending) {                                          \\\n        const char* message = (err_message == NULL)               \\\n            ? \"empty error message\"                               \\\n            : err_message;                                        \\\n        napi_throw_error((env), NULL, message);                   \\\n      }                                                           \\\n      return NULL;                                                \\\n    }                                                             \\\n  } while(0)\n\nstatic napi_value\nDoSomethingUseful(napi_env env, napi_callback_info info) {\n  // Do something useful.\n  return NULL;\n}\n\nnapi_value create_addon(napi_env env) {\n  napi_value result;\n  NODE_API_CALL(env, napi_create_object(env, &#x26;result));\n\n  napi_value exported_function;\n  NODE_API_CALL(env, napi_create_function(env,\n                                          \"doSomethingUseful\",\n                                          NAPI_AUTO_LENGTH,\n                                          DoSomethingUseful,\n                                          NULL,\n                                          &#x26;exported_function));\n\n  NODE_API_CALL(env, napi_set_named_property(env,\n                                             result,\n                                             \"doSomethingUseful\",\n                                             exported_function));\n\n  return result;\n}\n</code></pre>\n<pre><code class=\"language-c\">// addon_node.c\n#include &#x3C;node_api.h>\n#include \"addon.h\"\n\nNAPI_MODULE_INIT(/* napi_env env, napi_value exports */) {\n  // This function body is expected to return a `napi_value`.\n  // The variables `napi_env env` and `napi_value exports` may be used within\n  // the body, as they are provided by the definition of `NAPI_MODULE_INIT()`.\n  return create_addon(env);\n}\n</code></pre>",
          "displayName": "Node-API version matrix"
        },
        {
          "textRaw": "Environment life cycle APIs",
          "name": "environment_life_cycle_apis",
          "type": "misc",
          "desc": "<p><a href=\"https://tc39.es/ecma262/#sec-agents\">Section Agents</a> of the <a href=\"https://tc39.es/ecma262/\">ECMAScript Language Specification</a> defines the concept\nof an \"Agent\" as a self-contained environment in which JavaScript code runs.\nMultiple such Agents may be started and terminated either concurrently or in\nsequence by the process.</p>\n<p>A Node.js environment corresponds to an ECMAScript Agent. In the main process,\nan environment is created at startup, and additional environments can be created\non separate threads to serve as <a href=\"https://nodejs.org/api/worker_threads.html\">worker threads</a>. When Node.js is embedded in\nanother application, the main thread of the application may also construct and\ndestroy a Node.js environment multiple times during the life cycle of the\napplication process such that each Node.js environment created by the\napplication may, in turn, during its life cycle create and destroy additional\nenvironments as worker threads.</p>\n<p>From the perspective of a native addon this means that the bindings it provides\nmay be called multiple times, from multiple contexts, and even concurrently from\nmultiple threads.</p>\n<p>Native addons may need to allocate global state which they use during\ntheir life cycle of an Node.js environment such that the state can be\nunique to each instance of the addon.</p>\n<p>To this end, Node-API provides a way to associate data such that its life cycle\nis tied to the life cycle of a Node.js environment.</p>",
          "modules": [
            {
              "textRaw": "`napi_set_instance_data`",
              "name": "`napi_set_instance_data`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.8.0",
                  "v10.20.0"
                ],
                "changes": [],
                "napiVersion": [
                  6
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_set_instance_data(node_api_basic_env env,\n                                   void* data,\n                                   napi_finalize finalize_cb,\n                                   void* finalize_hint);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] data</code>: The data item to make available to bindings of this instance.</li>\n<li><code>[in] finalize_cb</code>: The function to call when the environment is being torn\ndown. The function receives <code>data</code> so that it might free it.\n<a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.</li>\n<li><code>[in] finalize_hint</code>: Optional hint to pass to the finalize callback during\ncollection.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API associates <code>data</code> with the currently running Node.js environment. <code>data</code>\ncan later be retrieved using <code>napi_get_instance_data()</code>. Any existing data\nassociated with the currently running Node.js environment which was set by means\nof a previous call to <code>napi_set_instance_data()</code> will be overwritten. If a\n<code>finalize_cb</code> was provided by the previous call, it will not be called.</p>",
              "displayName": "`napi_set_instance_data`"
            },
            {
              "textRaw": "`napi_get_instance_data`",
              "name": "`napi_get_instance_data`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.8.0",
                  "v10.20.0"
                ],
                "changes": [],
                "napiVersion": [
                  6
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_get_instance_data(node_api_basic_env env,\n                                   void** data);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[out] data</code>: The data item that was previously associated with the currently\nrunning Node.js environment by a call to <code>napi_set_instance_data()</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API retrieves data that was previously associated with the currently\nrunning Node.js environment via <code>napi_set_instance_data()</code>. If no data is set,\nthe call will succeed and <code>data</code> will be set to <code>NULL</code>.</p>",
              "displayName": "`napi_get_instance_data`"
            }
          ],
          "displayName": "Environment life cycle APIs"
        },
        {
          "textRaw": "Basic Node-API data types",
          "name": "basic_node-api_data_types",
          "type": "misc",
          "desc": "<p>Node-API exposes the following fundamental data types as abstractions that are\nconsumed by the various APIs. These APIs should be treated as opaque,\nintrospectable only with other Node-API calls.</p>",
          "modules": [
            {
              "textRaw": "`napi_status`",
              "name": "`napi_status`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<p>Integral status code indicating the success or failure of a Node-API call.\nCurrently, the following status codes are supported.</p>\n<pre><code class=\"language-c\">typedef enum {\n  napi_ok,\n  napi_invalid_arg,\n  napi_object_expected,\n  napi_string_expected,\n  napi_name_expected,\n  napi_function_expected,\n  napi_number_expected,\n  napi_boolean_expected,\n  napi_array_expected,\n  napi_generic_failure,\n  napi_pending_exception,\n  napi_cancelled,\n  napi_escape_called_twice,\n  napi_handle_scope_mismatch,\n  napi_callback_scope_mismatch,\n  napi_queue_full,\n  napi_closing,\n  napi_bigint_expected,\n  napi_date_expected,\n  napi_arraybuffer_expected,\n  napi_detachable_arraybuffer_expected,\n  napi_would_deadlock,  /* unused */\n  napi_no_external_buffers_allowed,\n  napi_cannot_run_js\n} napi_status;\n</code></pre>\n<p>If additional information is required upon an API returning a failed status,\nit can be obtained by calling <code>napi_get_last_error_info</code>.</p>",
              "displayName": "`napi_status`"
            },
            {
              "textRaw": "`napi_extended_error_info`",
              "name": "`napi_extended_error_info`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">typedef struct {\n  const char* error_message;\n  void* engine_reserved;\n  uint32_t engine_error_code;\n  napi_status error_code;\n} napi_extended_error_info;\n</code></pre>\n<ul>\n<li><code>error_message</code>: UTF8-encoded string containing a VM-neutral description of\nthe error.</li>\n<li><code>engine_reserved</code>: Reserved for VM-specific error details. This is currently\nnot implemented for any VM.</li>\n<li><code>engine_error_code</code>: VM-specific error code. This is currently\nnot implemented for any VM.</li>\n<li><code>error_code</code>: The Node-API status code that originated with the last error.</li>\n</ul>\n<p>See the <a href=\"#error-handling\">Error handling</a> section for additional information.</p>",
              "displayName": "`napi_extended_error_info`"
            },
            {
              "textRaw": "`napi_env`",
              "name": "`napi_env`",
              "type": "module",
              "desc": "<p><code>napi_env</code> is used to represent a context that the underlying Node-API\nimplementation can use to persist VM-specific state. This structure is passed\nto native functions when they're invoked, and it must be passed back when\nmaking Node-API calls. Specifically, the same <code>napi_env</code> that was passed in when\nthe initial native function was called must be passed to any subsequent\nnested Node-API calls. Caching the <code>napi_env</code> for the purpose of general reuse,\nand passing the <code>napi_env</code> between instances of the same addon running on\ndifferent <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads is not allowed. The <code>napi_env</code> becomes invalid\nwhen an instance of a native addon is unloaded. Notification of this event is\ndelivered through the callbacks given to <a href=\"#napi_add_env_cleanup_hook\"><code>napi_add_env_cleanup_hook</code></a> and\n<a href=\"#napi_set_instance_data\"><code>napi_set_instance_data</code></a>.</p>",
              "displayName": "`napi_env`"
            },
            {
              "textRaw": "`node_api_basic_env`",
              "name": "`node_api_basic_env`",
              "type": "module",
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>This variant of <code>napi_env</code> is passed to synchronous finalizers\n(<a href=\"#node_api_basic_finalize\"><code>node_api_basic_finalize</code></a>). There is a subset of Node-APIs which accept\na parameter of type <code>node_api_basic_env</code> as their first argument. These APIs do\nnot access the state of the JavaScript engine and are thus safe to call from\nsynchronous finalizers. Passing a parameter of type <code>napi_env</code> to these APIs is\nallowed, however, passing a parameter of type <code>node_api_basic_env</code> to APIs that\naccess the JavaScript engine state is not allowed. Attempting to do so without\na cast will produce a compiler warning or an error when add-ons are compiled\nwith flags which cause them to emit warnings and/or errors when incorrect\npointer types are passed into a function. Calling such APIs from a synchronous\nfinalizer will ultimately result in the termination of the application.</p>",
              "displayName": "`node_api_basic_env`"
            },
            {
              "textRaw": "`napi_value`",
              "name": "`napi_value`",
              "type": "module",
              "desc": "<p>This is an opaque pointer that is used to represent a JavaScript value.</p>",
              "displayName": "`napi_value`"
            },
            {
              "textRaw": "`napi_threadsafe_function`",
              "name": "`napi_threadsafe_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<p>This is an opaque pointer that represents a JavaScript function which can be\ncalled asynchronously from multiple threads via\n<code>napi_call_threadsafe_function()</code>.</p>",
              "displayName": "`napi_threadsafe_function`"
            },
            {
              "textRaw": "`napi_threadsafe_function_release_mode`",
              "name": "`napi_threadsafe_function_release_mode`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<p>A value to be given to <code>napi_release_threadsafe_function()</code> to indicate whether\nthe thread-safe function is to be closed immediately (<code>napi_tsfn_abort</code>) or\nmerely released (<code>napi_tsfn_release</code>) and thus available for subsequent use via\n<code>napi_acquire_threadsafe_function()</code> and <code>napi_call_threadsafe_function()</code>.</p>\n<pre><code class=\"language-c\">typedef enum {\n  napi_tsfn_release,\n  napi_tsfn_abort\n} napi_threadsafe_function_release_mode;\n</code></pre>",
              "displayName": "`napi_threadsafe_function_release_mode`"
            },
            {
              "textRaw": "`napi_threadsafe_function_call_mode`",
              "name": "`napi_threadsafe_function_call_mode`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<p>A value to be given to <code>napi_call_threadsafe_function()</code> to indicate whether\nthe call should block whenever the queue associated with the thread-safe\nfunction is full.</p>\n<pre><code class=\"language-c\">typedef enum {\n  napi_tsfn_nonblocking,\n  napi_tsfn_blocking\n} napi_threadsafe_function_call_mode;\n</code></pre>",
              "displayName": "`napi_threadsafe_function_call_mode`"
            },
            {
              "textRaw": "Node-API memory management types",
              "name": "node-api_memory_management_types",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_handle_scope`",
                  "name": "`napi_handle_scope`",
                  "type": "module",
                  "desc": "<p>This is an abstraction used to control and modify the lifetime of objects\ncreated within a particular scope. In general, Node-API values are created\nwithin the context of a handle scope. When a native method is called from\nJavaScript, a default handle scope will exist. If the user does not explicitly\ncreate a new handle scope, Node-API values will be created in the default handle\nscope. For any invocations of code outside the execution of a native method\n(for instance, during a libuv callback invocation), the module is required to\ncreate a scope before invoking any functions that can result in the creation\nof JavaScript values.</p>\n<p>Handle scopes are created using <a href=\"#napi_open_handle_scope\"><code>napi_open_handle_scope</code></a> and are destroyed\nusing <a href=\"#napi_close_handle_scope\"><code>napi_close_handle_scope</code></a>. Closing the scope can indicate to the GC\nthat all <code>napi_value</code>s created during the lifetime of the handle scope are no\nlonger referenced from the current stack frame.</p>\n<p>For more details, review the <a href=\"#object-lifetime-management\">Object lifetime management</a>.</p>",
                  "displayName": "`napi_handle_scope`"
                },
                {
                  "textRaw": "`napi_escapable_handle_scope`",
                  "name": "`napi_escapable_handle_scope`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<p>Escapable handle scopes are a special type of handle scope to return values\ncreated within a particular handle scope to a parent scope.</p>",
                  "displayName": "`napi_escapable_handle_scope`"
                },
                {
                  "textRaw": "`napi_ref`",
                  "name": "`napi_ref`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<p>This is the abstraction to use to reference a <code>napi_value</code>. This allows for\nusers to manage the lifetimes of JavaScript values, including defining their\nminimum lifetimes explicitly.</p>\n<p>For more details, review the <a href=\"#object-lifetime-management\">Object lifetime management</a>.</p>",
                  "displayName": "`napi_ref`"
                },
                {
                  "textRaw": "`napi_type_tag`",
                  "name": "`napi_type_tag`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v14.8.0",
                      "v12.19.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      8
                    ]
                  },
                  "desc": "<p>A 128-bit value stored as two unsigned 64-bit integers. It serves as a UUID\nwith which JavaScript objects or <a href=\"#napi_create_external\">externals</a> can be \"tagged\" in order to\nensure that they are of a certain type. This is a stronger check than\n<a href=\"#napi_instanceof\"><code>napi_instanceof</code></a>, because the latter can report a false positive if the\nobject's prototype has been manipulated. Type-tagging is most useful in\nconjunction with <a href=\"#napi_wrap\"><code>napi_wrap</code></a> because it ensures that the pointer retrieved\nfrom a wrapped object can be safely cast to the native type corresponding to the\ntype tag that had been previously applied to the JavaScript object.</p>\n<pre><code class=\"language-c\">typedef struct {\n  uint64_t lower;\n  uint64_t upper;\n} napi_type_tag;\n</code></pre>",
                  "displayName": "`napi_type_tag`"
                },
                {
                  "textRaw": "`napi_async_cleanup_hook_handle`",
                  "name": "`napi_async_cleanup_hook_handle`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v14.10.0",
                      "v12.19.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>An opaque value returned by <a href=\"#napi_add_async_cleanup_hook\"><code>napi_add_async_cleanup_hook</code></a>. It must be passed\nto <a href=\"#napi_remove_async_cleanup_hook\"><code>napi_remove_async_cleanup_hook</code></a> when the chain of asynchronous cleanup\nevents completes.</p>",
                  "displayName": "`napi_async_cleanup_hook_handle`"
                }
              ],
              "displayName": "Node-API memory management types"
            },
            {
              "textRaw": "Node-API callback types",
              "name": "node-api_callback_types",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_callback_info`",
                  "name": "`napi_callback_info`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<p>Opaque datatype that is passed to a callback function. It can be used for\ngetting additional information about the context in which the callback was\ninvoked.</p>",
                  "displayName": "`napi_callback_info`"
                },
                {
                  "textRaw": "`napi_callback`",
                  "name": "`napi_callback`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<p>Function pointer type for user-provided native functions which are to be\nexposed to JavaScript via Node-API. Callback functions should satisfy the\nfollowing signature:</p>\n<pre><code class=\"language-c\">typedef napi_value (*napi_callback)(napi_env, napi_callback_info);\n</code></pre>\n<p>Unless for reasons discussed in <a href=\"#object-lifetime-management\">Object Lifetime Management</a>, creating a\nhandle and/or callback scope inside a <code>napi_callback</code> is not necessary.</p>",
                  "displayName": "`napi_callback`"
                },
                {
                  "textRaw": "`node_api_basic_finalize`",
                  "name": "`node_api_basic_finalize`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v21.6.0",
                      "v20.12.0",
                      "v18.20.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "desc": "<p>Function pointer type for add-on provided functions that allow the user to be\nnotified when externally-owned data is ready to be cleaned up because the\nobject it was associated with has been garbage-collected. The user must provide\na function satisfying the following signature which would get called upon the\nobject's collection. Currently, <code>node_api_basic_finalize</code> can be used for\nfinding out when objects that have external data are collected.</p>\n<pre><code class=\"language-c\">typedef void (*node_api_basic_finalize)(node_api_basic_env env,\n                                      void* finalize_data,\n                                      void* finalize_hint);\n</code></pre>\n<p>Unless for reasons discussed in <a href=\"#object-lifetime-management\">Object Lifetime Management</a>, creating a\nhandle and/or callback scope inside the function body is not necessary.</p>\n<p>Since these functions may be called while the JavaScript engine is in a state\nwhere it cannot execute JavaScript code, only Node-APIs which accept a\n<code>node_api_basic_env</code> as their first parameter may be called.\n<a href=\"#node_api_post_finalizer\"><code>node_api_post_finalizer</code></a> can be used to schedule Node-API calls that\nrequire access to the JavaScript engine's state to run after the current\ngarbage collection cycle has completed.</p>\n<p>In the case of <a href=\"#node_api_create_external_string_latin1\"><code>node_api_create_external_string_latin1</code></a> and\n<a href=\"#node_api_create_external_string_utf16\"><code>node_api_create_external_string_utf16</code></a> the <code>env</code> parameter may be null,\nbecause external strings can be collected during the latter part of environment\nshutdown.</p>\n<p>Change History:</p>\n<ul>\n<li>\n<p>experimental (<code>NAPI_EXPERIMENTAL</code>):</p>\n<p>Only Node-API calls that accept a <code>node_api_basic_env</code> as their first\nparameter may be called, otherwise the application will be terminated with an\nappropriate error message. This feature can be turned off by defining\n<code>NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT</code>.</p>\n</li>\n</ul>",
                  "displayName": "`node_api_basic_finalize`"
                },
                {
                  "textRaw": "`napi_finalize`",
                  "name": "`napi_finalize`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<p>Function pointer type for add-on provided function that allow the user to\nschedule a group of calls to Node-APIs in response to a garbage collection\nevent, after the garbage collection cycle has completed. These function\npointers can be used with <a href=\"#node_api_post_finalizer\"><code>node_api_post_finalizer</code></a>.</p>\n<pre><code class=\"language-c\">typedef void (*napi_finalize)(napi_env env,\n                              void* finalize_data,\n                              void* finalize_hint);\n</code></pre>\n<p>Change History:</p>\n<ul>\n<li>\n<p>experimental (<code>NAPI_EXPERIMENTAL</code> is defined):</p>\n<p>A function of this type may no longer be used as a finalizer, except with\n<a href=\"#node_api_post_finalizer\"><code>node_api_post_finalizer</code></a>. <a href=\"#node_api_basic_finalize\"><code>node_api_basic_finalize</code></a> must be used\ninstead. This feature can be turned off by defining\n<code>NODE_API_EXPERIMENTAL_BASIC_ENV_OPT_OUT</code>.</p>\n</li>\n</ul>",
                  "displayName": "`napi_finalize`"
                },
                {
                  "textRaw": "`napi_async_execute_callback`",
                  "name": "`napi_async_execute_callback`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<p>Function pointer used with functions that support asynchronous\noperations. Callback functions must satisfy the following signature:</p>\n<pre><code class=\"language-c\">typedef void (*napi_async_execute_callback)(napi_env env, void* data);\n</code></pre>\n<p>Implementations of this function must avoid making Node-API calls that execute\nJavaScript or interact with JavaScript objects. Node-API calls should be in the\n<code>napi_async_complete_callback</code> instead. Do not use the <code>napi_env</code> parameter as\nit will likely result in execution of JavaScript.</p>",
                  "displayName": "`napi_async_execute_callback`"
                },
                {
                  "textRaw": "`napi_async_complete_callback`",
                  "name": "`napi_async_complete_callback`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<p>Function pointer used with functions that support asynchronous\noperations. Callback functions must satisfy the following signature:</p>\n<pre><code class=\"language-c\">typedef void (*napi_async_complete_callback)(napi_env env,\n                                             napi_status status,\n                                             void* data);\n</code></pre>\n<p>Unless for reasons discussed in <a href=\"#object-lifetime-management\">Object Lifetime Management</a>, creating a\nhandle and/or callback scope inside the function body is not necessary.</p>",
                  "displayName": "`napi_async_complete_callback`"
                },
                {
                  "textRaw": "`napi_threadsafe_function_call_js`",
                  "name": "`napi_threadsafe_function_call_js`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.6.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      4
                    ]
                  },
                  "desc": "<p>Function pointer used with asynchronous thread-safe function calls. The callback\nwill be called on the main thread. Its purpose is to use a data item arriving\nvia the queue from one of the secondary threads to construct the parameters\nnecessary for a call into JavaScript, usually via <code>napi_call_function</code>, and then\nmake the call into JavaScript.</p>\n<p>The data arriving from the secondary thread via the queue is given in the <code>data</code>\nparameter and the JavaScript function to call is given in the <code>js_callback</code>\nparameter.</p>\n<p>Node-API sets up the environment prior to calling this callback, so it is\nsufficient to call the JavaScript function via <code>napi_call_function</code> rather than\nvia <code>napi_make_callback</code>.</p>\n<p>Callback functions must satisfy the following signature:</p>\n<pre><code class=\"language-c\">typedef void (*napi_threadsafe_function_call_js)(napi_env env,\n                                                 napi_value js_callback,\n                                                 void* context,\n                                                 void* data);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment to use for API calls, or <code>NULL</code> if the thread-safe\nfunction is being torn down and <code>data</code> may need to be freed.</li>\n<li><code>[in] js_callback</code>: The JavaScript function to call, or <code>NULL</code> if the\nthread-safe function is being torn down and <code>data</code> may need to be freed. It\nmay also be <code>NULL</code> if the thread-safe function was created without\n<code>js_callback</code>.</li>\n<li><code>[in] context</code>: The optional data with which the thread-safe function was\ncreated.</li>\n<li><code>[in] data</code>: Data created by the secondary thread. It is the responsibility of\nthe callback to convert this native data to JavaScript values (with Node-API\nfunctions) that can be passed as parameters when <code>js_callback</code> is invoked.\nThis pointer is managed entirely by the threads and this callback. Thus this\ncallback should free the data.</li>\n</ul>\n<p>Unless for reasons discussed in <a href=\"#object-lifetime-management\">Object Lifetime Management</a>, creating a\nhandle and/or callback scope inside the function body is not necessary.</p>",
                  "displayName": "`napi_threadsafe_function_call_js`"
                },
                {
                  "textRaw": "`napi_cleanup_hook`",
                  "name": "`napi_cleanup_hook`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v19.2.0",
                      "v18.13.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      3
                    ]
                  },
                  "desc": "<p>Function pointer used with <a href=\"#napi_add_env_cleanup_hook\"><code>napi_add_env_cleanup_hook</code></a>. It will be called\nwhen the environment is being torn down.</p>\n<p>Callback functions must satisfy the following signature:</p>\n<pre><code class=\"language-c\">typedef void (*napi_cleanup_hook)(void* data);\n</code></pre>\n<ul>\n<li><code>[in] data</code>: The data that was passed to <a href=\"#napi_add_env_cleanup_hook\"><code>napi_add_env_cleanup_hook</code></a>.</li>\n</ul>",
                  "displayName": "`napi_cleanup_hook`"
                },
                {
                  "textRaw": "`napi_async_cleanup_hook`",
                  "name": "`napi_async_cleanup_hook`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v14.10.0",
                      "v12.19.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Function pointer used with <a href=\"#napi_add_async_cleanup_hook\"><code>napi_add_async_cleanup_hook</code></a>. It will be called\nwhen the environment is being torn down.</p>\n<p>Callback functions must satisfy the following signature:</p>\n<pre><code class=\"language-c\">typedef void (*napi_async_cleanup_hook)(napi_async_cleanup_hook_handle handle,\n                                        void* data);\n</code></pre>\n<ul>\n<li><code>[in] handle</code>: The handle that must be passed to\n<a href=\"#napi_remove_async_cleanup_hook\"><code>napi_remove_async_cleanup_hook</code></a> after completion of the asynchronous\ncleanup.</li>\n<li><code>[in] data</code>: The data that was passed to <a href=\"#napi_add_async_cleanup_hook\"><code>napi_add_async_cleanup_hook</code></a>.</li>\n</ul>\n<p>The body of the function should initiate the asynchronous cleanup actions at the\nend of which <code>handle</code> must be passed in a call to\n<a href=\"#napi_remove_async_cleanup_hook\"><code>napi_remove_async_cleanup_hook</code></a>.</p>",
                  "displayName": "`napi_async_cleanup_hook`"
                }
              ],
              "displayName": "Node-API callback types"
            }
          ],
          "displayName": "Basic Node-API data types"
        },
        {
          "textRaw": "Error handling",
          "name": "error_handling",
          "type": "misc",
          "desc": "<p>Node-API uses both return values and JavaScript exceptions for error handling.\nThe following sections explain the approach for each case.</p>",
          "modules": [
            {
              "textRaw": "Return values",
              "name": "return_values",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<p>All of the Node-API functions share the same error handling pattern. The\nreturn type of all API functions is <code>napi_status</code>.</p>\n<p>The return value will be <code>napi_ok</code> if the request was successful and\nno uncaught JavaScript exception was thrown. If an error occurred AND\nan exception was thrown, the <code>napi_status</code> value for the error\nwill be returned. If an exception was thrown, and no error occurred,\n<code>napi_pending_exception</code> will be returned.</p>\n<p>In cases where a return value other than <code>napi_ok</code> or\n<code>napi_pending_exception</code> is returned, <a href=\"#napi_is_exception_pending\"><code>napi_is_exception_pending</code></a>\nmust be called to check if an exception is pending.\nSee the section on exceptions for more details.</p>\n<p>The full set of possible <code>napi_status</code> values is defined\nin <code>napi_api_types.h</code>.</p>\n<p>The <code>napi_status</code> return value provides a VM-independent representation of\nthe error which occurred. In some cases it is useful to be able to get\nmore detailed information, including a string representing the error as well as\nVM (engine)-specific information.</p>\n<p>In order to retrieve this information <a href=\"#napi_get_last_error_info\"><code>napi_get_last_error_info</code></a>\nis provided which returns a <code>napi_extended_error_info</code> structure.\nThe format of the <code>napi_extended_error_info</code> structure is as follows:</p>\n<pre><code class=\"language-c\">typedef struct napi_extended_error_info {\n  const char* error_message;\n  void* engine_reserved;\n  uint32_t engine_error_code;\n  napi_status error_code;\n};\n</code></pre>\n<ul>\n<li><code>error_message</code>: Textual representation of the error that occurred.</li>\n<li><code>engine_reserved</code>: Opaque handle reserved for engine use only.</li>\n<li><code>engine_error_code</code>: VM specific error code.</li>\n<li><code>error_code</code>: Node-API status code for the last error.</li>\n</ul>\n<p><a href=\"#napi_get_last_error_info\"><code>napi_get_last_error_info</code></a> returns the information for the last\nNode-API call that was made.</p>\n<p>Do not rely on the content or format of any of the extended information as it\nis not subject to SemVer and may change at any time. It is intended only for\nlogging purposes.</p>",
              "modules": [
                {
                  "textRaw": "`napi_get_last_error_info`",
                  "name": "`napi_get_last_error_info`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status\nnapi_get_last_error_info(node_api_basic_env env,\n                         const napi_extended_error_info** result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: The <code>napi_extended_error_info</code> structure with more\ninformation about the error.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API retrieves a <code>napi_extended_error_info</code> structure with information\nabout the last error that occurred.</p>\n<p>The content of the <code>napi_extended_error_info</code> returned is only valid up until\na Node-API function is called on the same <code>env</code>. This includes a call to\n<code>napi_is_exception_pending</code> so it may often be necessary to make a copy\nof the information so that it can be used later. The pointer returned\nin <code>error_message</code> points to a statically-defined string so it is safe to use\nthat pointer if you have copied it out of the <code>error_message</code> field (which will\nbe overwritten) before another Node-API function was called.</p>\n<p>Do not rely on the content or format of any of the extended information as it\nis not subject to SemVer and may change at any time. It is intended only for\nlogging purposes.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
                  "displayName": "`napi_get_last_error_info`"
                }
              ],
              "displayName": "Return values"
            },
            {
              "textRaw": "Exceptions",
              "name": "exceptions",
              "type": "module",
              "desc": "<p>Any Node-API function call may result in a pending JavaScript exception. This is\nthe case for any of the API functions, even those that may not cause the\nexecution of JavaScript.</p>\n<p>If the <code>napi_status</code> returned by a function is <code>napi_ok</code> then no\nexception is pending and no additional action is required. If the\n<code>napi_status</code> returned is anything other than <code>napi_ok</code> or\n<code>napi_pending_exception</code>, in order to try to recover and continue\ninstead of simply returning immediately, <a href=\"#napi_is_exception_pending\"><code>napi_is_exception_pending</code></a>\nmust be called in order to determine if an exception is pending or not.</p>\n<p>In many cases when a Node-API function is called and an exception is\nalready pending, the function will return immediately with a\n<code>napi_status</code> of <code>napi_pending_exception</code>. However, this is not the case\nfor all functions. Node-API allows a subset of the functions to be\ncalled to allow for some minimal cleanup before returning to JavaScript.\nIn that case, <code>napi_status</code> will reflect the status for the function. It\nwill not reflect previous pending exceptions. To avoid confusion, check\nthe error status after every function call.</p>\n<p>When an exception is pending one of two approaches can be employed.</p>\n<p>The first approach is to do any appropriate cleanup and then return so that\nexecution will return to JavaScript. As part of the transition back to\nJavaScript, the exception will be thrown at the point in the JavaScript\ncode where the native method was invoked. The behavior of most Node-API calls\nis unspecified while an exception is pending, and many will simply return\n<code>napi_pending_exception</code>, so do as little as possible and then return to\nJavaScript where the exception can be handled.</p>\n<p>The second approach is to try to handle the exception. There will be cases\nwhere the native code can catch the exception, take the appropriate action,\nand then continue. This is only recommended in specific cases\nwhere it is known that the exception can be safely handled. In these\ncases <a href=\"#napi_get_and_clear_last_exception\"><code>napi_get_and_clear_last_exception</code></a> can be used to get and\nclear the exception. On success, result will contain the handle to\nthe last JavaScript <code>Object</code> thrown. If it is determined, after\nretrieving the exception, the exception cannot be handled after all\nit can be re-thrown it with <a href=\"#napi_throw\"><code>napi_throw</code></a> where error is the\nJavaScript value to be thrown.</p>\n<p>The following utility functions are also available in case native code\nneeds to throw an exception or determine if a <code>napi_value</code> is an instance\nof a JavaScript <code>Error</code> object: <a href=\"#napi_throw_error\"><code>napi_throw_error</code></a>,\n<a href=\"#napi_throw_type_error\"><code>napi_throw_type_error</code></a>, <a href=\"#napi_throw_range_error\"><code>napi_throw_range_error</code></a>, <a href=\"#node_api_throw_syntax_error\"><code>node_api_throw_syntax_error</code></a> and <a href=\"#napi_is_error\"><code>napi_is_error</code></a>.</p>\n<p>The following utility functions are also available in case native\ncode needs to create an <code>Error</code> object: <a href=\"#napi_create_error\"><code>napi_create_error</code></a>,\n<a href=\"#napi_create_type_error\"><code>napi_create_type_error</code></a>, <a href=\"#napi_create_range_error\"><code>napi_create_range_error</code></a> and <a href=\"#node_api_create_syntax_error\"><code>node_api_create_syntax_error</code></a>,\nwhere result is the <code>napi_value</code> that refers to the newly created\nJavaScript <code>Error</code> object.</p>\n<p>The Node.js project is adding error codes to all of the errors\ngenerated internally. The goal is for applications to use these\nerror codes for all error checking. The associated error messages\nwill remain, but will only be meant to be used for logging and\ndisplay with the expectation that the message can change without\nSemVer applying. In order to support this model with Node-API, both\nin internal functionality and for module specific functionality\n(as its good practice), the <code>throw_</code> and <code>create_</code> functions\ntake an optional code parameter which is the string for the code\nto be added to the error object. If the optional parameter is <code>NULL</code>\nthen no code will be associated with the error. If a code is provided,\nthe name associated with the error is also updated to be:</p>\n<pre><code class=\"language-text\">originalName [code]\n</code></pre>\n<p>where <code>originalName</code> is the original name associated with the error\nand <code>code</code> is the code that was provided. For example, if the code\nis <code>'ERR_ERROR_1'</code> and a <code>TypeError</code> is being created the name will be:</p>\n<pre><code class=\"language-text\">TypeError [ERR_ERROR_1]\n</code></pre>",
              "modules": [
                {
                  "textRaw": "`napi_throw`",
                  "name": "`napi_throw`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_throw(napi_env env, napi_value error);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] error</code>: The JavaScript value to be thrown.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API throws the JavaScript value provided.</p>",
                  "displayName": "`napi_throw`"
                },
                {
                  "textRaw": "`napi_throw_error`",
                  "name": "`napi_throw_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_throw_error(napi_env env,\n                                         const char* code,\n                                         const char* msg);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] code</code>: Optional error code to be set on the error.</li>\n<li><code>[in] msg</code>: C string representing the text to be associated with the error.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API throws a JavaScript <code>Error</code> with the text provided.</p>",
                  "displayName": "`napi_throw_error`"
                },
                {
                  "textRaw": "`napi_throw_type_error`",
                  "name": "`napi_throw_type_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_throw_type_error(napi_env env,\n                                              const char* code,\n                                              const char* msg);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] code</code>: Optional error code to be set on the error.</li>\n<li><code>[in] msg</code>: C string representing the text to be associated with the error.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API throws a JavaScript <code>TypeError</code> with the text provided.</p>",
                  "displayName": "`napi_throw_type_error`"
                },
                {
                  "textRaw": "`napi_throw_range_error`",
                  "name": "`napi_throw_range_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_throw_range_error(napi_env env,\n                                               const char* code,\n                                               const char* msg);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] code</code>: Optional error code to be set on the error.</li>\n<li><code>[in] msg</code>: C string representing the text to be associated with the error.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API throws a JavaScript <code>RangeError</code> with the text provided.</p>",
                  "displayName": "`napi_throw_range_error`"
                },
                {
                  "textRaw": "`node_api_throw_syntax_error`",
                  "name": "`node_api_throw_syntax_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v17.2.0",
                      "v16.14.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      9
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status node_api_throw_syntax_error(napi_env env,\n                                                    const char* code,\n                                                    const char* msg);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] code</code>: Optional error code to be set on the error.</li>\n<li><code>[in] msg</code>: C string representing the text to be associated with the error.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API throws a JavaScript <code>SyntaxError</code> with the text provided.</p>",
                  "displayName": "`node_api_throw_syntax_error`"
                },
                {
                  "textRaw": "`napi_is_error`",
                  "name": "`napi_is_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_is_error(napi_env env,\n                                      napi_value value,\n                                      bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The <code>napi_value</code> to be checked.</li>\n<li><code>[out] result</code>: Boolean value that is set to true if <code>napi_value</code> represents\nan error, false otherwise.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API queries a <code>napi_value</code> to check if it represents an error object.</p>",
                  "displayName": "`napi_is_error`"
                },
                {
                  "textRaw": "`napi_create_error`",
                  "name": "`napi_create_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_create_error(napi_env env,\n                                          napi_value code,\n                                          napi_value msg,\n                                          napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] code</code>: Optional <code>napi_value</code> with the string for the error code to be\nassociated with the error.</li>\n<li><code>[in] msg</code>: <code>napi_value</code> that references a JavaScript <code>string</code> to be used as\nthe message for the <code>Error</code>.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the error created.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns a JavaScript <code>Error</code> with the text provided.</p>",
                  "displayName": "`napi_create_error`"
                },
                {
                  "textRaw": "`napi_create_type_error`",
                  "name": "`napi_create_type_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_create_type_error(napi_env env,\n                                               napi_value code,\n                                               napi_value msg,\n                                               napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] code</code>: Optional <code>napi_value</code> with the string for the error code to be\nassociated with the error.</li>\n<li><code>[in] msg</code>: <code>napi_value</code> that references a JavaScript <code>string</code> to be used as\nthe message for the <code>Error</code>.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the error created.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns a JavaScript <code>TypeError</code> with the text provided.</p>",
                  "displayName": "`napi_create_type_error`"
                },
                {
                  "textRaw": "`napi_create_range_error`",
                  "name": "`napi_create_range_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_create_range_error(napi_env env,\n                                                napi_value code,\n                                                napi_value msg,\n                                                napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] code</code>: Optional <code>napi_value</code> with the string for the error code to be\nassociated with the error.</li>\n<li><code>[in] msg</code>: <code>napi_value</code> that references a JavaScript <code>string</code> to be used as\nthe message for the <code>Error</code>.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the error created.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns a JavaScript <code>RangeError</code> with the text provided.</p>",
                  "displayName": "`napi_create_range_error`"
                },
                {
                  "textRaw": "`node_api_create_syntax_error`",
                  "name": "`node_api_create_syntax_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v17.2.0",
                      "v16.14.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      9
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status node_api_create_syntax_error(napi_env env,\n                                                     napi_value code,\n                                                     napi_value msg,\n                                                     napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] code</code>: Optional <code>napi_value</code> with the string for the error code to be\nassociated with the error.</li>\n<li><code>[in] msg</code>: <code>napi_value</code> that references a JavaScript <code>string</code> to be used as\nthe message for the <code>Error</code>.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the error created.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns a JavaScript <code>SyntaxError</code> with the text provided.</p>",
                  "displayName": "`node_api_create_syntax_error`"
                },
                {
                  "textRaw": "`napi_get_and_clear_last_exception`",
                  "name": "`napi_get_and_clear_last_exception`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_and_clear_last_exception(napi_env env,\n                                              napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: The exception if one is pending, <code>NULL</code> otherwise.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
                  "displayName": "`napi_get_and_clear_last_exception`"
                },
                {
                  "textRaw": "`napi_is_exception_pending`",
                  "name": "`napi_is_exception_pending`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_is_exception_pending(napi_env env, bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: Boolean value that is set to true if an exception is pending.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
                  "displayName": "`napi_is_exception_pending`"
                },
                {
                  "textRaw": "`napi_fatal_exception`",
                  "name": "`napi_fatal_exception`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v9.10.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      3
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_fatal_exception(napi_env env, napi_value err);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] err</code>: The error that is passed to <code>'uncaughtException'</code>.</li>\n</ul>\n<p>Trigger an <code>'uncaughtException'</code> in JavaScript. Useful if an async\ncallback throws an exception with no way to recover.</p>",
                  "displayName": "`napi_fatal_exception`"
                }
              ],
              "displayName": "Exceptions"
            },
            {
              "textRaw": "Fatal errors",
              "name": "fatal_errors",
              "type": "module",
              "desc": "<p>In the event of an unrecoverable error in a native addon, a fatal error can be\nthrown to immediately terminate the process.</p>",
              "modules": [
                {
                  "textRaw": "`napi_fatal_error`",
                  "name": "`napi_fatal_error`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_NO_RETURN void napi_fatal_error(const char* location,\n                                     size_t location_len,\n                                     const char* message,\n                                     size_t message_len);\n</code></pre>\n<ul>\n<li><code>[in] location</code>: Optional location at which the error occurred.</li>\n<li><code>[in] location_len</code>: The length of the location in bytes, or\n<code>NAPI_AUTO_LENGTH</code> if it is null-terminated.</li>\n<li><code>[in] message</code>: The message associated with the error.</li>\n<li><code>[in] message_len</code>: The length of the message in bytes, or <code>NAPI_AUTO_LENGTH</code>\nif it is null-terminated.</li>\n</ul>\n<p>The function call does not return, the process will be terminated.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
                  "displayName": "`napi_fatal_error`"
                }
              ],
              "displayName": "Fatal errors"
            }
          ],
          "displayName": "Error handling"
        },
        {
          "textRaw": "Object lifetime management",
          "name": "object_lifetime_management",
          "type": "misc",
          "desc": "<p>As Node-API calls are made, handles to objects in the heap for the underlying\nVM may be returned as <code>napi_values</code>. These handles must hold the\nobjects 'live' until they are no longer required by the native code,\notherwise the objects could be collected before the native code was\nfinished using them.</p>\n<p>As object handles are returned they are associated with a\n'scope'. The lifespan for the default scope is tied to the lifespan\nof the native method call. The result is that, by default, handles\nremain valid and the objects associated with these handles will be\nheld live for the lifespan of the native method call.</p>\n<p>In many cases, however, it is necessary that the handles remain valid for\neither a shorter or longer lifespan than that of the native method.\nThe sections which follow describe the Node-API functions that can be used\nto change the handle lifespan from the default.</p>",
          "modules": [
            {
              "textRaw": "Making handle lifespan shorter than that of the native method",
              "name": "making_handle_lifespan_shorter_than_that_of_the_native_method",
              "type": "module",
              "desc": "<p>It is often necessary to make the lifespan of handles shorter than\nthe lifespan of a native method. For example, consider a native method\nthat has a loop which iterates through the elements in a large array:</p>\n<pre><code class=\"language-c\">for (int i = 0; i &#x3C; 1000000; i++) {\n  napi_value result;\n  napi_status status = napi_get_element(env, object, i, &#x26;result);\n  if (status != napi_ok) {\n    break;\n  }\n  // do something with element\n}\n</code></pre>\n<p>This would result in a large number of handles being created, consuming\nsubstantial resources. In addition, even though the native code could only\nuse the most recent handle, all of the associated objects would also be\nkept alive since they all share the same scope.</p>\n<p>To handle this case, Node-API provides the ability to establish a new 'scope' to\nwhich newly created handles will be associated. Once those handles\nare no longer required, the scope can be 'closed' and any handles associated\nwith the scope are invalidated. The methods available to open/close scopes are\n<a href=\"#napi_open_handle_scope\"><code>napi_open_handle_scope</code></a> and <a href=\"#napi_close_handle_scope\"><code>napi_close_handle_scope</code></a>.</p>\n<p>Node-API only supports a single nested hierarchy of scopes. There is only one\nactive scope at any time, and all new handles will be associated with that\nscope while it is active. Scopes must be closed in the reverse order from\nwhich they are opened. In addition, all scopes created within a native method\nmust be closed before returning from that method.</p>\n<p>Taking the earlier example, adding calls to <a href=\"#napi_open_handle_scope\"><code>napi_open_handle_scope</code></a> and\n<a href=\"#napi_close_handle_scope\"><code>napi_close_handle_scope</code></a> would ensure that at most a single handle\nis valid throughout the execution of the loop:</p>\n<pre><code class=\"language-c\">for (int i = 0; i &#x3C; 1000000; i++) {\n  napi_handle_scope scope;\n  napi_status status = napi_open_handle_scope(env, &#x26;scope);\n  if (status != napi_ok) {\n    break;\n  }\n  napi_value result;\n  status = napi_get_element(env, object, i, &#x26;result);\n  if (status != napi_ok) {\n    break;\n  }\n  // do something with element\n  status = napi_close_handle_scope(env, scope);\n  if (status != napi_ok) {\n    break;\n  }\n}\n</code></pre>\n<p>When nesting scopes, there are cases where a handle from an\ninner scope needs to live beyond the lifespan of that scope. Node-API supports\nan 'escapable scope' in order to support this case. An escapable scope\nallows one handle to be 'promoted' so that it 'escapes' the\ncurrent scope and the lifespan of the handle changes from the current\nscope to that of the outer scope.</p>\n<p>The methods available to open/close escapable scopes are\n<a href=\"#napi_open_escapable_handle_scope\"><code>napi_open_escapable_handle_scope</code></a> and\n<a href=\"#napi_close_escapable_handle_scope\"><code>napi_close_escapable_handle_scope</code></a>.</p>\n<p>The request to promote a handle is made through <a href=\"#napi_escape_handle\"><code>napi_escape_handle</code></a> which\ncan only be called once.</p>",
              "modules": [
                {
                  "textRaw": "`napi_open_handle_scope`",
                  "name": "`napi_open_handle_scope`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_open_handle_scope(napi_env env,\n                                               napi_handle_scope* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the new scope.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API opens a new scope.</p>",
                  "displayName": "`napi_open_handle_scope`"
                },
                {
                  "textRaw": "`napi_close_handle_scope`",
                  "name": "`napi_close_handle_scope`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_close_handle_scope(napi_env env,\n                                                napi_handle_scope scope);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] scope</code>: <code>napi_value</code> representing the scope to be closed.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API closes the scope passed in. Scopes must be closed in the\nreverse order from which they were created.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
                  "displayName": "`napi_close_handle_scope`"
                },
                {
                  "textRaw": "`napi_open_escapable_handle_scope`",
                  "name": "`napi_open_escapable_handle_scope`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\n    napi_open_escapable_handle_scope(napi_env env,\n                                     napi_handle_scope* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the new scope.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API opens a new scope from which one object can be promoted\nto the outer scope.</p>",
                  "displayName": "`napi_open_escapable_handle_scope`"
                },
                {
                  "textRaw": "`napi_close_escapable_handle_scope`",
                  "name": "`napi_close_escapable_handle_scope`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\n    napi_close_escapable_handle_scope(napi_env env,\n                                      napi_handle_scope scope);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] scope</code>: <code>napi_value</code> representing the scope to be closed.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API closes the scope passed in. Scopes must be closed in the\nreverse order from which they were created.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
                  "displayName": "`napi_close_escapable_handle_scope`"
                },
                {
                  "textRaw": "`napi_escape_handle`",
                  "name": "`napi_escape_handle`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_escape_handle(napi_env env,\n                               napi_escapable_handle_scope scope,\n                               napi_value escapee,\n                               napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] scope</code>: <code>napi_value</code> representing the current scope.</li>\n<li><code>[in] escapee</code>: <code>napi_value</code> representing the JavaScript <code>Object</code> to be\nescaped.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the handle to the escaped <code>Object</code>\nin the outer scope.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API promotes the handle to the JavaScript object so that it is valid\nfor the lifetime of the outer scope. It can only be called once per scope.\nIf it is called more than once an error will be returned.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
                  "displayName": "`napi_escape_handle`"
                }
              ],
              "displayName": "Making handle lifespan shorter than that of the native method"
            },
            {
              "textRaw": "References to values with a lifespan longer than that of the native method",
              "name": "references_to_values_with_a_lifespan_longer_than_that_of_the_native_method",
              "type": "module",
              "desc": "<p>In some cases, an addon will need to be able to create and reference values\nwith a lifespan longer than that of a single native method invocation. For\nexample, to create a constructor and later use that constructor\nin a request to create instances, it must be possible to reference\nthe constructor object across many different instance creation requests. This\nwould not be possible with a normal handle returned as a <code>napi_value</code> as\ndescribed in the earlier section. The lifespan of a normal handle is\nmanaged by scopes and all scopes must be closed before the end of a native\nmethod.</p>\n<p>Node-API provides methods for creating persistent references to values.\nCurrently Node-API only allows references to be created for a\nlimited set of value types, including object, external, function, and symbol.</p>\n<p>Each reference has an associated count with a value of 0 or higher,\nwhich determines whether the reference will keep the corresponding value alive.\nReferences with a count of 0 do not prevent values from being collected.\nValues of object (object, function, external) and symbol types are becoming\n'weak' references and can still be accessed while they are not collected.\nAny count greater than 0 will prevent the values from being collected.</p>\n<p>Symbol values have different flavors. The true weak reference behavior is\nonly supported by local symbols created with the <code>napi_create_symbol</code> function\nor the JavaScript <code>Symbol()</code> constructor calls. Globally registered symbols\ncreated with the <code>node_api_symbol_for</code> function or JavaScript <code>Symbol.for()</code>\nfunction calls remain always strong references because the garbage collector\ndoes not collect them. The same is true for well-known symbols such as\n<code>Symbol.iterator</code>. They are also never collected by the garbage collector.</p>\n<p>References can be created with an initial reference count. The count can\nthen be modified through <a href=\"#napi_reference_ref\"><code>napi_reference_ref</code></a> and\n<a href=\"#napi_reference_unref\"><code>napi_reference_unref</code></a>. If an object is collected while the count\nfor a reference is 0, all subsequent calls to\nget the object associated with the reference <a href=\"#napi_get_reference_value\"><code>napi_get_reference_value</code></a>\nwill return <code>NULL</code> for the returned <code>napi_value</code>. An attempt to call\n<a href=\"#napi_reference_ref\"><code>napi_reference_ref</code></a> for a reference whose object has been collected\nresults in an error.</p>\n<p>References must be deleted once they are no longer required by the addon. When\na reference is deleted, it will no longer prevent the corresponding object from\nbeing collected. Failure to delete a persistent reference results in\na 'memory leak' with both the native memory for the persistent reference and\nthe corresponding object on the heap being retained forever.</p>\n<p>There can be multiple persistent references created which refer to the same\nobject, each of which will either keep the object live or not based on its\nindividual count. Multiple persistent references to the same object\ncan result in unexpectedly keeping alive native memory. The native structures\nfor a persistent reference must be kept alive until finalizers for the\nreferenced object are executed. If a new persistent reference is created\nfor the same object, the finalizers for that object will not be\nrun and the native memory pointed by the earlier persistent reference\nwill not be freed. This can be avoided by calling\n<code>napi_delete_reference</code> in addition to <code>napi_reference_unref</code> when possible.</p>\n<p><strong>Change History:</strong></p>\n<ul>\n<li>\n<p>Version 10 (<code>NAPI_VERSION</code> is defined as <code>10</code> or higher):</p>\n<p>References can be created for all value types. The new supported value\ntypes do not support weak reference semantic and the values of these types\nare released when the reference count becomes 0 and cannot be accessed from\nthe reference anymore.</p>\n</li>\n</ul>",
              "modules": [
                {
                  "textRaw": "`napi_create_reference`",
                  "name": "`napi_create_reference`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_create_reference(napi_env env,\n                                              napi_value value,\n                                              uint32_t initial_refcount,\n                                              napi_ref* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The <code>napi_value</code> for which a reference is being created.</li>\n<li><code>[in] initial_refcount</code>: Initial reference count for the new reference.</li>\n<li><code>[out] result</code>: <code>napi_ref</code> pointing to the new reference.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a new reference with the specified reference count\nto the value passed in.</p>",
                  "displayName": "`napi_create_reference`"
                },
                {
                  "textRaw": "`napi_delete_reference`",
                  "name": "`napi_delete_reference`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_delete_reference(napi_env env, napi_ref ref);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] ref</code>: <code>napi_ref</code> to be deleted.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API deletes the reference passed in.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
                  "displayName": "`napi_delete_reference`"
                },
                {
                  "textRaw": "`napi_reference_ref`",
                  "name": "`napi_reference_ref`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_reference_ref(napi_env env,\n                                           napi_ref ref,\n                                           uint32_t* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] ref</code>: <code>napi_ref</code> for which the reference count will be incremented.</li>\n<li><code>[out] result</code>: The new reference count.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API increments the reference count for the reference\npassed in and returns the resulting reference count.</p>",
                  "displayName": "`napi_reference_ref`"
                },
                {
                  "textRaw": "`napi_reference_unref`",
                  "name": "`napi_reference_unref`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_reference_unref(napi_env env,\n                                             napi_ref ref,\n                                             uint32_t* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] ref</code>: <code>napi_ref</code> for which the reference count will be decremented.</li>\n<li><code>[out] result</code>: The new reference count.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API decrements the reference count for the reference\npassed in and returns the resulting reference count.</p>",
                  "displayName": "`napi_reference_unref`"
                },
                {
                  "textRaw": "`napi_get_reference_value`",
                  "name": "`napi_get_reference_value`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_get_reference_value(napi_env env,\n                                                 napi_ref ref,\n                                                 napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] ref</code>: The <code>napi_ref</code> for which the corresponding value is\nbeing requested.</li>\n<li><code>[out] result</code>: The <code>napi_value</code> referenced by the <code>napi_ref</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>If still valid, this API returns the <code>napi_value</code> representing the\nJavaScript value associated with the <code>napi_ref</code>. Otherwise, result\nwill be <code>NULL</code>.</p>",
                  "displayName": "`napi_get_reference_value`"
                }
              ],
              "displayName": "References to values with a lifespan longer than that of the native method"
            },
            {
              "textRaw": "Cleanup on exit of the current Node.js environment",
              "name": "cleanup_on_exit_of_the_current_node.js_environment",
              "type": "module",
              "desc": "<p>While a Node.js process typically releases all its resources when exiting,\nembedders of Node.js, or future Worker support, may require addons to register\nclean-up hooks that will be run once the current Node.js environment exits.</p>\n<p>Node-API provides functions for registering and un-registering such callbacks.\nWhen those callbacks are run, all resources that are being held by the addon\nshould be freed up.</p>",
              "modules": [
                {
                  "textRaw": "`napi_add_env_cleanup_hook`",
                  "name": "`napi_add_env_cleanup_hook`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.2.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      3
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NODE_EXTERN napi_status napi_add_env_cleanup_hook(node_api_basic_env env,\n                                                  napi_cleanup_hook fun,\n                                                  void* arg);\n</code></pre>\n<p>Registers <code>fun</code> as a function to be run with the <code>arg</code> parameter once the\ncurrent Node.js environment exits.</p>\n<p>A function can safely be specified multiple times with different\n<code>arg</code> values. In that case, it will be called multiple times as well.\nProviding the same <code>fun</code> and <code>arg</code> values multiple times is not allowed\nand will lead the process to abort.</p>\n<p>The hooks will be called in reverse order, i.e. the most recently added one\nwill be called first.</p>\n<p>Removing this hook can be done by using <a href=\"#napi_remove_env_cleanup_hook\"><code>napi_remove_env_cleanup_hook</code></a>.\nTypically, that happens when the resource for which this hook was added\nis being torn down anyway.</p>\n<p>For asynchronous cleanup, <a href=\"#napi_add_async_cleanup_hook\"><code>napi_add_async_cleanup_hook</code></a> is available.</p>",
                  "displayName": "`napi_add_env_cleanup_hook`"
                },
                {
                  "textRaw": "`napi_remove_env_cleanup_hook`",
                  "name": "`napi_remove_env_cleanup_hook`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.2.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      3
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_remove_env_cleanup_hook(node_api_basic_env env,\n                                                     void (*fun)(void* arg),\n                                                     void* arg);\n</code></pre>\n<p>Unregisters <code>fun</code> as a function to be run with the <code>arg</code> parameter once the\ncurrent Node.js environment exits. Both the argument and the function value\nneed to be exact matches.</p>\n<p>The function must have originally been registered\nwith <code>napi_add_env_cleanup_hook</code>, otherwise the process will abort.</p>",
                  "displayName": "`napi_remove_env_cleanup_hook`"
                },
                {
                  "textRaw": "`napi_add_async_cleanup_hook`",
                  "name": "`napi_add_async_cleanup_hook`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v14.8.0",
                      "v12.19.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v14.10.0",
                          "v12.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/34819",
                        "description": "Changed signature of the `hook` callback."
                      }
                    ],
                    "napiVersion": [
                      8
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_add_async_cleanup_hook(\n    node_api_basic_env env,\n    napi_async_cleanup_hook hook,\n    void* arg,\n    napi_async_cleanup_hook_handle* remove_handle);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] hook</code>: The function pointer to call at environment teardown.</li>\n<li><code>[in] arg</code>: The pointer to pass to <code>hook</code> when it gets called.</li>\n<li><code>[out] remove_handle</code>: Optional handle that refers to the asynchronous cleanup\nhook.</li>\n</ul>\n<p>Registers <code>hook</code>, which is a function of type <a href=\"#napi_async_cleanup_hook\"><code>napi_async_cleanup_hook</code></a>, as\na function to be run with the <code>remove_handle</code> and <code>arg</code> parameters once the\ncurrent Node.js environment exits.</p>\n<p>Unlike <a href=\"#napi_add_env_cleanup_hook\"><code>napi_add_env_cleanup_hook</code></a>, the hook is allowed to be asynchronous.</p>\n<p>Otherwise, behavior generally matches that of <a href=\"#napi_add_env_cleanup_hook\"><code>napi_add_env_cleanup_hook</code></a>.</p>\n<p>If <code>remove_handle</code> is not <code>NULL</code>, an opaque value will be stored in it\nthat must later be passed to <a href=\"#napi_remove_async_cleanup_hook\"><code>napi_remove_async_cleanup_hook</code></a>,\nregardless of whether the hook has already been invoked.\nTypically, that happens when the resource for which this hook was added\nis being torn down anyway.</p>",
                  "displayName": "`napi_add_async_cleanup_hook`"
                },
                {
                  "textRaw": "`napi_remove_async_cleanup_hook`",
                  "name": "`napi_remove_async_cleanup_hook`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v14.8.0",
                      "v12.19.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v14.10.0",
                          "v12.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/34819",
                        "description": "Removed `env` parameter."
                      }
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_remove_async_cleanup_hook(\n    napi_async_cleanup_hook_handle remove_handle);\n</code></pre>\n<ul>\n<li><code>[in] remove_handle</code>: The handle to an asynchronous cleanup hook that was\ncreated with <a href=\"#napi_add_async_cleanup_hook\"><code>napi_add_async_cleanup_hook</code></a>.</li>\n</ul>\n<p>Unregisters the cleanup hook corresponding to <code>remove_handle</code>. This will prevent\nthe hook from being executed, unless it has already started executing.\nThis must be called on any <code>napi_async_cleanup_hook_handle</code> value obtained\nfrom <a href=\"#napi_add_async_cleanup_hook\"><code>napi_add_async_cleanup_hook</code></a>.</p>",
                  "displayName": "`napi_remove_async_cleanup_hook`"
                }
              ],
              "displayName": "Cleanup on exit of the current Node.js environment"
            },
            {
              "textRaw": "Finalization on the exit of the Node.js environment",
              "name": "finalization_on_the_exit_of_the_node.js_environment",
              "type": "module",
              "desc": "<p>The Node.js environment may be torn down at an arbitrary time as soon as\npossible with JavaScript execution disallowed, like on the request of\n<a href=\"worker_threads.html#workerterminate\"><code>worker.terminate()</code></a>. When the environment is being torn down, the\nregistered <code>napi_finalize</code> callbacks of JavaScript objects, thread-safe\nfunctions and environment instance data are invoked immediately and\nindependently.</p>\n<p>The invocation of <code>napi_finalize</code> callbacks is scheduled after the manually\nregistered cleanup hooks. In order to ensure a proper order of addon\nfinalization during environment shutdown to avoid use-after-free in the\n<code>napi_finalize</code> callback, addons should register a cleanup hook with\n<code>napi_add_env_cleanup_hook</code> and <code>napi_add_async_cleanup_hook</code> to manually\nrelease the allocated resource in a proper order.</p>",
              "displayName": "Finalization on the exit of the Node.js environment"
            }
          ],
          "displayName": "Object lifetime management"
        },
        {
          "textRaw": "Module registration",
          "name": "module_registration",
          "type": "misc",
          "desc": "<p>Node-API modules are registered in a manner similar to other modules\nexcept that instead of using the <code>NODE_MODULE</code> macro the following\nis used:</p>\n<pre><code class=\"language-c\">NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)\n</code></pre>\n<p>The next difference is the signature for the <code>Init</code> method. For a Node-API\nmodule it is as follows:</p>\n<pre><code class=\"language-c\">napi_value Init(napi_env env, napi_value exports);\n</code></pre>\n<p>The return value from <code>Init</code> is treated as the <code>exports</code> object for the module.\nThe <code>Init</code> method is passed an empty object via the <code>exports</code> parameter as a\nconvenience. If <code>Init</code> returns <code>NULL</code>, the parameter passed as <code>exports</code> is\nexported by the module. Node-API modules cannot modify the <code>module</code> object but\ncan specify anything as the <code>exports</code> property of the module.</p>\n<p>To add the method <code>hello</code> as a function so that it can be called as a method\nprovided by the addon:</p>\n<pre><code class=\"language-c\">napi_value Init(napi_env env, napi_value exports) {\n  napi_status status;\n  napi_property_descriptor desc = {\n    \"hello\",\n    NULL,\n    Method,\n    NULL,\n    NULL,\n    NULL,\n    napi_writable | napi_enumerable | napi_configurable,\n    NULL\n  };\n  status = napi_define_properties(env, exports, 1, &#x26;desc);\n  if (status != napi_ok) return NULL;\n  return exports;\n}\n</code></pre>\n<p>To set a function to be returned by the <code>require()</code> for the addon:</p>\n<pre><code class=\"language-c\">napi_value Init(napi_env env, napi_value exports) {\n  napi_value method;\n  napi_status status;\n  status = napi_create_function(env, \"exports\", NAPI_AUTO_LENGTH, Method, NULL, &#x26;method);\n  if (status != napi_ok) return NULL;\n  return method;\n}\n</code></pre>\n<p>To define a class so that new instances can be created (often used with\n<a href=\"#object-wrap\">Object wrap</a>):</p>\n<pre><code class=\"language-c\">// NOTE: partial example, not all referenced code is included\nnapi_value Init(napi_env env, napi_value exports) {\n  napi_status status;\n  napi_property_descriptor properties[] = {\n    { \"value\", NULL, NULL, GetValue, SetValue, NULL, napi_writable | napi_configurable, NULL },\n    DECLARE_NAPI_METHOD(\"plusOne\", PlusOne),\n    DECLARE_NAPI_METHOD(\"multiply\", Multiply),\n  };\n\n  napi_value cons;\n  status =\n      napi_define_class(env, \"MyObject\", New, NULL, 3, properties, &#x26;cons);\n  if (status != napi_ok) return NULL;\n\n  status = napi_create_reference(env, cons, 1, &#x26;constructor);\n  if (status != napi_ok) return NULL;\n\n  status = napi_set_named_property(env, exports, \"MyObject\", cons);\n  if (status != napi_ok) return NULL;\n\n  return exports;\n}\n</code></pre>\n<p>You can also use the <code>NAPI_MODULE_INIT</code> macro, which acts as a shorthand\nfor <code>NAPI_MODULE</code> and defining an <code>Init</code> function:</p>\n<pre><code class=\"language-c\">NAPI_MODULE_INIT(/* napi_env env, napi_value exports */) {\n  napi_value answer;\n  napi_status result;\n\n  status = napi_create_int64(env, 42, &#x26;answer);\n  if (status != napi_ok) return NULL;\n\n  status = napi_set_named_property(env, exports, \"answer\", answer);\n  if (status != napi_ok) return NULL;\n\n  return exports;\n}\n</code></pre>\n<p>The parameters <code>env</code> and <code>exports</code> are provided to the body of the\n<code>NAPI_MODULE_INIT</code> macro.</p>\n<p>All Node-API addons are context-aware, meaning they may be loaded multiple\ntimes. There are a few design considerations when declaring such a module.\nThe documentation on <a href=\"addons.html#context-aware-addons\">context-aware addons</a> provides more details.</p>\n<p>The variables <code>env</code> and <code>exports</code> will be available inside the function body\nfollowing the macro invocation.</p>\n<p>For more details on setting properties on objects, see the section on\n<a href=\"#working-with-javascript-properties\">Working with JavaScript properties</a>.</p>\n<p>For more details on building addon modules in general, refer to the existing\nAPI.</p>",
          "displayName": "Module registration"
        },
        {
          "textRaw": "Working with JavaScript values",
          "name": "working_with_javascript_values",
          "type": "misc",
          "desc": "<p>Node-API exposes a set of APIs to create all types of JavaScript values.\nSome of these types are documented under <a href=\"https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\">Section language types</a>\nof the <a href=\"https://tc39.es/ecma262/\">ECMAScript Language Specification</a>.</p>\n<p>Fundamentally, these APIs are used to do one of the following:</p>\n<ol>\n<li>Create a new JavaScript object</li>\n<li>Convert from a primitive C type to a Node-API value</li>\n<li>Convert from Node-API value to a primitive C type</li>\n<li>Get global instances including <code>undefined</code> and <code>null</code></li>\n</ol>\n<p>Node-API values are represented by the type <code>napi_value</code>.\nAny Node-API call that requires a JavaScript value takes in a <code>napi_value</code>.\nIn some cases, the API does check the type of the <code>napi_value</code> up-front.\nHowever, for better performance, it's better for the caller to make sure that\nthe <code>napi_value</code> in question is of the JavaScript type expected by the API.</p>",
          "modules": [
            {
              "textRaw": "Enum types",
              "name": "enum_types",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_key_collection_mode`",
                  "name": "`napi_key_collection_mode`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v13.7.0",
                      "v12.17.0",
                      "v10.20.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">typedef enum {\n  napi_key_include_prototypes,\n  napi_key_own_only\n} napi_key_collection_mode;\n</code></pre>\n<p>Describes the <code>Keys/Properties</code> filter enums:</p>\n<p><code>napi_key_collection_mode</code> limits the range of collected properties.</p>\n<p><code>napi_key_own_only</code> limits the collected properties to the given\nobject only. <code>napi_key_include_prototypes</code> will include all keys\nof the objects's prototype chain as well.</p>",
                  "displayName": "`napi_key_collection_mode`"
                },
                {
                  "textRaw": "`napi_key_filter`",
                  "name": "`napi_key_filter`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v13.7.0",
                      "v12.17.0",
                      "v10.20.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">typedef enum {\n  napi_key_all_properties = 0,\n  napi_key_writable = 1,\n  napi_key_enumerable = 1 &#x3C;&#x3C; 1,\n  napi_key_configurable = 1 &#x3C;&#x3C; 2,\n  napi_key_skip_strings = 1 &#x3C;&#x3C; 3,\n  napi_key_skip_symbols = 1 &#x3C;&#x3C; 4\n} napi_key_filter;\n</code></pre>\n<p>Property filter bit flag. This works with bit operators to build a composite filter.</p>",
                  "displayName": "`napi_key_filter`"
                },
                {
                  "textRaw": "`napi_key_conversion`",
                  "name": "`napi_key_conversion`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v13.7.0",
                      "v12.17.0",
                      "v10.20.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">typedef enum {\n  napi_key_keep_numbers,\n  napi_key_numbers_to_strings\n} napi_key_conversion;\n</code></pre>\n<p><code>napi_key_numbers_to_strings</code> will convert integer indexes to\nstrings. <code>napi_key_keep_numbers</code> will return numbers for integer\nindexes.</p>",
                  "displayName": "`napi_key_conversion`"
                },
                {
                  "textRaw": "`napi_valuetype`",
                  "name": "`napi_valuetype`",
                  "type": "module",
                  "desc": "<pre><code class=\"language-c\">typedef enum {\n  // ES6 types (corresponds to typeof)\n  napi_undefined,\n  napi_null,\n  napi_boolean,\n  napi_number,\n  napi_string,\n  napi_symbol,\n  napi_object,\n  napi_function,\n  napi_external,\n  napi_bigint,\n} napi_valuetype;\n</code></pre>\n<p>Describes the type of a <code>napi_value</code>. This generally corresponds to the types\ndescribed in <a href=\"https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\">Section language types</a> of the ECMAScript Language Specification.\nIn addition to types in that section, <code>napi_valuetype</code> can also represent\n<code>Function</code>s and <code>Object</code>s with external data.</p>\n<p>A JavaScript value of type <code>napi_external</code> appears in JavaScript as a plain\nobject such that no properties can be set on it, and no prototype.</p>",
                  "displayName": "`napi_valuetype`"
                },
                {
                  "textRaw": "`napi_typedarray_type`",
                  "name": "`napi_typedarray_type`",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v25.5.0",
                          "v24.13.1"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/58879",
                        "description": "Added `napi_float16_array` for Float16Array support."
                      }
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">typedef enum {\n  napi_int8_array,\n  napi_uint8_array,\n  napi_uint8_clamped_array,\n  napi_int16_array,\n  napi_uint16_array,\n  napi_int32_array,\n  napi_uint32_array,\n  napi_float32_array,\n  napi_float64_array,\n  napi_bigint64_array,\n  napi_biguint64_array,\n  napi_float16_array,\n} napi_typedarray_type;\n</code></pre>\n<p>This represents the underlying binary scalar datatype of the <code>TypedArray</code>.\nElements of this enum correspond to\n<a href=\"https://tc39.es/ecma262/#sec-typedarray-objects\">Section TypedArray objects</a> of the <a href=\"https://tc39.es/ecma262/\">ECMAScript Language Specification</a>.</p>",
                  "displayName": "`napi_typedarray_type`"
                }
              ],
              "displayName": "Enum types"
            },
            {
              "textRaw": "Object creation functions",
              "name": "object_creation_functions",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_create_array`",
                  "name": "`napi_create_array`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_array(napi_env env, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>Array</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns a Node-API value corresponding to a JavaScript <code>Array</code> type.\nJavaScript arrays are described in\n<a href=\"https://tc39.es/ecma262/#sec-array-objects\">Section Array objects</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_array`"
                },
                {
                  "textRaw": "`napi_create_array_with_length`",
                  "name": "`napi_create_array_with_length`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_array_with_length(napi_env env,\n                                          size_t length,\n                                          napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] length</code>: The initial length of the <code>Array</code>.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>Array</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns a Node-API value corresponding to a JavaScript <code>Array</code> type.\nThe <code>Array</code>'s length property is set to the passed-in length parameter.\nHowever, the underlying buffer is not guaranteed to be pre-allocated by the VM\nwhen the array is created. That behavior is left to the underlying VM\nimplementation. If the buffer must be a contiguous block of memory that can be\ndirectly read and/or written via C, consider using\n<a href=\"#napi_create_external_arraybuffer\"><code>napi_create_external_arraybuffer</code></a>.</p>\n<p>JavaScript arrays are described in\n<a href=\"https://tc39.es/ecma262/#sec-array-objects\">Section Array objects</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_array_with_length`"
                },
                {
                  "textRaw": "`napi_create_arraybuffer`",
                  "name": "`napi_create_arraybuffer`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_arraybuffer(napi_env env,\n                                    size_t byte_length,\n                                    void** data,\n                                    napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] length</code>: The length in bytes of the array buffer to create.</li>\n<li><code>[out] data</code>: Pointer to the underlying byte buffer of the <code>ArrayBuffer</code>.\n<code>data</code> can optionally be ignored by passing <code>NULL</code>.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>ArrayBuffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns a Node-API value corresponding to a JavaScript <code>ArrayBuffer</code>.\n<code>ArrayBuffer</code>s are used to represent fixed-length binary data buffers. They are\nnormally used as a backing-buffer for <code>TypedArray</code> objects.\nThe <code>ArrayBuffer</code> allocated will have an underlying byte buffer whose size is\ndetermined by the <code>length</code> parameter that's passed in.\nThe underlying buffer is optionally returned back to the caller in case the\ncaller wants to directly manipulate the buffer. This buffer can only be\nwritten to directly from native code. To write to this buffer from JavaScript,\na typed array or <code>DataView</code> object would need to be created.</p>\n<p>JavaScript <code>ArrayBuffer</code> objects are described in\n<a href=\"https://tc39.es/ecma262/#sec-arraybuffer-objects\">Section ArrayBuffer objects</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_arraybuffer`"
                },
                {
                  "textRaw": "`napi_create_buffer`",
                  "name": "`napi_create_buffer`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_buffer(napi_env env,\n                               size_t size,\n                               void** data,\n                               napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] size</code>: Size in bytes of the underlying buffer.</li>\n<li><code>[out] data</code>: Raw pointer to the underlying buffer.\n<code>data</code> can optionally be ignored by passing <code>NULL</code>.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a <code>node::Buffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API allocates a <code>node::Buffer</code> object. While this is still a\nfully-supported data structure, in most cases using a <code>TypedArray</code> will suffice.</p>",
                  "displayName": "`napi_create_buffer`"
                },
                {
                  "textRaw": "`napi_create_buffer_copy`",
                  "name": "`napi_create_buffer_copy`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_buffer_copy(napi_env env,\n                                    size_t length,\n                                    const void* data,\n                                    void** result_data,\n                                    napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] size</code>: Size in bytes of the input buffer (should be the same as the size\nof the new buffer).</li>\n<li><code>[in] data</code>: Raw pointer to the underlying buffer to copy from.</li>\n<li><code>[out] result_data</code>: Pointer to the new <code>Buffer</code>'s underlying data buffer.\n<code>result_data</code> can optionally be ignored by passing <code>NULL</code>.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a <code>node::Buffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API allocates a <code>node::Buffer</code> object and initializes it with data copied\nfrom the passed-in buffer. While this is still a fully-supported data\nstructure, in most cases using a <code>TypedArray</code> will suffice.</p>",
                  "displayName": "`napi_create_buffer_copy`"
                },
                {
                  "textRaw": "`napi_create_date`",
                  "name": "`napi_create_date`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v11.11.0",
                      "v10.17.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      5
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_date(napi_env env,\n                             double time,\n                             napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] time</code>: ECMAScript time value in milliseconds since 01 January, 1970 UTC.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>Date</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API does not observe leap seconds; they are ignored, as\nECMAScript aligns with POSIX time specification.</p>\n<p>This API allocates a JavaScript <code>Date</code> object.</p>\n<p>JavaScript <code>Date</code> objects are described in\n<a href=\"https://tc39.es/ecma262/#sec-date-objects\">Section Date objects</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_date`"
                },
                {
                  "textRaw": "`napi_create_external`",
                  "name": "`napi_create_external`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_external(napi_env env,\n                                 void* data,\n                                 napi_finalize finalize_cb,\n                                 void* finalize_hint,\n                                 napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] data</code>: Raw pointer to the external data.</li>\n<li><code>[in] finalize_cb</code>: Optional callback to call when the external value is being\ncollected. <a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.</li>\n<li><code>[in] finalize_hint</code>: Optional hint to pass to the finalize callback during\ncollection.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing an external value.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API allocates a JavaScript value with external data attached to it. This\nis used to pass external data through JavaScript code, so it can be retrieved\nlater by native code using <a href=\"#napi_get_value_external\"><code>napi_get_value_external</code></a>.</p>\n<p>The API adds a <code>napi_finalize</code> callback which will be called when the JavaScript\nobject just created has been garbage collected.</p>\n<p>The created value is not an object, and therefore does not support additional\nproperties. It is considered a distinct value type: calling <code>napi_typeof()</code> with\nan external value yields <code>napi_external</code>.</p>",
                  "displayName": "`napi_create_external`"
                },
                {
                  "textRaw": "`napi_create_external_arraybuffer`",
                  "name": "`napi_create_external_arraybuffer`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status\nnapi_create_external_arraybuffer(napi_env env,\n                                 void* external_data,\n                                 size_t byte_length,\n                                 napi_finalize finalize_cb,\n                                 void* finalize_hint,\n                                 napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] external_data</code>: Pointer to the underlying byte buffer of the\n<code>ArrayBuffer</code>.</li>\n<li><code>[in] byte_length</code>: The length in bytes of the underlying buffer.</li>\n<li><code>[in] finalize_cb</code>: Optional callback to call when the <code>ArrayBuffer</code> is being\ncollected. <a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.</li>\n<li><code>[in] finalize_hint</code>: Optional hint to pass to the finalize callback during\ncollection.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>ArrayBuffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p><strong>Some runtimes other than Node.js have dropped support for external buffers</strong>.\nOn runtimes other than Node.js this method may return\n<code>napi_no_external_buffers_allowed</code> to indicate that external\nbuffers are not supported. One such runtime is Electron as\ndescribed in this issue\n<a href=\"https://github.com/electron/electron/issues/35801\">electron/issues/35801</a>.</p>\n<p>In order to maintain broadest compatibility with all runtimes\nyou may define <code>NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED</code> in your addon before\nincludes for the node-api headers. Doing so will hide the 2 functions\nthat create external buffers. This will ensure a compilation error\noccurs if you accidentally use one of these methods.</p>\n<p>This API returns a Node-API value corresponding to a JavaScript <code>ArrayBuffer</code>.\nThe underlying byte buffer of the <code>ArrayBuffer</code> is externally allocated and\nmanaged. The caller must ensure that the byte buffer remains valid until the\nfinalize callback is called.</p>\n<p>The API adds a <code>napi_finalize</code> callback which will be called when the JavaScript\nobject just created has been garbage collected.</p>\n<p>JavaScript <code>ArrayBuffer</code>s are described in\n<a href=\"https://tc39.es/ecma262/#sec-arraybuffer-objects\">Section ArrayBuffer objects</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_external_arraybuffer`"
                },
                {
                  "textRaw": "`node_api_create_external_sharedarraybuffer`",
                  "name": "`node_api_create_external_sharedarraybuffer`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status\nnode_api_create_external_sharedarraybuffer(napi_env env,\n                                           void* external_data,\n                                           size_t byte_length,\n                                           node_api_noenv_finalize finalize_cb,\n                                           void* finalize_hint,\n                                           napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] external_data</code>: Pointer to the underlying byte buffer of the\n<code>SharedArrayBuffer</code>.</li>\n<li><code>[in] byte_length</code>: The length in bytes of the underlying buffer.</li>\n<li><code>[in] finalize_cb</code>: Optional callback to call when the <code>SharedArrayBuffer</code> is\nbeing collected. Called on an arbitrary thread. Because a <code>SharedArrayBuffer</code>\ncan outlive the environment it's created in, the callback does not receive a\nreference to <code>env</code>.</li>\n<li><code>[in] finalize_hint</code>: Optional hint to pass to the finalize callback during\ncollection.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>SharedArrayBuffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Create a <code>SharedArrayBuffer</code> with externally managed memory.</p>\n<p>See the entry on <a href=\"#napi_create_external_arraybuffer\"><code>napi_create_external_arraybuffer</code></a> for runtime\ncompatibility.</p>",
                  "displayName": "`node_api_create_external_sharedarraybuffer`"
                },
                {
                  "textRaw": "`napi_create_external_buffer`",
                  "name": "`napi_create_external_buffer`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_external_buffer(napi_env env,\n                                        size_t length,\n                                        void* data,\n                                        napi_finalize finalize_cb,\n                                        void* finalize_hint,\n                                        napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] length</code>: Size in bytes of the input buffer (should be the same as the\nsize of the new buffer).</li>\n<li><code>[in] data</code>: Raw pointer to the underlying buffer to expose to JavaScript.</li>\n<li><code>[in] finalize_cb</code>: Optional callback to call when the <code>ArrayBuffer</code> is being\ncollected. <a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.</li>\n<li><code>[in] finalize_hint</code>: Optional hint to pass to the finalize callback during\ncollection.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a <code>node::Buffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p><strong>Some runtimes other than Node.js have dropped support for external buffers</strong>.\nOn runtimes other than Node.js this method may return\n<code>napi_no_external_buffers_allowed</code> to indicate that external\nbuffers are not supported. One such runtime is Electron as\ndescribed in this issue\n<a href=\"https://github.com/electron/electron/issues/35801\">electron/issues/35801</a>.</p>\n<p>In order to maintain broadest compatibility with all runtimes\nyou may define <code>NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED</code> in your addon before\nincludes for the node-api headers. Doing so will hide the 2 functions\nthat create external buffers. This will ensure a compilation error\noccurs if you accidentally use one of these methods.</p>\n<p>This API allocates a <code>node::Buffer</code> object and initializes it with data\nbacked by the passed in buffer. While this is still a fully-supported data\nstructure, in most cases using a <code>TypedArray</code> will suffice.</p>\n<p>The API adds a <code>napi_finalize</code> callback which will be called when the JavaScript\nobject just created has been garbage collected.</p>\n<p>For Node.js >=4 <code>Buffers</code> are <code>Uint8Array</code>s.</p>",
                  "displayName": "`napi_create_external_buffer`"
                },
                {
                  "textRaw": "`napi_create_object`",
                  "name": "`napi_create_object`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_object(napi_env env, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>Object</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API allocates a default JavaScript <code>Object</code>.\nIt is the equivalent of doing <code>new Object()</code> in JavaScript.</p>\n<p>The JavaScript <code>Object</code> type is described in <a href=\"https://tc39.es/ecma262/#sec-object-type\">Section object type</a> of the\nECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_object`"
                },
                {
                  "textRaw": "`node_api_create_object_with_properties`",
                  "name": "`node_api_create_object_with_properties`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v25.2.0",
                      "v24.12.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "desc": "<pre><code class=\"language-cpp\">napi_status node_api_create_object_with_properties(napi_env env,\n                                                   napi_value prototype_or_null,\n                                                   const napi_value* property_names,\n                                                   const napi_value* property_values,\n                                                   size_t property_count,\n                                                   napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] prototype_or_null</code>: The prototype object for the new object. Can be a\n<code>napi_value</code> representing a JavaScript object to use as the prototype, a\n<code>napi_value</code> representing JavaScript <code>null</code>, or a <code>nullptr</code> that will be converted to <code>null</code>.</li>\n<li><code>[in] property_names</code>: Array of <code>napi_value</code> representing the property names.</li>\n<li><code>[in] property_values</code>: Array of <code>napi_value</code> representing the property values.</li>\n<li><code>[in] property_count</code>: Number of properties in the arrays.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>Object</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>Object</code> with the specified prototype and\nproperties. This is more efficient than calling <code>napi_create_object</code> followed\nby multiple <code>napi_set_property</code> calls, as it can create the object with all\nproperties atomically, avoiding potential V8 map transitions.</p>\n<p>The arrays <code>property_names</code> and <code>property_values</code> must have the same length\nspecified by <code>property_count</code>. The properties are added to the object in the\norder they appear in the arrays.</p>",
                  "displayName": "`node_api_create_object_with_properties`"
                },
                {
                  "textRaw": "`napi_create_symbol`",
                  "name": "`napi_create_symbol`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_symbol(napi_env env,\n                               napi_value description,\n                               napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] description</code>: Optional <code>napi_value</code> which refers to a JavaScript\n<code>string</code> to be set as the description for the symbol.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>symbol</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>symbol</code> value from a UTF8-encoded C string.</p>\n<p>The JavaScript <code>symbol</code> type is described in <a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-symbol-type\">Section symbol type</a>\nof the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_symbol`"
                },
                {
                  "textRaw": "`node_api_symbol_for`",
                  "name": "`node_api_symbol_for`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v17.5.0",
                      "v16.15.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      9
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status node_api_symbol_for(napi_env env,\n                                const char* utf8description,\n                                size_t length,\n                                napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] utf8description</code>: UTF-8 C string representing the text to be used as the\ndescription for the symbol.</li>\n<li><code>[in] length</code>: The length of the description string in bytes, or\n<code>NAPI_AUTO_LENGTH</code> if it is null-terminated.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>symbol</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API searches in the global registry for an existing symbol with the given\ndescription. If the symbol already exists it will be returned, otherwise a new\nsymbol will be created in the registry.</p>\n<p>The JavaScript <code>symbol</code> type is described in <a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-symbol-type\">Section symbol type</a> of the ECMAScript\nLanguage Specification.</p>",
                  "displayName": "`node_api_symbol_for`"
                },
                {
                  "textRaw": "`napi_create_typedarray`",
                  "name": "`napi_create_typedarray`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v26.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/62710",
                        "description": "Added support for `SharedArrayBuffer`."
                      }
                    ],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_typedarray(napi_env env,\n                                   napi_typedarray_type type,\n                                   size_t length,\n                                   napi_value arraybuffer,\n                                   size_t byte_offset,\n                                   napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] type</code>: Scalar datatype of the elements within the <code>TypedArray</code>.</li>\n<li><code>[in] length</code>: Number of elements in the <code>TypedArray</code>.</li>\n<li><code>[in] arraybuffer</code>: <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code> underlying the\ntyped array.</li>\n<li><code>[in] byte_offset</code>: The byte offset within the <code>ArrayBuffer</code> or\n<code>SharedArrayBuffer</code> from which to start projecting the <code>TypedArray</code>.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>TypedArray</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>TypedArray</code> object over an existing\n<code>ArrayBuffer</code> or <code>SharedArrayBuffer</code>. <code>TypedArray</code> objects provide an\narray-like view over an underlying data buffer where each element has the same\nunderlying binary scalar datatype.</p>\n<p>It is required that <code>(length * size_of_element) + byte_offset</code> is less than or\nequal to the size in bytes of the <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code> passed\nin. If not, a <code>RangeError</code> exception is raised.</p>\n<p>For element sizes greater than 1, <code>byte_offset</code> is required to be a multiple\nof the element size. If not, a <code>RangeError</code> exception is raised.</p>\n<p>JavaScript <code>TypedArray</code> objects are described in\n<a href=\"https://tc39.es/ecma262/#sec-typedarray-objects\">Section TypedArray objects</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_typedarray`"
                },
                {
                  "textRaw": "`node_api_create_buffer_from_arraybuffer`",
                  "name": "`node_api_create_buffer_from_arraybuffer`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v23.0.0",
                      "v22.12.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      10
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status NAPI_CDECL node_api_create_buffer_from_arraybuffer(napi_env env,\n                                                              napi_value arraybuffer,\n                                                              size_t byte_offset,\n                                                              size_t byte_length,\n                                                              napi_value* result)\n</code></pre>\n<ul>\n<li><strong><code>[in] env</code></strong>: The environment that the API is invoked under.</li>\n<li><strong><code>[in] arraybuffer</code></strong>: The <code>ArrayBuffer</code> from which the buffer will be created.</li>\n<li><strong><code>[in] byte_offset</code></strong>: The byte offset within the <code>ArrayBuffer</code> from which to start creating the buffer.</li>\n<li><strong><code>[in] byte_length</code></strong>: The length in bytes of the buffer to be created from the <code>ArrayBuffer</code>.</li>\n<li><strong><code>[out] result</code></strong>: A <code>napi_value</code> representing the created JavaScript <code>Buffer</code> object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>Buffer</code> object from an existing <code>ArrayBuffer</code>.\nThe <code>Buffer</code> object is a Node.js-specific class that provides a way to work with binary data directly in JavaScript.</p>\n<p>The byte range <code>[byte_offset, byte_offset + byte_length)</code>\nmust be within the bounds of the <code>ArrayBuffer</code>. If <code>byte_offset + byte_length</code>\nexceeds the size of the <code>ArrayBuffer</code>, a <code>RangeError</code> exception is raised.</p>",
                  "displayName": "`node_api_create_buffer_from_arraybuffer`"
                },
                {
                  "textRaw": "`napi_create_dataview`",
                  "name": "`napi_create_dataview`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.3.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v25.5.0",
                          "v24.13.1"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/60473",
                        "description": "Added support for `SharedArrayBuffer`."
                      }
                    ],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_dataview(napi_env env,\n                                 size_t byte_length,\n                                 napi_value arraybuffer,\n                                 size_t byte_offset,\n                                 napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] length</code>: Number of elements in the <code>DataView</code>.</li>\n<li><code>[in] arraybuffer</code>: <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code> underlying the\n<code>DataView</code>.</li>\n<li><code>[in] byte_offset</code>: The byte offset within the <code>ArrayBuffer</code> from which to\nstart projecting the <code>DataView</code>.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>DataView</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>DataView</code> object over an existing <code>ArrayBuffer</code>\nor <code>SharedArrayBuffer</code>. <code>DataView</code> objects provide an array-like view over an\nunderlying data buffer, but one which allows items of different size and type in\nthe <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code>.</p>\n<p>It is required that <code>byte_length + byte_offset</code> is less than or equal to the\nsize in bytes of the array passed in. If not, a <code>RangeError</code> exception is\nraised.</p>\n<p>JavaScript <code>DataView</code> objects are described in\n<a href=\"https://tc39.es/ecma262/#sec-dataview-objects\">Section DataView objects</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_dataview`"
                }
              ],
              "displayName": "Object creation functions"
            },
            {
              "textRaw": "Functions to convert from C types to Node-API",
              "name": "functions_to_convert_from_c_types_to_node-api",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_create_int32`",
                  "name": "`napi_create_int32`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_int32(napi_env env, int32_t value, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: Integer value to be represented in JavaScript.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>number</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API is used to convert from the C <code>int32_t</code> type to the JavaScript\n<code>number</code> type.</p>\n<p>The JavaScript <code>number</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type\">Section number type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_int32`"
                },
                {
                  "textRaw": "`napi_create_uint32`",
                  "name": "`napi_create_uint32`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_uint32(napi_env env, uint32_t value, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: Unsigned integer value to be represented in JavaScript.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>number</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API is used to convert from the C <code>uint32_t</code> type to the JavaScript\n<code>number</code> type.</p>\n<p>The JavaScript <code>number</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type\">Section number type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_uint32`"
                },
                {
                  "textRaw": "`napi_create_int64`",
                  "name": "`napi_create_int64`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_int64(napi_env env, int64_t value, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: Integer value to be represented in JavaScript.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>number</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API is used to convert from the C <code>int64_t</code> type to the JavaScript\n<code>number</code> type.</p>\n<p>The JavaScript <code>number</code> type is described in <a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type\">Section number type</a>\nof the ECMAScript Language Specification. Note the complete range of <code>int64_t</code>\ncannot be represented with full precision in JavaScript. Integer values\noutside the range of <a href=\"https://tc39.es/ecma262/#sec-number.min_safe_integer\"><code>Number.MIN_SAFE_INTEGER</code></a> <code>-(2**53 - 1)</code> -\n<a href=\"https://tc39.es/ecma262/#sec-number.max_safe_integer\"><code>Number.MAX_SAFE_INTEGER</code></a> <code>(2**53 - 1)</code> will lose precision.</p>",
                  "displayName": "`napi_create_int64`"
                },
                {
                  "textRaw": "`napi_create_double`",
                  "name": "`napi_create_double`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_double(napi_env env, double value, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: Double-precision value to be represented in JavaScript.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>number</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API is used to convert from the C <code>double</code> type to the JavaScript\n<code>number</code> type.</p>\n<p>The JavaScript <code>number</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-number-type\">Section number type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_double`"
                },
                {
                  "textRaw": "`napi_create_bigint_int64`",
                  "name": "`napi_create_bigint_int64`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_bigint_int64(napi_env env,\n                                     int64_t value,\n                                     napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: Integer value to be represented in JavaScript.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>BigInt</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API converts the C <code>int64_t</code> type to the JavaScript <code>BigInt</code> type.</p>",
                  "displayName": "`napi_create_bigint_int64`"
                },
                {
                  "textRaw": "`napi_create_bigint_uint64`",
                  "name": "`napi_create_bigint_uint64`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_bigint_uint64(napi_env env,\n                                      uint64_t value,\n                                      napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: Unsigned integer value to be represented in JavaScript.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>BigInt</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API converts the C <code>uint64_t</code> type to the JavaScript <code>BigInt</code> type.</p>",
                  "displayName": "`napi_create_bigint_uint64`"
                },
                {
                  "textRaw": "`napi_create_bigint_words`",
                  "name": "`napi_create_bigint_words`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_bigint_words(napi_env env,\n                                     int sign_bit,\n                                     size_t word_count,\n                                     const uint64_t* words,\n                                     napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] sign_bit</code>: Determines if the resulting <code>BigInt</code> will be positive or\nnegative.</li>\n<li><code>[in] word_count</code>: The length of the <code>words</code> array.</li>\n<li><code>[in] words</code>: An array of <code>uint64_t</code> little-endian 64-bit words.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>BigInt</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API converts an array of unsigned 64-bit words into a single <code>BigInt</code>\nvalue.</p>\n<p>The resulting <code>BigInt</code> is calculated as: (–1)<sup><code>sign_bit</code></sup> (<code>words[0]</code>\n× (2<sup>64</sup>)<sup>0</sup> + <code>words[1]</code> × (2<sup>64</sup>)<sup>1</sup> + …)</p>",
                  "displayName": "`napi_create_bigint_words`"
                },
                {
                  "textRaw": "`napi_create_string_latin1`",
                  "name": "`napi_create_string_latin1`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_string_latin1(napi_env env,\n                                      const char* str,\n                                      size_t length,\n                                      napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] str</code>: Character buffer representing an ISO-8859-1-encoded string.</li>\n<li><code>[in] length</code>: The length of the string in bytes, or <code>NAPI_AUTO_LENGTH</code> if it\nis null-terminated.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>string</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>string</code> value from an ISO-8859-1-encoded C\nstring. The native string is copied.</p>\n<p>The JavaScript <code>string</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type\">Section string type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_string_latin1`"
                },
                {
                  "textRaw": "`node_api_create_external_string_latin1`",
                  "name": "`node_api_create_external_string_latin1`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v20.4.0",
                      "v18.18.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      10
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status\nnode_api_create_external_string_latin1(napi_env env,\n                                       char* str,\n                                       size_t length,\n                                       napi_finalize finalize_callback,\n                                       void* finalize_hint,\n                                       napi_value* result,\n                                       bool* copied);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] str</code>: Character buffer representing an ISO-8859-1-encoded string.</li>\n<li><code>[in] length</code>: The length of the string in bytes, or <code>NAPI_AUTO_LENGTH</code> if it\nis null-terminated.</li>\n<li><code>[in] finalize_callback</code>: The function to call when the string is being\ncollected. The function will be called with the following parameters:\n<ul>\n<li><code>[in] env</code>: The environment in which the add-on is running. This value\nmay be null if the string is being collected as part of the termination\nof the worker or the main Node.js instance.</li>\n<li><code>[in] data</code>: This is the value <code>str</code> as a <code>void*</code> pointer.</li>\n<li><code>[in] finalize_hint</code>: This is the value <code>finalize_hint</code> that was given\nto the API.\n<a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.\nThis parameter is optional. Passing a null value means that the add-on\ndoesn't need to be notified when the corresponding JavaScript string is\ncollected.</li>\n</ul>\n</li>\n<li><code>[in] finalize_hint</code>: Optional hint to pass to the finalize callback during\ncollection.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>string</code>.</li>\n<li><code>[out] copied</code>: Whether the string was copied. If it was, the finalizer will\nalready have been invoked to destroy <code>str</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>string</code> value from an ISO-8859-1-encoded C\nstring. The native string may not be copied and must thus exist for the entire\nlife cycle of the JavaScript value.</p>\n<p>The JavaScript <code>string</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type\">Section string type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`node_api_create_external_string_latin1`"
                },
                {
                  "textRaw": "`napi_create_string_utf16`",
                  "name": "`napi_create_string_utf16`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_string_utf16(napi_env env,\n                                     const char16_t* str,\n                                     size_t length,\n                                     napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] str</code>: Character buffer representing a UTF16-LE-encoded string.</li>\n<li><code>[in] length</code>: The length of the string in two-byte code units, or\n<code>NAPI_AUTO_LENGTH</code> if it is null-terminated.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>string</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>string</code> value from a UTF16-LE-encoded C string.\nThe native string is copied.</p>\n<p>The JavaScript <code>string</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type\">Section string type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_string_utf16`"
                },
                {
                  "textRaw": "`node_api_create_external_string_utf16`",
                  "name": "`node_api_create_external_string_utf16`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v20.4.0",
                      "v18.18.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      10
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status\nnode_api_create_external_string_utf16(napi_env env,\n                                      char16_t* str,\n                                      size_t length,\n                                      napi_finalize finalize_callback,\n                                      void* finalize_hint,\n                                      napi_value* result,\n                                      bool* copied);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] str</code>: Character buffer representing a UTF16-LE-encoded string.</li>\n<li><code>[in] length</code>: The length of the string in two-byte code units, or\n<code>NAPI_AUTO_LENGTH</code> if it is null-terminated.</li>\n<li><code>[in] finalize_callback</code>: The function to call when the string is being\ncollected. The function will be called with the following parameters:\n<ul>\n<li><code>[in] env</code>: The environment in which the add-on is running. This value\nmay be null if the string is being collected as part of the termination\nof the worker or the main Node.js instance.</li>\n<li><code>[in] data</code>: This is the value <code>str</code> as a <code>void*</code> pointer.</li>\n<li><code>[in] finalize_hint</code>: This is the value <code>finalize_hint</code> that was given\nto the API.\n<a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.\nThis parameter is optional. Passing a null value means that the add-on\ndoesn't need to be notified when the corresponding JavaScript string is\ncollected.</li>\n</ul>\n</li>\n<li><code>[in] finalize_hint</code>: Optional hint to pass to the finalize callback during\ncollection.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>string</code>.</li>\n<li><code>[out] copied</code>: Whether the string was copied. If it was, the finalizer will\nalready have been invoked to destroy <code>str</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>string</code> value from a UTF16-LE-encoded C string.\nThe native string may not be copied and must thus exist for the entire life\ncycle of the JavaScript value.</p>\n<p>The JavaScript <code>string</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type\">Section string type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`node_api_create_external_string_utf16`"
                },
                {
                  "textRaw": "`napi_create_string_utf8`",
                  "name": "`napi_create_string_utf8`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_create_string_utf8(napi_env env,\n                                    const char* str,\n                                    size_t length,\n                                    napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] str</code>: Character buffer representing a UTF8-encoded string.</li>\n<li><code>[in] length</code>: The length of the string in bytes, or <code>NAPI_AUTO_LENGTH</code> if it\nis null-terminated.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>string</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a JavaScript <code>string</code> value from a UTF8-encoded C string.\nThe native string is copied.</p>\n<p>The JavaScript <code>string</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type\">Section string type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`napi_create_string_utf8`"
                }
              ],
              "displayName": "Functions to convert from C types to Node-API"
            },
            {
              "textRaw": "Functions to create optimized property keys",
              "name": "functions_to_create_optimized_property_keys",
              "type": "module",
              "desc": "<p>Many JavaScript engines including V8 use internalized strings as keys\nto set and get property values. They typically use a hash table to create\nand lookup such strings. While it adds some cost per key creation, it improves\nthe performance after that by enabling comparison of string pointers instead\nof the whole strings.</p>\n<p>If a new JavaScript string is intended to be used as a property key, then for\nsome JavaScript engines it will be more efficient to use the functions in this\nsection. Otherwise, use the <code>napi_create_string_utf8</code> or\n<code>node_api_create_external_string_utf8</code> series functions as there may be\nadditional overhead in creating/storing strings with the property key\ncreation methods.</p>",
              "modules": [
                {
                  "textRaw": "`node_api_create_property_key_latin1`",
                  "name": "`node_api_create_property_key_latin1`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v22.9.0",
                      "v20.18.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      10
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status NAPI_CDECL node_api_create_property_key_latin1(napi_env env,\n                                                           const char* str,\n                                                           size_t length,\n                                                           napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] str</code>: Character buffer representing an ISO-8859-1-encoded string.</li>\n<li><code>[in] length</code>: The length of the string in bytes, or <code>NAPI_AUTO_LENGTH</code> if it\nis null-terminated.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing an optimized JavaScript <code>string</code>\nto be used as a property key for objects.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates an optimized JavaScript <code>string</code> value from\nan ISO-8859-1-encoded C string to be used as a property key for objects.\nThe native string is copied. In contrast with <code>napi_create_string_latin1</code>,\nsubsequent calls to this function with the same <code>str</code> pointer may benefit from a speedup\nin the creation of the requested <code>napi_value</code>, depending on the engine.</p>\n<p>The JavaScript <code>string</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type\">Section string type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`node_api_create_property_key_latin1`"
                },
                {
                  "textRaw": "`node_api_create_property_key_utf16`",
                  "name": "`node_api_create_property_key_utf16`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v21.7.0",
                      "v20.12.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      10
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status NAPI_CDECL node_api_create_property_key_utf16(napi_env env,\n                                                          const char16_t* str,\n                                                          size_t length,\n                                                          napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] str</code>: Character buffer representing a UTF16-LE-encoded string.</li>\n<li><code>[in] length</code>: The length of the string in two-byte code units, or\n<code>NAPI_AUTO_LENGTH</code> if it is null-terminated.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing an optimized JavaScript <code>string</code>\nto be used as a property key for objects.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates an optimized JavaScript <code>string</code> value from\na UTF16-LE-encoded C string to be used as a property key for objects.\nThe native string is copied.</p>\n<p>The JavaScript <code>string</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type\">Section string type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`node_api_create_property_key_utf16`"
                },
                {
                  "textRaw": "`node_api_create_property_key_utf8`",
                  "name": "`node_api_create_property_key_utf8`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v22.9.0",
                      "v20.18.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      10
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status NAPI_CDECL node_api_create_property_key_utf8(napi_env env,\n                                                         const char* str,\n                                                         size_t length,\n                                                         napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] str</code>: Character buffer representing a UTF8-encoded string.</li>\n<li><code>[in] length</code>: The length of the string in two-byte code units, or\n<code>NAPI_AUTO_LENGTH</code> if it is null-terminated.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing an optimized JavaScript <code>string</code>\nto be used as a property key for objects.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates an optimized JavaScript <code>string</code> value from\na UTF8-encoded C string to be used as a property key for objects.\nThe native string is copied.</p>\n<p>The JavaScript <code>string</code> type is described in\n<a href=\"https://tc39.es/ecma262/#sec-ecmascript-language-types-string-type\">Section string type</a> of the ECMAScript Language Specification.</p>",
                  "displayName": "`node_api_create_property_key_utf8`"
                }
              ],
              "displayName": "Functions to create optimized property keys"
            },
            {
              "textRaw": "Functions to convert from Node-API to C types",
              "name": "functions_to_convert_from_node-api_to_c_types",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_get_array_length`",
                  "name": "`napi_get_array_length`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_array_length(napi_env env,\n                                  napi_value value,\n                                  uint32_t* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing the JavaScript <code>Array</code> whose length is\nbeing queried.</li>\n<li><code>[out] result</code>: <code>uint32</code> representing length of the array.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns the length of an array.</p>\n<p><code>Array</code> length is described in <a href=\"https://tc39.es/ecma262/#sec-properties-of-array-instances-length\">Section Array instance length</a> of the ECMAScript Language\nSpecification.</p>",
                  "displayName": "`napi_get_array_length`"
                },
                {
                  "textRaw": "`napi_get_arraybuffer_info`",
                  "name": "`napi_get_arraybuffer_info`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.9.0",
                          "v22.21.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/59071",
                        "description": "Added support for `SharedArrayBuffer`."
                      }
                    ],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_arraybuffer_info(napi_env env,\n                                      napi_value arraybuffer,\n                                      void** data,\n                                      size_t* byte_length)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] arraybuffer</code>: <code>napi_value</code> representing the <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code> being queried.</li>\n<li><code>[out] data</code>: The underlying data buffer of the <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code>\nis <code>0</code>, this may be <code>NULL</code> or any other pointer value.</li>\n<li><code>[out] byte_length</code>: Length in bytes of the underlying data buffer.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API is used to retrieve the underlying data buffer of an <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code> and its length.</p>\n<p><em>WARNING</em>: Use caution while using this API. The lifetime of the underlying data\nbuffer is managed by the <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code> even after it's returned. A\npossible safe way to use this API is in conjunction with\n<a href=\"#napi_create_reference\"><code>napi_create_reference</code></a>, which can be used to guarantee control over the\nlifetime of the <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code>. It's also safe to use the returned data buffer\nwithin the same callback as long as there are no calls to other APIs that might\ntrigger a GC.</p>",
                  "displayName": "`napi_get_arraybuffer_info`"
                },
                {
                  "textRaw": "`napi_get_buffer_info`",
                  "name": "`napi_get_buffer_info`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_buffer_info(napi_env env,\n                                 napi_value value,\n                                 void** data,\n                                 size_t* length)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing the <code>node::Buffer</code> or <code>Uint8Array</code>\nbeing queried.</li>\n<li><code>[out] data</code>: The underlying data buffer of the <code>node::Buffer</code> or\n<code>Uint8Array</code>. If length is <code>0</code>, this may be <code>NULL</code> or any other pointer value.</li>\n<li><code>[out] length</code>: Length in bytes of the underlying data buffer.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method returns the identical <code>data</code> and <code>byte_length</code> as\n<a href=\"#napi_get_typedarray_info\"><code>napi_get_typedarray_info</code></a>. And <code>napi_get_typedarray_info</code> accepts a\n<code>node::Buffer</code> (a Uint8Array) as the value too.</p>\n<p>This API is used to retrieve the underlying data buffer of a <code>node::Buffer</code>\nand its length.</p>\n<p><em>Warning</em>: Use caution while using this API since the underlying data buffer's\nlifetime is not guaranteed if it's managed by the VM.</p>",
                  "displayName": "`napi_get_buffer_info`"
                },
                {
                  "textRaw": "`napi_get_prototype`",
                  "name": "`napi_get_prototype`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_prototype(napi_env env,\n                               napi_value object,\n                               napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] object</code>: <code>napi_value</code> representing JavaScript <code>Object</code> whose prototype\nto return. This returns the equivalent of <code>Object.getPrototypeOf</code> (which is\nnot the same as the function's <code>prototype</code> property).</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing prototype of the given object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>",
                  "displayName": "`napi_get_prototype`"
                },
                {
                  "textRaw": "`napi_get_typedarray_info`",
                  "name": "`napi_get_typedarray_info`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_typedarray_info(napi_env env,\n                                     napi_value typedarray,\n                                     napi_typedarray_type* type,\n                                     size_t* length,\n                                     void** data,\n                                     napi_value* arraybuffer,\n                                     size_t* byte_offset)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] typedarray</code>: <code>napi_value</code> representing the <code>TypedArray</code> whose\nproperties to query.</li>\n<li><code>[out] type</code>: Scalar datatype of the elements within the <code>TypedArray</code>.</li>\n<li><code>[out] length</code>: The number of elements in the <code>TypedArray</code>.</li>\n<li><code>[out] data</code>: The data buffer underlying the <code>TypedArray</code> adjusted by\nthe <code>byte_offset</code> value so that it points to the first element in the\n<code>TypedArray</code>. If the length of the array is <code>0</code>, this may be <code>NULL</code> or\nany other pointer value.</li>\n<li><code>[out] arraybuffer</code>: The <code>ArrayBuffer</code> or <code>SharedArrayBuffer</code> underlying the\n<code>TypedArray</code>.</li>\n<li><code>[out] byte_offset</code>: The byte offset within the underlying native array\nat which the first element of the arrays is located. The value for the data\nparameter has already been adjusted so that data points to the first element\nin the array. Therefore, the first byte of the native array would be at\n<code>data - byte_offset</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns various properties of a typed array.</p>\n<p>Any of the out parameters may be <code>NULL</code> if that property is unneeded.</p>\n<p><em>Warning</em>: Use caution while using this API since the underlying data buffer\nis managed by the VM.</p>",
                  "displayName": "`napi_get_typedarray_info`"
                },
                {
                  "textRaw": "`napi_get_dataview_info`",
                  "name": "`napi_get_dataview_info`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.3.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_dataview_info(napi_env env,\n                                   napi_value dataview,\n                                   size_t* byte_length,\n                                   void** data,\n                                   napi_value* arraybuffer,\n                                   size_t* byte_offset)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] dataview</code>: <code>napi_value</code> representing the <code>DataView</code> whose\nproperties to query.</li>\n<li><code>[out] byte_length</code>: Number of bytes in the <code>DataView</code>.</li>\n<li><code>[out] data</code>: The data buffer underlying the <code>DataView</code>.\nIf byte_length is <code>0</code>, this may be <code>NULL</code> or any other pointer value.</li>\n<li><code>[out] arraybuffer</code>: <code>ArrayBuffer</code> underlying the <code>DataView</code>.</li>\n<li><code>[out] byte_offset</code>: The byte offset within the data buffer from which\nto start projecting the <code>DataView</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Any of the out parameters may be <code>NULL</code> if that property is unneeded.</p>\n<p>This API returns various properties of a <code>DataView</code>.</p>",
                  "displayName": "`napi_get_dataview_info`"
                },
                {
                  "textRaw": "`napi_get_date_value`",
                  "name": "`napi_get_date_value`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v11.11.0",
                      "v10.17.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      5
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_date_value(napi_env env,\n                                napi_value value,\n                                double* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing a JavaScript <code>Date</code>.</li>\n<li><code>[out] result</code>: Time value as a <code>double</code> represented as milliseconds since\nmidnight at the beginning of 01 January, 1970 UTC.</li>\n</ul>\n<p>This API does not observe leap seconds; they are ignored, as\nECMAScript aligns with POSIX time specification.</p>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-date <code>napi_value</code> is passed\nin it returns <code>napi_date_expected</code>.</p>\n<p>This API returns the C double primitive of time value for the given JavaScript\n<code>Date</code>.</p>",
                  "displayName": "`napi_get_date_value`"
                },
                {
                  "textRaw": "`napi_get_value_bool`",
                  "name": "`napi_get_value_bool`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_bool(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript <code>Boolean</code>.</li>\n<li><code>[out] result</code>: C boolean primitive equivalent of the given JavaScript\n<code>Boolean</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-boolean <code>napi_value</code> is\npassed in it returns <code>napi_boolean_expected</code>.</p>\n<p>This API returns the C boolean primitive equivalent of the given JavaScript\n<code>Boolean</code>.</p>",
                  "displayName": "`napi_get_value_bool`"
                },
                {
                  "textRaw": "`napi_get_value_double`",
                  "name": "`napi_get_value_double`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_double(napi_env env,\n                                  napi_value value,\n                                  double* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript <code>number</code>.</li>\n<li><code>[out] result</code>: C double primitive equivalent of the given JavaScript\n<code>number</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-number <code>napi_value</code> is passed\nin it returns <code>napi_number_expected</code>.</p>\n<p>This API returns the C double primitive equivalent of the given JavaScript\n<code>number</code>.</p>",
                  "displayName": "`napi_get_value_double`"
                },
                {
                  "textRaw": "`napi_get_value_bigint_int64`",
                  "name": "`napi_get_value_bigint_int64`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_bigint_int64(napi_env env,\n                                        napi_value value,\n                                        int64_t* result,\n                                        bool* lossless);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript <code>BigInt</code>.</li>\n<li><code>[out] result</code>: C <code>int64_t</code> primitive equivalent of the given JavaScript\n<code>BigInt</code>.</li>\n<li><code>[out] lossless</code>: Indicates whether the <code>BigInt</code> value was converted\nlosslessly.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-<code>BigInt</code> is passed in it\nreturns <code>napi_bigint_expected</code>.</p>\n<p>This API returns the C <code>int64_t</code> primitive equivalent of the given JavaScript\n<code>BigInt</code>. If needed it will truncate the value, setting <code>lossless</code> to <code>false</code>.</p>",
                  "displayName": "`napi_get_value_bigint_int64`"
                },
                {
                  "textRaw": "`napi_get_value_bigint_uint64`",
                  "name": "`napi_get_value_bigint_uint64`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_bigint_uint64(napi_env env,\n                                        napi_value value,\n                                        uint64_t* result,\n                                        bool* lossless);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript <code>BigInt</code>.</li>\n<li><code>[out] result</code>: C <code>uint64_t</code> primitive equivalent of the given JavaScript\n<code>BigInt</code>.</li>\n<li><code>[out] lossless</code>: Indicates whether the <code>BigInt</code> value was converted\nlosslessly.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-<code>BigInt</code> is passed in it\nreturns <code>napi_bigint_expected</code>.</p>\n<p>This API returns the C <code>uint64_t</code> primitive equivalent of the given JavaScript\n<code>BigInt</code>. If needed it will truncate the value, setting <code>lossless</code> to <code>false</code>.</p>",
                  "displayName": "`napi_get_value_bigint_uint64`"
                },
                {
                  "textRaw": "`napi_get_value_bigint_words`",
                  "name": "`napi_get_value_bigint_words`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v10.7.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_bigint_words(napi_env env,\n                                        napi_value value,\n                                        int* sign_bit,\n                                        size_t* word_count,\n                                        uint64_t* words);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript <code>BigInt</code>.</li>\n<li><code>[out] sign_bit</code>: Integer representing if the JavaScript <code>BigInt</code> is positive\nor negative.</li>\n<li><code>[in/out] word_count</code>: Must be initialized to the length of the <code>words</code>\narray. Upon return, it will be set to the actual number of words that\nwould be needed to store this <code>BigInt</code>.</li>\n<li><code>[out] words</code>: Pointer to a pre-allocated 64-bit word array.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API converts a single <code>BigInt</code> value into a sign bit, 64-bit little-endian\narray, and the number of elements in the array. <code>sign_bit</code> and <code>words</code> may be\nboth set to <code>NULL</code>, in order to get only <code>word_count</code>.</p>",
                  "displayName": "`napi_get_value_bigint_words`"
                },
                {
                  "textRaw": "`napi_get_value_external`",
                  "name": "`napi_get_value_external`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_external(napi_env env,\n                                    napi_value value,\n                                    void** result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript external value.</li>\n<li><code>[out] result</code>: Pointer to the data wrapped by the JavaScript external value.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-external <code>napi_value</code> is\npassed in it returns <code>napi_invalid_arg</code>.</p>\n<p>This API retrieves the external data pointer that was previously passed to\n<code>napi_create_external()</code>.</p>",
                  "displayName": "`napi_get_value_external`"
                },
                {
                  "textRaw": "`napi_get_value_int32`",
                  "name": "`napi_get_value_int32`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_int32(napi_env env,\n                                 napi_value value,\n                                 int32_t* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript <code>number</code>.</li>\n<li><code>[out] result</code>: C <code>int32</code> primitive equivalent of the given JavaScript\n<code>number</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-number <code>napi_value</code>\nis passed in <code>napi_number_expected</code>.</p>\n<p>This API returns the C <code>int32</code> primitive equivalent\nof the given JavaScript <code>number</code>.</p>\n<p>If the number exceeds the range of the 32 bit integer, then the result is\ntruncated to the equivalent of the bottom 32 bits. This can result in a large\npositive number becoming a negative number if the value is > 2<sup>31</sup> - 1.</p>\n<p>Non-finite number values (<code>NaN</code>, <code>+Infinity</code>, or <code>-Infinity</code>) set the\nresult to zero.</p>",
                  "displayName": "`napi_get_value_int32`"
                },
                {
                  "textRaw": "`napi_get_value_int64`",
                  "name": "`napi_get_value_int64`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_int64(napi_env env,\n                                 napi_value value,\n                                 int64_t* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript <code>number</code>.</li>\n<li><code>[out] result</code>: C <code>int64</code> primitive equivalent of the given JavaScript\n<code>number</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-number <code>napi_value</code>\nis passed in it returns <code>napi_number_expected</code>.</p>\n<p>This API returns the C <code>int64</code> primitive equivalent of the given JavaScript\n<code>number</code>.</p>\n<p><code>number</code> values outside the range of <a href=\"https://tc39.es/ecma262/#sec-number.min_safe_integer\"><code>Number.MIN_SAFE_INTEGER</code></a>\n<code>-(2**53 - 1)</code> - <a href=\"https://tc39.es/ecma262/#sec-number.max_safe_integer\"><code>Number.MAX_SAFE_INTEGER</code></a> <code>(2**53 - 1)</code> will lose\nprecision.</p>\n<p>Non-finite number values (<code>NaN</code>, <code>+Infinity</code>, or <code>-Infinity</code>) set the\nresult to zero.</p>",
                  "displayName": "`napi_get_value_int64`"
                },
                {
                  "textRaw": "`napi_get_value_string_latin1`",
                  "name": "`napi_get_value_string_latin1`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_string_latin1(napi_env env,\n                                         napi_value value,\n                                         char* buf,\n                                         size_t bufsize,\n                                         size_t* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript string.</li>\n<li><code>[in] buf</code>: Buffer to write the ISO-8859-1-encoded string into. If <code>NULL</code> is\npassed in, the length of the string in bytes and excluding the null terminator\nis returned in <code>result</code>.</li>\n<li><code>[in] bufsize</code>: Size of the destination buffer. When this value is\ninsufficient, the returned string is truncated and null-terminated.\nIf this value is zero, then the string is not returned and no changes are done\nto the buffer.</li>\n<li><code>[out] result</code>: Number of bytes copied into the buffer, excluding the null\nterminator.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-<code>string</code> <code>napi_value</code>\nis passed in it returns <code>napi_string_expected</code>.</p>\n<p>This API returns the ISO-8859-1-encoded string corresponding the value passed\nin.</p>",
                  "displayName": "`napi_get_value_string_latin1`"
                },
                {
                  "textRaw": "`napi_get_value_string_utf8`",
                  "name": "`napi_get_value_string_utf8`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_string_utf8(napi_env env,\n                                       napi_value value,\n                                       char* buf,\n                                       size_t bufsize,\n                                       size_t* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript string.</li>\n<li><code>[in] buf</code>: Buffer to write the UTF8-encoded string into. If <code>NULL</code> is passed\nin, the length of the string in bytes and excluding the null terminator is\nreturned in <code>result</code>.</li>\n<li><code>[in] bufsize</code>: Size of the destination buffer. When this value is\ninsufficient, the returned string is truncated and null-terminated.\nIf this value is zero, then the string is not returned and no changes are done\nto the buffer.</li>\n<li><code>[out] result</code>: Number of bytes copied into the buffer, excluding the null\nterminator.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-<code>string</code> <code>napi_value</code>\nis passed in it returns <code>napi_string_expected</code>.</p>\n<p>This API returns the UTF8-encoded string corresponding the value passed in.</p>",
                  "displayName": "`napi_get_value_string_utf8`"
                },
                {
                  "textRaw": "`napi_get_value_string_utf16`",
                  "name": "`napi_get_value_string_utf16`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_string_utf16(napi_env env,\n                                        napi_value value,\n                                        char16_t* buf,\n                                        size_t bufsize,\n                                        size_t* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript string.</li>\n<li><code>[in] buf</code>: Buffer to write the UTF16-LE-encoded string into. If <code>NULL</code> is\npassed in, the length of the string in 2-byte code units and excluding the\nnull terminator is returned.</li>\n<li><code>[in] bufsize</code>: Size of the destination buffer. When this value is\ninsufficient, the returned string is truncated and null-terminated.\nIf this value is zero, then the string is not returned and no changes are done\nto the buffer.</li>\n<li><code>[out] result</code>: Number of 2-byte code units copied into the buffer, excluding\nthe null terminator.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-<code>string</code> <code>napi_value</code>\nis passed in it returns <code>napi_string_expected</code>.</p>\n<p>This API returns the UTF16-encoded string corresponding the value passed in.</p>",
                  "displayName": "`napi_get_value_string_utf16`"
                },
                {
                  "textRaw": "`napi_get_value_uint32`",
                  "name": "`napi_get_value_uint32`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_value_uint32(napi_env env,\n                                  napi_value value,\n                                  uint32_t* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: <code>napi_value</code> representing JavaScript <code>number</code>.</li>\n<li><code>[out] result</code>: C primitive equivalent of the given <code>napi_value</code> as a\n<code>uint32_t</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-number <code>napi_value</code>\nis passed in it returns <code>napi_number_expected</code>.</p>\n<p>This API returns the C primitive equivalent of the given <code>napi_value</code> as a\n<code>uint32_t</code>.</p>",
                  "displayName": "`napi_get_value_uint32`"
                }
              ],
              "displayName": "Functions to convert from Node-API to C types"
            },
            {
              "textRaw": "Functions to get global instances",
              "name": "functions_to_get_global_instances",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_get_boolean`",
                  "name": "`napi_get_boolean`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_boolean(napi_env env, bool value, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The value of the boolean to retrieve.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing JavaScript <code>Boolean</code> singleton to\nretrieve.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API is used to return the JavaScript singleton object that is used to\nrepresent the given boolean value.</p>",
                  "displayName": "`napi_get_boolean`"
                },
                {
                  "textRaw": "`napi_get_global`",
                  "name": "`napi_get_global`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_global(napi_env env, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing JavaScript <code>global</code> object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns the <code>global</code> object.</p>",
                  "displayName": "`napi_get_global`"
                },
                {
                  "textRaw": "`napi_get_null`",
                  "name": "`napi_get_null`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_null(napi_env env, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing JavaScript <code>null</code> object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns the <code>null</code> object.</p>",
                  "displayName": "`napi_get_null`"
                },
                {
                  "textRaw": "`napi_get_undefined`",
                  "name": "`napi_get_undefined`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_undefined(napi_env env, napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing JavaScript Undefined value.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns the Undefined object.</p>",
                  "displayName": "`napi_get_undefined`"
                }
              ],
              "displayName": "Functions to get global instances"
            }
          ],
          "displayName": "Working with JavaScript values"
        },
        {
          "textRaw": "Working with JavaScript values and abstract operations",
          "name": "working_with_javascript_values_and_abstract_operations",
          "type": "misc",
          "desc": "<p>Node-API exposes a set of APIs to perform some abstract operations on JavaScript\nvalues.</p>\n<p>These APIs support doing one of the following:</p>\n<ol>\n<li>Coerce JavaScript values to specific JavaScript types (such as <code>number</code> or\n<code>string</code>).</li>\n<li>Check the type of a JavaScript value.</li>\n<li>Check for equality between two JavaScript values.</li>\n</ol>",
          "modules": [
            {
              "textRaw": "`napi_coerce_to_bool`",
              "name": "`napi_coerce_to_bool`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_coerce_to_bool(napi_env env,\n                                napi_value value,\n                                napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to coerce.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the coerced JavaScript <code>Boolean</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API implements the abstract operation <code>ToBoolean()</code> as defined in\n<a href=\"https://tc39.es/ecma262/#sec-toboolean\">Section ToBoolean</a> of the ECMAScript Language Specification.</p>",
              "displayName": "`napi_coerce_to_bool`"
            },
            {
              "textRaw": "`napi_coerce_to_number`",
              "name": "`napi_coerce_to_number`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_coerce_to_number(napi_env env,\n                                  napi_value value,\n                                  napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to coerce.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the coerced JavaScript <code>number</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API implements the abstract operation <code>ToNumber()</code> as defined in\n<a href=\"https://tc39.es/ecma262/#sec-tonumber\">Section ToNumber</a> of the ECMAScript Language Specification.\nThis function potentially runs JS code if the passed-in value is an\nobject.</p>",
              "displayName": "`napi_coerce_to_number`"
            },
            {
              "textRaw": "`napi_coerce_to_object`",
              "name": "`napi_coerce_to_object`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_coerce_to_object(napi_env env,\n                                  napi_value value,\n                                  napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to coerce.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the coerced JavaScript <code>Object</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API implements the abstract operation <code>ToObject()</code> as defined in\n<a href=\"https://tc39.es/ecma262/#sec-toobject\">Section ToObject</a> of the ECMAScript Language Specification.</p>",
              "displayName": "`napi_coerce_to_object`"
            },
            {
              "textRaw": "`napi_coerce_to_string`",
              "name": "`napi_coerce_to_string`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_coerce_to_string(napi_env env,\n                                  napi_value value,\n                                  napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to coerce.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the coerced JavaScript <code>string</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API implements the abstract operation <code>ToString()</code> as defined in\n<a href=\"https://tc39.es/ecma262/#sec-tostring\">Section ToString</a> of the ECMAScript Language Specification.\nThis function potentially runs JS code if the passed-in value is an\nobject.</p>",
              "displayName": "`napi_coerce_to_string`"
            },
            {
              "textRaw": "`napi_typeof`",
              "name": "`napi_typeof`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_typeof(napi_env env, napi_value value, napi_valuetype* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value whose type to query.</li>\n<li><code>[out] result</code>: The type of the JavaScript value.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<ul>\n<li><code>napi_invalid_arg</code> if the type of <code>value</code> is not a known ECMAScript type and\n<code>value</code> is not an External value.</li>\n</ul>\n<p>This API represents behavior similar to invoking the <code>typeof</code> Operator on\nthe object as defined in <a href=\"https://tc39.es/ecma262/#sec-typeof-operator\">Section typeof operator</a> of the ECMAScript Language\nSpecification. However, there are some differences:</p>\n<ol>\n<li>It has support for detecting an External value.</li>\n<li>It detects <code>null</code> as a separate type, while ECMAScript <code>typeof</code> would detect\n<code>object</code>.</li>\n</ol>\n<p>If <code>value</code> has a type that is invalid, an error is returned.</p>",
              "displayName": "`napi_typeof`"
            },
            {
              "textRaw": "`napi_instanceof`",
              "name": "`napi_instanceof`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_instanceof(napi_env env,\n                            napi_value object,\n                            napi_value constructor,\n                            bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] object</code>: The JavaScript value to check.</li>\n<li><code>[in] constructor</code>: The JavaScript function object of the constructor function\nto check against.</li>\n<li><code>[out] result</code>: Boolean that is set to true if <code>object instanceof constructor</code>\nis true.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API represents invoking the <code>instanceof</code> Operator on the object as\ndefined in <a href=\"https://tc39.es/ecma262/#sec-instanceofoperator\">Section instanceof operator</a> of the ECMAScript Language Specification.</p>",
              "displayName": "`napi_instanceof`"
            },
            {
              "textRaw": "`napi_is_array`",
              "name": "`napi_is_array`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_array(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to check.</li>\n<li><code>[out] result</code>: Whether the given object is an array.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API represents invoking the <code>IsArray</code> operation on the object\nas defined in <a href=\"https://tc39.es/ecma262/#sec-isarray\">Section IsArray</a> of the ECMAScript Language Specification.</p>",
              "displayName": "`napi_is_array`"
            },
            {
              "textRaw": "`napi_is_arraybuffer`",
              "name": "`napi_is_arraybuffer`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_arraybuffer(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to check.</li>\n<li><code>[out] result</code>: Whether the given object is an <code>ArrayBuffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the <code>Object</code> passed in is an array buffer.</p>",
              "displayName": "`napi_is_arraybuffer`"
            },
            {
              "textRaw": "`napi_is_buffer`",
              "name": "`napi_is_buffer`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_buffer(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to check.</li>\n<li><code>[out] result</code>: Whether the given <code>napi_value</code> represents a <code>node::Buffer</code> or\n<code>Uint8Array</code> object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the <code>Object</code> passed in is a buffer or Uint8Array.\n<a href=\"#napi_is_typedarray\"><code>napi_is_typedarray</code></a> should be preferred if the caller needs to check if the\nvalue is a Uint8Array.</p>",
              "displayName": "`napi_is_buffer`"
            },
            {
              "textRaw": "`napi_is_date`",
              "name": "`napi_is_date`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.11.0",
                  "v10.17.0"
                ],
                "changes": [],
                "napiVersion": [
                  5
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_date(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to check.</li>\n<li><code>[out] result</code>: Whether the given <code>napi_value</code> represents a JavaScript <code>Date</code>\nobject.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the <code>Object</code> passed in is a date.</p>",
              "displayName": "`napi_is_date`"
            },
            {
              "textRaw": "`napi_is_error`",
              "name": "`napi_is_error`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_error(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to check.</li>\n<li><code>[out] result</code>: Whether the given <code>napi_value</code> represents an <code>Error</code> object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the <code>Object</code> passed in is an <code>Error</code>.</p>",
              "displayName": "`napi_is_error`"
            },
            {
              "textRaw": "`napi_is_typedarray`",
              "name": "`napi_is_typedarray`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_typedarray(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to check.</li>\n<li><code>[out] result</code>: Whether the given <code>napi_value</code> represents a <code>TypedArray</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the <code>Object</code> passed in is a typed array.</p>",
              "displayName": "`napi_is_typedarray`"
            },
            {
              "textRaw": "`napi_is_dataview`",
              "name": "`napi_is_dataview`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_dataview(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to check.</li>\n<li><code>[out] result</code>: Whether the given <code>napi_value</code> represents a <code>DataView</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the <code>Object</code> passed in is a <code>DataView</code>.</p>",
              "displayName": "`napi_is_dataview`"
            },
            {
              "textRaw": "`napi_strict_equals`",
              "name": "`napi_strict_equals`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_strict_equals(napi_env env,\n                               napi_value lhs,\n                               napi_value rhs,\n                               bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] lhs</code>: The JavaScript value to check.</li>\n<li><code>[in] rhs</code>: The JavaScript value to check against.</li>\n<li><code>[out] result</code>: Whether the two <code>napi_value</code> objects are equal.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API represents the invocation of the Strict Equality algorithm as\ndefined in <a href=\"https://tc39.es/ecma262/#sec-strict-equality-comparison\">Section IsStrctEqual</a> of the ECMAScript Language Specification.</p>",
              "displayName": "`napi_strict_equals`"
            },
            {
              "textRaw": "`napi_detach_arraybuffer`",
              "name": "`napi_detach_arraybuffer`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.0.0",
                  "v12.16.0",
                  "v10.22.0"
                ],
                "changes": [],
                "napiVersion": [
                  7
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_detach_arraybuffer(napi_env env,\n                                    napi_value arraybuffer)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] arraybuffer</code>: The JavaScript <code>ArrayBuffer</code> to be detached.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded. If a non-detachable <code>ArrayBuffer</code> is\npassed in it returns <code>napi_detachable_arraybuffer_expected</code>.</p>\n<p>Generally, an <code>ArrayBuffer</code> is non-detachable if it has been detached before.\nThe engine may impose additional conditions on whether an <code>ArrayBuffer</code> is\ndetachable. For example, V8 requires that the <code>ArrayBuffer</code> be external,\nthat is, created with <a href=\"#napi_create_external_arraybuffer\"><code>napi_create_external_arraybuffer</code></a>.</p>\n<p>This API represents the invocation of the <code>ArrayBuffer</code> detach operation as\ndefined in <a href=\"https://tc39.es/ecma262/#sec-detacharraybuffer\">Section detachArrayBuffer</a> of the ECMAScript Language Specification.</p>",
              "displayName": "`napi_detach_arraybuffer`"
            },
            {
              "textRaw": "`napi_is_detached_arraybuffer`",
              "name": "`napi_is_detached_arraybuffer`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.3.0",
                  "v12.16.0",
                  "v10.22.0"
                ],
                "changes": [],
                "napiVersion": [
                  7
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_detached_arraybuffer(napi_env env,\n                                         napi_value arraybuffer,\n                                         bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] arraybuffer</code>: The JavaScript <code>ArrayBuffer</code> to be checked.</li>\n<li><code>[out] result</code>: Whether the <code>arraybuffer</code> is detached.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>The <code>ArrayBuffer</code> is considered detached if its internal data is <code>null</code>.</p>\n<p>This API represents the invocation of the <code>ArrayBuffer</code> <code>IsDetachedBuffer</code>\noperation as defined in <a href=\"https://tc39.es/ecma262/#sec-isdetachedbuffer\">Section isDetachedBuffer</a> of the ECMAScript Language\nSpecification.</p>",
              "displayName": "`napi_is_detached_arraybuffer`"
            },
            {
              "textRaw": "`node_api_is_sharedarraybuffer`",
              "name": "`node_api_is_sharedarraybuffer`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.9.0",
                  "v22.21.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<pre><code class=\"language-c\">napi_status node_api_is_sharedarraybuffer(napi_env env, napi_value value, bool* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The JavaScript value to check.</li>\n<li><code>[out] result</code>: Whether the given <code>napi_value</code> represents a <code>SharedArrayBuffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the Object passed in is a <code>SharedArrayBuffer</code>.</p>",
              "displayName": "`node_api_is_sharedarraybuffer`"
            },
            {
              "textRaw": "`node_api_create_sharedarraybuffer`",
              "name": "`node_api_create_sharedarraybuffer`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.9.0",
                  "v22.21.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<pre><code class=\"language-c\">napi_status node_api_create_sharedarraybuffer(napi_env env,\n                                             size_t byte_length,\n                                             void** data,\n                                             napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] byte_length</code>: The length in bytes of the shared array buffer to create.</li>\n<li><code>[out] data</code>: Pointer to the underlying byte buffer of the <code>SharedArrayBuffer</code>.\n<code>data</code> can optionally be ignored by passing <code>NULL</code>.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing a JavaScript <code>SharedArrayBuffer</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns a Node-API value corresponding to a JavaScript <code>SharedArrayBuffer</code>.\n<code>SharedArrayBuffer</code>s are used to represent fixed-length binary data buffers that\ncan be shared across multiple workers.</p>\n<p>The <code>SharedArrayBuffer</code> allocated will have an underlying byte buffer whose size is\ndetermined by the <code>byte_length</code> parameter that's passed in.\nThe underlying buffer is optionally returned back to the caller in case the\ncaller wants to directly manipulate the buffer. This buffer can only be\nwritten to directly from native code. To write to this buffer from JavaScript,\na typed array or <code>DataView</code> object would need to be created.</p>\n<p>JavaScript <code>SharedArrayBuffer</code> objects are described in\n<a href=\"https://tc39.es/ecma262/#sec-sharedarraybuffer-objects\">Section SharedArrayBuffer objects</a> of the ECMAScript Language Specification.</p>",
              "displayName": "`node_api_create_sharedarraybuffer`"
            }
          ],
          "displayName": "Working with JavaScript values and abstract operations"
        },
        {
          "textRaw": "Working with JavaScript properties",
          "name": "working_with_javascript_properties",
          "type": "misc",
          "desc": "<p>Node-API exposes a set of APIs to get and set properties on JavaScript\nobjects.</p>\n<p>Properties in JavaScript are represented as a tuple of a key and a value.\nFundamentally, all property keys in Node-API can be represented in one of the\nfollowing forms:</p>\n<ul>\n<li>Named: a simple UTF8-encoded string</li>\n<li>Integer-Indexed: an index value represented by <code>uint32_t</code></li>\n<li>JavaScript value: these are represented in Node-API by <code>napi_value</code>. This can\nbe a <code>napi_value</code> representing a <code>string</code>, <code>number</code>, or <code>symbol</code>.</li>\n</ul>\n<p>Node-API values are represented by the type <code>napi_value</code>.\nAny Node-API call that requires a JavaScript value takes in a <code>napi_value</code>.\nHowever, it's the caller's responsibility to make sure that the\n<code>napi_value</code> in question is of the JavaScript type expected by the API.</p>\n<p>The APIs documented in this section provide a simple interface to\nget and set properties on arbitrary JavaScript objects represented by\n<code>napi_value</code>.</p>\n<p>For instance, consider the following JavaScript code snippet:</p>\n<pre><code class=\"language-js\">const obj = {};\nobj.myProp = 123;\n</code></pre>\n<p>The equivalent can be done using Node-API values with the following snippet:</p>\n<pre><code class=\"language-c\">napi_status status = napi_generic_failure;\n\n// const obj = {}\nnapi_value obj, value;\nstatus = napi_create_object(env, &#x26;obj);\nif (status != napi_ok) return status;\n\n// Create a napi_value for 123\nstatus = napi_create_int32(env, 123, &#x26;value);\nif (status != napi_ok) return status;\n\n// obj.myProp = 123\nstatus = napi_set_named_property(env, obj, \"myProp\", value);\nif (status != napi_ok) return status;\n</code></pre>\n<p>Indexed properties can be set in a similar manner. Consider the following\nJavaScript snippet:</p>\n<pre><code class=\"language-js\">const arr = [];\narr[123] = 'hello';\n</code></pre>\n<p>The equivalent can be done using Node-API values with the following snippet:</p>\n<pre><code class=\"language-c\">napi_status status = napi_generic_failure;\n\n// const arr = [];\nnapi_value arr, value;\nstatus = napi_create_array(env, &#x26;arr);\nif (status != napi_ok) return status;\n\n// Create a napi_value for 'hello'\nstatus = napi_create_string_utf8(env, \"hello\", NAPI_AUTO_LENGTH, &#x26;value);\nif (status != napi_ok) return status;\n\n// arr[123] = 'hello';\nstatus = napi_set_element(env, arr, 123, value);\nif (status != napi_ok) return status;\n</code></pre>\n<p>Properties can be retrieved using the APIs described in this section.\nConsider the following JavaScript snippet:</p>\n<pre><code class=\"language-js\">const arr = [];\nconst value = arr[123];\n</code></pre>\n<p>The following is the approximate equivalent of the Node-API counterpart:</p>\n<pre><code class=\"language-c\">napi_status status = napi_generic_failure;\n\n// const arr = []\nnapi_value arr, value;\nstatus = napi_create_array(env, &#x26;arr);\nif (status != napi_ok) return status;\n\n// const value = arr[123]\nstatus = napi_get_element(env, arr, 123, &#x26;value);\nif (status != napi_ok) return status;\n</code></pre>\n<p>Finally, multiple properties can also be defined on an object for performance\nreasons. Consider the following JavaScript:</p>\n<pre><code class=\"language-js\">const obj = {};\nObject.defineProperties(obj, {\n  'foo': { value: 123, writable: true, configurable: true, enumerable: true },\n  'bar': { value: 456, writable: true, configurable: true, enumerable: true },\n});\n</code></pre>\n<p>The following is the approximate equivalent of the Node-API counterpart:</p>\n<pre><code class=\"language-c\">napi_status status = napi_status_generic_failure;\n\n// const obj = {};\nnapi_value obj;\nstatus = napi_create_object(env, &#x26;obj);\nif (status != napi_ok) return status;\n\n// Create napi_values for 123 and 456\nnapi_value fooValue, barValue;\nstatus = napi_create_int32(env, 123, &#x26;fooValue);\nif (status != napi_ok) return status;\nstatus = napi_create_int32(env, 456, &#x26;barValue);\nif (status != napi_ok) return status;\n\n// Set the properties\nnapi_property_descriptor descriptors[] = {\n  { \"foo\", NULL, NULL, NULL, NULL, fooValue, napi_writable | napi_configurable, NULL },\n  { \"bar\", NULL, NULL, NULL, NULL, barValue, napi_writable | napi_configurable, NULL }\n}\nstatus = napi_define_properties(env,\n                                obj,\n                                sizeof(descriptors) / sizeof(descriptors[0]),\n                                descriptors);\nif (status != napi_ok) return status;\n</code></pre>",
          "modules": [
            {
              "textRaw": "Structures",
              "name": "structures",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_property_attributes`",
                  "name": "`napi_property_attributes`",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": "v14.12.0",
                        "pr-url": "https://github.com/nodejs/node/pull/35214",
                        "description": "added `napi_default_method` and `napi_default_property`."
                      }
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">typedef enum {\n  napi_default = 0,\n  napi_writable = 1 &#x3C;&#x3C; 0,\n  napi_enumerable = 1 &#x3C;&#x3C; 1,\n  napi_configurable = 1 &#x3C;&#x3C; 2,\n\n  // Used with napi_define_class to distinguish static properties\n  // from instance properties. Ignored by napi_define_properties.\n  napi_static = 1 &#x3C;&#x3C; 10,\n\n  // Default for class methods.\n  napi_default_method = napi_writable | napi_configurable,\n\n  // Default for object properties, like in JS obj[prop].\n  napi_default_jsproperty = napi_writable |\n                          napi_enumerable |\n                          napi_configurable,\n} napi_property_attributes;\n</code></pre>\n<p><code>napi_property_attributes</code> are bit flags used to control the behavior of\nproperties set on a JavaScript object. Other than <code>napi_static</code> they\ncorrespond to the attributes listed in <a href=\"https://tc39.es/ecma262/#sec-property-attributes\">Section property attributes</a>\nof the <a href=\"https://tc39.es/ecma262/\">ECMAScript Language Specification</a>.\nThey can be one or more of the following bit flags:</p>\n<ul>\n<li><code>napi_default</code>: No explicit attributes are set on the property. By default, a\nproperty is read only, not enumerable and not configurable.</li>\n<li><code>napi_writable</code>: The property is writable.</li>\n<li><code>napi_enumerable</code>: The property is enumerable.</li>\n<li><code>napi_configurable</code>: The property is configurable as defined in\n<a href=\"https://tc39.es/ecma262/#sec-property-attributes\">Section property attributes</a> of the <a href=\"https://tc39.es/ecma262/\">ECMAScript Language Specification</a>.</li>\n<li><code>napi_static</code>: The property will be defined as a static property on a class as\nopposed to an instance property, which is the default. This is used only by\n<a href=\"#napi_define_class\"><code>napi_define_class</code></a>. It is ignored by <code>napi_define_properties</code>.</li>\n<li><code>napi_default_method</code>: Like a method in a JS class, the property is\nconfigurable and writeable, but not enumerable.</li>\n<li><code>napi_default_jsproperty</code>: Like a property set via assignment in JavaScript,\nthe property is writable, enumerable, and configurable.</li>\n</ul>",
                  "displayName": "`napi_property_attributes`"
                },
                {
                  "textRaw": "`napi_property_descriptor`",
                  "name": "`napi_property_descriptor`",
                  "type": "module",
                  "desc": "<pre><code class=\"language-c\">typedef struct {\n  // One of utf8name or name should be NULL.\n  const char* utf8name;\n  napi_value name;\n\n  napi_callback method;\n  napi_callback getter;\n  napi_callback setter;\n  napi_value value;\n\n  napi_property_attributes attributes;\n  void* data;\n} napi_property_descriptor;\n</code></pre>\n<ul>\n<li><code>utf8name</code>: Optional string describing the key for the property,\nencoded as UTF8. One of <code>utf8name</code> or <code>name</code> must be provided for the\nproperty.</li>\n<li><code>name</code>: Optional <code>napi_value</code> that points to a JavaScript string or symbol\nto be used as the key for the property. One of <code>utf8name</code> or <code>name</code> must\nbe provided for the property.</li>\n<li><code>value</code>: The value that's retrieved by a get access of the property if the\nproperty is a data property. If this is passed in, set <code>getter</code>, <code>setter</code>,\n<code>method</code> and <code>data</code> to <code>NULL</code> (since these members won't be used).</li>\n<li><code>getter</code>: A function to call when a get access of the property is performed.\nIf this is passed in, set <code>value</code> and <code>method</code> to <code>NULL</code> (since these members\nwon't be used). The given function is called implicitly by the runtime when\nthe property is accessed from JavaScript code (or if a get on the property is\nperformed using a Node-API call). <a href=\"#napi_callback\"><code>napi_callback</code></a> provides more details.</li>\n<li><code>setter</code>: A function to call when a set access of the property is performed.\nIf this is passed in, set <code>value</code> and <code>method</code> to <code>NULL</code> (since these members\nwon't be used). The given function is called implicitly by the runtime when\nthe property is set from JavaScript code (or if a set on the property is\nperformed using a Node-API call). <a href=\"#napi_callback\"><code>napi_callback</code></a> provides more details.</li>\n<li><code>method</code>: Set this to make the property descriptor object's <code>value</code>\nproperty to be a JavaScript function represented by <code>method</code>. If this is\npassed in, set <code>value</code>, <code>getter</code> and <code>setter</code> to <code>NULL</code> (since these members\nwon't be used). <a href=\"#napi_callback\"><code>napi_callback</code></a> provides more details.</li>\n<li><code>attributes</code>: The attributes associated with the particular property. See\n<a href=\"#napi_property_attributes\"><code>napi_property_attributes</code></a>.</li>\n<li><code>data</code>: The callback data passed into <code>method</code>, <code>getter</code> and <code>setter</code> if this\nfunction is invoked.</li>\n</ul>",
                  "displayName": "`napi_property_descriptor`"
                }
              ],
              "displayName": "Structures"
            },
            {
              "textRaw": "Functions",
              "name": "functions",
              "type": "module",
              "modules": [
                {
                  "textRaw": "`napi_get_property_names`",
                  "name": "`napi_get_property_names`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_property_names(napi_env env,\n                                    napi_value object,\n                                    napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object from which to retrieve the properties.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing an array of JavaScript values\nthat represent the property names of the object. The API can be used to\niterate over <code>result</code> using <a href=\"#napi_get_array_length\"><code>napi_get_array_length</code></a>\nand <a href=\"#napi_get_element\"><code>napi_get_element</code></a>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns the names of the enumerable properties of <code>object</code> as an array\nof strings. The properties of <code>object</code> whose key is a symbol will not be\nincluded.</p>",
                  "displayName": "`napi_get_property_names`"
                },
                {
                  "textRaw": "`napi_get_all_property_names`",
                  "name": "`napi_get_all_property_names`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v13.7.0",
                      "v12.17.0",
                      "v10.20.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      6
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_get_all_property_names(napi_env env,\n                            napi_value object,\n                            napi_key_collection_mode key_mode,\n                            napi_key_filter key_filter,\n                            napi_key_conversion key_conversion,\n                            napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object from which to retrieve the properties.</li>\n<li><code>[in] key_mode</code>: Whether to retrieve prototype properties as well.</li>\n<li><code>[in] key_filter</code>: Which properties to retrieve\n(enumerable/readable/writable).</li>\n<li><code>[in] key_conversion</code>: Whether to convert numbered property keys to strings.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing an array of JavaScript values\nthat represent the property names of the object. <a href=\"#napi_get_array_length\"><code>napi_get_array_length</code></a>\nand <a href=\"#napi_get_element\"><code>napi_get_element</code></a> can be used to iterate over <code>result</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns an array containing the names of the available properties\nof this object.</p>",
                  "displayName": "`napi_get_all_property_names`"
                },
                {
                  "textRaw": "`napi_set_property`",
                  "name": "`napi_set_property`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_set_property(napi_env env,\n                              napi_value object,\n                              napi_value key,\n                              napi_value value);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object on which to set the property.</li>\n<li><code>[in] key</code>: The name of the property to set.</li>\n<li><code>[in] value</code>: The property value.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API set a property on the <code>Object</code> passed in.</p>",
                  "displayName": "`napi_set_property`"
                },
                {
                  "textRaw": "`napi_get_property`",
                  "name": "`napi_get_property`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_property(napi_env env,\n                              napi_value object,\n                              napi_value key,\n                              napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object from which to retrieve the property.</li>\n<li><code>[in] key</code>: The name of the property to retrieve.</li>\n<li><code>[out] result</code>: The value of the property.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API gets the requested property from the <code>Object</code> passed in.</p>",
                  "displayName": "`napi_get_property`"
                },
                {
                  "textRaw": "`napi_has_property`",
                  "name": "`napi_has_property`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_has_property(napi_env env,\n                              napi_value object,\n                              napi_value key,\n                              bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object to query.</li>\n<li><code>[in] key</code>: The name of the property whose existence to check.</li>\n<li><code>[out] result</code>: Whether the property exists on the object or not.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the <code>Object</code> passed in has the named property.</p>",
                  "displayName": "`napi_has_property`"
                },
                {
                  "textRaw": "`napi_delete_property`",
                  "name": "`napi_delete_property`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_delete_property(napi_env env,\n                                 napi_value object,\n                                 napi_value key,\n                                 bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object to query.</li>\n<li><code>[in] key</code>: The name of the property to delete.</li>\n<li><code>[out] result</code>: Whether the property deletion succeeded or not. <code>result</code> can\noptionally be ignored by passing <code>NULL</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API attempts to delete the <code>key</code> own property from <code>object</code>.</p>",
                  "displayName": "`napi_delete_property`"
                },
                {
                  "textRaw": "`napi_has_own_property`",
                  "name": "`napi_has_own_property`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_has_own_property(napi_env env,\n                                  napi_value object,\n                                  napi_value key,\n                                  bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object to query.</li>\n<li><code>[in] key</code>: The name of the own property whose existence to check.</li>\n<li><code>[out] result</code>: Whether the own property exists on the object or not.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API checks if the <code>Object</code> passed in has the named own property. <code>key</code> must\nbe a <code>string</code> or a <code>symbol</code>, or an error will be thrown. Node-API will not\nperform any conversion between data types.</p>",
                  "displayName": "`napi_has_own_property`"
                },
                {
                  "textRaw": "`napi_set_named_property`",
                  "name": "`napi_set_named_property`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_set_named_property(napi_env env,\n                                    napi_value object,\n                                    const char* utf8Name,\n                                    napi_value value);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object on which to set the property.</li>\n<li><code>[in] utf8Name</code>: The name of the property to set.</li>\n<li><code>[in] value</code>: The property value.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method is equivalent to calling <a href=\"#napi_set_property\"><code>napi_set_property</code></a> with a <code>napi_value</code>\ncreated from the string passed in as <code>utf8Name</code>.</p>",
                  "displayName": "`napi_set_named_property`"
                },
                {
                  "textRaw": "`napi_get_named_property`",
                  "name": "`napi_get_named_property`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_named_property(napi_env env,\n                                    napi_value object,\n                                    const char* utf8Name,\n                                    napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object from which to retrieve the property.</li>\n<li><code>[in] utf8Name</code>: The name of the property to get.</li>\n<li><code>[out] result</code>: The value of the property.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method is equivalent to calling <a href=\"#napi_get_property\"><code>napi_get_property</code></a> with a <code>napi_value</code>\ncreated from the string passed in as <code>utf8Name</code>.</p>",
                  "displayName": "`napi_get_named_property`"
                },
                {
                  "textRaw": "`napi_has_named_property`",
                  "name": "`napi_has_named_property`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_has_named_property(napi_env env,\n                                    napi_value object,\n                                    const char* utf8Name,\n                                    bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object to query.</li>\n<li><code>[in] utf8Name</code>: The name of the property whose existence to check.</li>\n<li><code>[out] result</code>: Whether the property exists on the object or not.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method is equivalent to calling <a href=\"#napi_has_property\"><code>napi_has_property</code></a> with a <code>napi_value</code>\ncreated from the string passed in as <code>utf8Name</code>.</p>",
                  "displayName": "`napi_has_named_property`"
                },
                {
                  "textRaw": "`napi_set_element`",
                  "name": "`napi_set_element`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_set_element(napi_env env,\n                             napi_value object,\n                             uint32_t index,\n                             napi_value value);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object from which to set the properties.</li>\n<li><code>[in] index</code>: The index of the property to set.</li>\n<li><code>[in] value</code>: The property value.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API sets an element on the <code>Object</code> passed in.</p>",
                  "displayName": "`napi_set_element`"
                },
                {
                  "textRaw": "`napi_get_element`",
                  "name": "`napi_get_element`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_get_element(napi_env env,\n                             napi_value object,\n                             uint32_t index,\n                             napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object from which to retrieve the property.</li>\n<li><code>[in] index</code>: The index of the property to get.</li>\n<li><code>[out] result</code>: The value of the property.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API gets the element at the requested index.</p>",
                  "displayName": "`napi_get_element`"
                },
                {
                  "textRaw": "`napi_has_element`",
                  "name": "`napi_has_element`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_has_element(napi_env env,\n                             napi_value object,\n                             uint32_t index,\n                             bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object to query.</li>\n<li><code>[in] index</code>: The index of the property whose existence to check.</li>\n<li><code>[out] result</code>: Whether the property exists on the object or not.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns if the <code>Object</code> passed in has an element at the\nrequested index.</p>",
                  "displayName": "`napi_has_element`"
                },
                {
                  "textRaw": "`napi_delete_element`",
                  "name": "`napi_delete_element`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_delete_element(napi_env env,\n                                napi_value object,\n                                uint32_t index,\n                                bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object to query.</li>\n<li><code>[in] index</code>: The index of the property to delete.</li>\n<li><code>[out] result</code>: Whether the element deletion succeeded or not. <code>result</code> can\noptionally be ignored by passing <code>NULL</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API attempts to delete the specified <code>index</code> from <code>object</code>.</p>",
                  "displayName": "`napi_delete_element`"
                },
                {
                  "textRaw": "`napi_define_properties`",
                  "name": "`napi_define_properties`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      1
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_define_properties(napi_env env,\n                                   napi_value object,\n                                   size_t property_count,\n                                   const napi_property_descriptor* properties);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object from which to retrieve the properties.</li>\n<li><code>[in] property_count</code>: The number of elements in the <code>properties</code> array.</li>\n<li><code>[in] properties</code>: The array of property descriptors.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method allows the efficient definition of multiple properties on a given\nobject. The properties are defined using property descriptors (see\n<a href=\"#napi_property_descriptor\"><code>napi_property_descriptor</code></a>). Given an array of such property descriptors,\nthis API will set the properties on the object one at a time, as defined by\n<code>DefineOwnProperty()</code> (described in <a href=\"https://tc39.es/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots-defineownproperty-p-desc\">Section DefineOwnProperty</a> of the ECMA-262\nspecification).</p>",
                  "displayName": "`napi_define_properties`"
                },
                {
                  "textRaw": "`napi_object_freeze`",
                  "name": "`napi_object_freeze`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v14.14.0",
                      "v12.20.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      8
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_object_freeze(napi_env env,\n                               napi_value object);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object to freeze.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method freezes a given object. This prevents new properties from\nbeing added to it, existing properties from being removed, prevents\nchanging the enumerability, configurability, or writability of existing\nproperties, and prevents the values of existing properties from being changed.\nIt also prevents the object's prototype from being changed. This is described\nin <a href=\"https://tc39.es/ecma262/#sec-object.freeze\">Section 19.1.2.6</a> of the\nECMA-262 specification.</p>",
                  "displayName": "`napi_object_freeze`"
                },
                {
                  "textRaw": "`napi_object_seal`",
                  "name": "`napi_object_seal`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v14.14.0",
                      "v12.20.0"
                    ],
                    "changes": [],
                    "napiVersion": [
                      8
                    ]
                  },
                  "desc": "<pre><code class=\"language-c\">napi_status napi_object_seal(napi_env env,\n                             napi_value object);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object to seal.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method seals a given object. This prevents new properties from being\nadded to it, as well as marking all existing properties as non-configurable.\nThis is described in <a href=\"https://tc39.es/ecma262/#sec-object.seal\">Section 19.1.2.20</a>\nof the ECMA-262 specification.</p>",
                  "displayName": "`napi_object_seal`"
                },
                {
                  "textRaw": "`node_api_set_prototype`",
                  "name": "`node_api_set_prototype`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v25.4.0",
                      "v24.13.1"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "desc": "<pre><code class=\"language-c\">napi_status node_api_set_prototype(napi_env env,\n                                   napi_value object,\n                                   napi_value value);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the Node-API call is invoked under.</li>\n<li><code>[in] object</code>: The object on which to set the prototype.</li>\n<li><code>[in] value</code>: The prototype value.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API sets the prototype of the <code>Object</code> passed in.</p>",
                  "displayName": "`node_api_set_prototype`"
                }
              ],
              "displayName": "Functions"
            }
          ],
          "displayName": "Working with JavaScript properties"
        },
        {
          "textRaw": "Working with JavaScript functions",
          "name": "working_with_javascript_functions",
          "type": "misc",
          "desc": "<p>Node-API provides a set of APIs that allow JavaScript code to\ncall back into native code. Node-APIs that support calling back\ninto native code take in a callback functions represented by\nthe <code>napi_callback</code> type. When the JavaScript VM calls back to\nnative code, the <code>napi_callback</code> function provided is invoked. The APIs\ndocumented in this section allow the callback function to do the\nfollowing:</p>\n<ul>\n<li>Get information about the context in which the callback was invoked.</li>\n<li>Get the arguments passed into the callback.</li>\n<li>Return a <code>napi_value</code> back from the callback.</li>\n</ul>\n<p>Additionally, Node-API provides a set of functions which allow calling\nJavaScript functions from native code. One can either call a function\nlike a regular JavaScript function call, or as a constructor\nfunction.</p>\n<p>Any non-<code>NULL</code> data which is passed to this API via the <code>data</code> field of the\n<code>napi_property_descriptor</code> items can be associated with <code>object</code> and freed\nwhenever <code>object</code> is garbage-collected by passing both <code>object</code> and the data to\n<a href=\"#napi_add_finalizer\"><code>napi_add_finalizer</code></a>.</p>",
          "modules": [
            {
              "textRaw": "`napi_call_function`",
              "name": "`napi_call_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_call_function(napi_env env,\n                                           napi_value recv,\n                                           napi_value func,\n                                           size_t argc,\n                                           const napi_value* argv,\n                                           napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] recv</code>: The <code>this</code> value passed to the called function.</li>\n<li><code>[in] func</code>: <code>napi_value</code> representing the JavaScript function to be invoked.</li>\n<li><code>[in] argc</code>: The count of elements in the <code>argv</code> array.</li>\n<li><code>[in] argv</code>: Array of <code>napi_values</code> representing JavaScript values passed in\nas arguments to the function.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the JavaScript object returned.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method allows a JavaScript function object to be called from a native\nadd-on. This is the primary mechanism of calling back <em>from</em> the add-on's\nnative code <em>into</em> JavaScript. For the special case of calling into JavaScript\nafter an async operation, see <a href=\"#napi_make_callback\"><code>napi_make_callback</code></a>.</p>\n<p>A sample use case might look as follows. Consider the following JavaScript\nsnippet:</p>\n<pre><code class=\"language-js\">function AddTwo(num) {\n  return num + 2;\n}\nglobal.AddTwo = AddTwo;\n</code></pre>\n<p>Then, the above function can be invoked from a native add-on using the\nfollowing code:</p>\n<pre><code class=\"language-c\">// Get the function named \"AddTwo\" on the global object\nnapi_value global, add_two, arg;\nnapi_status status = napi_get_global(env, &#x26;global);\nif (status != napi_ok) return;\n\nstatus = napi_get_named_property(env, global, \"AddTwo\", &#x26;add_two);\nif (status != napi_ok) return;\n\n// const arg = 1337\nstatus = napi_create_int32(env, 1337, &#x26;arg);\nif (status != napi_ok) return;\n\nnapi_value* argv = &#x26;arg;\nsize_t argc = 1;\n\n// AddTwo(arg);\nnapi_value return_val;\nstatus = napi_call_function(env, global, add_two, argc, argv, &#x26;return_val);\nif (status != napi_ok) return;\n\n// Convert the result back to a native type\nint32_t result;\nstatus = napi_get_value_int32(env, return_val, &#x26;result);\nif (status != napi_ok) return;\n</code></pre>",
              "displayName": "`napi_call_function`"
            },
            {
              "textRaw": "`napi_create_function`",
              "name": "`napi_create_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_create_function(napi_env env,\n                                 const char* utf8name,\n                                 size_t length,\n                                 napi_callback cb,\n                                 void* data,\n                                 napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] utf8Name</code>: Optional name of the function encoded as UTF8. This is\nvisible within JavaScript as the new function object's <code>name</code> property.</li>\n<li><code>[in] length</code>: The length of the <code>utf8name</code> in bytes, or <code>NAPI_AUTO_LENGTH</code> if\nit is null-terminated.</li>\n<li><code>[in] cb</code>: The native function which should be called when this function\nobject is invoked. <a href=\"#napi_callback\"><code>napi_callback</code></a> provides more details.</li>\n<li><code>[in] data</code>: User-provided data context. This will be passed back into the\nfunction when invoked later.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the JavaScript function object for\nthe newly created function.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API allows an add-on author to create a function object in native code.\nThis is the primary mechanism to allow calling <em>into</em> the add-on's native code\n<em>from</em> JavaScript.</p>\n<p>The newly created function is not automatically visible from script after this\ncall. Instead, a property must be explicitly set on any object that is visible\nto JavaScript, in order for the function to be accessible from script.</p>\n<p>In order to expose a function as part of the\nadd-on's module exports, set the newly created function on the exports\nobject. A sample module might look as follows:</p>\n<pre><code class=\"language-c\">napi_value SayHello(napi_env env, napi_callback_info info) {\n  printf(\"Hello\\n\");\n  return NULL;\n}\n\nnapi_value Init(napi_env env, napi_value exports) {\n  napi_status status;\n\n  napi_value fn;\n  status = napi_create_function(env, NULL, 0, SayHello, NULL, &#x26;fn);\n  if (status != napi_ok) return NULL;\n\n  status = napi_set_named_property(env, exports, \"sayHello\", fn);\n  if (status != napi_ok) return NULL;\n\n  return exports;\n}\n\nNAPI_MODULE(NODE_GYP_MODULE_NAME, Init)\n</code></pre>\n<p>Given the above code, the add-on can be used from JavaScript as follows:</p>\n<pre><code class=\"language-js\">const myaddon = require('./addon');\nmyaddon.sayHello();\n</code></pre>\n<p>The string passed to <code>require()</code> is the name of the target in <code>binding.gyp</code>\nresponsible for creating the <code>.node</code> file.</p>\n<p>Any non-<code>NULL</code> data which is passed to this API via the <code>data</code> parameter can\nbe associated with the resulting JavaScript function (which is returned in the\n<code>result</code> parameter) and freed whenever the function is garbage-collected by\npassing both the JavaScript function and the data to <a href=\"#napi_add_finalizer\"><code>napi_add_finalizer</code></a>.</p>\n<p>JavaScript <code>Function</code>s are described in <a href=\"https://tc39.es/ecma262/#sec-function-objects\">Section Function objects</a> of the ECMAScript\nLanguage Specification.</p>",
              "displayName": "`napi_create_function`"
            },
            {
              "textRaw": "`napi_get_cb_info`",
              "name": "`napi_get_cb_info`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_get_cb_info(napi_env env,\n                             napi_callback_info cbinfo,\n                             size_t* argc,\n                             napi_value* argv,\n                             napi_value* thisArg,\n                             void** data)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] cbinfo</code>: The callback info passed into the callback function.</li>\n<li><code>[in-out] argc</code>: Specifies the length of the provided <code>argv</code> array and\nreceives the actual count of arguments. <code>argc</code> can\noptionally be ignored by passing <code>NULL</code>.</li>\n<li><code>[out] argv</code>: C array of <code>napi_value</code>s to which the arguments will be\ncopied. If there are more arguments than the provided count, only the\nrequested number of arguments are copied. If there are fewer arguments\nprovided than claimed, the rest of <code>argv</code> is filled with <code>napi_value</code> values\nthat represent <code>undefined</code>. <code>argv</code> can optionally be ignored by\npassing <code>NULL</code>.</li>\n<li><code>[out] thisArg</code>: Receives the JavaScript <code>this</code> argument for the call.\n<code>thisArg</code> can optionally be ignored by passing <code>NULL</code>.</li>\n<li><code>[out] data</code>: Receives the data pointer for the callback. <code>data</code> can\noptionally be ignored by passing <code>NULL</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method is used within a callback function to retrieve details about the\ncall like the arguments and the <code>this</code> pointer from a given callback info.</p>",
              "displayName": "`napi_get_cb_info`"
            },
            {
              "textRaw": "`napi_get_new_target`",
              "name": "`napi_get_new_target`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_get_new_target(napi_env env,\n                                napi_callback_info cbinfo,\n                                napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] cbinfo</code>: The callback info passed into the callback function.</li>\n<li><code>[out] result</code>: The <code>new.target</code> of the constructor call.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns the <code>new.target</code> of the constructor call. If the current\ncallback is not a constructor call, the result is <code>NULL</code>.</p>",
              "displayName": "`napi_get_new_target`"
            },
            {
              "textRaw": "`napi_new_instance`",
              "name": "`napi_new_instance`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_new_instance(napi_env env,\n                              napi_value cons,\n                              size_t argc,\n                              napi_value* argv,\n                              napi_value* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] cons</code>: <code>napi_value</code> representing the JavaScript function to be invoked\nas a constructor.</li>\n<li><code>[in] argc</code>: The count of elements in the <code>argv</code> array.</li>\n<li><code>[in] argv</code>: Array of JavaScript values as <code>napi_value</code> representing the\narguments to the constructor. If <code>argc</code> is zero this parameter may be\nomitted by passing in <code>NULL</code>.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the JavaScript object returned,\nwhich in this case is the constructed object.</li>\n</ul>\n<p>This method is used to instantiate a new JavaScript value using a given\n<code>napi_value</code> that represents the constructor for the object. For example,\nconsider the following snippet:</p>\n<pre><code class=\"language-js\">function MyObject(param) {\n  this.param = param;\n}\n\nconst arg = 'hello';\nconst value = new MyObject(arg);\n</code></pre>\n<p>The following can be approximated in Node-API using the following snippet:</p>\n<pre><code class=\"language-c\">// Get the constructor function MyObject\nnapi_value global, constructor, arg, value;\nnapi_status status = napi_get_global(env, &#x26;global);\nif (status != napi_ok) return;\n\nstatus = napi_get_named_property(env, global, \"MyObject\", &#x26;constructor);\nif (status != napi_ok) return;\n\n// const arg = \"hello\"\nstatus = napi_create_string_utf8(env, \"hello\", NAPI_AUTO_LENGTH, &#x26;arg);\nif (status != napi_ok) return;\n\nnapi_value* argv = &#x26;arg;\nsize_t argc = 1;\n\n// const value = new MyObject(arg)\nstatus = napi_new_instance(env, constructor, argc, argv, &#x26;value);\n</code></pre>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>",
              "displayName": "`napi_new_instance`"
            }
          ],
          "displayName": "Working with JavaScript functions"
        },
        {
          "textRaw": "Object wrap",
          "name": "object_wrap",
          "type": "misc",
          "desc": "<p>Node-API offers a way to \"wrap\" C++ classes and instances so that the class\nconstructor and methods can be called from JavaScript.</p>\n<ol>\n<li>The <a href=\"#napi_define_class\"><code>napi_define_class</code></a> API defines a JavaScript class with constructor,\nstatic properties and methods, and instance properties and methods that\ncorrespond to the C++ class.</li>\n<li>When JavaScript code invokes the constructor, the constructor callback\nuses <a href=\"#napi_wrap\"><code>napi_wrap</code></a> to wrap a new C++ instance in a JavaScript object,\nthen returns the wrapper object.</li>\n<li>When JavaScript code invokes a method or property accessor on the class,\nthe corresponding <code>napi_callback</code> C++ function is invoked. For an instance\ncallback, <a href=\"#napi_unwrap\"><code>napi_unwrap</code></a> obtains the C++ instance that is the target of\nthe call.</li>\n</ol>\n<p>For wrapped objects it may be difficult to distinguish between a function\ncalled on a class prototype and a function called on an instance of a class.\nA common pattern used to address this problem is to save a persistent\nreference to the class constructor for later <code>instanceof</code> checks.</p>\n<pre><code class=\"language-c\">napi_value MyClass_constructor = NULL;\nstatus = napi_get_reference_value(env, MyClass::es_constructor, &#x26;MyClass_constructor);\nassert(napi_ok == status);\nbool is_instance = false;\nstatus = napi_instanceof(env, es_this, MyClass_constructor, &#x26;is_instance);\nassert(napi_ok == status);\nif (is_instance) {\n  // napi_unwrap() ...\n} else {\n  // otherwise...\n}\n</code></pre>\n<p>The reference must be freed once it is no longer needed.</p>\n<p>There are occasions where <code>napi_instanceof()</code> is insufficient for ensuring that\na JavaScript object is a wrapper for a certain native type. This is the case\nespecially when wrapped JavaScript objects are passed back into the addon via\nstatic methods rather than as the <code>this</code> value of prototype methods. In such\ncases there is a chance that they may be unwrapped incorrectly.</p>\n<pre><code class=\"language-js\">const myAddon = require('./build/Release/my_addon.node');\n\n// `openDatabase()` returns a JavaScript object that wraps a native database\n// handle.\nconst dbHandle = myAddon.openDatabase();\n\n// `query()` returns a JavaScript object that wraps a native query handle.\nconst queryHandle = myAddon.query(dbHandle, 'Gimme ALL the things!');\n\n// There is an accidental error in the line below. The first parameter to\n// `myAddon.queryHasRecords()` should be the database handle (`dbHandle`), not\n// the query handle (`query`), so the correct condition for the while-loop\n// should be\n//\n// myAddon.queryHasRecords(dbHandle, queryHandle)\n//\nwhile (myAddon.queryHasRecords(queryHandle, dbHandle)) {\n  // retrieve records\n}\n</code></pre>\n<p>In the above example <code>myAddon.queryHasRecords()</code> is a method that accepts two\narguments. The first is a database handle and the second is a query handle.\nInternally, it unwraps the first argument and casts the resulting pointer to a\nnative database handle. It then unwraps the second argument and casts the\nresulting pointer to a query handle. If the arguments are passed in the wrong\norder, the casts will work, however, there is a good chance that the underlying\ndatabase operation will fail, or will even cause an invalid memory access.</p>\n<p>To ensure that the pointer retrieved from the first argument is indeed a pointer\nto a database handle and, similarly, that the pointer retrieved from the second\nargument is indeed a pointer to a query handle, the implementation of\n<code>queryHasRecords()</code> has to perform a type validation. Retaining the JavaScript\nclass constructor from which the database handle was instantiated and the\nconstructor from which the query handle was instantiated in <code>napi_ref</code>s can\nhelp, because <code>napi_instanceof()</code> can then be used to ensure that the instances\npassed into <code>queryHashRecords()</code> are indeed of the correct type.</p>\n<p>Unfortunately, <code>napi_instanceof()</code> does not protect against prototype\nmanipulation. For example, the prototype of the database handle instance can be\nset to the prototype of the constructor for query handle instances. In this\ncase, the database handle instance can appear as a query handle instance, and it\nwill pass the <code>napi_instanceof()</code> test for a query handle instance, while still\ncontaining a pointer to a database handle.</p>\n<p>To this end, Node-API provides type-tagging capabilities.</p>\n<p>A type tag is a 128-bit integer unique to the addon. Node-API provides the\n<code>napi_type_tag</code> structure for storing a type tag. When such a value is passed\nalong with a JavaScript object or <a href=\"#napi_create_external\">external</a> stored in a <code>napi_value</code> to\n<code>napi_type_tag_object()</code>, the JavaScript object will be \"marked\" with the\ntype tag. The \"mark\" is invisible on the JavaScript side. When a JavaScript\nobject arrives into a native binding, <code>napi_check_object_type_tag()</code> can be used\nalong with the original type tag to determine whether the JavaScript object was\npreviously \"marked\" with the type tag. This creates a type-checking capability\nof a higher fidelity than <code>napi_instanceof()</code> can provide, because such type-\ntagging survives prototype manipulation and addon unloading/reloading.</p>\n<p>Continuing the above example, the following skeleton addon implementation\nillustrates the use of <code>napi_type_tag_object()</code> and\n<code>napi_check_object_type_tag()</code>.</p>\n<pre><code class=\"language-c\">// This value is the type tag for a database handle. The command\n//\n//   uuidgen | sed -r -e 's/-//g' -e 's/(.{16})(.*)/0x\\1, 0x\\2/'\n//\n// can be used to obtain the two values with which to initialize the structure.\nstatic const napi_type_tag DatabaseHandleTypeTag = {\n  0x1edf75a38336451d, 0xa5ed9ce2e4c00c38\n};\n\n// This value is the type tag for a query handle.\nstatic const napi_type_tag QueryHandleTypeTag = {\n  0x9c73317f9fad44a3, 0x93c3920bf3b0ad6a\n};\n\nstatic napi_value\nopenDatabase(napi_env env, napi_callback_info info) {\n  napi_status status;\n  napi_value result;\n\n  // Perform the underlying action which results in a database handle.\n  DatabaseHandle* dbHandle = open_database();\n\n  // Create a new, empty JS object.\n  status = napi_create_object(env, &#x26;result);\n  if (status != napi_ok) return NULL;\n\n  // Tag the object to indicate that it holds a pointer to a `DatabaseHandle`.\n  status = napi_type_tag_object(env, result, &#x26;DatabaseHandleTypeTag);\n  if (status != napi_ok) return NULL;\n\n  // Store the pointer to the `DatabaseHandle` structure inside the JS object.\n  status = napi_wrap(env, result, dbHandle, NULL, NULL, NULL);\n  if (status != napi_ok) return NULL;\n\n  return result;\n}\n\n// Later when we receive a JavaScript object purporting to be a database handle\n// we can use `napi_check_object_type_tag()` to ensure that it is indeed such a\n// handle.\n\nstatic napi_value\nquery(napi_env env, napi_callback_info info) {\n  napi_status status;\n  size_t argc = 2;\n  napi_value argv[2];\n  bool is_db_handle;\n\n  status = napi_get_cb_info(env, info, &#x26;argc, argv, NULL, NULL);\n  if (status != napi_ok) return NULL;\n\n  // Check that the object passed as the first parameter has the previously\n  // applied tag.\n  status = napi_check_object_type_tag(env,\n                                      argv[0],\n                                      &#x26;DatabaseHandleTypeTag,\n                                      &#x26;is_db_handle);\n  if (status != napi_ok) return NULL;\n\n  // Throw a `TypeError` if it doesn't.\n  if (!is_db_handle) {\n    // Throw a TypeError.\n    return NULL;\n  }\n}\n</code></pre>",
          "modules": [
            {
              "textRaw": "`napi_define_class`",
              "name": "`napi_define_class`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_define_class(napi_env env,\n                              const char* utf8name,\n                              size_t length,\n                              napi_callback constructor,\n                              void* data,\n                              size_t property_count,\n                              const napi_property_descriptor* properties,\n                              napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] utf8name</code>: Name of the JavaScript constructor function. For clarity,\nit is recommended to use the C++ class name when wrapping a C++ class.</li>\n<li><code>[in] length</code>: The length of the <code>utf8name</code> in bytes, or <code>NAPI_AUTO_LENGTH</code>\nif it is null-terminated.</li>\n<li><code>[in] constructor</code>: Callback function that handles constructing instances\nof the class. When wrapping a C++ class, this method must be a static member\nwith the <a href=\"#napi_callback\"><code>napi_callback</code></a> signature. A C++ class constructor cannot be\nused. <a href=\"#napi_callback\"><code>napi_callback</code></a> provides more details.</li>\n<li><code>[in] data</code>: Optional data to be passed to the constructor callback as\nthe <code>data</code> property of the callback info.</li>\n<li><code>[in] property_count</code>: Number of items in the <code>properties</code> array argument.</li>\n<li><code>[in] properties</code>: Array of property descriptors describing static and\ninstance data properties, accessors, and methods on the class\nSee <code>napi_property_descriptor</code>.</li>\n<li><code>[out] result</code>: A <code>napi_value</code> representing the constructor function for\nthe class.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Defines a JavaScript class, including:</p>\n<ul>\n<li>A JavaScript constructor function that has the class name. When wrapping a\ncorresponding C++ class, the callback passed via <code>constructor</code> can be used to\ninstantiate a new C++ class instance, which can then be placed inside the\nJavaScript object instance being constructed using <a href=\"#napi_wrap\"><code>napi_wrap</code></a>.</li>\n<li>Properties on the constructor function whose implementation can call\ncorresponding <em>static</em> data properties, accessors, and methods of the C++\nclass (defined by property descriptors with the <code>napi_static</code> attribute).</li>\n<li>Properties on the constructor function's <code>prototype</code> object. When wrapping a\nC++ class, <em>non-static</em> data properties, accessors, and methods of the C++\nclass can be called from the static functions given in the property\ndescriptors without the <code>napi_static</code> attribute after retrieving the C++ class\ninstance placed inside the JavaScript object instance by using\n<a href=\"#napi_unwrap\"><code>napi_unwrap</code></a>.</li>\n</ul>\n<p>When wrapping a C++ class, the C++ constructor callback passed via <code>constructor</code>\nshould be a static method on the class that calls the actual class constructor,\nthen wraps the new C++ instance in a JavaScript object, and returns the wrapper\nobject. See <a href=\"#napi_wrap\"><code>napi_wrap</code></a> for details.</p>\n<p>The JavaScript constructor function returned from <a href=\"#napi_define_class\"><code>napi_define_class</code></a> is\noften saved and used later to construct new instances of the class from native\ncode, and/or to check whether provided values are instances of the class. In\nthat case, to prevent the function value from being garbage-collected, a\nstrong persistent reference to it can be created using\n<a href=\"#napi_create_reference\"><code>napi_create_reference</code></a>, ensuring that the reference count is kept >= 1.</p>\n<p>Any non-<code>NULL</code> data which is passed to this API via the <code>data</code> parameter or via\nthe <code>data</code> field of the <code>napi_property_descriptor</code> array items can be associated\nwith the resulting JavaScript constructor (which is returned in the <code>result</code>\nparameter) and freed whenever the class is garbage-collected by passing both\nthe JavaScript function and the data to <a href=\"#napi_add_finalizer\"><code>napi_add_finalizer</code></a>.</p>",
              "displayName": "`napi_define_class`"
            },
            {
              "textRaw": "`napi_wrap`",
              "name": "`napi_wrap`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_wrap(napi_env env,\n                      napi_value js_object,\n                      void* native_object,\n                      napi_finalize finalize_cb,\n                      void* finalize_hint,\n                      napi_ref* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] js_object</code>: The JavaScript object that will be the wrapper for the\nnative object.</li>\n<li><code>[in] native_object</code>: The native instance that will be wrapped in the\nJavaScript object.</li>\n<li><code>[in] finalize_cb</code>: Optional native callback that can be used to free the\nnative instance when the JavaScript object has been garbage-collected.\n<a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.</li>\n<li><code>[in] finalize_hint</code>: Optional contextual hint that is passed to the\nfinalize callback.</li>\n<li><code>[out] result</code>: Optional reference to the wrapped object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Wraps a native instance in a JavaScript object. The native instance can be\nretrieved later using <code>napi_unwrap()</code>.</p>\n<p>When JavaScript code invokes a constructor for a class that was defined using\n<code>napi_define_class()</code>, the <code>napi_callback</code> for the constructor is invoked.\nAfter constructing an instance of the native class, the callback must then call\n<code>napi_wrap()</code> to wrap the newly constructed instance in the already-created\nJavaScript object that is the <code>this</code> argument to the constructor callback.\n(That <code>this</code> object was created from the constructor function's <code>prototype</code>,\nso it already has definitions of all the instance properties and methods.)</p>\n<p>Typically when wrapping a class instance, a finalize callback should be\nprovided that simply deletes the native instance that is received as the <code>data</code>\nargument to the finalize callback.</p>\n<p>The optional returned reference is initially a weak reference, meaning it\nhas a reference count of 0. Typically this reference count would be incremented\ntemporarily during async operations that require the instance to remain valid.</p>\n<p><em>Caution</em>: The optional returned reference (if obtained) should be deleted via\n<a href=\"#napi_delete_reference\"><code>napi_delete_reference</code></a> ONLY in response to the finalize callback\ninvocation. If it is deleted before then, then the finalize callback may never\nbe invoked. Therefore, when obtaining a reference a finalize callback is also\nrequired in order to enable correct disposal of the reference.</p>\n<p>Finalizer callbacks may be deferred, leaving a window where the object has\nbeen garbage collected (and the weak reference is invalid) but the finalizer\nhasn't been called yet. When using <code>napi_get_reference_value()</code> on weak\nreferences returned by <code>napi_wrap()</code>, you should still handle an empty result.</p>\n<p>Calling <code>napi_wrap()</code> a second time on an object will return an error. To\nassociate another native instance with the object, use <code>napi_remove_wrap()</code>\nfirst.</p>",
              "displayName": "`napi_wrap`"
            },
            {
              "textRaw": "`napi_unwrap`",
              "name": "`napi_unwrap`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_unwrap(napi_env env,\n                        napi_value js_object,\n                        void** result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] js_object</code>: The object associated with the native instance.</li>\n<li><code>[out] result</code>: Pointer to the wrapped native instance.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Retrieves a native instance that was previously wrapped in a JavaScript\nobject using <code>napi_wrap()</code>.</p>\n<p>When JavaScript code invokes a method or property accessor on the class, the\ncorresponding <code>napi_callback</code> is invoked. If the callback is for an instance\nmethod or accessor, then the <code>this</code> argument to the callback is the wrapper\nobject; the wrapped C++ instance that is the target of the call can be obtained\nthen by calling <code>napi_unwrap()</code> on the wrapper object.</p>",
              "displayName": "`napi_unwrap`"
            },
            {
              "textRaw": "`napi_remove_wrap`",
              "name": "`napi_remove_wrap`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_remove_wrap(napi_env env,\n                             napi_value js_object,\n                             void** result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] js_object</code>: The object associated with the native instance.</li>\n<li><code>[out] result</code>: Pointer to the wrapped native instance.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Retrieves a native instance that was previously wrapped in the JavaScript\nobject <code>js_object</code> using <code>napi_wrap()</code> and removes the wrapping. If a finalize\ncallback was associated with the wrapping, it will no longer be called when the\nJavaScript object becomes garbage-collected.</p>",
              "displayName": "`napi_remove_wrap`"
            },
            {
              "textRaw": "`napi_type_tag_object`",
              "name": "`napi_type_tag_object`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.8.0",
                  "v12.19.0"
                ],
                "changes": [],
                "napiVersion": [
                  8
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_type_tag_object(napi_env env,\n                                 napi_value js_object,\n                                 const napi_type_tag* type_tag);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] js_object</code>: The JavaScript object or <a href=\"#napi_create_external\">external</a> to be marked.</li>\n<li><code>[in] type_tag</code>: The tag with which the object is to be marked.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Associates the value of the <code>type_tag</code> pointer with the JavaScript object or\n<a href=\"#napi_create_external\">external</a>. <code>napi_check_object_type_tag()</code> can then be used to compare the tag\nthat was attached to the object with one owned by the addon to ensure that the\nobject has the right type.</p>\n<p>If the object already has an associated type tag, this API will return\n<code>napi_invalid_arg</code>.</p>",
              "displayName": "`napi_type_tag_object`"
            },
            {
              "textRaw": "`napi_check_object_type_tag`",
              "name": "`napi_check_object_type_tag`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.8.0",
                  "v12.19.0"
                ],
                "changes": [],
                "napiVersion": [
                  8
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_check_object_type_tag(napi_env env,\n                                       napi_value js_object,\n                                       const napi_type_tag* type_tag,\n                                       bool* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] js_object</code>: The JavaScript object or <a href=\"#napi_create_external\">external</a> whose type tag to\nexamine.</li>\n<li><code>[in] type_tag</code>: The tag with which to compare any tag found on the object.</li>\n<li><code>[out] result</code>: Whether the type tag given matched the type tag on the\nobject. <code>false</code> is also returned if no type tag was found on the object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Compares the pointer given as <code>type_tag</code> with any that can be found on\n<code>js_object</code>. If no tag is found on <code>js_object</code> or, if a tag is found but it does\nnot match <code>type_tag</code>, then <code>result</code> is set to <code>false</code>. If a tag is found and it\nmatches <code>type_tag</code>, then <code>result</code> is set to <code>true</code>.</p>",
              "displayName": "`napi_check_object_type_tag`"
            },
            {
              "textRaw": "`napi_add_finalizer`",
              "name": "`napi_add_finalizer`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  5
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_add_finalizer(napi_env env,\n                               napi_value js_object,\n                               void* finalize_data,\n                               node_api_basic_finalize finalize_cb,\n                               void* finalize_hint,\n                               napi_ref* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] js_object</code>: The JavaScript object to which the native data will be\nattached.</li>\n<li><code>[in] finalize_data</code>: Optional data to be passed to <code>finalize_cb</code>.</li>\n<li><code>[in] finalize_cb</code>: Native callback that will be used to free the\nnative data when the JavaScript object has been garbage-collected.\n<a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.</li>\n<li><code>[in] finalize_hint</code>: Optional contextual hint that is passed to the\nfinalize callback.</li>\n<li><code>[out] result</code>: Optional reference to the JavaScript object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Adds a <code>napi_finalize</code> callback which will be called when the JavaScript object\nin <code>js_object</code> has been garbage-collected.</p>\n<p>This API can be called multiple times on a single JavaScript object.</p>\n<p><em>Caution</em>: The optional returned reference (if obtained) should be deleted via\n<a href=\"#napi_delete_reference\"><code>napi_delete_reference</code></a> ONLY in response to the finalize callback\ninvocation. If it is deleted before then, then the finalize callback may never\nbe invoked. Therefore, when obtaining a reference a finalize callback is also\nrequired in order to enable correct disposal of the reference.</p>",
              "modules": [
                {
                  "textRaw": "`node_api_post_finalizer`",
                  "name": "`node_api_post_finalizer`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v21.0.0",
                      "v20.10.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "desc": "<pre><code class=\"language-c\">napi_status node_api_post_finalizer(node_api_basic_env env,\n                                    napi_finalize finalize_cb,\n                                    void* finalize_data,\n                                    void* finalize_hint);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] finalize_cb</code>: Native callback that will be used to free the\nnative data when the JavaScript object has been garbage-collected.\n<a href=\"#napi_finalize\"><code>napi_finalize</code></a> provides more details.</li>\n<li><code>[in] finalize_data</code>: Optional data to be passed to <code>finalize_cb</code>.</li>\n<li><code>[in] finalize_hint</code>: Optional contextual hint that is passed to the\nfinalize callback.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>Schedules a <code>napi_finalize</code> callback to be called asynchronously in the\nevent loop.</p>\n<p>Normally, finalizers are called while the GC (garbage collector) collects\nobjects. At that point calling any Node-API that may cause changes in the GC\nstate will be disabled and will crash Node.js.</p>\n<p><code>node_api_post_finalizer</code> helps to work around this limitation by allowing the\nadd-on to defer calls to such Node-APIs to a point in time outside of the GC\nfinalization.</p>",
                  "displayName": "`node_api_post_finalizer`"
                }
              ],
              "displayName": "`napi_add_finalizer`"
            }
          ],
          "displayName": "Object wrap"
        },
        {
          "textRaw": "Simple asynchronous operations",
          "name": "simple_asynchronous_operations",
          "type": "misc",
          "desc": "<p>Addon modules often need to leverage async helpers from libuv as part of their\nimplementation. This allows them to schedule work to be executed asynchronously\nso that their methods can return in advance of the work being completed. This\nallows them to avoid blocking overall execution of the Node.js application.</p>\n<p>Node-API provides an ABI-stable interface for these\nsupporting functions which covers the most common asynchronous use cases.</p>\n<p>Node-API defines the <code>napi_async_work</code> structure which is used to manage\nasynchronous workers. Instances are created/deleted with\n<a href=\"#napi_create_async_work\"><code>napi_create_async_work</code></a> and <a href=\"#napi_delete_async_work\"><code>napi_delete_async_work</code></a>.</p>\n<p>The <code>execute</code> and <code>complete</code> callbacks are functions that will be\ninvoked when the executor is ready to execute and when it completes its\ntask respectively.</p>\n<p>The <code>execute</code> function should avoid making any Node-API calls\nthat could result in the execution of JavaScript or interaction with\nJavaScript objects. Most often, any code that needs to make Node-API\ncalls should be made in <code>complete</code> callback instead.\nAvoid using the <code>napi_env</code> parameter in the execute callback as\nit will likely execute JavaScript.</p>\n<p>These functions implement the following interfaces:</p>\n<pre><code class=\"language-c\">typedef void (*napi_async_execute_callback)(napi_env env,\n                                            void* data);\ntypedef void (*napi_async_complete_callback)(napi_env env,\n                                             napi_status status,\n                                             void* data);\n</code></pre>\n<p>When these methods are invoked, the <code>data</code> parameter passed will be the\naddon-provided <code>void*</code> data that was passed into the\n<code>napi_create_async_work</code> call.</p>\n<p>Once created the async worker can be queued\nfor execution using the <a href=\"#napi_queue_async_work\"><code>napi_queue_async_work</code></a> function:</p>\n<pre><code class=\"language-c\">napi_status napi_queue_async_work(node_api_basic_env env,\n                                  napi_async_work work);\n</code></pre>\n<p><a href=\"#napi_cancel_async_work\"><code>napi_cancel_async_work</code></a> can be used if the work needs\nto be cancelled before the work has started execution.</p>\n<p>After calling <a href=\"#napi_cancel_async_work\"><code>napi_cancel_async_work</code></a>, the <code>complete</code> callback\nwill be invoked with a status value of <code>napi_cancelled</code>.\nThe work should not be deleted before the <code>complete</code>\ncallback invocation, even when it was cancelled.</p>",
          "modules": [
            {
              "textRaw": "`napi_create_async_work`",
              "name": "`napi_create_async_work`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [
                  {
                    "version": "v8.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14697",
                    "description": "Added `async_resource` and `async_resource_name` parameters."
                  }
                ],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_create_async_work(napi_env env,\n                                   napi_value async_resource,\n                                   napi_value async_resource_name,\n                                   napi_async_execute_callback execute,\n                                   napi_async_complete_callback complete,\n                                   void* data,\n                                   napi_async_work* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] async_resource</code>: An optional object associated with the async work\nthat will be passed to possible <code>async_hooks</code> <a href=\"async_hooks.html#initasyncid-type-triggerasyncid-resource\"><code>init</code> hooks</a>.</li>\n<li><code>[in] async_resource_name</code>: Identifier for the kind of resource that is being\nprovided for diagnostic information exposed by the <code>async_hooks</code> API.</li>\n<li><code>[in] execute</code>: The native function which should be called to execute the\nlogic asynchronously. The given function is called from a worker pool thread\nand can execute in parallel with the main event loop thread.</li>\n<li><code>[in] complete</code>: The native function which will be called when the\nasynchronous logic is completed or is cancelled. The given function is called\nfrom the main event loop thread. <a href=\"#napi_async_complete_callback\"><code>napi_async_complete_callback</code></a> provides\nmore details.</li>\n<li><code>[in] data</code>: User-provided data context. This will be passed back into the\nexecute and complete functions.</li>\n<li><code>[out] result</code>: <code>napi_async_work*</code> which is the handle to the newly created\nasync work.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API allocates a work object that is used to execute logic asynchronously.\nIt should be freed using <a href=\"#napi_delete_async_work\"><code>napi_delete_async_work</code></a> once the work is no longer\nrequired.</p>\n<p><code>async_resource_name</code> should be a null-terminated, UTF-8-encoded string.</p>\n<p>The <code>async_resource_name</code> identifier is provided by the user and should be\nrepresentative of the type of async work being performed. It is also recommended\nto apply namespacing to the identifier, e.g. by including the module name. See\nthe <a href=\"async_hooks.html#type\"><code>async_hooks</code> documentation</a> for more information.</p>",
              "displayName": "`napi_create_async_work`"
            },
            {
              "textRaw": "`napi_delete_async_work`",
              "name": "`napi_delete_async_work`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_delete_async_work(napi_env env,\n                                   napi_async_work work);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] work</code>: The handle returned by the call to <code>napi_create_async_work</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API frees a previously allocated work object.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
              "displayName": "`napi_delete_async_work`"
            },
            {
              "textRaw": "`napi_queue_async_work`",
              "name": "`napi_queue_async_work`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_queue_async_work(node_api_basic_env env,\n                                  napi_async_work work);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] work</code>: The handle returned by the call to <code>napi_create_async_work</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API requests that the previously allocated work be scheduled\nfor execution. Once it returns successfully, this API must not be called again\nwith the same <code>napi_async_work</code> item or the result will be undefined.</p>",
              "displayName": "`napi_queue_async_work`"
            },
            {
              "textRaw": "`napi_cancel_async_work`",
              "name": "`napi_cancel_async_work`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_cancel_async_work(node_api_basic_env env,\n                                   napi_async_work work);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] work</code>: The handle returned by the call to <code>napi_create_async_work</code>.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API cancels queued work if it has not yet\nbeen started. If it has already started executing, it cannot be\ncancelled and <code>napi_generic_failure</code> will be returned. If successful,\nthe <code>complete</code> callback will be invoked with a status value of\n<code>napi_cancelled</code>. The work should not be deleted before the <code>complete</code>\ncallback invocation, even if it has been successfully cancelled.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
              "displayName": "`napi_cancel_async_work`"
            }
          ],
          "displayName": "Simple asynchronous operations"
        },
        {
          "textRaw": "Custom asynchronous operations",
          "name": "custom_asynchronous_operations",
          "type": "misc",
          "desc": "<p>The simple asynchronous work APIs above may not be appropriate for every\nscenario. When using any other asynchronous mechanism, the following APIs\nare necessary to ensure an asynchronous operation is properly tracked by\nthe runtime.</p>",
          "modules": [
            {
              "textRaw": "`napi_async_init`",
              "name": "`napi_async_init`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.6.0"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59828",
                    "description": "The `async_resource` object will now be held as a strong reference."
                  }
                ],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_async_init(napi_env env,\n                            napi_value async_resource,\n                            napi_value async_resource_name,\n                            napi_async_context* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] async_resource</code>: Object associated with the async work\nthat will be passed to possible <code>async_hooks</code> <a href=\"async_hooks.html#initasyncid-type-triggerasyncid-resource\"><code>init</code> hooks</a> and can be\naccessed by <a href=\"async_hooks.html#async_hooksexecutionasyncresource\"><code>async_hooks.executionAsyncResource()</code></a>.</li>\n<li><code>[in] async_resource_name</code>: Identifier for the kind of resource that is being\nprovided for diagnostic information exposed by the <code>async_hooks</code> API.</li>\n<li><code>[out] result</code>: The initialized async context.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>In order to retain ABI compatibility with previous versions, passing <code>NULL</code>\nfor <code>async_resource</code> does not result in an error. However, this is not\nrecommended as this will result in undesirable behavior with  <code>async_hooks</code>\n<a href=\"async_hooks.html#initasyncid-type-triggerasyncid-resource\"><code>init</code> hooks</a> and <code>async_hooks.executionAsyncResource()</code> as the resource is\nnow required by the underlying <code>async_hooks</code> implementation in order to provide\nthe linkage between async callbacks.</p>\n<p>Previous versions of this API were not maintaining a strong reference to\n<code>async_resource</code> while the <code>napi_async_context</code> object existed and instead\nexpected the caller to hold a strong reference. This has been changed, as a\ncorresponding call to <a href=\"#napi_async_destroy\"><code>napi_async_destroy</code></a> for every call to\n<code>napi_async_init()</code> is a requirement in any case to avoid memory leaks.</p>",
              "displayName": "`napi_async_init`"
            },
            {
              "textRaw": "`napi_async_destroy`",
              "name": "`napi_async_destroy`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_async_destroy(napi_env env,\n                               napi_async_context async_context);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] async_context</code>: The async context to be destroyed.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
              "displayName": "`napi_async_destroy`"
            },
            {
              "textRaw": "`napi_make_callback`",
              "name": "`napi_make_callback`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [
                  {
                    "version": "v8.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15189",
                    "description": "Added `async_context` parameter."
                  }
                ],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_make_callback(napi_env env,\n                                           napi_async_context async_context,\n                                           napi_value recv,\n                                           napi_value func,\n                                           size_t argc,\n                                           const napi_value* argv,\n                                           napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] async_context</code>: Context for the async operation that is\ninvoking the callback. This should normally be a value previously\nobtained from <a href=\"#napi_async_init\"><code>napi_async_init</code></a>.\nIn order to retain ABI compatibility with previous versions, passing <code>NULL</code>\nfor <code>async_context</code> does not result in an error. However, this results\nin incorrect operation of async hooks. Potential issues include loss of\nasync context when using the <code>AsyncLocalStorage</code> API.</li>\n<li><code>[in] recv</code>: The <code>this</code> value passed to the called function.</li>\n<li><code>[in] func</code>: <code>napi_value</code> representing the JavaScript function to be invoked.</li>\n<li><code>[in] argc</code>: The count of elements in the <code>argv</code> array.</li>\n<li><code>[in] argv</code>: Array of JavaScript values as <code>napi_value</code> representing the\narguments to the function. If <code>argc</code> is zero this parameter may be\nomitted by passing in <code>NULL</code>.</li>\n<li><code>[out] result</code>: <code>napi_value</code> representing the JavaScript object returned.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This method allows a JavaScript function object to be called from a native\nadd-on. This API is similar to <code>napi_call_function</code>. However, it is used to call\n<em>from</em> native code back <em>into</em> JavaScript <em>after</em> returning from an async\noperation (when there is no other script on the stack). It is a fairly simple\nwrapper around <code>node::MakeCallback</code>.</p>\n<p>Note it is <em>not</em> necessary to use <code>napi_make_callback</code> from within a\n<code>napi_async_complete_callback</code>; in that situation the callback's async\ncontext has already been set up, so a direct call to <code>napi_call_function</code>\nis sufficient and appropriate. Use of the <code>napi_make_callback</code> function\nmay be required when implementing custom async behavior that does not use\n<code>napi_create_async_work</code>.</p>\n<p>Any <code>process.nextTick</code>s or Promises scheduled on the microtask queue by\nJavaScript during the callback are ran before returning back to C/C++.</p>",
              "displayName": "`napi_make_callback`"
            },
            {
              "textRaw": "`napi_open_callback_scope`",
              "name": "`napi_open_callback_scope`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  3
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_open_callback_scope(napi_env env,\n                                                 napi_value resource_object,\n                                                 napi_async_context context,\n                                                 napi_callback_scope* result)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] resource_object</code>: An object associated with the async work\nthat will be passed to possible <code>async_hooks</code> <a href=\"async_hooks.html#initasyncid-type-triggerasyncid-resource\"><code>init</code> hooks</a>. This\nparameter has been deprecated and is ignored at runtime. Use the\n<code>async_resource</code> parameter in <a href=\"#napi_async_init\"><code>napi_async_init</code></a> instead.</li>\n<li><code>[in] context</code>: Context for the async operation that is invoking the callback.\nThis should be a value previously obtained from <a href=\"#napi_async_init\"><code>napi_async_init</code></a>.</li>\n<li><code>[out] result</code>: The newly created scope.</li>\n</ul>\n<p>There are cases (for example, resolving promises) where it is\nnecessary to have the equivalent of the scope associated with a callback\nin place when making certain Node-API calls. If there is no other script on\nthe stack the <a href=\"#napi_open_callback_scope\"><code>napi_open_callback_scope</code></a> and\n<a href=\"#napi_close_callback_scope\"><code>napi_close_callback_scope</code></a> functions can be used to open/close\nthe required scope.</p>",
              "displayName": "`napi_open_callback_scope`"
            },
            {
              "textRaw": "`napi_close_callback_scope`",
              "name": "`napi_close_callback_scope`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  3
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_close_callback_scope(napi_env env,\n                                                  napi_callback_scope scope)\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] scope</code>: The scope to be closed.</li>\n</ul>\n<p>This API can be called even if there is a pending JavaScript exception.</p>",
              "displayName": "`napi_close_callback_scope`"
            }
          ],
          "displayName": "Custom asynchronous operations"
        },
        {
          "textRaw": "Version management",
          "name": "version_management",
          "type": "misc",
          "modules": [
            {
              "textRaw": "`napi_get_node_version`",
              "name": "`napi_get_node_version`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">typedef struct {\n  uint32_t major;\n  uint32_t minor;\n  uint32_t patch;\n  const char* release;\n} napi_node_version;\n\nnapi_status napi_get_node_version(node_api_basic_env env,\n                                  const napi_node_version** version);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] version</code>: A pointer to version information for Node.js itself.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This function fills the <code>version</code> struct with the major, minor, and patch\nversion of Node.js that is currently running, and the <code>release</code> field with the\nvalue of <a href=\"process.html#processrelease\"><code>process.release.name</code></a>.</p>\n<p>The returned buffer is statically allocated and does not need to be freed.</p>",
              "displayName": "`napi_get_node_version`"
            },
            {
              "textRaw": "`napi_get_version`",
              "name": "`napi_get_version`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_get_version(node_api_basic_env env,\n                             uint32_t* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: The highest version of Node-API supported.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API returns the highest Node-API version supported by the\nNode.js runtime. Node-API is planned to be additive such that\nnewer releases of Node.js may support additional API functions.\nIn order to allow an addon to use a newer function when running with\nversions of Node.js that support it, while providing\nfallback behavior when running with Node.js versions that don't\nsupport it:</p>\n<ul>\n<li>Call <code>napi_get_version()</code> to determine if the API is available.</li>\n<li>If available, dynamically load a pointer to the function using <code>uv_dlsym()</code>.</li>\n<li>Use the dynamically loaded pointer to invoke the function.</li>\n<li>If the function is not available, provide an alternate implementation\nthat does not use the function.</li>\n</ul>",
              "displayName": "`napi_get_version`"
            }
          ],
          "displayName": "Version management"
        },
        {
          "textRaw": "Memory management",
          "name": "memory_management",
          "type": "misc",
          "modules": [
            {
              "textRaw": "`napi_adjust_external_memory`",
              "name": "`napi_adjust_external_memory`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_adjust_external_memory(node_api_basic_env env,\n                                                    int64_t change_in_bytes,\n                                                    int64_t* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] change_in_bytes</code>: The change in externally allocated memory that is kept\nalive by JavaScript objects.</li>\n<li><code>[out] result</code>: The adjusted value. This value should reflect the\ntotal amount of external memory with the given <code>change_in_bytes</code> included.\nThe absolute value of the returned value should not  be depended on.\nFor example, implementations may use a single counter for all addons, or a\ncounter for each addon.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This function gives the runtime an indication of the amount of externally\nallocated memory that is kept alive by JavaScript objects\n(i.e. a JavaScript object that points to its own memory allocated by a\nnative addon). Registering externally allocated memory may, but is not\nguaranteed to, trigger global garbage collections more\noften than it would otherwise.</p>\n<p>This function is expected to be called in a manner such that an\naddon does not decrease the external memory more than it has\nincreased the external memory.</p>",
              "displayName": "`napi_adjust_external_memory`"
            }
          ],
          "displayName": "Memory management"
        },
        {
          "textRaw": "Promises",
          "name": "promises",
          "type": "misc",
          "desc": "<p>Node-API provides facilities for creating <code>Promise</code> objects as described in\n<a href=\"https://tc39.es/ecma262/#sec-promise-objects\">Section Promise objects</a> of the ECMA specification. It implements promises as a pair of\nobjects. When a promise is created by <code>napi_create_promise()</code>, a \"deferred\"\nobject is created and returned alongside the <code>Promise</code>. The deferred object is\nbound to the created <code>Promise</code> and is the only means to resolve or reject the\n<code>Promise</code> using <code>napi_resolve_deferred()</code> or <code>napi_reject_deferred()</code>. The\ndeferred object that is created by <code>napi_create_promise()</code> is freed by\n<code>napi_resolve_deferred()</code> or <code>napi_reject_deferred()</code>. The <code>Promise</code> object may\nbe returned to JavaScript where it can be used in the usual fashion.</p>\n<p>For example, to create a promise and pass it to an asynchronous worker:</p>\n<pre><code class=\"language-c\">napi_deferred deferred;\nnapi_value promise;\nnapi_status status;\n\n// Create the promise.\nstatus = napi_create_promise(env, &#x26;deferred, &#x26;promise);\nif (status != napi_ok) return NULL;\n\n// Pass the deferred to a function that performs an asynchronous action.\ndo_something_asynchronous(deferred);\n\n// Return the promise to JS\nreturn promise;\n</code></pre>\n<p>The above function <code>do_something_asynchronous()</code> would perform its asynchronous\naction and then it would resolve or reject the deferred, thereby concluding the\npromise and freeing the deferred:</p>\n<pre><code class=\"language-c\">napi_deferred deferred;\nnapi_value undefined;\nnapi_status status;\n\n// Create a value with which to conclude the deferred.\nstatus = napi_get_undefined(env, &#x26;undefined);\nif (status != napi_ok) return NULL;\n\n// Resolve or reject the promise associated with the deferred depending on\n// whether the asynchronous action succeeded.\nif (asynchronous_action_succeeded) {\n  status = napi_resolve_deferred(env, deferred, undefined);\n} else {\n  status = napi_reject_deferred(env, deferred, undefined);\n}\nif (status != napi_ok) return NULL;\n\n// At this point the deferred has been freed, so we should assign NULL to it.\ndeferred = NULL;\n</code></pre>",
          "modules": [
            {
              "textRaw": "`napi_create_promise`",
              "name": "`napi_create_promise`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_create_promise(napi_env env,\n                                napi_deferred* deferred,\n                                napi_value* promise);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] deferred</code>: A newly created deferred object which can later be passed to\n<code>napi_resolve_deferred()</code> or <code>napi_reject_deferred()</code> to resolve resp. reject\nthe associated promise.</li>\n<li><code>[out] promise</code>: The JavaScript promise associated with the deferred object.</li>\n</ul>\n<p>Returns <code>napi_ok</code> if the API succeeded.</p>\n<p>This API creates a deferred object and a JavaScript promise.</p>",
              "displayName": "`napi_create_promise`"
            },
            {
              "textRaw": "`napi_resolve_deferred`",
              "name": "`napi_resolve_deferred`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_resolve_deferred(napi_env env,\n                                  napi_deferred deferred,\n                                  napi_value resolution);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] deferred</code>: The deferred object whose associated promise to resolve.</li>\n<li><code>[in] resolution</code>: The value with which to resolve the promise.</li>\n</ul>\n<p>This API resolves a JavaScript promise by way of the deferred object\nwith which it is associated. Thus, it can only be used to resolve JavaScript\npromises for which the corresponding deferred object is available. This\neffectively means that the promise must have been created using\n<code>napi_create_promise()</code> and the deferred object returned from that call must\nhave been retained in order to be passed to this API.</p>\n<p>The deferred object is freed upon successful completion.</p>",
              "displayName": "`napi_resolve_deferred`"
            },
            {
              "textRaw": "`napi_reject_deferred`",
              "name": "`napi_reject_deferred`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_reject_deferred(napi_env env,\n                                 napi_deferred deferred,\n                                 napi_value rejection);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] deferred</code>: The deferred object whose associated promise to resolve.</li>\n<li><code>[in] rejection</code>: The value with which to reject the promise.</li>\n</ul>\n<p>This API rejects a JavaScript promise by way of the deferred object\nwith which it is associated. Thus, it can only be used to reject JavaScript\npromises for which the corresponding deferred object is available. This\neffectively means that the promise must have been created using\n<code>napi_create_promise()</code> and the deferred object returned from that call must\nhave been retained in order to be passed to this API.</p>\n<p>The deferred object is freed upon successful completion.</p>",
              "displayName": "`napi_reject_deferred`"
            },
            {
              "textRaw": "`napi_is_promise`",
              "name": "`napi_is_promise`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">napi_status napi_is_promise(napi_env env,\n                            napi_value value,\n                            bool* is_promise);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] value</code>: The value to examine</li>\n<li><code>[out] is_promise</code>: Flag indicating whether <code>promise</code> is a native promise\nobject (that is, a promise object created by the underlying engine).</li>\n</ul>",
              "displayName": "`napi_is_promise`"
            }
          ],
          "displayName": "Promises"
        },
        {
          "textRaw": "Script execution",
          "name": "script_execution",
          "type": "misc",
          "desc": "<p>Node-API provides an API for executing a string containing JavaScript using the\nunderlying JavaScript engine.</p>",
          "modules": [
            {
              "textRaw": "`napi_run_script`",
              "name": "`napi_run_script`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [],
                "napiVersion": [
                  1
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_run_script(napi_env env,\n                                        napi_value script,\n                                        napi_value* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] script</code>: A JavaScript string containing the script to execute.</li>\n<li><code>[out] result</code>: The value resulting from having executed the script.</li>\n</ul>\n<p>This function executes a string of JavaScript code and returns its result with\nthe following caveats:</p>\n<ul>\n<li>Unlike <code>eval</code>, this function does not allow the script to access the current\nlexical scope, and therefore also does not allow to access the\n<a href=\"modules.html#the-module-scope\">module scope</a>, meaning that pseudo-globals such as <code>require</code> will not be\navailable.</li>\n<li>The script can access the <a href=\"globals.html\">global scope</a>. Function and <code>var</code> declarations\nin the script will be added to the <a href=\"globals.html#global\"><code>global</code></a> object. Variable declarations\nmade using <code>let</code> and <code>const</code> will be visible globally, but will not be added\nto the <a href=\"globals.html#global\"><code>global</code></a> object.</li>\n<li>The value of <code>this</code> is <a href=\"globals.html#global\"><code>global</code></a> within the script.</li>\n</ul>",
              "displayName": "`napi_run_script`"
            }
          ],
          "displayName": "Script execution"
        },
        {
          "textRaw": "libuv event loop",
          "name": "libuv_event_loop",
          "type": "misc",
          "desc": "<p>Node-API provides a function for getting the current event loop associated with\na specific <code>napi_env</code>.</p>",
          "modules": [
            {
              "textRaw": "`napi_get_uv_event_loop`",
              "name": "`napi_get_uv_event_loop`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.3.0",
                  "v8.10.0"
                ],
                "changes": [],
                "napiVersion": [
                  2
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status napi_get_uv_event_loop(node_api_basic_env env,\n                                               struct uv_loop_s** loop);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] loop</code>: The current libuv loop instance.</li>\n</ul>\n<p>Note: While libuv only <a href=\"https://github.com/libuv/libuv?tab=readme-ov-file#versioning\">guarantees ABI stability</a>\nin a major version, its use may result in an addon that does not work across\nNode.js major versions.</p>\n<p><a href=\"#asynchronous-thread-safe-function-calls\">ThreadSafeFunction</a>\nis an ABI-stable alternative for many use cases to calling into the\nJavaScript thread from another thread.</p>",
              "displayName": "`napi_get_uv_event_loop`"
            }
          ],
          "displayName": "libuv event loop"
        },
        {
          "textRaw": "Asynchronous thread-safe function calls",
          "name": "asynchronous_thread-safe_function_calls",
          "type": "misc",
          "desc": "<p>JavaScript functions can normally only be called from a native addon's main\nthread. If an addon creates additional threads, then Node-API functions that\nrequire a <code>napi_env</code>, <code>napi_value</code>, or <code>napi_ref</code> must not be called from those\nthreads.</p>\n<p>When an addon has additional threads and JavaScript functions need to be invoked\nbased on the processing completed by those threads, those threads must\ncommunicate with the addon's main thread so that the main thread can invoke the\nJavaScript function on their behalf. The thread-safe function APIs provide an\neasy way to do this.</p>\n<p>These APIs provide the type <code>napi_threadsafe_function</code> as well as APIs to\ncreate, destroy, and call objects of this type.\n<code>napi_create_threadsafe_function()</code> creates a persistent reference to a\n<code>napi_value</code> that holds a JavaScript function which can be called from multiple\nthreads. The calls happen asynchronously. This means that values with which the\nJavaScript callback is to be called will be placed in a queue, and, for each\nvalue in the queue, a call will eventually be made to the JavaScript function.</p>\n<p>Upon creation of a <code>napi_threadsafe_function</code> a <code>napi_finalize</code> callback can be\nprovided. This callback will be invoked on the main thread when the thread-safe\nfunction is about to be destroyed. It receives the context and the finalize data\ngiven during construction, and provides an opportunity for cleaning up after the\nthreads e.g. by calling <code>uv_thread_join()</code>. <strong>Aside from the main loop thread,\nno threads should be using the thread-safe function after the finalize callback\ncompletes.</strong></p>\n<p>The <code>context</code> given during the call to <code>napi_create_threadsafe_function()</code> can\nbe retrieved from any thread with a call to\n<code>napi_get_threadsafe_function_context()</code>.</p>",
          "modules": [
            {
              "textRaw": "Calling a thread-safe function",
              "name": "calling_a_thread-safe_function",
              "type": "module",
              "desc": "<p><code>napi_call_threadsafe_function()</code> can be used for initiating a call into\nJavaScript. <code>napi_call_threadsafe_function()</code> accepts a parameter which controls\nwhether the API behaves blockingly. If set to <code>napi_tsfn_nonblocking</code>, the API\nbehaves non-blockingly, returning <code>napi_queue_full</code> if the queue was full,\npreventing data from being successfully added to the queue. If set to\n<code>napi_tsfn_blocking</code>, the API blocks until space becomes available in the queue.\n<code>napi_call_threadsafe_function()</code> never blocks if the thread-safe function was\ncreated with a maximum queue size of 0.</p>\n<p><code>napi_call_threadsafe_function()</code> should not be called with <code>napi_tsfn_blocking</code>\nfrom a JavaScript thread, because, if the queue is full, it may cause the\nJavaScript thread to deadlock.</p>\n<p>The actual call into JavaScript is controlled by the callback given via the\n<code>call_js_cb</code> parameter. <code>call_js_cb</code> is invoked on the main thread once for each\nvalue that was placed into the queue by a successful call to\n<code>napi_call_threadsafe_function()</code>. If such a callback is not given, a default\ncallback will be used, and the resulting JavaScript call will have no arguments.\nThe <code>call_js_cb</code> callback receives the JavaScript function to call as a\n<code>napi_value</code> in its parameters, as well as the <code>void*</code> context pointer used when\ncreating the <code>napi_threadsafe_function</code>, and the next data pointer that was\ncreated by one of the secondary threads. The callback can then use an API such\nas <code>napi_call_function()</code> to call into JavaScript.</p>\n<p>The callback may also be invoked with <code>env</code> and <code>call_js_cb</code> both set to <code>NULL</code>\nto indicate that calls into JavaScript are no longer possible, while items\nremain in the queue that may need to be freed. This normally occurs when the\nNode.js process exits while there is a thread-safe function still active.</p>\n<p>It is not necessary to call into JavaScript via <code>napi_make_callback()</code> because\nNode-API runs <code>call_js_cb</code> in a context appropriate for callbacks.</p>\n<p>Zero or more queued items may be invoked in each tick of the event loop.\nApplications should not depend on a specific behavior other than progress in\ninvoking callbacks will be made and events will be invoked\nas time moves forward.</p>",
              "displayName": "Calling a thread-safe function"
            },
            {
              "textRaw": "Reference counting of thread-safe functions",
              "name": "reference_counting_of_thread-safe_functions",
              "type": "module",
              "desc": "<p>Threads can be added to and removed from a <code>napi_threadsafe_function</code> object\nduring its existence. Thus, in addition to specifying an initial number of\nthreads upon creation, <code>napi_acquire_threadsafe_function</code> can be called to\nindicate that a new thread will start making use of the thread-safe function.\nSimilarly, <code>napi_release_threadsafe_function</code> can be called to indicate that an\nexisting thread will stop making use of the thread-safe function.</p>\n<p><code>napi_threadsafe_function</code> objects are destroyed when every thread which uses\nthe object has called <code>napi_release_threadsafe_function()</code> or has received a\nreturn status of <code>napi_closing</code> in response to a call to\n<code>napi_call_threadsafe_function</code>. The queue is emptied before the\n<code>napi_threadsafe_function</code> is destroyed. <code>napi_release_threadsafe_function()</code>\nshould be the last API call made in conjunction with a given\n<code>napi_threadsafe_function</code>, because after the call completes, there is no\nguarantee that the <code>napi_threadsafe_function</code> is still allocated. For the same\nreason, do not use a thread-safe function\nafter receiving a return value of <code>napi_closing</code> in response to a call to\n<code>napi_call_threadsafe_function</code>. Data associated with the\n<code>napi_threadsafe_function</code> can be freed in its <code>napi_finalize</code> callback which\nwas passed to <code>napi_create_threadsafe_function()</code>. The parameter\n<code>initial_thread_count</code> of <code>napi_create_threadsafe_function</code> marks the initial\nnumber of acquisitions of the thread-safe functions, instead of calling\n<code>napi_acquire_threadsafe_function</code> multiple times at creation.</p>\n<p>Once the number of threads making use of a <code>napi_threadsafe_function</code> reaches\nzero, no further threads can start making use of it by calling\n<code>napi_acquire_threadsafe_function()</code>. In fact, all subsequent API calls\nassociated with it, except <code>napi_release_threadsafe_function()</code>, will return an\nerror value of <code>napi_closing</code>.</p>\n<p>The thread-safe function can be \"aborted\" by giving a value of <code>napi_tsfn_abort</code>\nto <code>napi_release_threadsafe_function()</code>. This will cause all subsequent APIs\nassociated with the thread-safe function except\n<code>napi_release_threadsafe_function()</code> to return <code>napi_closing</code> even before its\nreference count reaches zero. In particular, <code>napi_call_threadsafe_function()</code>\nwill return <code>napi_closing</code>, thus informing the threads that it is no longer\npossible to make asynchronous calls to the thread-safe function. This can be\nused as a criterion for terminating the thread. <strong>Upon receiving a return value\nof <code>napi_closing</code> from <code>napi_call_threadsafe_function()</code> a thread must not use\nthe thread-safe function anymore because it is no longer guaranteed to\nbe allocated.</strong></p>",
              "displayName": "Reference counting of thread-safe functions"
            },
            {
              "textRaw": "Deciding whether to keep the process running",
              "name": "deciding_whether_to_keep_the_process_running",
              "type": "module",
              "desc": "<p>Similarly to libuv handles, thread-safe functions can be \"referenced\" and\n\"unreferenced\". A \"referenced\" thread-safe function will cause the event loop on\nthe thread on which it is created to remain alive until the thread-safe function\nis destroyed. In contrast, an \"unreferenced\" thread-safe function will not\nprevent the event loop from exiting. The APIs <code>napi_ref_threadsafe_function</code> and\n<code>napi_unref_threadsafe_function</code> exist for this purpose.</p>\n<p>Neither does <code>napi_unref_threadsafe_function</code> mark the thread-safe functions as\nable to be destroyed nor does <code>napi_ref_threadsafe_function</code> prevent it from\nbeing destroyed.</p>",
              "displayName": "Deciding whether to keep the process running"
            },
            {
              "textRaw": "`napi_create_threadsafe_function`",
              "name": "`napi_create_threadsafe_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v12.6.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/27791",
                    "description": "Made `func` parameter optional with custom `call_js_cb`."
                  }
                ],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_create_threadsafe_function(napi_env env,\n                                napi_value func,\n                                napi_value async_resource,\n                                napi_value async_resource_name,\n                                size_t max_queue_size,\n                                size_t initial_thread_count,\n                                void* thread_finalize_data,\n                                napi_finalize thread_finalize_cb,\n                                void* context,\n                                napi_threadsafe_function_call_js call_js_cb,\n                                napi_threadsafe_function* result);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] func</code>: An optional JavaScript function to call from another thread. It\nmust be provided if <code>NULL</code> is passed to <code>call_js_cb</code>.</li>\n<li><code>[in] async_resource</code>: An optional object associated with the async work that\nwill be passed to possible <code>async_hooks</code> <a href=\"async_hooks.html#initasyncid-type-triggerasyncid-resource\"><code>init</code> hooks</a>.</li>\n<li><code>[in] async_resource_name</code>: A JavaScript string to provide an identifier for\nthe kind of resource that is being provided for diagnostic information exposed\nby the <code>async_hooks</code> API.</li>\n<li><code>[in] max_queue_size</code>: Maximum size of the queue. <code>0</code> for no limit.</li>\n<li><code>[in] initial_thread_count</code>: The initial number of acquisitions, i.e. the\ninitial number of threads, including the main thread, which will be making use\nof this function.</li>\n<li><code>[in] thread_finalize_data</code>: Optional data to be passed to <code>thread_finalize_cb</code>.</li>\n<li><code>[in] thread_finalize_cb</code>: Optional function to call when the\n<code>napi_threadsafe_function</code> is being destroyed.</li>\n<li><code>[in] context</code>: Optional data to attach to the resulting\n<code>napi_threadsafe_function</code>.</li>\n<li><code>[in] call_js_cb</code>: Optional callback which calls the JavaScript function in\nresponse to a call on a different thread. This callback will be called on the\nmain thread. If not given, the JavaScript function will be called with no\nparameters and with <code>undefined</code> as its <code>this</code> value.\n<a href=\"#napi_threadsafe_function_call_js\"><code>napi_threadsafe_function_call_js</code></a> provides more details.</li>\n<li><code>[out] result</code>: The asynchronous thread-safe JavaScript function.</li>\n</ul>\n<p><strong>Change History:</strong></p>\n<ul>\n<li>\n<p>Version 10 (<code>NAPI_VERSION</code> is defined as <code>10</code> or higher):</p>\n<p>Uncaught exceptions thrown in <code>call_js_cb</code> are handled with the\n<a href=\"process.html#event-uncaughtexception\"><code>'uncaughtException'</code></a> event, instead of being ignored.</p>\n</li>\n</ul>",
              "displayName": "`napi_create_threadsafe_function`"
            },
            {
              "textRaw": "`napi_get_threadsafe_function_context`",
              "name": "`napi_get_threadsafe_function_context`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_get_threadsafe_function_context(napi_threadsafe_function func,\n                                     void** result);\n</code></pre>\n<ul>\n<li><code>[in] func</code>: The thread-safe function for which to retrieve the context.</li>\n<li><code>[out] result</code>: The location where to store the context.</li>\n</ul>\n<p>This API may be called from any thread which makes use of <code>func</code>.</p>",
              "displayName": "`napi_get_threadsafe_function_context`"
            },
            {
              "textRaw": "`napi_call_threadsafe_function`",
              "name": "`napi_call_threadsafe_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [
                  {
                    "version": "v14.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33453",
                    "description": "Support for `napi_would_deadlock` has been reverted."
                  },
                  {
                    "version": "v14.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32689",
                    "description": "Return `napi_would_deadlock` when called with `napi_tsfn_blocking` from the main thread or a worker thread and the queue is full."
                  }
                ],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_call_threadsafe_function(napi_threadsafe_function func,\n                              void* data,\n                              napi_threadsafe_function_call_mode is_blocking);\n</code></pre>\n<ul>\n<li><code>[in] func</code>: The asynchronous thread-safe JavaScript function to invoke.</li>\n<li><code>[in] data</code>: Data to send into JavaScript via the callback <code>call_js_cb</code>\nprovided during the creation of the thread-safe JavaScript function.</li>\n<li><code>[in] is_blocking</code>: Flag whose value can be either <code>napi_tsfn_blocking</code> to\nindicate that the call should block if the queue is full or\n<code>napi_tsfn_nonblocking</code> to indicate that the call should return immediately\nwith a status of <code>napi_queue_full</code> whenever the queue is full.</li>\n</ul>\n<p>This API should not be called with <code>napi_tsfn_blocking</code> from a JavaScript\nthread, because, if the queue is full, it may cause the JavaScript thread to\ndeadlock.</p>\n<p>This API will return <code>napi_closing</code> if <code>napi_release_threadsafe_function()</code> was\ncalled with <code>abort</code> set to <code>napi_tsfn_abort</code> from any thread. The value is only\nadded to the queue if the API returns <code>napi_ok</code>.</p>\n<p>This API may be called from any thread which makes use of <code>func</code>.</p>",
              "displayName": "`napi_call_threadsafe_function`"
            },
            {
              "textRaw": "`napi_acquire_threadsafe_function`",
              "name": "`napi_acquire_threadsafe_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_acquire_threadsafe_function(napi_threadsafe_function func);\n</code></pre>\n<ul>\n<li><code>[in] func</code>: The asynchronous thread-safe JavaScript function to start making\nuse of.</li>\n</ul>\n<p>A thread should call this API before passing <code>func</code> to any other thread-safe\nfunction APIs to indicate that it will be making use of <code>func</code>. This prevents\n<code>func</code> from being destroyed when all other threads have stopped making use of\nit.</p>\n<p>This API may be called from any thread which will start making use of <code>func</code>.</p>",
              "displayName": "`napi_acquire_threadsafe_function`"
            },
            {
              "textRaw": "`napi_release_threadsafe_function`",
              "name": "`napi_release_threadsafe_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_release_threadsafe_function(napi_threadsafe_function func,\n                                 napi_threadsafe_function_release_mode mode);\n</code></pre>\n<ul>\n<li><code>[in] func</code>: The asynchronous thread-safe JavaScript function whose reference\ncount to decrement.</li>\n<li><code>[in] mode</code>: Flag whose value can be either <code>napi_tsfn_release</code> to indicate\nthat the current thread will make no further calls to the thread-safe\nfunction, or <code>napi_tsfn_abort</code> to indicate that in addition to the current\nthread, no other thread should make any further calls to the thread-safe\nfunction. If set to <code>napi_tsfn_abort</code>, further calls to\n<code>napi_call_threadsafe_function()</code> will return <code>napi_closing</code>, and no further\nvalues will be placed in the queue.</li>\n</ul>\n<p>A thread should call this API when it stops making use of <code>func</code>. Passing <code>func</code>\nto any thread-safe APIs after having called this API has undefined results, as\n<code>func</code> may have been destroyed.</p>\n<p>This API may be called from any thread which will stop making use of <code>func</code>.</p>",
              "displayName": "`napi_release_threadsafe_function`"
            },
            {
              "textRaw": "`napi_ref_threadsafe_function`",
              "name": "`napi_ref_threadsafe_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_ref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] func</code>: The thread-safe function to reference.</li>\n</ul>\n<p>This API is used to indicate that the event loop running on the main thread\nshould not exit until <code>func</code> has been destroyed. Similar to <a href=\"https://docs.libuv.org/en/v1.x/handle.html#c.uv_ref\"><code>uv_ref</code></a> it is\nalso idempotent.</p>\n<p>Neither does <code>napi_unref_threadsafe_function</code> mark the thread-safe functions as\nable to be destroyed nor does <code>napi_ref_threadsafe_function</code> prevent it from\nbeing destroyed. <code>napi_acquire_threadsafe_function</code> and\n<code>napi_release_threadsafe_function</code> are available for that purpose.</p>\n<p>This API may only be called from the main thread.</p>",
              "displayName": "`napi_ref_threadsafe_function`"
            },
            {
              "textRaw": "`napi_unref_threadsafe_function`",
              "name": "`napi_unref_threadsafe_function`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [],
                "napiVersion": [
                  4
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnapi_unref_threadsafe_function(node_api_basic_env env, napi_threadsafe_function func);\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[in] func</code>: The thread-safe function to unreference.</li>\n</ul>\n<p>This API is used to indicate that the event loop running on the main thread\nmay exit before <code>func</code> is destroyed. Similar to <a href=\"https://docs.libuv.org/en/v1.x/handle.html#c.uv_unref\"><code>uv_unref</code></a> it is also\nidempotent.</p>\n<p>This API may only be called from the main thread.</p>",
              "displayName": "`napi_unref_threadsafe_function`"
            }
          ],
          "displayName": "Asynchronous thread-safe function calls"
        },
        {
          "textRaw": "Miscellaneous utilities",
          "name": "miscellaneous_utilities",
          "type": "misc",
          "modules": [
            {
              "textRaw": "`node_api_get_module_file_name`",
              "name": "`node_api_get_module_file_name`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.9.0",
                  "v14.18.0",
                  "v12.22.0"
                ],
                "changes": [],
                "napiVersion": [
                  9
                ]
              },
              "desc": "<pre><code class=\"language-c\">NAPI_EXTERN napi_status\nnode_api_get_module_file_name(node_api_basic_env env, const char** result);\n\n</code></pre>\n<ul>\n<li><code>[in] env</code>: The environment that the API is invoked under.</li>\n<li><code>[out] result</code>: A URL containing the absolute path of the\nlocation from which the add-on was loaded. For a file on the local\nfile system it will start with <code>file://</code>. The string is null-terminated and\nowned by <code>env</code> and must thus not be modified or freed.</li>\n</ul>\n<p><code>result</code> may be an empty string if the add-on loading process fails to establish\nthe add-on's file name during loading.</p>",
              "displayName": "`node_api_get_module_file_name`"
            }
          ],
          "displayName": "Miscellaneous utilities"
        }
      ],
      "source": "doc/api/n-api.md"
    },
    {
      "textRaw": "Command-line API",
      "name": "Command-line API",
      "introduced_in": "v5.9.1",
      "type": "misc",
      "desc": "<p>Node.js comes with a variety of CLI options. These options expose built-in\ndebugging, multiple ways to execute scripts, and other helpful runtime options.</p>\n<p>To view this documentation as a manual page in a terminal, run <code>man node</code>.</p>",
      "miscs": [
        {
          "textRaw": "Synopsis",
          "name": "synopsis",
          "type": "misc",
          "desc": "<p><code>node [options] [V8 options] [&#x3C;program-entry-point> | -e \"script\" | -] [--] [arguments]</code></p>\n<p><code>node inspect [&#x3C;program-entry-point> | -e \"script\" | &#x3C;host>:&#x3C;port>] …</code></p>\n<p><code>node --v8-options</code></p>\n<p>Execute without arguments to start the <a href=\"repl.html\">REPL</a>.</p>\n<p>For more info about <code>node inspect</code>, see the <a href=\"debugger.html\">debugger</a> documentation.</p>",
          "displayName": "Synopsis"
        },
        {
          "textRaw": "Program entry point",
          "name": "program_entry_point",
          "type": "misc",
          "desc": "<p>The program entry point is a specifier-like string. If the string is not an\nabsolute path, it's resolved as a relative path from the current working\ndirectory. That entry point string is then resolved as if it's been requested\nby <code>require()</code> from the current working directory. If no corresponding file\nis found, an error is thrown.</p>\n<p>By default, the resolved path is also loaded as if it's been requested by <code>require()</code>,\nunless one of the conditions below apply—then it's loaded as if it's been requested\nby <code>import()</code>:</p>\n<ul>\n<li>The program was started with a command-line flag that forces the entry\npoint to be loaded with ECMAScript module loader, such as <code>--import</code>.</li>\n<li>The file has an <code>.mjs</code>, <code>.mts</code> or <code>.wasm</code> extension.</li>\n<li>The file does not have a <code>.cjs</code> extension, and the nearest parent\n<code>package.json</code> file contains a top-level <a href=\"packages.html#type\"><code>\"type\"</code></a> field with a value of\n<code>\"module\"</code>.</li>\n</ul>\n<p>See <a href=\"packages.html#module-resolution-and-loading\">module resolution and loading</a> for more details.</p>",
          "displayName": "Program entry point"
        },
        {
          "textRaw": "Options",
          "name": "options",
          "type": "misc",
          "meta": {
            "changes": [
              {
                "version": "v10.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/23020",
                "description": "Underscores instead of dashes are now allowed for Node.js options as well, in addition to V8 options."
              }
            ]
          },
          "stability": 2,
          "stabilityText": "Stable",
          "desc": "<p>All options, including V8 options, allow words to be separated by both\ndashes (<code>-</code>) or underscores (<code>_</code>). For example, <code>--pending-deprecation</code> is\nequivalent to <code>--pending_deprecation</code>.</p>\n<p>If an option that takes a single value (such as <code>--max-http-header-size</code>) is\npassed more than once, then the last passed value is used. Options from the\ncommand line take precedence over options passed through the <a href=\"#node_optionsoptions\"><code>NODE_OPTIONS</code></a>\nenvironment variable.</p>",
          "modules": [
            {
              "textRaw": "`-`",
              "name": "`-`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Alias for stdin. Analogous to the use of <code>-</code> in other command-line utilities,\nmeaning that the script is read from stdin, and the rest of the options\nare passed to that script.</p>",
              "displayName": "`-`"
            },
            {
              "textRaw": "`--`",
              "name": "`--`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.11.0"
                ],
                "changes": []
              },
              "desc": "<p>Indicate the end of node options. Pass the rest of the arguments to the script.\nIf no script filename or eval/print script is supplied prior to this, then\nthe next argument is used as a script filename.</p>",
              "displayName": "`--`"
            },
            {
              "textRaw": "`--abort-on-uncaught-exception`",
              "name": "`--abort-on-uncaught-exception`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.10.8"
                ],
                "changes": []
              },
              "desc": "<p>Aborting instead of exiting causes a core file to be generated for post-mortem\nanalysis using a debugger (such as <code>lldb</code>, <code>gdb</code>, and <code>mdb</code>).</p>\n<p>If this flag is passed, the behavior can still be set to not abort through\n<a href=\"process.html#processsetuncaughtexceptioncapturecallbackfn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> (and through usage of the\n<code>node:domain</code> module that uses it).</p>",
              "displayName": "`--abort-on-uncaught-exception`"
            },
            {
              "textRaw": "`--allow-addons`",
              "name": "`--allow-addons`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.6.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the process will not be able to use\nnative addons by default.\nAttempts to do so will throw an <code>ERR_DLOPEN_DISABLED</code> unless the\nuser explicitly passes the <code>--allow-addons</code> flag when starting Node.js.</p>\n<p>Example:</p>\n<pre><code class=\"language-cjs\">// Attempt to require an native addon\nrequire('nodejs-addon-example');\n</code></pre>\n<pre><code class=\"language-console\">$ node --permission --allow-fs-read=* index.js\nnode:internal/modules/cjs/loader:1319\n  return process.dlopen(module, path.toNamespacedPath(filename));\n                 ^\n\nError: Cannot load native addon because loading addons is disabled.\n    at Module._extensions..node (node:internal/modules/cjs/loader:1319:18)\n    at Module.load (node:internal/modules/cjs/loader:1091:32)\n    at Module._load (node:internal/modules/cjs/loader:938:12)\n    at Module.require (node:internal/modules/cjs/loader:1115:19)\n    at require (node:internal/modules/helpers:130:18)\n    at Object.&#x3C;anonymous> (/home/index.js:1:15)\n    at Module._compile (node:internal/modules/cjs/loader:1233:14)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)\n    at Module.load (node:internal/modules/cjs/loader:1091:32)\n    at Module._load (node:internal/modules/cjs/loader:938:12) {\n  code: 'ERR_DLOPEN_DISABLED'\n}\n</code></pre>",
              "displayName": "`--allow-addons`"
            },
            {
              "textRaw": "`--allow-child-process`",
              "name": "`--allow-child-process`",
              "type": "module",
              "meta": {
                "added": [
                  "v20.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.4.0",
                      "v22.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58853",
                    "description": "When spawning process with the permission model enabled. The flags are inherit to the child Node.js process through NODE_OPTIONS environment variable."
                  }
                ]
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the process will not be able to spawn any\nchild process by default.\nAttempts to do so will throw an <code>ERR_ACCESS_DENIED</code> unless the\nuser explicitly passes the <code>--allow-child-process</code> flag when starting Node.js.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const childProcess = require('node:child_process');\n// Attempt to bypass the permission\nchildProcess.spawn('node', ['-e', 'require(\"fs\").writeFileSync(\"/new-file\", \"example\")']);\n</code></pre>\n<pre><code class=\"language-console\">$ node --permission --allow-fs-read=* index.js\nnode:internal/child_process:388\n  const err = this._handle.spawn(options);\n                           ^\nError: Access to this API has been restricted\n    at ChildProcess.spawn (node:internal/child_process:388:28)\n    at node:internal/main/run_main_module:17:47 {\n  code: 'ERR_ACCESS_DENIED',\n  permission: 'ChildProcess'\n}\n</code></pre>\n<p>The <code>child_process.fork()</code> API inherits the execution arguments from the\nparent process. This means that if Node.js is started with the Permission\nModel enabled and the <code>--allow-child-process</code> flag is set, any child process\ncreated using <code>child_process.fork()</code> will automatically receive all relevant\nPermission Model flags.</p>\n<p>This behavior also applies to <code>child_process.spawn()</code>, but in that case, the\nflags are propagated via the <code>NODE_OPTIONS</code> environment variable rather than\ndirectly through the process arguments.</p>",
              "displayName": "`--allow-child-process`"
            },
            {
              "textRaw": "`--allow-ffi`",
              "name": "`--allow-ffi`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the process will not be able to use FFI\nAPIs by default. Attempts to use FFI APIs will throw an <code>ERR_ACCESS_DENIED</code>\nexception unless the user explicitly passes the <code>--allow-ffi</code> flag when\nstarting Node.js. The <a href=\"ffi.html\"><code>node:ffi</code></a> module also requires the\n<code>--experimental-ffi</code> flag and is only available in builds with FFI support.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const { DynamicLibrary } = require('node:ffi');\nconst lib = new DynamicLibrary('mylib.so');\n</code></pre>\n<pre><code class=\"language-console\">$ node --permission --experimental-ffi index.js\nError: Access to this API has been restricted. Use --allow-ffi to manage permissions.\n    at node:internal/main/run_main_module:17:47 {\n  code: 'ERR_ACCESS_DENIED',\n  permission: 'FFI'\n}\n</code></pre>",
              "displayName": "`--allow-ffi`"
            },
            {
              "textRaw": "`--allow-fs-read`",
              "name": "`--allow-fs-read`",
              "type": "module",
              "meta": {
                "added": [
                  "v20.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.2.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58579",
                    "description": "Entrypoints of your application are allowed to be read implicitly."
                  },
                  {
                    "version": [
                      "v23.5.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56201",
                    "description": "Permission Model and --allow-fs flags are stable."
                  },
                  {
                    "version": "v20.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49047",
                    "description": "Paths delimited by comma (`,`) are no longer allowed."
                  }
                ]
              },
              "desc": "<p>This flag configures file system read permissions using\nthe <a href=\"permissions.html#permission-model\">Permission Model</a>.</p>\n<p>The valid arguments for the <code>--allow-fs-read</code> flag are:</p>\n<ul>\n<li><code>*</code> - To allow all <code>FileSystemRead</code> operations.</li>\n<li>Multiple paths can be allowed using multiple <code>--allow-fs-read</code> flags.\nExample <code>--allow-fs-read=/folder1/ --allow-fs-read=/folder1/</code></li>\n</ul>\n<p>Examples can be found in the <a href=\"permissions.html#file-system-permissions\">File System Permissions</a> documentation.</p>\n<p>The initializer module and custom <code>--require</code> modules has a implicit\nread permission.</p>\n<pre><code class=\"language-console\">$ node --permission -r custom-require.js -r custom-require-2.js index.js\n</code></pre>\n<ul>\n<li>The <code>custom-require.js</code>, <code>custom-require-2.js</code>, and <code>index.js</code> will be\nby default in the allowed read list.</li>\n</ul>\n<pre><code class=\"language-js\">process.permission.has('fs.read', 'index.js'); // true\nprocess.permission.has('fs.read', 'custom-require.js'); // true\nprocess.permission.has('fs.read', 'custom-require-2.js'); // true\n</code></pre>",
              "displayName": "`--allow-fs-read`"
            },
            {
              "textRaw": "`--allow-fs-write`",
              "name": "`--allow-fs-write`",
              "type": "module",
              "meta": {
                "added": [
                  "v20.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.5.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56201",
                    "description": "Permission Model and --allow-fs flags are stable."
                  },
                  {
                    "version": "v20.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49047",
                    "description": "Paths delimited by comma (`,`) are no longer allowed."
                  }
                ]
              },
              "desc": "<p>This flag configures file system write permissions using\nthe <a href=\"permissions.html#permission-model\">Permission Model</a>.</p>\n<p>The valid arguments for the <code>--allow-fs-write</code> flag are:</p>\n<ul>\n<li><code>*</code> - To allow all <code>FileSystemWrite</code> operations.</li>\n<li>Multiple paths can be allowed using multiple <code>--allow-fs-write</code> flags.\nExample <code>--allow-fs-write=/folder1/ --allow-fs-write=/folder1/</code></li>\n</ul>\n<p>Paths delimited by comma (<code>,</code>) are no longer allowed.\nWhen passing a single flag with a comma a warning will be displayed.</p>\n<p>Examples can be found in the <a href=\"permissions.html#file-system-permissions\">File System Permissions</a> documentation.</p>",
              "displayName": "`--allow-fs-write`"
            },
            {
              "textRaw": "`--allow-inspector`",
              "name": "`--allow-inspector`",
              "type": "module",
              "meta": {
                "added": [
                  "v25.0.0",
                  "v24.12.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the process will not be able to connect\nthrough inspector protocol.</p>\n<p>Attempts to do so will throw an <code>ERR_ACCESS_DENIED</code> unless the\nuser explicitly passes the <code>--allow-inspector</code> flag when starting Node.js.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const { Session } = require('node:inspector/promises');\n\nconst session = new Session();\nsession.connect();\n</code></pre>\n<pre><code class=\"language-console\">$ node --permission index.js\nError: connect ERR_ACCESS_DENIED Access to this API has been restricted. Use --allow-inspector to manage permissions.\n  code: 'ERR_ACCESS_DENIED',\n}\n</code></pre>",
              "displayName": "`--allow-inspector`"
            },
            {
              "textRaw": "`--allow-net`",
              "name": "`--allow-net`",
              "type": "module",
              "meta": {
                "added": [
                  "v25.0.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the process will not be able to access\nnetwork by default.\nAttempts to do so will throw an <code>ERR_ACCESS_DENIED</code> unless the\nuser explicitly passes the <code>--allow-net</code> flag when starting Node.js.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const http = require('node:http');\n// Attempt to bypass the permission\nconst req = http.get('http://example.com', () => {});\n\nreq.on('error', (err) => {\n  console.log('err', err);\n});\n</code></pre>\n<pre><code class=\"language-console\">$ node --permission index.js\nError: connect ERR_ACCESS_DENIED Access to this API has been restricted. Use --allow-net to manage permissions.\n  code: 'ERR_ACCESS_DENIED',\n}\n</code></pre>",
              "displayName": "`--allow-net`"
            },
            {
              "textRaw": "`--allow-wasi`",
              "name": "`--allow-wasi`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.16.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the process will not be capable of creating\nany WASI instances by default.\nFor security reasons, the call will throw an <code>ERR_ACCESS_DENIED</code> unless the\nuser explicitly passes the flag <code>--allow-wasi</code> in the main Node.js process.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const { WASI } = require('node:wasi');\n// Attempt to bypass the permission\nnew WASI({\n  version: 'preview1',\n  // Attempt to mount the whole filesystem\n  preopens: {\n    '/': '/',\n  },\n});\n</code></pre>\n<pre><code class=\"language-console\">$ node --permission --allow-fs-read=* index.js\n\nError: Access to this API has been restricted\n    at node:internal/main/run_main_module:30:49 {\n  code: 'ERR_ACCESS_DENIED',\n  permission: 'WASI',\n}\n</code></pre>",
              "displayName": "`--allow-wasi`"
            },
            {
              "textRaw": "`--allow-worker`",
              "name": "`--allow-worker`",
              "type": "module",
              "meta": {
                "added": [
                  "v20.0.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the process will not be able to create any\nworker threads by default.\nFor security reasons, the call will throw an <code>ERR_ACCESS_DENIED</code> unless the\nuser explicitly pass the flag <code>--allow-worker</code> in the main Node.js process.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const { Worker } = require('node:worker_threads');\n// Attempt to bypass the permission\nnew Worker(__filename);\n</code></pre>\n<pre><code class=\"language-console\">$ node --permission --allow-fs-read=* index.js\n\nError: Access to this API has been restricted\n    at node:internal/main/run_main_module:17:47 {\n  code: 'ERR_ACCESS_DENIED',\n  permission: 'WorkerThreads'\n}\n</code></pre>",
              "displayName": "`--allow-worker`"
            },
            {
              "textRaw": "`--build-sea=config`",
              "name": "`--build-sea=config`",
              "type": "module",
              "meta": {
                "added": [
                  "v25.5.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>Generates a <a href=\"single-executable-applications.html\">single executable application</a> from a JSON\nconfiguration file. The argument must be a path to the configuration file. If\nthe path is not absolute, it is resolved relative to the current working\ndirectory.</p>\n<p>For configuration fields, cross-platform notes, and asset APIs, see\nthe <a href=\"single-executable-applications.html\">single executable application</a> documentation.</p>",
              "displayName": "`--build-sea=config`"
            },
            {
              "textRaw": "`--build-snapshot`",
              "name": "`--build-snapshot`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.4.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60954",
                    "description": "The snapshot building process is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Generates a snapshot blob when the process exits and writes it to\ndisk, which can be loaded later with <code>--snapshot-blob</code>.</p>\n<p>When building the snapshot, if <code>--snapshot-blob</code> is not specified,\nthe generated blob will be written, by default, to <code>snapshot.blob</code>\nin the current working directory. Otherwise it will be written to\nthe path specified by <code>--snapshot-blob</code>.</p>\n<pre><code class=\"language-console\">$ echo \"globalThis.foo = 'I am from the snapshot'\" > snapshot.js\n\n# Run snapshot.js to initialize the application and snapshot the\n# state of it into snapshot.blob.\n$ node --snapshot-blob snapshot.blob --build-snapshot snapshot.js\n\n$ echo \"console.log(globalThis.foo)\" > index.js\n\n# Load the generated snapshot and start the application from index.js.\n$ node --snapshot-blob snapshot.blob index.js\nI am from the snapshot\n</code></pre>\n<p>The <a href=\"v8.html#startup-snapshot-api\"><code>v8.startupSnapshot</code> API</a> can be used to specify an entry point at\nsnapshot building time, thus avoiding the need of an additional entry\nscript at deserialization time:</p>\n<pre><code class=\"language-console\">$ echo \"require('v8').startupSnapshot.setDeserializeMainFunction(() => console.log('I am from the snapshot'))\" > snapshot.js\n$ node --snapshot-blob snapshot.blob --build-snapshot snapshot.js\n$ node --snapshot-blob snapshot.blob\nI am from the snapshot\n</code></pre>\n<p>For more information, check out the <a href=\"v8.html#startup-snapshot-api\"><code>v8.startupSnapshot</code> API</a> documentation.</p>\n<p>The snapshot currently only supports loding a single entrypoint during the\nsnapshot building process, which can load built-in modules, but not additional user-land modules.\nUsers can bundle their applications into a single script with their bundler\nof choice before building a snapshot.</p>\n<p>As it's complicated to ensure the serializablility of all built-in modules,\nwhich are also growing over time, only a subset of the built-in modules are\nwell tested to be serializable during the snapshot building process.\nThe Node.js core test suite checks that a few fairly complex applications\ncan be snapshotted. The list of built-in modules being\n<a href=\"https://github.com/nodejs/node/blob/b19525a33cc84033af4addd0f80acd4dc33ce0cf/test/parallel/test-bootstrap-modules.js#L24\">captured by the built-in snapshot of Node.js</a> is considered supported.\nWhen the snapshot builder encounters a built-in module that cannot be\nserialized, it may crash the snapshot building process. In that case a typical\nworkaround would be to delay loading that module until\nruntime, using either <a href=\"v8.html#v8startupsnapshotsetdeserializemainfunctioncallback-data\"><code>v8.startupSnapshot.setDeserializeMainFunction()</code></a> or\n<a href=\"v8.html#v8startupsnapshotadddeserializecallbackcallback-data\"><code>v8.startupSnapshot.addDeserializeCallback()</code></a>. If serialization for\nan additional module during the snapshot building process is needed,\nplease file a request in the <a href=\"https://github.com/nodejs/node/issues\">Node.js issue tracker</a> and link to it in the\n<a href=\"https://github.com/nodejs/node/issues/44014\">tracking issue for user-land snapshots</a>.</p>",
              "displayName": "`--build-snapshot`"
            },
            {
              "textRaw": "`--build-snapshot-config`",
              "name": "`--build-snapshot-config`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.6.0",
                  "v20.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.4.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60954",
                    "description": "The snapshot building process is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Specifies the path to a JSON configuration file which configures snapshot\ncreation behavior.</p>\n<p>The following options are currently supported:</p>\n<ul>\n<li><code>builder</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Required. Provides the name to the script that is executed\nbefore building the snapshot, as if <a href=\"#--build-snapshot\"><code>--build-snapshot</code></a> had been passed\nwith <code>builder</code> as the main script name.</li>\n<li><code>withoutCodeCache</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Optional. Including the code cache reduces the\ntime spent on compiling functions included in the snapshot at the expense\nof a bigger snapshot size and potentially breaking portability of the\nsnapshot.</li>\n</ul>\n<p>When using this flag, additional script files provided on the command line will\nnot be executed and instead be interpreted as regular command line arguments.</p>",
              "displayName": "`--build-snapshot-config`"
            },
            {
              "textRaw": "`-c`, `--check`",
              "name": "`-c`,_`--check`",
              "type": "module",
              "meta": {
                "added": [
                  "v5.0.0",
                  "v4.2.0"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19600",
                    "description": "The `--require` option is now supported when checking a file."
                  }
                ]
              },
              "desc": "<p>Syntax check the script without executing.</p>",
              "displayName": "`-c`, `--check`"
            },
            {
              "textRaw": "`--completion-bash`",
              "name": "`--completion-bash`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": []
              },
              "desc": "<p>Print source-able bash completion script for Node.js.</p>\n<pre><code class=\"language-bash\">node --completion-bash > node_bash_completion\nsource node_bash_completion\n</code></pre>",
              "displayName": "`--completion-bash`"
            },
            {
              "textRaw": "`-C condition`, `--conditions=condition`",
              "name": "`-c_condition`,_`--conditions=condition`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.9.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.9.0",
                      "v20.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/54209",
                    "description": "The flag is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Provide custom <a href=\"packages.html#conditional-exports\">conditional exports</a> resolution conditions.</p>\n<p>Any number of custom string condition names are permitted.</p>\n<p>The default Node.js conditions of <code>\"node\"</code>, <code>\"default\"</code>, <code>\"import\"</code>, and\n<code>\"require\"</code> will always apply as defined.</p>\n<p>For example, to run a module with \"development\" resolutions:</p>\n<pre><code class=\"language-bash\">node -C development app.js\n</code></pre>",
              "displayName": "`-C condition`, `--conditions=condition`"
            },
            {
              "textRaw": "`--cpu-prof`",
              "name": "`--cpu-prof`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53343",
                    "description": "The `--cpu-prof` flags are now stable."
                  }
                ]
              },
              "desc": "<p>Starts the V8 CPU profiler on start up, and writes the CPU profile to disk\nbefore exit.</p>\n<p>If <code>--cpu-prof-dir</code> is not specified, the generated profile is placed\nin the current working directory.</p>\n<p>If <code>--cpu-prof-name</code> is not specified, the generated profile is\nnamed <code>CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile</code>.</p>\n<pre><code class=\"language-console\">$ node --cpu-prof index.js\n$ ls *.cpuprofile\nCPU.20190409.202950.15293.0.0.cpuprofile\n</code></pre>\n<p>If <code>--cpu-prof-name</code> is specified, the provided value is used as a template\nfor the file name. The following placeholder is supported and will be\nsubstituted at runtime:</p>\n<ul>\n<li><code>${pid}</code> — the current process ID</li>\n</ul>\n<pre><code class=\"language-console\">$ node --cpu-prof --cpu-prof-name 'CPU.${pid}.cpuprofile' index.js\n$ ls *.cpuprofile\nCPU.15293.cpuprofile\n</code></pre>",
              "displayName": "`--cpu-prof`"
            },
            {
              "textRaw": "`--cpu-prof-dir`",
              "name": "`--cpu-prof-dir`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53343",
                    "description": "The `--cpu-prof` flags are now stable."
                  }
                ]
              },
              "desc": "<p>Specify the directory where the CPU profiles generated by <code>--cpu-prof</code> will\nbe placed.</p>\n<p>The default value is controlled by the\n<a href=\"#--diagnostic-dirdirectory\"><code>--diagnostic-dir</code></a> command-line option.</p>",
              "displayName": "`--cpu-prof-dir`"
            },
            {
              "textRaw": "`--cpu-prof-interval`",
              "name": "`--cpu-prof-interval`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.2.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53343",
                    "description": "The `--cpu-prof` flags are now stable."
                  }
                ]
              },
              "desc": "<p>Specify the sampling interval in microseconds for the CPU profiles generated\nby <code>--cpu-prof</code>. The default is 1000 microseconds.</p>",
              "displayName": "`--cpu-prof-interval`"
            },
            {
              "textRaw": "`--cpu-prof-name`",
              "name": "`--cpu-prof-name`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53343",
                    "description": "The `--cpu-prof` flags are now stable."
                  }
                ]
              },
              "desc": "<p>Specify the file name of the CPU profile generated by <code>--cpu-prof</code>.</p>",
              "displayName": "`--cpu-prof-name`"
            },
            {
              "textRaw": "`--diagnostic-dir=directory`",
              "name": "`--diagnostic-dir=directory`",
              "type": "module",
              "desc": "<p>Set the directory to which all diagnostic output files are written.\nDefaults to current working directory.</p>\n<p>Affects the default output directory of:</p>\n<ul>\n<li><a href=\"#--cpu-prof-dir\"><code>--cpu-prof-dir</code></a></li>\n<li><a href=\"#--heap-prof-dir\"><code>--heap-prof-dir</code></a></li>\n<li><a href=\"#--redirect-warningsfile\"><code>--redirect-warnings</code></a></li>\n</ul>",
              "displayName": "`--diagnostic-dir=directory`"
            },
            {
              "textRaw": "`--disable-proto=mode`",
              "name": "`--disable-proto=mode`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.12.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Disable the <code>Object.prototype.__proto__</code> property. If <code>mode</code> is <code>delete</code>, the\nproperty is removed entirely. If <code>mode</code> is <code>throw</code>, accesses to the\nproperty throw an exception with the code <code>ERR_PROTO_ACCESS</code>.</p>",
              "displayName": "`--disable-proto=mode`"
            },
            {
              "textRaw": "`--disable-sigusr1`",
              "name": "`--disable-sigusr1`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.7.0",
                  "v22.14.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.8.0",
                      "v22.20.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59707",
                    "description": "The option is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Disable the ability of starting a debugging session by sending a\n<code>SIGUSR1</code> signal to the process.</p>",
              "displayName": "`--disable-sigusr1`"
            },
            {
              "textRaw": "`--disable-warning=code-or-type`",
              "name": "`--disable-warning=code-or-type`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.3.0",
                  "v20.11.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>Disable specific process warnings by <code>code</code> or <code>type</code>.</p>\n<p>Warnings emitted from <a href=\"process.html#processemitwarningwarning-options\"><code>process.emitWarning()</code></a> may contain a\n<code>code</code> and a <code>type</code>. This option will not-emit warnings that have a matching\n<code>code</code> or <code>type</code>.</p>\n<p>List of <a href=\"deprecations.html#list-of-deprecated-apis\">deprecation warnings</a>.</p>\n<p>The Node.js core warning types are: <code>DeprecationWarning</code> and\n<code>ExperimentalWarning</code></p>\n<p>For example, the following script will not emit\n<a href=\"deprecations.html#dep0025-requirenodesys\">DEP0025 <code>require('node:sys')</code></a> when executed with\n<code>node --disable-warning=DEP0025</code>:</p>\n<pre><code class=\"language-mjs\">import sys from 'node:sys';\n</code></pre>\n<pre><code class=\"language-cjs\">const sys = require('node:sys');\n</code></pre>\n<p>For example, the following script will emit the\n<a href=\"deprecations.html#dep0025-requirenodesys\">DEP0025 <code>require('node:sys')</code></a>, but not any Experimental\nWarnings (such as\n<a href=\"vm.html#vmmeasurememoryoptions\">ExperimentalWarning: <code>vm.measureMemory</code> is an experimental feature</a>\nin &#x3C;=v21) when executed with <code>node --disable-warning=ExperimentalWarning</code>:</p>\n<pre><code class=\"language-mjs\">import sys from 'node:sys';\nimport vm from 'node:vm';\n\nvm.measureMemory();\n</code></pre>\n<pre><code class=\"language-cjs\">const sys = require('node:sys');\nconst vm = require('node:vm');\n\nvm.measureMemory();\n</code></pre>",
              "displayName": "`--disable-warning=code-or-type`"
            },
            {
              "textRaw": "`--disable-wasm-trap-handler`",
              "name": "`--disable-wasm-trap-handler`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.2.0",
                  "v20.15.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v26.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/62132",
                    "description": "Node.js now automatically disables the trap handler when there is not enough virtual memory available at startup to allocate one cage."
                  }
                ]
              },
              "desc": "<p>Node.js enables V8's trap-handler-based WebAssembly bound checks on 64-bit platforms,\nwhich significantly improves WebAssembly performance by eliminating the need for\ninline bound checks. This optimization requires allocating a large virtual memory\ncage per WebAssembly memory instance (currently typically 8GB for 32-bit WebAssembly memory,\n16GB for 64-bit WebAssembly memory) to trap out-of-bound accesses. On most 64-bit\nplatforms, the virtual memory address space is usually large enough (around 128TB)\nto accommodate typical WebAssembly usages, but if the machine has manual limits\non virtual memory (e.g. through <code>ulimit -v</code>), WebAssembly memory allocation is\nmore likely to fail with <code>WebAssembly.Memory(): could not allocate memory</code>.</p>\n<p>At startup, Node.js automatically checks whether there is enough virtual memory\navailable to allocate at least one cage, and if not, the trap-handler optimization\nis automatically disabled so that WebAssembly can still run using inline\nbound checks (with less optimal performance). But if the application needs to create\nmany WebAssembly memory instances and the machine still configures a relatively high\nlimit on virtual memory, allocation of WebAssembly memory instances may still fail\nmore quickly than expected due to the raised virtual memory usage.</p>\n<p><code>--disable-wasm-trap-handler</code> fully disables this optimization so that WebAssembly memory\ninstances always use inline bound checks instead of reserving large virtual memory cages.\nThis allows more instances to be created when the virtual memory address space available\nto the Node.js process is limited.</p>",
              "displayName": "`--disable-wasm-trap-handler`"
            },
            {
              "textRaw": "`--disallow-code-generation-from-strings`",
              "name": "`--disallow-code-generation-from-strings`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Make built-in language features like <code>eval</code> and <code>new Function</code> that generate\ncode from strings throw an exception instead. This does not affect the Node.js\n<code>node:vm</code> module.</p>",
              "displayName": "`--disallow-code-generation-from-strings`"
            },
            {
              "textRaw": "`--dns-result-order=order`",
              "name": "`--dns-result-order=order`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.4.0",
                  "v14.18.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.1.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52492",
                    "description": "The `ipv6first` is supported now."
                  },
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39987",
                    "description": "Changed default value to `verbatim`."
                  }
                ]
              },
              "desc": "<p>Set the default value of <code>order</code> in <a href=\"dns.html#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and\n<a href=\"dns.html#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a>. The value could be:</p>\n<ul>\n<li><code>ipv4first</code>: sets default <code>order</code> to <code>ipv4first</code>.</li>\n<li><code>ipv6first</code>: sets default <code>order</code> to <code>ipv6first</code>.</li>\n<li><code>verbatim</code>: sets default <code>order</code> to <code>verbatim</code>.</li>\n</ul>\n<p>The default is <code>verbatim</code> and <a href=\"dns.html#dnssetdefaultresultorderorder\"><code>dns.setDefaultResultOrder()</code></a> have higher\npriority than <code>--dns-result-order</code>.</p>",
              "displayName": "`--dns-result-order=order`"
            },
            {
              "textRaw": "`--enable-fips`",
              "name": "`--enable-fips`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable FIPS-compliant crypto at startup. (Requires Node.js to be built\nagainst FIPS-compatible OpenSSL.)</p>",
              "displayName": "`--enable-fips`"
            },
            {
              "textRaw": "`--enable-source-maps`",
              "name": "`--enable-source-maps`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.11.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37362",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Enable <a href=\"https://tc39.es/ecma426/\">Source Map</a> support for stack traces.</p>\n<p>When using a transpiler, such as TypeScript, stack traces thrown by an\napplication reference the transpiled code, not the original source position.\n<code>--enable-source-maps</code> enables caching of Source Maps and makes a best\neffort to report stack traces relative to the original source file.</p>\n<p>Overriding <code>Error.prepareStackTrace</code> may prevent <code>--enable-source-maps</code> from\nmodifying the stack trace. Call and return the results of the original\n<code>Error.prepareStackTrace</code> in the overriding function to modify the stack trace\nwith source maps.</p>\n<pre><code class=\"language-js\">const originalPrepareStackTrace = Error.prepareStackTrace;\nError.prepareStackTrace = (error, trace) => {\n  // Modify error and trace and format stack trace with\n  // original Error.prepareStackTrace.\n  return originalPrepareStackTrace(error, trace);\n};\n</code></pre>\n<p>Note, enabling source maps can introduce latency to your application\nwhen <code>Error.stack</code> is accessed. If you access <code>Error.stack</code> frequently\nin your application, take into account the performance implications\nof <code>--enable-source-maps</code>.</p>",
              "displayName": "`--enable-source-maps`"
            },
            {
              "textRaw": "`--entry-url`",
              "name": "`--entry-url`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>When present, Node.js will interpret the entry point as a URL, rather than a\npath.</p>\n<p>Follows <a href=\"esm.html#modules-ecmascript-modules\">ECMAScript module</a> resolution rules.</p>\n<p>Any query parameter or hash in the URL will be accessible via <a href=\"esm.html#importmetaurl\"><code>import.meta.url</code></a>.</p>\n<pre><code class=\"language-bash\">node --entry-url 'file:///path/to/file.js?queryparams=work#and-hashes-too'\nnode --entry-url 'file.ts?query#hash'\nnode --entry-url 'data:text/javascript,console.log(\"Hello\")'\n</code></pre>",
              "displayName": "`--entry-url`"
            },
            {
              "textRaw": "`--env-file-if-exists=file`",
              "name": "`--env-file-if-exists=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.9.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.10.0",
                      "v22.21.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59925",
                    "description": "The `--env-file-if-exists` flag is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Behavior is the same as <a href=\"#--env-filefile\"><code>--env-file</code></a>, but an error is not thrown if the file\ndoes not exist.</p>",
              "displayName": "`--env-file-if-exists=file`"
            },
            {
              "textRaw": "`--env-file=file`",
              "name": "`--env-file=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v20.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.10.0",
                      "v22.21.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59925",
                    "description": "The `--env-file` flag is no longer experimental."
                  },
                  {
                    "version": [
                      "v21.7.0",
                      "v20.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/51289",
                    "description": "Add support to multi-line values."
                  }
                ]
              },
              "desc": "<p>Loads environment variables from a file relative to the current directory,\nmaking them available to applications on <code>process.env</code>. The <a href=\"#environment-variables_1\">environment\nvariables which configure Node.js</a>, such as <code>NODE_OPTIONS</code>,\nare parsed and applied. If the same variable is defined in the environment and\nin the file, the value from the environment takes precedence.</p>\n<p>You can pass multiple <code>--env-file</code> arguments. Subsequent files override\npre-existing variables defined in previous files.</p>\n<p>An error is thrown if the file does not exist.</p>\n<pre><code class=\"language-bash\">node --env-file=.env --env-file=.development.env index.js\n</code></pre>\n<p>The format of the file should be one line per key-value pair of environment\nvariable name and value separated by <code>=</code>:</p>\n<pre><code class=\"language-text\">PORT=3000\n</code></pre>\n<p>Any text after a <code>#</code> is treated as a comment:</p>\n<pre><code class=\"language-text\"># This is a comment\nPORT=3000 # This is also a comment\n</code></pre>\n<p>Values can start and end with the following quotes: <code>`</code>, <code>\"</code> or <code>'</code>.\nThey are omitted from the values.</p>\n<pre><code class=\"language-text\">USERNAME=\"nodejs\" # will result in `nodejs` as the value.\n</code></pre>\n<p>Multi-line values are supported:</p>\n<pre><code class=\"language-text\">MULTI_LINE=\"THIS IS\nA MULTILINE\"\n# will result in `THIS IS\\nA MULTILINE` as the value.\n</code></pre>\n<p>Export keyword before a key is ignored:</p>\n<pre><code class=\"language-text\">export USERNAME=\"nodejs\" # will result in `nodejs` as the value.\n</code></pre>\n<p>If you want to load environment variables from a file that may not exist, you\ncan use the <a href=\"#--env-file-if-existsfile\"><code>--env-file-if-exists</code></a> flag instead.</p>",
              "displayName": "`--env-file=file`"
            },
            {
              "textRaw": "`-e`, `--eval \"script\"`",
              "name": "`-e`,_`--eval_\"script\"`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.5.2"
                ],
                "changes": [
                  {
                    "version": "v22.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53725",
                    "description": "Eval now supports experimental type-stripping."
                  },
                  {
                    "version": "v5.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5348",
                    "description": "Built-in libraries are now available as predefined variables."
                  }
                ]
              },
              "desc": "<p>Evaluate the following argument as JavaScript. The modules which are\npredefined in the REPL can also be used in <code>script</code>.</p>\n<p>If <code>script</code> starts with <code>-</code>, pass it using <code>=</code> (for example,\n<code>node --print --eval=-42</code>) so it is parsed as the value of <code>--eval</code>.</p>\n<p>On Windows, using <code>cmd.exe</code> a single quote will not work correctly because it\nonly recognizes double <code>\"</code> for quoting. In Powershell or Git bash, both <code>'</code>\nand <code>\"</code> are usable.</p>\n<p>It is possible to run code containing inline types unless the\n<a href=\"#--no-strip-types\"><code>--no-strip-types</code></a> flag is provided.</p>",
              "displayName": "`-e`, `--eval \"script\"`"
            },
            {
              "textRaw": "`--experimental-addon-modules`",
              "name": "`--experimental-addon-modules`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.6.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>Enable experimental import support for <code>.node</code> addons.</p>",
              "displayName": "`--experimental-addon-modules`"
            },
            {
              "textRaw": "`--experimental-config-file=path`, `--experimental-config-file`",
              "name": "`--experimental-config-file=path`,_`--experimental-config-file`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.10.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>If present, Node.js will look for a configuration file at the specified path.\nIf the path is not specified, Node.js will look for a <code>node.config.json</code> file\nin the current working directory.\nTo specify a custom path, use the <code>--experimental-config-file=path</code> form.\nThe space-separated <code>--experimental-config-file path</code> form is not supported.\nThe alias <code>--experimental-default-config-file</code> is equivalent to\n<code>--experimental-config-file</code> without an argument.\nNode.js will read the configuration file and apply the settings. The\nconfiguration file should be a JSON file with the following structure. <code>vX.Y.Z</code>\nin the <code>$schema</code> must be replaced with the version of Node.js you are using or\n<code>latest-vX.x</code> for the latest version of that major release line.</p>\n<pre><code class=\"language-json\">{\n  \"$schema\": \"https://nodejs.org/dist/vX.Y.Z/docs/node-config-schema.json\",\n  \"nodeOptions\": {\n    \"import\": [\n      \"amaro/strip\"\n    ],\n    \"watch-path\": \"src\",\n    \"watch-preserve-output\": true\n  },\n  \"test\": {\n    \"test-isolation\": \"process\"\n  },\n  \"watch\": {\n    \"watch-preserve-output\": true\n  }\n}\n</code></pre>\n<p>The configuration file supports namespace-specific options:</p>\n<ul>\n<li>\n<p>The <code>nodeOptions</code> field contains CLI flags that are allowed in <a href=\"#node_optionsoptions\"><code>NODE_OPTIONS</code></a>.</p>\n</li>\n<li>\n<p>Namespace fields like <code>test</code>, <code>watch</code>, and <code>permission</code> contain configuration specific to that subsystem.</p>\n</li>\n</ul>\n<p>The configuration file can target a specific Node.js major version with\n<code>nodeVersion</code>:</p>\n<pre><code class=\"language-json\">{\n  \"nodeVersion\": 25,\n  \"nodeOptions\": {\n    \"watch-path\": \"src\"\n  }\n}\n</code></pre>\n<p>To keep multiple version-specific configurations in the same file, use the\n<code>configs</code> array. Node.js will use the first entry whose <code>nodeVersion</code> matches\nthe current Node.js major version:</p>\n<pre><code class=\"language-json\">{\n  \"$schema\": \"https://nodejs.org/dist/latest-v26.x/docs/node-config-schema.json\",\n  \"configs\": [\n    {\n      \"nodeVersion\": 25,\n      \"config\": {\n        \"$schema\": \"https://nodejs.org/dist/latest-v25.x/docs/node-config-schema.json\",\n        \"nodeOptions\": {\n          \"watch-path\": \"src\"\n        }\n      }\n    }\n  ]\n}\n</code></pre>\n<p>When <code>configs</code> is used, the top level may only contain <code>$schema</code> and\n<code>configs</code>. Each <code>configs</code> item must define an integer <code>nodeVersion</code> and an\nobject <code>config</code>. A single top-level config does not require <code>nodeVersion</code>, but\nif present it must match the current Node.js major version.</p>\n<p>When a namespace is present in the\nconfiguration file, Node.js automatically enables the corresponding flag\n(e.g., <code>--test</code>, <code>--watch</code>, <code>--permission</code>). This allows you to configure\nsubsystem-specific options without explicitly passing the flag on the command line.</p>\n<p>For example:</p>\n<pre><code class=\"language-json\">{\n  \"test\": {\n    \"test-isolation\": \"process\"\n  }\n}\n</code></pre>\n<p>is equivalent to:</p>\n<pre><code class=\"language-bash\">node --test --test-isolation=process\n</code></pre>\n<p>To disable the automatic flag while still using namespace options, you can\nexplicitly set the flag to <code>false</code> within the namespace:</p>\n<pre><code class=\"language-json\">{\n  \"test\": {\n    \"test\": false,\n    \"test-isolation\": \"process\"\n  }\n}\n</code></pre>\n<p>No-op flags are not supported.\nNot all V8 flags are currently supported.</p>\n<p>It is possible to use the <a href=\"../node-config-schema.json\">official JSON schema</a>\nto validate the configuration file, which may vary depending on the Node.js version.\nEach key in the configuration file corresponds to a flag that can be passed\nas a command-line argument. The value of the key is the value that would be\npassed to the flag.</p>\n<p>For example, the configuration file above is equivalent to\nthe following command-line arguments:</p>\n<pre><code class=\"language-bash\">node --import amaro/strip --watch-path=src --watch-preserve-output --test-isolation=process\n</code></pre>\n<p>The priority in configuration is as follows:</p>\n<ol>\n<li>NODE_OPTIONS and command-line options</li>\n<li>Dotenv NODE_OPTIONS</li>\n<li>Configuration file</li>\n</ol>\n<p>Values in the configuration file will not override the values in the environment\nvariables, command-line options, or the <code>NODE_OPTIONS</code> env file parsed by the\n<code>--env-file</code> flag.</p>\n<p>Keys cannot be duplicated within the same or different namespaces.</p>\n<p>The configuration parser will throw an error if the configuration file contains\nunknown keys or keys that cannot be used in a namespace.</p>\n<p>Node.js will not sanitize or perform validation on the user-provided configuration,\nso <strong>NEVER</strong> use untrusted configuration files.</p>",
              "displayName": "`--experimental-config-file=path`, `--experimental-config-file`"
            },
            {
              "textRaw": "`--experimental-default-config-file`",
              "name": "`--experimental-default-config-file`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.10.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>This flag is an alias for <code>--experimental-config-file</code> without an argument.\nIf present, Node.js will look for a\n<code>node.config.json</code> file in the current working directory and load it as a\nconfiguration file.</p>",
              "displayName": "`--experimental-default-config-file`"
            },
            {
              "textRaw": "`--experimental-eventsource`",
              "name": "`--experimental-eventsource`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable exposition of <a href=\"https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events\">EventSource Web API</a> on the global scope.</p>",
              "displayName": "`--experimental-eventsource`"
            },
            {
              "textRaw": "`--experimental-ffi`",
              "name": "`--experimental-ffi`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Enable the experimental <a href=\"ffi.html\"><code>node:ffi</code></a> module.</p>\n<p>This flag is only available in builds with FFI support.</p>",
              "displayName": "`--experimental-ffi`"
            },
            {
              "textRaw": "`--experimental-import-meta-resolve`",
              "name": "`--experimental-import-meta-resolve`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.9.0",
                  "v12.16.2"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/49028",
                    "description": "synchronous import.meta.resolve made available by default, with the flag retained for enabling the experimental second argument as previously supported."
                  }
                ]
              },
              "desc": "<p>Enable experimental <code>import.meta.resolve()</code> parent URL support, which allows\npassing a second <code>parentURL</code> argument for contextual resolution.</p>\n<p>Previously gated the entire <code>import.meta.resolve</code> feature.</p>",
              "displayName": "`--experimental-import-meta-resolve`"
            },
            {
              "textRaw": "`--experimental-inspector-network-resource`",
              "name": "`--experimental-inspector-network-resource`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.5.0",
                  "v22.19.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "desc": "<p>Enable experimental support for inspector network resources.</p>",
              "displayName": "`--experimental-inspector-network-resource`"
            },
            {
              "textRaw": "`--experimental-loader=module`",
              "name": "`--experimental-loader=module`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.6.1",
                      "v22.13.1",
                      "v20.18.2"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/629",
                    "description": "Using this feature with the permission model enabled requires passing `--allow-worker`."
                  },
                  {
                    "version": "v12.11.1",
                    "pr-url": "https://github.com/nodejs/node/pull/29752",
                    "description": "This flag was renamed from `--loader` to `--experimental-loader`."
                  }
                ]
              },
              "desc": "<blockquote>\n<p>This flag is discouraged and may be removed in a future version of Node.js.\nPlease use\n<a href=\"module.html#registration-of-asynchronous-customization-hooks\"><code>--import</code> with <code>register()</code></a> instead.</p>\n</blockquote>\n<p>Specify the <code>module</code> containing exported <a href=\"module.html#asynchronous-customization-hooks\">asynchronous module customization hooks</a>.\n<code>module</code> may be any string accepted as an <a href=\"esm.html#import-specifiers\"><code>import</code> specifier</a>.</p>\n<p>This feature requires <code>--allow-worker</code> if used with the <a href=\"permissions.html#permission-model\">Permission Model</a>.</p>",
              "displayName": "`--experimental-loader=module`"
            },
            {
              "textRaw": "`--experimental-network-inspection`",
              "name": "`--experimental-network-inspection`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.6.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Enable experimental support for the network inspection with Chrome DevTools.</p>",
              "displayName": "`--experimental-network-inspection`"
            },
            {
              "textRaw": "`--experimental-print-required-tla`",
              "name": "`--experimental-print-required-tla`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.0.0",
                  "v20.17.0"
                ],
                "changes": []
              },
              "desc": "<p>If the ES module being <code>require()</code>'d contains top-level <code>await</code>, this flag\nallows Node.js to evaluate the module, try to locate the\ntop-level awaits, and print their location to help users find them.</p>",
              "displayName": "`--experimental-print-required-tla`"
            },
            {
              "textRaw": "`--experimental-quic`",
              "name": "`--experimental-quic`",
              "type": "module",
              "meta": {
                "added": [
                  "v25.0.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>Enable experimental support for the QUIC protocol.</p>",
              "displayName": "`--experimental-quic`"
            },
            {
              "textRaw": "`--experimental-sea-config`",
              "name": "`--experimental-sea-config`",
              "type": "module",
              "meta": {
                "added": [
                  "v20.0.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Use this flag to generate a blob that can be injected into the Node.js\nbinary to produce a <a href=\"single-executable-applications.html\">single executable application</a>. See the documentation\nabout <a href=\"single-executable-applications.html#1-generating-single-executable-preparation-blobs\">this configuration</a> for details.</p>",
              "displayName": "`--experimental-sea-config`"
            },
            {
              "textRaw": "`--experimental-shadow-realm`",
              "name": "`--experimental-shadow-realm`",
              "type": "module",
              "meta": {
                "added": [
                  "v19.0.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "desc": "<p>Use this flag to enable <a href=\"https://github.com/tc39/proposal-shadowrealm\">ShadowRealm</a> support.</p>",
              "displayName": "`--experimental-shadow-realm`"
            },
            {
              "textRaw": "`--experimental-storage-inspection`",
              "name": "`--experimental-storage-inspection`",
              "type": "module",
              "meta": {
                "added": [
                  "v25.5.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "desc": "<p>Enable experimental support for storage inspection</p>",
              "displayName": "`--experimental-storage-inspection`"
            },
            {
              "textRaw": "`--experimental-stream-iter`",
              "name": "`--experimental-stream-iter`",
              "type": "module",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Enable the experimental <a href=\"stream_iter.html\"><code>node:stream/iter</code></a> module.</p>",
              "displayName": "`--experimental-stream-iter`"
            },
            {
              "textRaw": "`--experimental-test-coverage`",
              "name": "`--experimental-test-coverage`",
              "type": "module",
              "meta": {
                "added": [
                  "v19.7.0",
                  "v18.15.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47686",
                    "description": "This option can be used with `--test`."
                  }
                ]
              },
              "desc": "<p>When used in conjunction with the <code>node:test</code> module, a code coverage report is\ngenerated as part of the test runner output. If no tests are run, a coverage\nreport is not generated. See the documentation on\n<a href=\"test.html#collecting-code-coverage\">collecting code coverage from tests</a> for more details.</p>",
              "displayName": "`--experimental-test-coverage`"
            },
            {
              "textRaw": "`--experimental-test-module-mocks`",
              "name": "`--experimental-test-module-mocks`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.18.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.6.1",
                      "v22.13.1",
                      "v20.18.2"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/629",
                    "description": "Using this feature with the permission model enabled requires passing `--allow-worker`."
                  }
                ]
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>Enable module mocking in the test runner.</p>\n<p>This feature requires <code>--allow-worker</code> if used with the <a href=\"permissions.html#permission-model\">Permission Model</a>.</p>",
              "displayName": "`--experimental-test-module-mocks`"
            },
            {
              "textRaw": "`--experimental-test-tag-filter=<tag>`",
              "name": "`--experimental-test-tag-filter=<tag>`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.2.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>Run only tests whose tag set contains <code>&#x3C;tag></code>. Tests declare tags via the\n<code>tags</code> option on <code>test()</code>, <code>it()</code>, <code>suite()</code>, or <code>describe()</code>; tags\ninherit from suites to nested tests by union. Filtering is\ncase-insensitive.</p>\n<p>The flag may be specified more than once; tests must contain <strong>every</strong>\nfilter value to run. See <a href=\"test.html#test-tags\">Test tags</a> for details on declaring and\ninheriting tags.</p>",
              "displayName": "`--experimental-test-tag-filter=<tag>`"
            },
            {
              "textRaw": "`--experimental-vm-modules`",
              "name": "`--experimental-vm-modules`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable experimental ES Module support in the <code>node:vm</code> module.</p>",
              "displayName": "`--experimental-vm-modules`"
            },
            {
              "textRaw": "`--experimental-wasi-unstable-preview1`",
              "name": "`--experimental-wasi-unstable-preview1`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.3.0",
                  "v12.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.0.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47286",
                    "description": "This option is no longer required as WASI is enabled by default, but can still be passed."
                  },
                  {
                    "version": "v13.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30980",
                    "description": "changed from `--experimental-wasi-unstable-preview0` to `--experimental-wasi-unstable-preview1`."
                  }
                ]
              },
              "desc": "<p>Enable experimental WebAssembly System Interface (WASI) support.</p>",
              "displayName": "`--experimental-wasi-unstable-preview1`"
            },
            {
              "textRaw": "`--experimental-worker-inspection`",
              "name": "`--experimental-worker-inspection`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.1.0",
                  "v22.17.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "desc": "<p>Enable experimental support for the worker inspection with Chrome DevTools.</p>",
              "displayName": "`--experimental-worker-inspection`"
            },
            {
              "textRaw": "`--expose-gc`",
              "name": "`--expose-gc`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental. This flag is inherited from V8 and is subject to change upstream.",
              "desc": "<p>This flag will expose the gc extension from V8.</p>\n<pre><code class=\"language-js\">if (globalThis.gc) {\n  globalThis.gc();\n}\n</code></pre>",
              "displayName": "`--expose-gc`"
            },
            {
              "textRaw": "`--force-context-aware`",
              "name": "`--force-context-aware`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "desc": "<p>Disable loading native addons that are not <a href=\"addons.html#context-aware-addons\">context-aware</a>.</p>",
              "displayName": "`--force-context-aware`"
            },
            {
              "textRaw": "`--force-fips`",
              "name": "`--force-fips`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Force FIPS-compliant crypto on startup. (Cannot be disabled from script code.)\n(Same requirements as <code>--enable-fips</code>.)</p>",
              "displayName": "`--force-fips`"
            },
            {
              "textRaw": "`--force-node-api-uncaught-exceptions-policy`",
              "name": "`--force-node-api-uncaught-exceptions-policy`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Enforces <code>uncaughtException</code> event on Node-API asynchronous callbacks.</p>\n<p>To prevent from an existing add-on from crashing the process, this flag is not\nenabled by default. In the future, this flag will be enabled by default to\nenforce the correct behavior.</p>",
              "displayName": "`--force-node-api-uncaught-exceptions-policy`"
            },
            {
              "textRaw": "`--frozen-intrinsics`",
              "name": "`--frozen-intrinsics`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Enable experimental frozen intrinsics like <code>Array</code> and <code>Object</code>.</p>\n<p>Only the root context is supported. There is no guarantee that\n<code>globalThis.Array</code> is indeed the default intrinsic reference. Code may break\nunder this flag.</p>\n<p>To allow polyfills to be added,\n<a href=\"#-r---require-module\"><code>--require</code></a> and <a href=\"#--importmodule\"><code>--import</code></a> both run before freezing intrinsics.</p>",
              "displayName": "`--frozen-intrinsics`"
            },
            {
              "textRaw": "`--heap-prof`",
              "name": "`--heap-prof`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53343",
                    "description": "The `--heap-prof` flags are now stable."
                  }
                ]
              },
              "desc": "<p>Starts the V8 heap profiler on start up, and writes the heap profile to disk\nbefore exit.</p>\n<p>If <code>--heap-prof-dir</code> is not specified, the generated profile is placed\nin the current working directory.</p>\n<p>If <code>--heap-prof-name</code> is not specified, the generated profile is\nnamed <code>Heap.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.heapprofile</code>.</p>\n<pre><code class=\"language-console\">$ node --heap-prof index.js\n$ ls *.heapprofile\nHeap.20190409.202950.15293.0.001.heapprofile\n</code></pre>",
              "displayName": "`--heap-prof`"
            },
            {
              "textRaw": "`--heap-prof-dir`",
              "name": "`--heap-prof-dir`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53343",
                    "description": "The `--heap-prof` flags are now stable."
                  }
                ]
              },
              "desc": "<p>Specify the directory where the heap profiles generated by <code>--heap-prof</code> will\nbe placed.</p>\n<p>The default value is controlled by the\n<a href=\"#--diagnostic-dirdirectory\"><code>--diagnostic-dir</code></a> command-line option.</p>",
              "displayName": "`--heap-prof-dir`"
            },
            {
              "textRaw": "`--heap-prof-interval`",
              "name": "`--heap-prof-interval`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53343",
                    "description": "The `--heap-prof` flags are now stable."
                  }
                ]
              },
              "desc": "<p>Specify the average sampling interval in bytes for the heap profiles generated\nby <code>--heap-prof</code>. The default is 512 * 1024 bytes.</p>",
              "displayName": "`--heap-prof-interval`"
            },
            {
              "textRaw": "`--heap-prof-name`",
              "name": "`--heap-prof-name`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53343",
                    "description": "The `--heap-prof` flags are now stable."
                  }
                ]
              },
              "desc": "<p>Specify the file name of the heap profile generated by <code>--heap-prof</code>.</p>",
              "displayName": "`--heap-prof-name`"
            },
            {
              "textRaw": "`--heapsnapshot-near-heap-limit=max_count`",
              "name": "`--heapsnapshot-near-heap-limit=max_count`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.1.0",
                  "v14.18.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.4.0",
                      "v24.13.1",
                      "v22.22.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60956",
                    "description": "The flag is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Writes a V8 heap snapshot to disk when the V8 heap usage is approaching the\nheap limit. <code>count</code> should be a non-negative integer (in which case\nNode.js will write no more than <code>max_count</code> snapshots to disk).</p>\n<p>When generating snapshots, garbage collection may be triggered and bring\nthe heap usage down. Therefore multiple snapshots may be written to disk\nbefore the Node.js instance finally runs out of memory. These heap snapshots\ncan be compared to determine what objects are being allocated during the\ntime consecutive snapshots are taken. It's not guaranteed that Node.js will\nwrite exactly <code>max_count</code> snapshots to disk, but it will try\nits best to generate at least one and up to <code>max_count</code> snapshots before the\nNode.js instance runs out of memory when <code>max_count</code> is greater than <code>0</code>.</p>\n<p>Generating V8 snapshots takes time and memory (both memory managed by the\nV8 heap and native memory outside the V8 heap). The bigger the heap is,\nthe more resources it needs. Node.js will adjust the V8 heap to accommodate\nthe additional V8 heap memory overhead, and try its best to avoid using up\nall the memory available to the process. When the process uses\nmore memory than the system deems appropriate, the process may be terminated\nabruptly by the system, depending on the system configuration.</p>\n<pre><code class=\"language-console\">$ node --max-old-space-size=100 --heapsnapshot-near-heap-limit=3 index.js\nWrote snapshot to Heap.20200430.100036.49580.0.001.heapsnapshot\nWrote snapshot to Heap.20200430.100037.49580.0.002.heapsnapshot\nWrote snapshot to Heap.20200430.100038.49580.0.003.heapsnapshot\n\n&#x3C;--- Last few GCs --->\n\n[49580:0x110000000]     4826 ms: Mark-sweep 130.6 (147.8) -> 130.5 (147.8) MB, 27.4 / 0.0 ms  (average mu = 0.126, current mu = 0.034) allocation failure scavenge might not succeed\n[49580:0x110000000]     4845 ms: Mark-sweep 130.6 (147.8) -> 130.6 (147.8) MB, 18.8 / 0.0 ms  (average mu = 0.088, current mu = 0.031) allocation failure scavenge might not succeed\n\n\n&#x3C;--- JS stacktrace --->\n\nFATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory\n....\n</code></pre>",
              "displayName": "`--heapsnapshot-near-heap-limit=max_count`"
            },
            {
              "textRaw": "`--heapsnapshot-signal=signal`",
              "name": "`--heapsnapshot-signal=signal`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Enables a signal handler that causes the Node.js process to write a heap dump\nwhen the specified signal is received. <code>signal</code> must be a valid signal name.\nDisabled by default.</p>\n<pre><code class=\"language-console\">$ node --heapsnapshot-signal=SIGUSR2 index.js &#x26;\n$ ps aux\nUSER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\nnode         1  5.5  6.1 787252 247004 ?       Ssl  16:43   0:02 node --heapsnapshot-signal=SIGUSR2 index.js\n$ kill -USR2 1\n$ ls\nHeap.20190718.133405.15554.0.001.heapsnapshot\n</code></pre>",
              "displayName": "`--heapsnapshot-signal=signal`"
            },
            {
              "textRaw": "`-h`, `--help`",
              "name": "`-h`,_`--help`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.1.3"
                ],
                "changes": []
              },
              "desc": "<p>Print node command-line options.\nThe output of this option is less detailed than this document.</p>",
              "displayName": "`-h`, `--help`"
            },
            {
              "textRaw": "`--icu-data-dir=file`",
              "name": "`--icu-data-dir=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": []
              },
              "desc": "<p>Specify ICU data load path. (Overrides <code>NODE_ICU_DATA</code>.)</p>",
              "displayName": "`--icu-data-dir=file`"
            },
            {
              "textRaw": "`--import=module`",
              "name": "`--import=module`",
              "type": "module",
              "meta": {
                "added": [
                  "v19.0.0",
                  "v18.18.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Preload the specified module at startup. If the flag is provided several times,\neach module will be executed sequentially in the order they appear, starting\nwith the ones provided in <a href=\"#node_optionsoptions\"><code>NODE_OPTIONS</code></a>.</p>\n<p>Follows <a href=\"esm.html#modules-ecmascript-modules\">ECMAScript module</a> resolution rules.\nUse <a href=\"#-r---require-module\"><code>--require</code></a> to load a <a href=\"modules.html\">CommonJS module</a>.\nModules preloaded with <code>--require</code> will run before modules preloaded with <code>--import</code>.</p>\n<p>Modules are preloaded into the main thread as well as any worker threads,\nforked processes, or clustered processes.</p>",
              "displayName": "`--import=module`"
            },
            {
              "textRaw": "`--input-type=type`",
              "name": "`--input-type=type`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.6.0",
                      "v22.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56350",
                    "description": "Add support for `-typescript` values."
                  },
                  {
                    "version": [
                      "v22.7.0",
                      "v20.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53619",
                    "description": "ESM syntax detection is enabled by default."
                  }
                ]
              },
              "desc": "<p>This configures Node.js to interpret <code>--eval</code> or <code>STDIN</code> input as CommonJS or\nas an ES module. Valid values are <code>\"commonjs\"</code>, <code>\"module\"</code>, <code>\"module-typescript\"</code> and <code>\"commonjs-typescript\"</code>.\nThe <code>\"-typescript\"</code> values are not available with the flag <code>--no-strip-types</code>.\nThe default is no value, or <code>\"commonjs\"</code> if <code>--no-experimental-detect-module</code> is passed.</p>\n<p>If <code>--input-type</code> is not provided,\nNode.js will try to detect the syntax with the following steps:</p>\n<ol>\n<li>Run the input as CommonJS.</li>\n<li>If step 1 fails, run the input as an ES module.</li>\n<li>If step 2 fails with a SyntaxError, strip the types.</li>\n<li>If step 3 fails with an error code <a href=\"errors.html#err_unsupported_typescript_syntax\"><code>ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX</code></a>\nor <a href=\"errors.html#err_invalid_typescript_syntax\"><code>ERR_INVALID_TYPESCRIPT_SYNTAX</code></a>,\nthrow the error from step 2, including the TypeScript error in the message,\nelse run as CommonJS.</li>\n<li>If step 4 fails, run the input as an ES module.</li>\n</ol>\n<p>To avoid the delay of multiple syntax detection passes, the <code>--input-type=type</code> flag can be used to specify\nhow the <code>--eval</code> input should be interpreted.</p>\n<p>The REPL does not support this option. Usage of <code>--input-type=module</code> with\n<a href=\"#-p---print-script\"><code>--print</code></a> will throw an error, as <code>--print</code> does not support ES module\nsyntax.</p>",
              "displayName": "`--input-type=type`"
            },
            {
              "textRaw": "`--insecure-http-parser`",
              "name": "`--insecure-http-parser`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.4.0",
                  "v12.15.0",
                  "v10.19.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable leniency flags on the HTTP parser. This may allow\ninteroperability with non-conformant HTTP implementations.</p>\n<p>When enabled, the parser will accept the following:</p>\n<ul>\n<li>Invalid HTTP headers values.</li>\n<li>Invalid HTTP versions.</li>\n<li>Allow message containing both <code>Transfer-Encoding</code>\nand <code>Content-Length</code> headers.</li>\n<li>Allow extra data after message when <code>Connection: close</code> is present.</li>\n<li>Allow extra transfer encodings after <code>chunked</code> has been provided.</li>\n<li>Allow <code>\\n</code> to be used as token separator instead of <code>\\r\\n</code>.</li>\n<li>Allow <code>\\r\\n</code> not to be provided after a chunk.</li>\n<li>Allow spaces to be present after a chunk size and before <code>\\r\\n</code>.</li>\n</ul>\n<p>All the above will expose your application to request smuggling\nor poisoning attack. Avoid using this option.</p>",
              "displayName": "`--insecure-http-parser`"
            },
            {
              "textRaw": "`--inspect-brk[=[host:]port]`",
              "name": "`--inspect-brk[=[host:]port]`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Activate inspector on <code>host:port</code> and break at start of user script.\nDefault <code>host:port</code> is <code>127.0.0.1:9229</code>. If port <code>0</code> is specified,\na random available port will be used.</p>\n<p>See <a href=\"debugger.html#v8-inspector-integration-for-nodejs\">V8 Inspector integration for Node.js</a> for further explanation on Node.js debugger.</p>\n<p>See the <a href=\"#warning-binding-inspector-to-a-public-ipport-combination-is-insecure\">security warning</a> below regarding the <code>host</code>\nparameter usage.</p>",
              "displayName": "`--inspect-brk[=[host:]port]`"
            },
            {
              "textRaw": "`--inspect-port=[host:]port`",
              "name": "`--inspect-port=[host:]port`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Set the <code>host:port</code> to be used when the inspector is activated.\nUseful when activating the inspector by sending the <code>SIGUSR1</code> signal.\nExcept when <a href=\"#--disable-sigusr1\"><code>--disable-sigusr1</code></a> is passed.</p>\n<p>Default host is <code>127.0.0.1</code>. If port <code>0</code> is specified,\na random available port will be used.</p>\n<p>See the <a href=\"#warning-binding-inspector-to-a-public-ipport-combination-is-insecure\">security warning</a> below regarding the <code>host</code>\nparameter usage.</p>",
              "displayName": "`--inspect-port=[host:]port`"
            },
            {
              "textRaw": "`--inspect-publish-uid=stderr,http`",
              "name": "`--inspect-publish-uid=stderr,http`",
              "type": "module",
              "desc": "<p>Specify ways of the inspector web socket url exposure.</p>\n<p>By default inspector websocket url is available in stderr and under <code>/json/list</code>\nendpoint on <code>http://host:port/json/list</code>.</p>",
              "displayName": "`--inspect-publish-uid=stderr,http`"
            },
            {
              "textRaw": "`--inspect-wait[=[host:]port]`",
              "name": "`--inspect-wait[=[host:]port]`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.2.0",
                  "v20.15.0"
                ],
                "changes": []
              },
              "desc": "<p>Activate inspector on <code>host:port</code> and wait for debugger to be attached.\nDefault <code>host:port</code> is <code>127.0.0.1:9229</code>. If port <code>0</code> is specified,\na random available port will be used.</p>\n<p>See <a href=\"debugger.html#v8-inspector-integration-for-nodejs\">V8 Inspector integration for Node.js</a> for further explanation on Node.js debugger.</p>\n<p>See the <a href=\"#warning-binding-inspector-to-a-public-ipport-combination-is-insecure\">security warning</a> below regarding the <code>host</code>\nparameter usage.</p>",
              "displayName": "`--inspect-wait[=[host:]port]`"
            },
            {
              "textRaw": "`--inspect[=[host:]port]`",
              "name": "`--inspect[=[host:]port]`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.3.0"
                ],
                "changes": []
              },
              "desc": "<p>Activate inspector on <code>host:port</code>. Default is <code>127.0.0.1:9229</code>. If port <code>0</code> is\nspecified, a random available port will be used.</p>\n<p>V8 inspector integration allows tools such as Chrome DevTools and IDEs to debug\nand profile Node.js instances. The tools attach to Node.js instances via a\ntcp port and communicate using the <a href=\"https://chromedevtools.github.io/devtools-protocol/\">Chrome DevTools Protocol</a>.\nSee <a href=\"debugger.html#v8-inspector-integration-for-nodejs\">V8 Inspector integration for Node.js</a> for further explanation on Node.js debugger.</p>\n<p><a id=\"inspector_security\"></a></p>",
              "modules": [
                {
                  "textRaw": "Warning: binding inspector to a public IP:port combination is insecure",
                  "name": "warning:_binding_inspector_to_a_public_ip:port_combination_is_insecure",
                  "type": "module",
                  "desc": "<p>Binding the inspector to a public IP (including <code>0.0.0.0</code>) with an open port is\ninsecure, as it allows external hosts to connect to the inspector and perform\na <a href=\"https://www.owasp.org/index.php/Code_Injection\">remote code execution</a> attack.</p>\n<p>If specifying a host, make sure that either:</p>\n<ul>\n<li>The host is not accessible from public networks.</li>\n<li>A firewall disallows unwanted connections on the port.</li>\n</ul>\n<p><strong>More specifically, <code>--inspect=0.0.0.0</code> is insecure if the port (<code>9229</code> by\ndefault) is not firewall-protected.</strong></p>\n<p>See the <a href=\"https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications\">debugging security implications</a> section for more information.</p>",
                  "displayName": "Warning: binding inspector to a public IP:port combination is insecure"
                }
              ],
              "displayName": "`--inspect[=[host:]port]`"
            },
            {
              "textRaw": "`-i`, `--interactive`",
              "name": "`-i`,_`--interactive`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "desc": "<p>Opens the REPL even if stdin does not appear to be a terminal.</p>",
              "displayName": "`-i`, `--interactive`"
            },
            {
              "textRaw": "`--jitless`",
              "name": "`--jitless`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental. This flag is inherited from V8 and is subject to change upstream.",
              "desc": "<p>Disable <a href=\"https://v8.dev/blog/jitless\">runtime allocation of executable memory</a>. This may be\nrequired on some platforms for security reasons. It can also reduce attack\nsurface on other platforms, but the performance impact may be severe.</p>",
              "displayName": "`--jitless`"
            },
            {
              "textRaw": "`--localstorage-file=file`",
              "name": "`--localstorage-file=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.4.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate.",
              "desc": "<p>The file used to store <code>localStorage</code> data. If the file does not exist, it is\ncreated the first time <code>localStorage</code> is accessed. The same file may be shared\nbetween multiple Node.js processes concurrently.</p>",
              "displayName": "`--localstorage-file=file`"
            },
            {
              "textRaw": "`--max-http-header-size=size`",
              "name": "`--max-http-header-size=size`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.6.0",
                  "v10.15.0"
                ],
                "changes": [
                  {
                    "version": "v13.13.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32520",
                    "description": "Change maximum default size of HTTP headers from 8 KiB to 16 KiB."
                  }
                ]
              },
              "desc": "<p>Specify the maximum size, in bytes, of HTTP headers. Defaults to 16 KiB.</p>",
              "displayName": "`--max-http-header-size=size`"
            },
            {
              "textRaw": "`--max-old-space-size-percentage=percentage`",
              "name": "`--max-old-space-size-percentage=percentage`",
              "type": "module",
              "desc": "<p>Sets the maximum memory size of V8's old memory section as a percentage of available system memory.\nThis flag takes precedence over <code>--max-old-space-size</code> when both are specified.</p>\n<p>The <code>percentage</code> parameter must be a number greater than 0 and up to 100, representing the percentage\nof available system memory to allocate to the V8 heap.</p>\n<p><strong>Note:</strong> This flag utilizes <code>--max-old-space-size</code>, which may be unreliable on 32-bit platforms due to\ninteger overflow issues.</p>\n<pre><code class=\"language-bash\"># Using 50% of available system memory\nnode --max-old-space-size-percentage=50 index.js\n\n# Using 75% of available system memory\nnode --max-old-space-size-percentage=75 index.js\n</code></pre>",
              "displayName": "`--max-old-space-size-percentage=percentage`"
            },
            {
              "textRaw": "`--napi-modules`",
              "name": "`--napi-modules`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.10.0"
                ],
                "changes": []
              },
              "desc": "<p>This option is a no-op. It is kept for compatibility.</p>",
              "displayName": "`--napi-modules`"
            },
            {
              "textRaw": "`--network-family-autoselection-attempt-timeout`",
              "name": "`--network-family-autoselection-attempt-timeout`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.1.0",
                  "v20.13.0"
                ],
                "changes": []
              },
              "desc": "<p>Sets the default value for the network family autoselection attempt timeout.\nFor more information, see <a href=\"net.html#netgetdefaultautoselectfamilyattempttimeout\"><code>net.getDefaultAutoSelectFamilyAttemptTimeout()</code></a>.</p>",
              "displayName": "`--network-family-autoselection-attempt-timeout`"
            },
            {
              "textRaw": "`--no-addons`",
              "name": "`--no-addons`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.10.0",
                  "v14.19.0"
                ],
                "changes": []
              },
              "desc": "<p>Disable the <code>node-addons</code> exports condition as well as disable loading\nnative addons. When <code>--no-addons</code> is specified, calling <code>process.dlopen</code> or\nrequiring a native C++ addon will fail and throw an exception.</p>",
              "displayName": "`--no-addons`"
            },
            {
              "textRaw": "`--no-async-context-frame`",
              "name": "`--no-async-context-frame`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Disables the use of <a href=\"async_context.html#class-asynclocalstorage\"><code>AsyncLocalStorage</code></a> backed by <code>AsyncContextFrame</code> and\nuses the prior implementation which relied on async_hooks. The previous model\nis retained for compatibility with Electron and for cases where the context\nflow may differ. However, if a difference in flow is found please report it.</p>",
              "displayName": "`--no-async-context-frame`"
            },
            {
              "textRaw": "`--no-deprecation`",
              "name": "`--no-deprecation`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Silence deprecation warnings.</p>",
              "displayName": "`--no-deprecation`"
            },
            {
              "textRaw": "`--no-experimental-detect-module`",
              "name": "`--no-experimental-detect-module`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.1.0",
                  "v20.10.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.7.0",
                      "v20.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53619",
                    "description": "Syntax detection is enabled by default."
                  }
                ]
              },
              "desc": "<p>Disable using <a href=\"packages.html#syntax-detection\">syntax detection</a> to determine module type.</p>",
              "displayName": "`--no-experimental-detect-module`"
            },
            {
              "textRaw": "`--no-experimental-global-navigator`",
              "name": "`--no-experimental-global-navigator`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.2.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Disable exposition of <a href=\"globals.html#navigator\">Navigator API</a> on the global scope.</p>",
              "displayName": "`--no-experimental-global-navigator`"
            },
            {
              "textRaw": "`--no-experimental-repl-await`",
              "name": "`--no-experimental-repl-await`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Use this flag to disable top-level await in REPL.</p>",
              "displayName": "`--no-experimental-repl-await`"
            },
            {
              "textRaw": "`--no-experimental-require-module`",
              "name": "`--no-experimental-require-module`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.0.0",
                  "v20.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.4.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60959",
                    "description": "The flag was renamed from `--no-experimental-require-module` to `--no-require-module`, with the former marked as legacy."
                  },
                  {
                    "version": [
                      "v23.0.0",
                      "v22.12.0",
                      "v20.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55085",
                    "description": "This is now false by default."
                  }
                ]
              },
              "stability": 3,
              "stabilityText": "Legacy: Use `--no-require-module` instead.",
              "desc": "<p>Legacy alias for <a href=\"#--no-require-module\"><code>--no-require-module</code></a>.</p>",
              "displayName": "`--no-experimental-require-module`"
            },
            {
              "textRaw": "`--no-experimental-sqlite`",
              "name": "`--no-experimental-sqlite`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.4.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55890",
                    "description": "SQLite is unflagged but still experimental."
                  }
                ]
              },
              "desc": "<p>Disable the experimental <a href=\"sqlite.html\"><code>node:sqlite</code></a> module.</p>",
              "displayName": "`--no-experimental-sqlite`"
            },
            {
              "textRaw": "`--no-experimental-websocket`",
              "name": "`--no-experimental-websocket`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Disable exposition of <a href=\"https://developer.mozilla.org/docs/Web/API/WebSocket\"><code>&#x3C;WebSocket></code></a> on the global scope.</p>",
              "displayName": "`--no-experimental-websocket`"
            },
            {
              "textRaw": "`--no-experimental-webstorage`",
              "name": "`--no-experimental-webstorage`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.4.0"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57666",
                    "description": "The feature is now enabled by default."
                  }
                ]
              },
              "stability": 1.2,
              "stabilityText": "Release candidate.",
              "desc": "<p>Disable <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API\"><code>Web Storage</code></a> support.</p>",
              "displayName": "`--no-experimental-webstorage`"
            },
            {
              "textRaw": "`--no-extra-info-on-fatal-exception`",
              "name": "`--no-extra-info-on-fatal-exception`",
              "type": "module",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Hide extra information on fatal exception that causes exit.</p>",
              "displayName": "`--no-extra-info-on-fatal-exception`"
            },
            {
              "textRaw": "`--no-force-async-hooks-checks`",
              "name": "`--no-force-async-hooks-checks`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Disables runtime checks for <code>async_hooks</code>. These will still be enabled\ndynamically when <code>async_hooks</code> is enabled.</p>",
              "displayName": "`--no-force-async-hooks-checks`"
            },
            {
              "textRaw": "`--no-global-search-paths`",
              "name": "`--no-global-search-paths`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.10.0"
                ],
                "changes": []
              },
              "desc": "<p>Do not search modules from global paths like <code>$HOME/.node_modules</code> and\n<code>$NODE_PATH</code>.</p>",
              "displayName": "`--no-global-search-paths`"
            },
            {
              "textRaw": "`--no-network-family-autoselection`",
              "name": "`--no-network-family-autoselection`",
              "type": "module",
              "meta": {
                "added": [
                  "v19.4.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46790",
                    "description": "The flag was renamed from `--no-enable-network-family-autoselection` to `--no-network-family-autoselection`. The old name can still work as an alias."
                  }
                ]
              },
              "desc": "<p>Disables the family autoselection algorithm unless connection options explicitly\nenables it.</p>\n<p><a id=\"--experimental-require-module\"></a></p>",
              "displayName": "`--no-network-family-autoselection`"
            },
            {
              "textRaw": "`--no-require-module`",
              "name": "`--no-require-module`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.0.0",
                  "v20.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.4.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60959",
                    "description": "This flag is no longer experimental."
                  },
                  {
                    "version": [
                      "v25.4.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60959",
                    "description": "This flag was renamed from `--no-experimental-require-module` to `--no-require-module`."
                  },
                  {
                    "version": [
                      "v23.0.0",
                      "v22.12.0",
                      "v20.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55085",
                    "description": "This is now false by default."
                  }
                ]
              },
              "desc": "<p>Disable support for loading a synchronous ES module graph in <code>require()</code>.</p>\n<p>See <a href=\"modules.html#loading-ecmascript-modules-using-require\">Loading ECMAScript modules using <code>require()</code></a>.</p>",
              "displayName": "`--no-require-module`"
            },
            {
              "textRaw": "`--no-strip-types`",
              "name": "`--no-strip-types`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.2.0",
                      "v24.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60600",
                    "description": "Type stripping is now stable, the flag was renamed from `--no-experimental-strip-types` to `--no-strip-types`."
                  },
                  {
                    "version": [
                      "v23.6.0",
                      "v22.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56350",
                    "description": "Type stripping is enabled by default."
                  }
                ]
              },
              "desc": "<p>Disable type-stripping for TypeScript files.\nFor more information, see the <a href=\"typescript.html#type-stripping\">TypeScript type-stripping</a> documentation.</p>",
              "displayName": "`--no-strip-types`"
            },
            {
              "textRaw": "`--no-warnings`",
              "name": "`--no-warnings`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Silence all process warnings (including deprecations).</p>",
              "displayName": "`--no-warnings`"
            },
            {
              "textRaw": "`--node-memory-debug`",
              "name": "`--node-memory-debug`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable extra debug checks for memory leaks in Node.js internals. This is\nusually only useful for developers debugging Node.js itself.</p>",
              "displayName": "`--node-memory-debug`"
            },
            {
              "textRaw": "`--openssl-config=file`",
              "name": "`--openssl-config=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Load an OpenSSL configuration file on startup. Among other uses, this can be\nused to enable FIPS-compliant crypto if Node.js is built\nagainst FIPS-enabled OpenSSL.</p>",
              "displayName": "`--openssl-config=file`"
            },
            {
              "textRaw": "`--openssl-legacy-provider`",
              "name": "`--openssl-legacy-provider`",
              "type": "module",
              "meta": {
                "added": [
                  "v17.0.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable OpenSSL 3.0 legacy provider. For more information please see\n<a href=\"https://www.openssl.org/docs/man3.0/man7/OSSL_PROVIDER-legacy.html\">OSSL_PROVIDER-legacy</a>.</p>",
              "displayName": "`--openssl-legacy-provider`"
            },
            {
              "textRaw": "`--openssl-shared-config`",
              "name": "`--openssl-shared-config`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.5.0",
                  "v16.17.0",
                  "v14.21.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable OpenSSL default configuration section, <code>openssl_conf</code> to be read from\nthe OpenSSL configuration file. The default configuration file is named\n<code>openssl.cnf</code> but this can be changed using the environment variable\n<code>OPENSSL_CONF</code>, or by using the command line option <code>--openssl-config</code>.\nThe location of the default OpenSSL configuration file depends on how OpenSSL\nis being linked to Node.js. Sharing the OpenSSL configuration may have unwanted\nimplications and it is recommended to use a configuration section specific to\nNode.js which is <code>nodejs_conf</code> and is default when this option is not used.</p>",
              "displayName": "`--openssl-shared-config`"
            },
            {
              "textRaw": "`--pending-deprecation`",
              "name": "`--pending-deprecation`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Emit pending deprecation warnings.</p>\n<p>Pending deprecations are generally identical to a runtime deprecation with the\nnotable exception that they are turned <em>off</em> by default and will not be emitted\nunless either the <code>--pending-deprecation</code> command-line flag, or the\n<code>NODE_PENDING_DEPRECATION=1</code> environment variable, is set. Pending deprecations\nare used to provide a kind of selective \"early warning\" mechanism that\ndevelopers may leverage to detect deprecated API usage.</p>",
              "displayName": "`--pending-deprecation`"
            },
            {
              "textRaw": "`--permission`",
              "name": "`--permission`",
              "type": "module",
              "meta": {
                "added": [
                  "v20.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.5.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56201",
                    "description": "Permission Model is now stable."
                  }
                ]
              },
              "desc": "<p>Enable the Permission Model for current process. When enabled, the\nfollowing permissions are restricted:</p>\n<ul>\n<li>File System - manageable through\n<a href=\"#--allow-fs-read\"><code>--allow-fs-read</code></a>, <a href=\"#--allow-fs-write\"><code>--allow-fs-write</code></a> flags</li>\n<li>Network - manageable through <a href=\"#--allow-net\"><code>--allow-net</code></a> flag</li>\n<li>Child Process - manageable through <a href=\"#--allow-child-process\"><code>--allow-child-process</code></a> flag</li>\n<li>Worker Threads - manageable through <a href=\"#--allow-worker\"><code>--allow-worker</code></a> flag</li>\n<li>WASI - manageable through <a href=\"#--allow-wasi\"><code>--allow-wasi</code></a> flag</li>\n<li>Addons - manageable through <a href=\"#--allow-addons\"><code>--allow-addons</code></a> flag</li>\n<li>FFI - manageable through <a href=\"#--allow-ffi\"><code>--allow-ffi</code></a> flag</li>\n</ul>",
              "displayName": "`--permission`"
            },
            {
              "textRaw": "`--permission-audit`",
              "name": "`--permission-audit`",
              "type": "module",
              "meta": {
                "added": [
                  "v25.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Enable audit only for the permission model. When enabled, permission checks\nare performed but access is not denied. Instead, a warning is emitted for\neach permission violation via diagnostics channel.</p>",
              "displayName": "`--permission-audit`"
            },
            {
              "textRaw": "`--preserve-symlinks`",
              "name": "`--preserve-symlinks`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.3.0"
                ],
                "changes": []
              },
              "desc": "<p>Instructs the module loader to preserve symbolic links when resolving and\ncaching modules.</p>\n<p>By default, when Node.js loads a module from a path that is symbolically linked\nto a different on-disk location, Node.js will dereference the link and use the\nactual on-disk \"real path\" of the module as both an identifier and as a root\npath to locate other dependency modules. In most cases, this default behavior\nis acceptable. However, when using symbolically linked peer dependencies, as\nillustrated in the example below, the default behavior causes an exception to\nbe thrown if <code>moduleA</code> attempts to require <code>moduleB</code> as a peer dependency:</p>\n<pre><code class=\"language-text\">{appDir}\n ├── app\n │   ├── index.js\n │   └── node_modules\n │       ├── moduleA -> {appDir}/moduleA\n │       └── moduleB\n │           ├── index.js\n │           └── package.json\n └── moduleA\n     ├── index.js\n     └── package.json\n</code></pre>\n<p>The <code>--preserve-symlinks</code> command-line flag instructs Node.js to use the\nsymlink path for modules as opposed to the real path, allowing symbolically\nlinked peer dependencies to be found.</p>\n<p>Note, however, that using <code>--preserve-symlinks</code> can have other side effects.\nSpecifically, symbolically linked <em>native</em> modules can fail to load if those\nare linked from more than one location in the dependency tree (Node.js would\nsee those as two separate modules and would attempt to load the module multiple\ntimes, causing an exception to be thrown).</p>\n<p>The <code>--preserve-symlinks</code> flag does not apply to the main module, which allows\n<code>node --preserve-symlinks node_module/.bin/&#x3C;foo></code> to work. To apply the same\nbehavior for the main module, also use <code>--preserve-symlinks-main</code>.</p>",
              "displayName": "`--preserve-symlinks`"
            },
            {
              "textRaw": "`--preserve-symlinks-main`",
              "name": "`--preserve-symlinks-main`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.2.0"
                ],
                "changes": []
              },
              "desc": "<p>Instructs the module loader to preserve symbolic links when resolving and\ncaching the main module (<code>require.main</code>).</p>\n<p>This flag exists so that the main module can be opted-in to the same behavior\nthat <code>--preserve-symlinks</code> gives to all other imports; they are separate flags,\nhowever, for backward compatibility with older Node.js versions.</p>\n<p><code>--preserve-symlinks-main</code> does not imply <code>--preserve-symlinks</code>; use\n<code>--preserve-symlinks-main</code> in addition to\n<code>--preserve-symlinks</code> when it is not desirable to follow symlinks before\nresolving relative paths.</p>\n<p>See <a href=\"#--preserve-symlinks\"><code>--preserve-symlinks</code></a> for more information.</p>",
              "displayName": "`--preserve-symlinks-main`"
            },
            {
              "textRaw": "`-p`, `--print \"script\"`",
              "name": "`-p`,_`--print_\"script\"`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.6.4"
                ],
                "changes": [
                  {
                    "version": "v5.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5348",
                    "description": "Built-in libraries are now available as predefined variables."
                  }
                ]
              },
              "desc": "<p>Identical to <code>-e</code> but prints the result.</p>",
              "displayName": "`-p`, `--print \"script\"`"
            },
            {
              "textRaw": "`--prof`",
              "name": "`--prof`",
              "type": "module",
              "meta": {
                "added": [
                  "v2.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Generate V8 profiler output.</p>",
              "displayName": "`--prof`"
            },
            {
              "textRaw": "`--prof-process`",
              "name": "`--prof-process`",
              "type": "module",
              "meta": {
                "added": [
                  "v5.2.0"
                ],
                "changes": []
              },
              "desc": "<p>Process V8 profiler output generated using the V8 option <code>--prof</code>.</p>",
              "displayName": "`--prof-process`"
            },
            {
              "textRaw": "`--redirect-warnings=file`",
              "name": "`--redirect-warnings=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Write process warnings to the given file instead of printing to stderr. The\nfile will be created if it does not exist, and will be appended to if it does.\nIf an error occurs while attempting to write the warning to the file, the\nwarning will be written to stderr instead.</p>\n<p>The <code>file</code> name may be an absolute path. If it is not, the default directory it\nwill be written to is controlled by the\n<a href=\"#--diagnostic-dirdirectory\"><code>--diagnostic-dir</code></a> command-line option.</p>",
              "displayName": "`--redirect-warnings=file`"
            },
            {
              "textRaw": "`--report-compact`",
              "name": "`--report-compact`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.12.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Write reports in a compact format, single-line JSON, more easily consumable\nby log processing systems than the default multi-line format designed for\nhuman consumption.</p>",
              "displayName": "`--report-compact`"
            },
            {
              "textRaw": "`--report-dir=directory`, `--report-directory=directory`",
              "name": "`--report-dir=directory`,_`--report-directory=directory`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer experimental."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27312",
                    "description": "Changed from `--diagnostic-report-directory` to `--report-directory`."
                  }
                ]
              },
              "desc": "<p>Location at which the report will be generated.</p>",
              "displayName": "`--report-dir=directory`, `--report-directory=directory`"
            },
            {
              "textRaw": "`--report-exclude-env`",
              "name": "`--report-exclude-env`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.3.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "desc": "<p>When <code>--report-exclude-env</code> is passed the diagnostic report generated will not\ncontain the <code>environmentVariables</code> data.</p>",
              "displayName": "`--report-exclude-env`"
            },
            {
              "textRaw": "`--report-exclude-network`",
              "name": "`--report-exclude-network`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.0.0",
                  "v20.13.0"
                ],
                "changes": []
              },
              "desc": "<p>Exclude <code>header.networkInterfaces</code> from the diagnostic report. By default\nthis is not set and the network interfaces are included.</p>",
              "displayName": "`--report-exclude-network`"
            },
            {
              "textRaw": "`--report-filename=filename`",
              "name": "`--report-filename=filename`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer experimental."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27312",
                    "description": "changed from `--diagnostic-report-filename` to `--report-filename`."
                  }
                ]
              },
              "desc": "<p>Name of the file to which the report will be written.</p>\n<p>If the filename is set to <code>'stdout'</code> or <code>'stderr'</code>, the report is written to\nthe stdout or stderr of the process respectively.</p>",
              "displayName": "`--report-filename=filename`"
            },
            {
              "textRaw": "`--report-on-fatalerror`",
              "name": "`--report-on-fatalerror`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.0.0",
                      "v13.14.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32496",
                    "description": "This option is no longer experimental."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27312",
                    "description": "changed from `--diagnostic-report-on-fatalerror` to `--report-on-fatalerror`."
                  }
                ]
              },
              "desc": "<p>Enables the report to be triggered on fatal errors (internal errors within\nthe Node.js runtime such as out of memory) that lead to termination of the\napplication. Useful to inspect various diagnostic data elements such as heap,\nstack, event loop state, resource consumption etc. to reason about the fatal\nerror.</p>",
              "displayName": "`--report-on-fatalerror`"
            },
            {
              "textRaw": "`--report-on-signal`",
              "name": "`--report-on-signal`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer experimental."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27312",
                    "description": "changed from `--diagnostic-report-on-signal` to `--report-on-signal`."
                  }
                ]
              },
              "desc": "<p>Enables report to be generated upon receiving the specified (or predefined)\nsignal to the running Node.js process. The signal to trigger the report is\nspecified through <code>--report-signal</code>.</p>",
              "displayName": "`--report-on-signal`"
            },
            {
              "textRaw": "`--report-signal=signal`",
              "name": "`--report-signal=signal`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer experimental."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27312",
                    "description": "changed from `--diagnostic-report-signal` to `--report-signal`."
                  }
                ]
              },
              "desc": "<p>Sets or resets the signal for report generation (not supported on Windows).\nDefault signal is <code>SIGUSR2</code>.</p>",
              "displayName": "`--report-signal=signal`"
            },
            {
              "textRaw": "`--report-uncaught-exception`",
              "name": "`--report-uncaught-exception`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44208",
                    "description": "Report is not generated if the uncaught exception is handled."
                  },
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This option is no longer experimental."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27312",
                    "description": "changed from `--diagnostic-report-uncaught-exception` to `--report-uncaught-exception`."
                  }
                ]
              },
              "desc": "<p>Enables report to be generated when the process exits due to an uncaught\nexception. Useful when inspecting the JavaScript stack in conjunction with\nnative stack and other runtime environment data.</p>",
              "displayName": "`--report-uncaught-exception`"
            },
            {
              "textRaw": "`-r`, `--require module`",
              "name": "`-r`,_`--require_module`",
              "type": "module",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.0.0",
                      "v22.12.0",
                      "v20.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/51977",
                    "description": "This option also supports ECMAScript module."
                  }
                ]
              },
              "desc": "<p>Preload the specified module at startup.</p>\n<p>Follows <code>require()</code>'s module resolution\nrules. <code>module</code> may be either a path to a file, or a node module name.</p>\n<p>Modules preloaded with <code>--require</code> will run before modules preloaded with <code>--import</code>.</p>\n<p>Modules are preloaded into the main thread as well as any worker threads,\nforked processes, or clustered processes.</p>",
              "displayName": "`-r`, `--require module`"
            },
            {
              "textRaw": "`--run`",
              "name": "`--run`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.0.0"
                ],
                "changes": [
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53032",
                    "description": "NODE_RUN_SCRIPT_NAME environment variable is added."
                  },
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53058",
                    "description": "NODE_RUN_PACKAGE_JSON_PATH environment variable is added."
                  },
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53154",
                    "description": "Traverses up to the root directory and finds a `package.json` file to run the command from, and updates `PATH` environment variable accordingly."
                  }
                ]
              },
              "desc": "<p>This runs a specified command from a package.json's <code>\"scripts\"</code> object.\nIf a missing <code>\"command\"</code> is provided, it will list the available scripts.</p>\n<p><code>--run</code> will traverse up to the root directory and finds a <code>package.json</code>\nfile to run the command from.</p>\n<p><code>--run</code> prepends <code>./node_modules/.bin</code> for each ancestor of\nthe current directory, to the <code>PATH</code> in order to execute the binaries from\ndifferent folders where multiple <code>node_modules</code> directories are present, if\n<code>ancestor-folder/node_modules/.bin</code> is a directory.</p>\n<p><code>--run</code> executes the command in the directory containing the related <code>package.json</code>.</p>\n<p>For example, the following command will run the <code>test</code> script of\nthe <code>package.json</code> in the current folder:</p>\n<pre><code class=\"language-console\">$ node --run test\n</code></pre>\n<p>You can also pass arguments to the command. Any argument after <code>--</code> will\nbe appended to the script:</p>\n<pre><code class=\"language-console\">$ node --run test -- --verbose\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Intentional limitations",
                  "name": "intentional_limitations",
                  "type": "module",
                  "desc": "<p><code>node --run</code> is not meant to match the behaviors of <code>npm run</code> or of the <code>run</code>\ncommands of other package managers. The Node.js implementation is intentionally\nmore limited, in order to focus on top performance for the most common use\ncases.\nSome features of other <code>run</code> implementations that are intentionally excluded\nare:</p>\n<ul>\n<li>Running <code>pre</code> or <code>post</code> scripts in addition to the specified script.</li>\n<li>Defining package manager-specific environment variables.</li>\n</ul>",
                  "displayName": "Intentional limitations"
                },
                {
                  "textRaw": "Environment variables",
                  "name": "environment_variables",
                  "type": "module",
                  "desc": "<p>The following environment variables are set when running a script with <code>--run</code>:</p>\n<ul>\n<li><code>NODE_RUN_SCRIPT_NAME</code>: The name of the script being run. For example, if\n<code>--run</code> is used to run <code>test</code>, the value of this variable will be <code>test</code>.</li>\n<li><code>NODE_RUN_PACKAGE_JSON_PATH</code>: The path to the <code>package.json</code> that is being\nprocessed.</li>\n</ul>",
                  "displayName": "Environment variables"
                }
              ],
              "displayName": "`--run`"
            },
            {
              "textRaw": "`--secure-heap-min=n`",
              "name": "`--secure-heap-min=n`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>When using <code>--secure-heap</code>, the <code>--secure-heap-min</code> flag specifies the\nminimum allocation from the secure heap. The minimum value is <code>2</code>.\nThe maximum value is the lesser of <code>--secure-heap</code> or <code>2147483647</code>.\nThe value given must be a power of two.</p>",
              "displayName": "`--secure-heap-min=n`"
            },
            {
              "textRaw": "`--secure-heap=n`",
              "name": "`--secure-heap=n`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Initializes an OpenSSL secure heap of <code>n</code> bytes. When initialized, the\nsecure heap is used for selected types of allocations within OpenSSL\nduring key generation and other operations. This is useful, for instance,\nto prevent sensitive information from leaking due to pointer overruns\nor underruns.</p>\n<p>The secure heap is a fixed size and cannot be resized at runtime so,\nif used, it is important to select a large enough heap to cover all\napplication uses.</p>\n<p>The heap size given must be a power of two. Any value less than 2\nwill disable the secure heap.</p>\n<p>The secure heap is disabled by default.</p>\n<p>The secure heap is not available on Windows.</p>\n<p>See <a href=\"https://www.openssl.org/docs/man3.0/man3/CRYPTO_secure_malloc_init.html\"><code>CRYPTO_secure_malloc_init</code></a> for more details.</p>",
              "displayName": "`--secure-heap=n`"
            },
            {
              "textRaw": "`--snapshot-blob=path`",
              "name": "`--snapshot-blob=path`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.8.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>When used with <code>--build-snapshot</code>, <code>--snapshot-blob</code> specifies the path\nwhere the generated snapshot blob is written to. If not specified, the\ngenerated blob is written to <code>snapshot.blob</code> in the current working directory.</p>\n<p>When used without <code>--build-snapshot</code>, <code>--snapshot-blob</code> specifies the\npath to the blob that is used to restore the application state.</p>\n<p>When loading a snapshot, Node.js checks that:</p>\n<ol>\n<li>The version, architecture, and platform of the running Node.js binary\nare exactly the same as that of the binary that generates the snapshot.</li>\n<li>The V8 flags and CPU features are compatible with that of the binary\nthat generates the snapshot.</li>\n</ol>\n<p>If they don't match, Node.js refuses to load the snapshot and exits with\nstatus code 1.</p>",
              "displayName": "`--snapshot-blob=path`"
            },
            {
              "textRaw": "`--test`",
              "name": "`--test`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.1.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46983",
                    "description": "The test runner is now stable."
                  },
                  {
                    "version": [
                      "v19.2.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/45214",
                    "description": "Test runner now supports running in watch mode."
                  }
                ]
              },
              "desc": "<p>Starts the Node.js command line test runner. This flag cannot be combined with\n<code>--watch-path</code>, <code>--check</code>, <code>--eval</code>, <code>--interactive</code>, or the inspector.\nSee the documentation on <a href=\"test.html#running-tests-from-the-command-line\">running tests from the command line</a>\nfor more details.</p>",
              "displayName": "`--test`"
            },
            {
              "textRaw": "`--test-concurrency`",
              "name": "`--test-concurrency`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.0.0",
                  "v20.10.0",
                  "v18.19.0"
                ],
                "changes": []
              },
              "desc": "<p>The maximum number of test files that the test runner CLI will execute\nconcurrently. If <code>--test-isolation</code> is set to <code>'none'</code>, this flag is ignored and\nconcurrency is one. Otherwise, concurrency defaults to\n<code>os.availableParallelism() - 1</code>.</p>",
              "displayName": "`--test-concurrency`"
            },
            {
              "textRaw": "`--test-coverage-branches=threshold`",
              "name": "`--test-coverage-branches=threshold`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.8.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Require a minimum percent of covered branches. If code coverage does not reach\nthe threshold specified, the process will exit with code <code>1</code>.</p>",
              "displayName": "`--test-coverage-branches=threshold`"
            },
            {
              "textRaw": "`--test-coverage-exclude`",
              "name": "`--test-coverage-exclude`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Excludes specific files from code coverage using a glob pattern, which can match\nboth absolute and relative file paths.</p>\n<p>This option may be specified multiple times to exclude multiple glob patterns.</p>\n<p>If both <code>--test-coverage-exclude</code> and <code>--test-coverage-include</code> are provided,\nfiles must meet <strong>both</strong> criteria to be included in the coverage report.</p>\n<p>By default all the matching test files are excluded from the coverage report.\nSpecifying this option will override the default behavior.</p>",
              "displayName": "`--test-coverage-exclude`"
            },
            {
              "textRaw": "`--test-coverage-functions=threshold`",
              "name": "`--test-coverage-functions=threshold`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.8.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Require a minimum percent of covered functions. If code coverage does not reach\nthe threshold specified, the process will exit with code <code>1</code>.</p>",
              "displayName": "`--test-coverage-functions=threshold`"
            },
            {
              "textRaw": "`--test-coverage-include`",
              "name": "`--test-coverage-include`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Includes specific files in code coverage using a glob pattern, which can match\nboth absolute and relative file paths.</p>\n<p>This option may be specified multiple times to include multiple glob patterns.</p>\n<p>If both <code>--test-coverage-exclude</code> and <code>--test-coverage-include</code> are provided,\nfiles must meet <strong>both</strong> criteria to be included in the coverage report.</p>",
              "displayName": "`--test-coverage-include`"
            },
            {
              "textRaw": "`--test-coverage-lines=threshold`",
              "name": "`--test-coverage-lines=threshold`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.8.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Require a minimum percent of covered lines. If code coverage does not reach\nthe threshold specified, the process will exit with code <code>1</code>.</p>",
              "displayName": "`--test-coverage-lines=threshold`"
            },
            {
              "textRaw": "`--test-force-exit`",
              "name": "`--test-force-exit`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.0.0",
                  "v20.14.0"
                ],
                "changes": []
              },
              "desc": "<p>Configures the test runner to exit the process once all known tests have\nfinished executing even if the event loop would otherwise remain active.</p>",
              "displayName": "`--test-force-exit`"
            },
            {
              "textRaw": "`--test-global-setup=module`",
              "name": "`--test-global-setup=module`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.0.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>Specify a module that will be evaluated before all tests are executed and\ncan be used to setup global state or fixtures for tests.</p>\n<p>See the documentation on <a href=\"test.html#global-setup-and-teardown\">global setup and teardown</a> for more details.</p>",
              "displayName": "`--test-global-setup=module`"
            },
            {
              "textRaw": "`--test-isolation=mode`",
              "name": "`--test-isolation=mode`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.8.0"
                ],
                "changes": [
                  {
                    "version": "v23.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/56298",
                    "description": "This flag was renamed from `--experimental-test-isolation` to `--test-isolation`."
                  }
                ]
              },
              "desc": "<p>Configures the type of test isolation used in the test runner. When <code>mode</code> is\n<code>'process'</code>, each test file is run in a separate child process. When <code>mode</code> is\n<code>'none'</code>, all test files run in the same process as the test runner. The default\nisolation mode is <code>'process'</code>. This flag is ignored if the <code>--test</code> flag is not\npresent. See the <a href=\"test.html#test-runner-execution-model\">test runner execution model</a> section for more information.</p>",
              "displayName": "`--test-isolation=mode`"
            },
            {
              "textRaw": "`--test-name-pattern`",
              "name": "`--test-name-pattern`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.11.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46983",
                    "description": "The test runner is now stable."
                  }
                ]
              },
              "desc": "<p>A regular expression that configures the test runner to only execute tests\nwhose name matches the provided pattern. See the documentation on\n<a href=\"test.html#filtering-tests-by-name\">filtering tests by name</a> for more details.</p>\n<p>If both <code>--test-name-pattern</code> and <code>--test-skip-pattern</code> are supplied,\ntests must satisfy <strong>both</strong> requirements in order to be executed.</p>",
              "displayName": "`--test-name-pattern`"
            },
            {
              "textRaw": "`--test-only`",
              "name": "`--test-only`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.0.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46983",
                    "description": "The test runner is now stable."
                  }
                ]
              },
              "desc": "<p>Configures the test runner to only execute top level tests that have the <code>only</code>\noption set. This flag is not necessary when test isolation is disabled.</p>",
              "displayName": "`--test-only`"
            },
            {
              "textRaw": "`--test-random-seed`",
              "name": "`--test-random-seed`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "desc": "<p>Set the seed used to randomize test execution order. This applies to both test\nfile execution order and queued tests within each file. Providing this flag\nenables randomization implicitly, even without <code>--test-randomize</code>.</p>\n<p>The value must be an integer between <code>0</code> and <code>4294967295</code>.</p>\n<p>This flag cannot be used with <code>--watch</code> or <code>--test-rerun-failures</code>.</p>",
              "displayName": "`--test-random-seed`"
            },
            {
              "textRaw": "`--test-randomize`",
              "name": "`--test-randomize`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "desc": "<p>Randomize test execution order. This applies to both test file execution order\nand queued tests within each file. This can help detect tests that rely on\nshared state or execution order.</p>\n<p>The seed used for randomization is printed in the test summary and can be\nreused with <code>--test-random-seed</code>.</p>\n<p>For detailed behavior and examples, see\n<a href=\"test.html#randomizing-tests-execution-order\">randomizing tests execution order</a>.</p>\n<p>This flag cannot be used with <code>--watch</code> or <code>--test-rerun-failures</code>.</p>",
              "displayName": "`--test-randomize`"
            },
            {
              "textRaw": "`--test-reporter`",
              "name": "`--test-reporter`",
              "type": "module",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46983",
                    "description": "The test runner is now stable."
                  }
                ]
              },
              "desc": "<p>A test reporter to use when running tests. See the documentation on\n<a href=\"test.html#test-reporters\">test reporters</a> for more details.</p>",
              "displayName": "`--test-reporter`"
            },
            {
              "textRaw": "`--test-reporter-destination`",
              "name": "`--test-reporter-destination`",
              "type": "module",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46983",
                    "description": "The test runner is now stable."
                  }
                ]
              },
              "desc": "<p>The destination for the corresponding test reporter. See the documentation on\n<a href=\"test.html#test-reporters\">test reporters</a> for more details.</p>",
              "displayName": "`--test-reporter-destination`"
            },
            {
              "textRaw": "`--test-rerun-failures`",
              "name": "`--test-rerun-failures`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "desc": "<p>A path to a file allowing the test runner to persist the state of the test\nsuite between runs. The test runner will use this file to determine which tests\nhave already succeeded or failed, allowing for re-running of failed tests\nwithout having to re-run the entire test suite. The test runner will create this\nfile if it does not exist.\nSee the documentation on <a href=\"test.html#rerunning-failed-tests\">test reruns</a> for more details.</p>",
              "displayName": "`--test-rerun-failures`"
            },
            {
              "textRaw": "`--test-shard`",
              "name": "`--test-shard`",
              "type": "module",
              "meta": {
                "added": [
                  "v20.5.0",
                  "v18.19.0"
                ],
                "changes": []
              },
              "desc": "<p>Test suite shard to execute in a format of <code>&#x3C;index>/&#x3C;total></code>, where</p>\n<ul>\n<li><code>index</code> is a positive integer, index of divided parts.</li>\n<li><code>total</code> is a positive integer, total of divided part.</li>\n</ul>\n<p>This command will divide all tests files into <code>total</code> equal parts,\nand will run only those that happen to be in an <code>index</code> part.</p>\n<p>For example, to split your tests suite into three parts, use this:</p>\n<pre><code class=\"language-bash\">node --test --test-shard=1/3\nnode --test --test-shard=2/3\nnode --test --test-shard=3/3\n</code></pre>",
              "displayName": "`--test-shard`"
            },
            {
              "textRaw": "`--test-skip-pattern`",
              "name": "`--test-skip-pattern`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.1.0"
                ],
                "changes": []
              },
              "desc": "<p>A regular expression that configures the test runner to skip tests\nwhose name matches the provided pattern. See the documentation on\n<a href=\"test.html#filtering-tests-by-name\">filtering tests by name</a> for more details.</p>\n<p>If both <code>--test-name-pattern</code> and <code>--test-skip-pattern</code> are supplied,\ntests must satisfy <strong>both</strong> requirements in order to be executed.</p>",
              "displayName": "`--test-skip-pattern`"
            },
            {
              "textRaw": "`--test-timeout`",
              "name": "`--test-timeout`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.2.0",
                  "v20.11.0"
                ],
                "changes": []
              },
              "desc": "<p>A number of milliseconds the test execution will fail after. If unspecified,\nsubtests inherit this value from their parent. The default value is <code>Infinity</code>.</p>",
              "displayName": "`--test-timeout`"
            },
            {
              "textRaw": "`--test-update-snapshots`",
              "name": "`--test-update-snapshots`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.3.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.4.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55897",
                    "description": "Snapshot testing is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Regenerates the snapshot files used by the test runner for <a href=\"test.html#snapshot-testing\">snapshot testing</a>.</p>",
              "displayName": "`--test-update-snapshots`"
            },
            {
              "textRaw": "`--throw-deprecation`",
              "name": "`--throw-deprecation`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "desc": "<p>Throw errors for deprecations.</p>",
              "displayName": "`--throw-deprecation`"
            },
            {
              "textRaw": "`--title=title`",
              "name": "`--title=title`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.7.0"
                ],
                "changes": []
              },
              "desc": "<p>Set <code>process.title</code> on startup.</p>",
              "displayName": "`--title=title`"
            },
            {
              "textRaw": "`--tls-cipher-list=list`",
              "name": "`--tls-cipher-list=list`",
              "type": "module",
              "meta": {
                "added": [
                  "v4.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Specify an alternative default TLS cipher list. Requires Node.js to be built\nwith crypto support (default).</p>",
              "displayName": "`--tls-cipher-list=list`"
            },
            {
              "textRaw": "`--tls-keylog=file`",
              "name": "`--tls-keylog=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>Log TLS key material to a file. The key material is in NSS <code>SSLKEYLOGFILE</code>\nformat and can be used by software (such as Wireshark) to decrypt the TLS\ntraffic.</p>",
              "displayName": "`--tls-keylog=file`"
            },
            {
              "textRaw": "`--tls-max-v1.2`",
              "name": "`--tls-max-v1.2`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "desc": "<p>Set <a href=\"tls.html#tlsdefault_max_version\"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1.2'. Use to disable support for\nTLSv1.3.</p>",
              "displayName": "`--tls-max-v1.2`"
            },
            {
              "textRaw": "`--tls-max-v1.3`",
              "name": "`--tls-max-v1.3`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tlsdefault_max_version\"><code>tls.DEFAULT_MAX_VERSION</code></a> to 'TLSv1.3'. Use to enable support\nfor TLSv1.3.</p>",
              "displayName": "`--tls-max-v1.3`"
            },
            {
              "textRaw": "`--tls-min-v1.0`",
              "name": "`--tls-min-v1.0`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tlsdefault_min_version\"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1'. Use for compatibility with\nold TLS clients or servers.</p>",
              "displayName": "`--tls-min-v1.0`"
            },
            {
              "textRaw": "`--tls-min-v1.1`",
              "name": "`--tls-min-v1.1`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tlsdefault_min_version\"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.1'. Use for compatibility\nwith old TLS clients or servers.</p>",
              "displayName": "`--tls-min-v1.1`"
            },
            {
              "textRaw": "`--tls-min-v1.2`",
              "name": "`--tls-min-v1.2`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.2.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tlsdefault_min_version\"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.2'. This is the default for\n12.x and later, but the option is supported for compatibility with older Node.js\nversions.</p>",
              "displayName": "`--tls-min-v1.2`"
            },
            {
              "textRaw": "`--tls-min-v1.3`",
              "name": "`--tls-min-v1.3`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Set default <a href=\"tls.html#tlsdefault_min_version\"><code>tls.DEFAULT_MIN_VERSION</code></a> to 'TLSv1.3'. Use to disable support\nfor TLSv1.2, which is not as secure as TLSv1.3.</p>",
              "displayName": "`--tls-min-v1.3`"
            },
            {
              "textRaw": "`--trace-deprecation`",
              "name": "`--trace-deprecation`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Print stack traces for deprecations.</p>",
              "displayName": "`--trace-deprecation`"
            },
            {
              "textRaw": "`--trace-env`",
              "name": "`--trace-env`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "desc": "<p>Print information about any access to environment variables done in the current Node.js\ninstance to stderr, including:</p>\n<ul>\n<li>The environment variable reads that Node.js does internally.</li>\n<li>Writes in the form of <code>process.env.KEY = \"SOME VALUE\"</code>.</li>\n<li>Reads in the form of <code>process.env.KEY</code>.</li>\n<li>Definitions in the form of <code>Object.defineProperty(process.env, 'KEY', {...})</code>.</li>\n<li>Queries in the form of <code>Object.hasOwn(process.env, 'KEY')</code>,\n<code>process.env.hasOwnProperty('KEY')</code> or <code>'KEY' in process.env</code>.</li>\n<li>Deletions in the form of <code>delete process.env.KEY</code>.</li>\n<li>Enumerations inf the form of <code>...process.env</code> or <code>Object.keys(process.env)</code>.</li>\n</ul>\n<p>Only the names of the environment variables being accessed are printed. The values are not printed.</p>\n<p>To print the stack trace of the access, use <code>--trace-env-js-stack</code> and/or\n<code>--trace-env-native-stack</code>.</p>",
              "displayName": "`--trace-env`"
            },
            {
              "textRaw": "`--trace-env-js-stack`",
              "name": "`--trace-env-js-stack`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "desc": "<p>In addition to what <code>--trace-env</code> does, this prints the JavaScript stack trace of the access.</p>",
              "displayName": "`--trace-env-js-stack`"
            },
            {
              "textRaw": "`--trace-env-native-stack`",
              "name": "`--trace-env-native-stack`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "desc": "<p>In addition to what <code>--trace-env</code> does, this prints the native stack trace of the access.</p>",
              "displayName": "`--trace-env-native-stack`"
            },
            {
              "textRaw": "`--trace-event-categories`",
              "name": "`--trace-event-categories`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "desc": "<p>A comma separated list of categories that should be traced when trace event\ntracing is enabled using <code>--trace-events-enabled</code>.</p>",
              "displayName": "`--trace-event-categories`"
            },
            {
              "textRaw": "`--trace-event-file-pattern`",
              "name": "`--trace-event-file-pattern`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Template string specifying the filepath for the trace event data, it\nsupports <code>${rotation}</code> and <code>${pid}</code>.</p>",
              "displayName": "`--trace-event-file-pattern`"
            },
            {
              "textRaw": "`--trace-events-enabled`",
              "name": "`--trace-events-enabled`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "desc": "<p>Enables the collection of trace event tracing information.</p>",
              "displayName": "`--trace-events-enabled`"
            },
            {
              "textRaw": "`--trace-exit`",
              "name": "`--trace-exit`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.5.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>Prints a stack trace whenever an environment is exited proactively,\ni.e. invoking <code>process.exit()</code>.</p>",
              "displayName": "`--trace-exit`"
            },
            {
              "textRaw": "`--trace-require-module=mode`",
              "name": "`--trace-require-module=mode`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.5.0",
                  "v22.13.0",
                  "v20.19.0"
                ],
                "changes": []
              },
              "desc": "<p>Prints information about usage of <a href=\"modules.html#loading-ecmascript-modules-using-require\">Loading ECMAScript modules using <code>require()</code></a>.</p>\n<p>When <code>mode</code> is <code>all</code>, all usage is printed. When <code>mode</code> is <code>no-node-modules</code>, usage\nfrom the <code>node_modules</code> folder is excluded.</p>",
              "displayName": "`--trace-require-module=mode`"
            },
            {
              "textRaw": "`--trace-sigint`",
              "name": "`--trace-sigint`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.9.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Prints a stack trace on SIGINT.</p>",
              "displayName": "`--trace-sigint`"
            },
            {
              "textRaw": "`--trace-sync-io`",
              "name": "`--trace-sync-io`",
              "type": "module",
              "meta": {
                "added": [
                  "v2.1.0"
                ],
                "changes": []
              },
              "desc": "<p>Prints a stack trace whenever synchronous I/O is detected after the first turn\nof the event loop.</p>",
              "displayName": "`--trace-sync-io`"
            },
            {
              "textRaw": "`--trace-tls`",
              "name": "`--trace-tls`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.2.0"
                ],
                "changes": []
              },
              "desc": "<p>Prints TLS packet trace information to <code>stderr</code>. This can be used to debug TLS\nconnection problems.</p>",
              "displayName": "`--trace-tls`"
            },
            {
              "textRaw": "`--trace-uncaught`",
              "name": "`--trace-uncaught`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.1.0"
                ],
                "changes": []
              },
              "desc": "<p>Print stack traces for uncaught exceptions; usually, the stack trace associated\nwith the creation of an <code>Error</code> is printed, whereas this makes Node.js also\nprint the stack trace associated with throwing the value (which does not need\nto be an <code>Error</code> instance).</p>\n<p>Enabling this option may affect garbage collection behavior negatively.</p>",
              "displayName": "`--trace-uncaught`"
            },
            {
              "textRaw": "`--trace-warnings`",
              "name": "`--trace-warnings`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Print stack traces for process warnings (including deprecations).</p>",
              "displayName": "`--trace-warnings`"
            },
            {
              "textRaw": "`--track-heap-objects`",
              "name": "`--track-heap-objects`",
              "type": "module",
              "meta": {
                "added": [
                  "v2.4.0"
                ],
                "changes": []
              },
              "desc": "<p>Track heap object allocations for heap snapshots.</p>",
              "displayName": "`--track-heap-objects`"
            },
            {
              "textRaw": "`--unhandled-rejections=mode`",
              "name": "`--unhandled-rejections=mode`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.17.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33021",
                    "description": "Changed default mode to `throw`. Previously, a warning was emitted."
                  }
                ]
              },
              "desc": "<p>Using this flag allows to change what should happen when an unhandled rejection\noccurs. One of the following modes can be chosen:</p>\n<ul>\n<li><code>throw</code>: Emit <a href=\"process.html#event-unhandledrejection\"><code>unhandledRejection</code></a>. If this hook is not set, raise the\nunhandled rejection as an uncaught exception. This is the default.</li>\n<li><code>strict</code>: Raise the unhandled rejection as an uncaught exception. If the\nexception is handled, <a href=\"process.html#event-unhandledrejection\"><code>unhandledRejection</code></a> is emitted.</li>\n<li><code>warn</code>: Always trigger a warning, no matter if the <a href=\"process.html#event-unhandledrejection\"><code>unhandledRejection</code></a>\nhook is set or not but do not print the deprecation warning.</li>\n<li><code>warn-with-error-code</code>: Emit <a href=\"process.html#event-unhandledrejection\"><code>unhandledRejection</code></a>. If this hook is not\nset, trigger a warning, and set the process exit code to 1.</li>\n<li><code>none</code>: Silence all warnings.</li>\n</ul>\n<p>If a rejection happens during the command line entry point's ES module static\nloading phase, it will always raise it as an uncaught exception.</p>",
              "displayName": "`--unhandled-rejections=mode`"
            },
            {
              "textRaw": "`--use-bundled-ca`, `--use-openssl-ca`",
              "name": "`--use-bundled-ca`,_`--use-openssl-ca`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.11.0"
                ],
                "changes": []
              },
              "desc": "<p>Use bundled Mozilla CA store as supplied by current Node.js version\nor use OpenSSL's default CA store. The default store is selectable\nat build-time.</p>\n<p>The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store\nthat is fixed at release time. It is identical on all supported platforms.</p>\n<p>Using OpenSSL store allows for external modifications of the store. For most\nLinux and BSD distributions, this store is maintained by the distribution\nmaintainers and system administrators. OpenSSL CA store location is dependent on\nconfiguration of the OpenSSL library but this can be altered at runtime using\nenvironment variables.</p>\n<p>See <code>SSL_CERT_DIR</code> and <code>SSL_CERT_FILE</code>.</p>",
              "displayName": "`--use-bundled-ca`, `--use-openssl-ca`"
            },
            {
              "textRaw": "`--use-env-proxy`",
              "name": "`--use-env-proxy`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.5.0",
                  "v22.21.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "desc": "<p>When enabled, Node.js parses the <code>HTTP_PROXY</code>, <code>HTTPS_PROXY</code> and <code>NO_PROXY</code>\nenvironment variables during startup, and tunnels requests over the\nspecified proxy.</p>\n<p>This is equivalent to setting the <a href=\"#node_use_env_proxy1\"><code>NODE_USE_ENV_PROXY=1</code></a> environment variable.\nWhen both are set, <code>--use-env-proxy</code> takes precedence.</p>",
              "displayName": "`--use-env-proxy`"
            },
            {
              "textRaw": "`--use-largepages=mode`",
              "name": "`--use-largepages=mode`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.6.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Re-map the Node.js static code to large memory pages at startup. If supported on\nthe target system, this will cause the Node.js static code to be moved onto 2\nMiB pages instead of 4 KiB pages.</p>\n<p>The following values are valid for <code>mode</code>:</p>\n<ul>\n<li><code>off</code>: No mapping will be attempted. This is the default.</li>\n<li><code>on</code>: If supported by the OS, mapping will be attempted. Failure to map will\nbe ignored and a message will be printed to standard error.</li>\n<li><code>silent</code>: If supported by the OS, mapping will be attempted. Failure to map\nwill be ignored and will not be reported.</li>\n</ul>",
              "displayName": "`--use-largepages=mode`"
            },
            {
              "textRaw": "`--use-system-ca`",
              "name": "`--use-system-ca`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": [
                  {
                    "version": "v23.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57009",
                    "description": "Added support on non-Windows and non-macOS."
                  }
                ]
              },
              "desc": "<p>Node.js uses the trusted CA certificates present in the system store along with\nthe <code>--use-bundled-ca</code> option and the <code>NODE_EXTRA_CA_CERTS</code> environment variable.\nOn platforms other than Windows and macOS, this loads certificates from the directory\nand file trusted by OpenSSL, similar to <code>--use-openssl-ca</code>, with the difference being\nthat it caches the certificates after first load.</p>\n<p>On Windows and macOS, the certificate trust policy is similar to\n<a href=\"https://chromium.googlesource.com/chromium/src/+/main/net/data/ssl/chrome_root_store/faq.md#does-the-chrome-certificate-verifier-consider-local-trust-decisions\">Chromium's policy for locally trusted certificates</a>, but with some differences:</p>\n<p>On macOS, the following settings are respected:</p>\n<ul>\n<li>Default and System Keychains\n<ul>\n<li>Trust:\n<ul>\n<li>Any certificate where the “When using this certificate” flag is set to “Always Trust” or</li>\n<li>Any certificate where the “Secure Sockets Layer (SSL)” flag is set to “Always Trust”.</li>\n</ul>\n</li>\n<li>The certificate must also be valid, with \"X.509 Basic Policy\" set to  “Always Trust”.</li>\n</ul>\n</li>\n</ul>\n<p>On Windows, the following settings are respected:</p>\n<ul>\n<li>Local Machine (accessed via <code>certlm.msc</code>)\n<ul>\n<li>Trust:\n<ul>\n<li>Trusted Root Certification Authorities</li>\n<li>Trusted People</li>\n<li>Enterprise Trust -> Enterprise -> Trusted Root Certification Authorities</li>\n<li>Enterprise Trust -> Enterprise -> Trusted People</li>\n<li>Enterprise Trust -> Group Policy -> Trusted Root Certification Authorities</li>\n<li>Enterprise Trust -> Group Policy -> Trusted People</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Current User (accessed via <code>certmgr.msc</code>)\n<ul>\n<li>Trust:\n<ul>\n<li>Trusted Root Certification Authorities</li>\n<li>Enterprise Trust -> Group Policy -> Trusted Root Certification Authorities</li>\n</ul>\n</li>\n</ul>\n</li>\n</ul>\n<p>On Windows and macOS, Node.js would check that the user settings for the trusted\ncertificates do not forbid them for TLS server authentication before using them.</p>\n<p>Node.js currently does not support distrust/revocation of certificates\nfrom another source based on system settings.</p>\n<p>On other systems, Node.js loads certificates from the default certificate file\n(typically <code>/etc/ssl/cert.pem</code>) and default certificate directory (typically\n<code>/etc/ssl/certs</code>) that the version of OpenSSL that Node.js links to respects.\nThis typically works with the convention on major Linux distributions and other\nUnix-like systems. If the overriding OpenSSL environment variables\n(typically <code>SSL_CERT_FILE</code> and <code>SSL_CERT_DIR</code>, depending on the configuration\nof the OpenSSL that Node.js links to) are set, the specified paths will be used to load\ncertificates instead. These environment variables can be used as workarounds\nif the conventional paths used by the version of OpenSSL Node.js links to are\nnot consistent with the system configuration that the users have for some reason.</p>",
              "displayName": "`--use-system-ca`"
            },
            {
              "textRaw": "`--v8-options`",
              "name": "`--v8-options`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.1.3"
                ],
                "changes": []
              },
              "desc": "<p>Print V8 command-line options.</p>",
              "displayName": "`--v8-options`"
            },
            {
              "textRaw": "`--v8-pool-size=num`",
              "name": "`--v8-pool-size=num`",
              "type": "module",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "desc": "<p>Set V8's thread pool size which will be used to allocate background jobs.</p>\n<p>If set to <code>0</code> then Node.js will choose an appropriate size of the thread pool\nbased on an estimate of the amount of parallelism.</p>\n<p>The amount of parallelism refers to the number of computations that can be\ncarried out simultaneously in a given machine. In general, it's the same as the\namount of CPUs, but it may diverge in environments such as VMs or containers.</p>",
              "displayName": "`--v8-pool-size=num`"
            },
            {
              "textRaw": "`-v`, `--version`",
              "name": "`-v`,_`--version`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.1.3"
                ],
                "changes": []
              },
              "desc": "<p>Print node's version.</p>",
              "displayName": "`-v`, `--version`"
            },
            {
              "textRaw": "`--watch`",
              "name": "`--watch`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.11.0",
                  "v16.19.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.0.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52074",
                    "description": "Watch mode is now stable."
                  },
                  {
                    "version": [
                      "v19.2.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/45214",
                    "description": "Test runner now supports running in watch mode."
                  }
                ]
              },
              "desc": "<p>Starts Node.js in watch mode.\nWhen in watch mode, changes in the watched files cause the Node.js process to\nrestart.\nBy default, watch mode will watch the entry point\nand any required or imported module.\nUse <code>--watch-path</code> to specify what paths to watch.</p>\n<p>This flag cannot be combined with\n<code>--check</code>, <code>--eval</code>, <code>--interactive</code>, or the REPL.</p>\n<p>Note: The <code>--watch</code> flag requires a file path as an argument and is incompatible\nwith <code>--run</code> or inline script input, as <code>--run</code> takes precedence and ignores watch\nmode. If no file is provided, Node.js will exit with status code <code>9</code>.</p>\n<pre><code class=\"language-bash\">node --watch index.js\n</code></pre>",
              "displayName": "`--watch`"
            },
            {
              "textRaw": "`--watch-kill-signal`",
              "name": "`--watch-kill-signal`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.4.0",
                  "v22.18.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "desc": "<p>Customizes the signal sent to the process on watch mode restarts.</p>\n<pre><code class=\"language-bash\">node --watch --watch-kill-signal SIGINT test.js\n</code></pre>",
              "displayName": "`--watch-kill-signal`"
            },
            {
              "textRaw": "`--watch-path`",
              "name": "`--watch-path`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.11.0",
                  "v16.19.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.0.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52074",
                    "description": "Watch mode is now stable."
                  }
                ]
              },
              "desc": "<p>Starts Node.js in watch mode and specifies what paths to watch.\nWhen in watch mode, changes in the watched paths cause the Node.js process to\nrestart.\nThis will turn off watching of required or imported modules, even when used in\ncombination with <code>--watch</code>.</p>\n<p>This flag cannot be combined with\n<code>--check</code>, <code>--eval</code>, <code>--interactive</code>, <code>--test</code>, or the REPL.</p>\n<p>Note: Using <code>--watch-path</code> implicitly enables <code>--watch</code>, which requires a file path\nand is incompatible with <code>--run</code>, as <code>--run</code> takes precedence and ignores watch mode.</p>\n<pre><code class=\"language-bash\">node --watch-path=./src --watch-path=./tests index.js\n</code></pre>\n<p>This option is only supported on macOS and Windows.\nAn <code>ERR_FEATURE_UNAVAILABLE_ON_PLATFORM</code> exception will be thrown\nwhen the option is used on a platform that does not support it.</p>",
              "displayName": "`--watch-path`"
            },
            {
              "textRaw": "`--watch-preserve-output`",
              "name": "`--watch-preserve-output`",
              "type": "module",
              "meta": {
                "added": [
                  "v19.3.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "desc": "<p>Disable the clearing of the console when watch mode restarts the process.</p>\n<pre><code class=\"language-bash\">node --watch --watch-preserve-output test.js\n</code></pre>",
              "displayName": "`--watch-preserve-output`"
            },
            {
              "textRaw": "`--zero-fill-buffers`",
              "name": "`--zero-fill-buffers`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Automatically zero-fills all newly allocated <a href=\"buffer.html#class-buffer\"><code>Buffer</code></a> instances.</p>",
              "displayName": "`--zero-fill-buffers`"
            }
          ],
          "displayName": "Options"
        },
        {
          "textRaw": "Environment variables",
          "name": "environment_variables",
          "type": "misc",
          "stability": 2,
          "stabilityText": "Stable",
          "modules": [
            {
              "textRaw": "`FORCE_COLOR=[1, 2, 3]`",
              "name": "`force_color=[1,_2,_3]`",
              "type": "module",
              "desc": "<p>The <code>FORCE_COLOR</code> environment variable is used to\nenable ANSI colorized output. The value may be:</p>\n<ul>\n<li><code>1</code>, <code>true</code>, or the empty string <code>''</code> indicate 16-color support,</li>\n<li><code>2</code> to indicate 256-color support, or</li>\n<li><code>3</code> to indicate 16 million-color support.</li>\n</ul>\n<p>When <code>FORCE_COLOR</code> is used and set to a supported value, both the <code>NO_COLOR</code>,\nand <code>NODE_DISABLE_COLORS</code> environment variables are ignored.</p>\n<p>Any other value will result in colorized output being disabled.</p>",
              "displayName": "`FORCE_COLOR=[1, 2, 3]`"
            },
            {
              "textRaw": "`NODE_COMPILE_CACHE=dir`",
              "name": "`node_compile_cache=dir`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.1.0"
                ],
                "changes": [
                  {
                    "version": "v25.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60971",
                    "description": "This feature is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Enable the <a href=\"module.html#module-compile-cache\">module compile cache</a> for the Node.js instance. See the documentation of\n<a href=\"module.html#module-compile-cache\">module compile cache</a> for details.</p>",
              "displayName": "`NODE_COMPILE_CACHE=dir`"
            },
            {
              "textRaw": "`NODE_COMPILE_CACHE_PORTABLE=1`",
              "name": "`node_compile_cache_portable=1`",
              "type": "module",
              "desc": "<p>When set to 1, the <a href=\"module.html#module-compile-cache\">module compile cache</a>  can be reused across different directory\nlocations as long as the module layout relative to the cache directory remains the same.</p>",
              "displayName": "`NODE_COMPILE_CACHE_PORTABLE=1`"
            },
            {
              "textRaw": "`NODE_DEBUG=module[,…]`",
              "name": "`node_debug=module[,…]`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.1.32"
                ],
                "changes": []
              },
              "desc": "<p><code>','</code>-separated list of core modules that should print debug information.</p>",
              "displayName": "`NODE_DEBUG=module[,…]`"
            },
            {
              "textRaw": "`NODE_DEBUG_NATIVE=module[,…]`",
              "name": "`node_debug_native=module[,…]`",
              "type": "module",
              "desc": "<p><code>','</code>-separated list of core C++ modules that should print debug information.</p>",
              "displayName": "`NODE_DEBUG_NATIVE=module[,…]`"
            },
            {
              "textRaw": "`NODE_DISABLE_COLORS=1`",
              "name": "`node_disable_colors=1`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>When set, colors will not be used in the REPL.</p>",
              "displayName": "`NODE_DISABLE_COLORS=1`"
            },
            {
              "textRaw": "`NODE_DISABLE_COMPILE_CACHE=1`",
              "name": "`node_disable_compile_cache=1`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.8.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "desc": "<p>Disable the <a href=\"module.html#module-compile-cache\">module compile cache</a> for the Node.js instance. See the documentation of\n<a href=\"module.html#module-compile-cache\">module compile cache</a> for details.</p>",
              "displayName": "`NODE_DISABLE_COMPILE_CACHE=1`"
            },
            {
              "textRaw": "`NODE_EXTRA_CA_CERTS=file`",
              "name": "`node_extra_ca_certs=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.3.0"
                ],
                "changes": []
              },
              "desc": "<p>When set, the well known \"root\" CAs (like VeriSign) will be extended with the\nextra certificates in <code>file</code>. The file should consist of one or more trusted\ncertificates in PEM format. A message will be emitted (once) with\n<a href=\"process.html#processemitwarningwarning-options\"><code>process.emitWarning()</code></a> if the file is missing or\nmalformed, but any errors are otherwise ignored.</p>\n<p>Neither the well known nor extra certificates are used when the <code>ca</code>\noptions property is explicitly specified for a TLS or HTTPS client or server.</p>\n<p>This environment variable is ignored when <code>node</code> runs as setuid root or\nhas Linux file capabilities set.</p>\n<p>The <code>NODE_EXTRA_CA_CERTS</code> environment variable is only read when the Node.js\nprocess is first launched. Changing the value at runtime using\n<code>process.env.NODE_EXTRA_CA_CERTS</code> has no effect on the current process.</p>",
              "displayName": "`NODE_EXTRA_CA_CERTS=file`"
            },
            {
              "textRaw": "`NODE_ICU_DATA=file`",
              "name": "`node_icu_data=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": []
              },
              "desc": "<p>Data path for ICU (<code>Intl</code> object) data. Will extend linked-in data when compiled\nwith small-icu support.</p>",
              "displayName": "`NODE_ICU_DATA=file`"
            },
            {
              "textRaw": "`NODE_NO_WARNINGS=1`",
              "name": "`node_no_warnings=1`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.11.0"
                ],
                "changes": []
              },
              "desc": "<p>When set to <code>1</code>, process warnings are silenced.</p>",
              "displayName": "`NODE_NO_WARNINGS=1`"
            },
            {
              "textRaw": "`NODE_OPTIONS=options...`",
              "name": "`node_options=options...`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A space-separated list of command-line options. <code>options...</code> are interpreted\nbefore command-line options, so command-line options will override or\ncompound after anything in <code>options...</code>. Node.js will exit with an error if\nan option that is not allowed in the environment is used, such as <code>-p</code> or a\nscript file.</p>\n<p>If an option value contains a space, it can be escaped using double quotes:</p>\n<pre><code class=\"language-bash\">NODE_OPTIONS='--require \"./my path/file.js\"'\n</code></pre>\n<p>A singleton flag passed as a command-line option will override the same flag\npassed into <code>NODE_OPTIONS</code>:</p>\n<pre><code class=\"language-bash\"># The inspector will be available on port 5555\nNODE_OPTIONS='--inspect=localhost:4444' node --inspect=localhost:5555\n</code></pre>\n<p>A flag that can be passed multiple times will be treated as if its\n<code>NODE_OPTIONS</code> instances were passed first, and then its command-line\ninstances afterwards:</p>\n<pre><code class=\"language-bash\">NODE_OPTIONS='--require \"./a.js\"' node --require \"./b.js\"\n# is equivalent to:\nnode --require \"./a.js\" --require \"./b.js\"\n</code></pre>\n<p>Node.js options that are allowed are in the following list. If an option\nsupports both --XX and --no-XX variants, they are both supported but only\none is included in the list below.</p>\n<ul>\n<li><code>--allow-addons</code></li>\n<li><code>--allow-child-process</code></li>\n<li><code>--allow-ffi</code></li>\n<li><code>--allow-fs-read</code></li>\n<li><code>--allow-fs-write</code></li>\n<li><code>--allow-inspector</code></li>\n<li><code>--allow-net</code></li>\n<li><code>--allow-wasi</code></li>\n<li><code>--allow-worker</code></li>\n<li><code>--conditions</code>, <code>-C</code></li>\n<li><code>--cpu-prof-dir</code></li>\n<li><code>--cpu-prof-interval</code></li>\n<li><code>--cpu-prof-name</code></li>\n<li><code>--cpu-prof</code></li>\n<li><code>--diagnostic-dir</code></li>\n<li><code>--disable-proto</code></li>\n<li><code>--disable-sigusr1</code></li>\n<li><code>--disable-warning</code></li>\n<li><code>--disable-wasm-trap-handler</code></li>\n<li><code>--dns-result-order</code></li>\n<li><code>--enable-fips</code></li>\n<li><code>--enable-network-family-autoselection</code></li>\n<li><code>--enable-source-maps</code></li>\n<li><code>--entry-url</code></li>\n<li><code>--experimental-abortcontroller</code></li>\n<li><code>--experimental-addon-modules</code></li>\n<li><code>--experimental-detect-module</code></li>\n<li><code>--experimental-eventsource</code></li>\n<li><code>--experimental-ffi</code></li>\n<li><code>--experimental-import-meta-resolve</code></li>\n<li><code>--experimental-json-modules</code></li>\n<li><code>--experimental-loader</code></li>\n<li><code>--experimental-modules</code></li>\n<li><code>--experimental-print-required-tla</code></li>\n<li><code>--experimental-quic</code></li>\n<li><code>--experimental-require-module</code></li>\n<li><code>--experimental-shadow-realm</code></li>\n<li><code>--experimental-specifier-resolution</code></li>\n<li><code>--experimental-stream-iter</code></li>\n<li><code>--experimental-test-isolation</code></li>\n<li><code>--experimental-top-level-await</code></li>\n<li><code>--experimental-vm-modules</code></li>\n<li><code>--experimental-wasi-unstable-preview1</code></li>\n<li><code>--force-context-aware</code></li>\n<li><code>--force-fips</code></li>\n<li><code>--force-node-api-uncaught-exceptions-policy</code></li>\n<li><code>--frozen-intrinsics</code></li>\n<li><code>--heap-prof-dir</code></li>\n<li><code>--heap-prof-interval</code></li>\n<li><code>--heap-prof-name</code></li>\n<li><code>--heap-prof</code></li>\n<li><code>--heapsnapshot-near-heap-limit</code></li>\n<li><code>--heapsnapshot-signal</code></li>\n<li><code>--http-parser</code></li>\n<li><code>--icu-data-dir</code></li>\n<li><code>--import</code></li>\n<li><code>--input-type</code></li>\n<li><code>--insecure-http-parser</code></li>\n<li><code>--inspect-brk</code></li>\n<li><code>--inspect-port</code>, <code>--debug-port</code></li>\n<li><code>--inspect-publish-uid</code></li>\n<li><code>--inspect-wait</code></li>\n<li><code>--inspect</code></li>\n<li><code>--localstorage-file</code></li>\n<li><code>--max-http-header-size</code></li>\n<li><code>--max-old-space-size-percentage</code></li>\n<li><code>--napi-modules</code></li>\n<li><code>--network-family-autoselection-attempt-timeout</code></li>\n<li><code>--no-addons</code></li>\n<li><code>--no-async-context-frame</code></li>\n<li><code>--no-deprecation</code></li>\n<li><code>--no-experimental-global-navigator</code></li>\n<li><code>--no-experimental-repl-await</code></li>\n<li><code>--no-experimental-sqlite</code></li>\n<li><code>--no-experimental-strip-types</code></li>\n<li><code>--no-experimental-websocket</code></li>\n<li><code>--no-experimental-webstorage</code></li>\n<li><code>--no-extra-info-on-fatal-exception</code></li>\n<li><code>--no-force-async-hooks-checks</code></li>\n<li><code>--no-global-search-paths</code></li>\n<li><code>--no-network-family-autoselection</code></li>\n<li><code>--no-strip-types</code></li>\n<li><code>--no-warnings</code></li>\n<li><code>--no-webstorage</code></li>\n<li><code>--node-memory-debug</code></li>\n<li><code>--openssl-config</code></li>\n<li><code>--openssl-legacy-provider</code></li>\n<li><code>--openssl-shared-config</code></li>\n<li><code>--pending-deprecation</code></li>\n<li><code>--permission-audit</code></li>\n<li><code>--permission</code></li>\n<li><code>--preserve-symlinks-main</code></li>\n<li><code>--preserve-symlinks</code></li>\n<li><code>--prof-process</code></li>\n<li><code>--redirect-warnings</code></li>\n<li><code>--report-compact</code></li>\n<li><code>--report-dir</code>, <code>--report-directory</code></li>\n<li><code>--report-exclude-env</code></li>\n<li><code>--report-exclude-network</code></li>\n<li><code>--report-filename</code></li>\n<li><code>--report-on-fatalerror</code></li>\n<li><code>--report-on-signal</code></li>\n<li><code>--report-signal</code></li>\n<li><code>--report-uncaught-exception</code></li>\n<li><code>--require-module</code></li>\n<li><code>--require</code>, <code>-r</code></li>\n<li><code>--secure-heap-min</code></li>\n<li><code>--secure-heap</code></li>\n<li><code>--snapshot-blob</code></li>\n<li><code>--test-coverage-branches</code></li>\n<li><code>--test-coverage-exclude</code></li>\n<li><code>--test-coverage-functions</code></li>\n<li><code>--test-coverage-include</code></li>\n<li><code>--test-coverage-lines</code></li>\n<li><code>--test-global-setup</code></li>\n<li><code>--test-isolation</code></li>\n<li><code>--test-name-pattern</code></li>\n<li><code>--test-only</code></li>\n<li><code>--test-random-seed</code></li>\n<li><code>--test-randomize</code></li>\n<li><code>--test-reporter-destination</code></li>\n<li><code>--test-reporter</code></li>\n<li><code>--test-rerun-failures</code></li>\n<li><code>--test-shard</code></li>\n<li><code>--test-skip-pattern</code></li>\n<li><code>--throw-deprecation</code></li>\n<li><code>--title</code></li>\n<li><code>--tls-cipher-list</code></li>\n<li><code>--tls-keylog</code></li>\n<li><code>--tls-max-v1.2</code></li>\n<li><code>--tls-max-v1.3</code></li>\n<li><code>--tls-min-v1.0</code></li>\n<li><code>--tls-min-v1.1</code></li>\n<li><code>--tls-min-v1.2</code></li>\n<li><code>--tls-min-v1.3</code></li>\n<li><code>--trace-deprecation</code></li>\n<li><code>--trace-env-js-stack</code></li>\n<li><code>--trace-env-native-stack</code></li>\n<li><code>--trace-env</code></li>\n<li><code>--trace-event-categories</code></li>\n<li><code>--trace-event-file-pattern</code></li>\n<li><code>--trace-events-enabled</code></li>\n<li><code>--trace-exit</code></li>\n<li><code>--trace-require-module</code></li>\n<li><code>--trace-sigint</code></li>\n<li><code>--trace-sync-io</code></li>\n<li><code>--trace-tls</code></li>\n<li><code>--trace-uncaught</code></li>\n<li><code>--trace-warnings</code></li>\n<li><code>--track-heap-objects</code></li>\n<li><code>--unhandled-rejections</code></li>\n<li><code>--use-bundled-ca</code></li>\n<li><code>--use-env-proxy</code></li>\n<li><code>--use-largepages</code></li>\n<li><code>--use-openssl-ca</code></li>\n<li><code>--use-system-ca</code></li>\n<li><code>--v8-pool-size</code></li>\n<li><code>--watch-kill-signal</code></li>\n<li><code>--watch-path</code></li>\n<li><code>--watch-preserve-output</code></li>\n<li><code>--watch</code></li>\n<li><code>--zero-fill-buffers</code></li>\n</ul>\n<p>V8 options that are allowed are:</p>\n<ul>\n<li><code>--abort-on-uncaught-exception</code></li>\n<li><code>--disallow-code-generation-from-strings</code></li>\n<li><code>--enable-etw-stack-walking</code></li>\n<li><code>--expose-gc</code></li>\n<li><code>--interpreted-frames-native-stack</code></li>\n<li><code>--jitless</code></li>\n<li><code>--max-heap-size</code></li>\n<li><code>--max-old-space-size</code></li>\n<li><code>--max-semi-space-size</code></li>\n<li><code>--perf-basic-prof-only-functions</code></li>\n<li><code>--perf-basic-prof</code></li>\n<li><code>--perf-prof-unwinding-info</code></li>\n<li><code>--perf-prof</code></li>\n<li><code>--stack-trace-limit</code></li>\n</ul>\n<p><code>--perf-basic-prof-only-functions</code>, <code>--perf-basic-prof</code>,\n<code>--perf-prof-unwinding-info</code>, and <code>--perf-prof</code> are only available on Linux.</p>\n<p><code>--enable-etw-stack-walking</code> is only available on Windows.</p>",
              "displayName": "`NODE_OPTIONS=options...`"
            },
            {
              "textRaw": "`NODE_PATH=path[:…]`",
              "name": "`node_path=path[:…]`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.1.32"
                ],
                "changes": []
              },
              "desc": "<p><code>':'</code>-separated list of directories prefixed to the module search path.</p>\n<p>On Windows, this is a <code>';'</code>-separated list instead.</p>",
              "displayName": "`NODE_PATH=path[:…]`"
            },
            {
              "textRaw": "`NODE_PENDING_DEPRECATION=1`",
              "name": "`node_pending_deprecation=1`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>When set to <code>1</code>, emit pending deprecation warnings.</p>\n<p>Pending deprecations are generally identical to a runtime deprecation with the\nnotable exception that they are turned <em>off</em> by default and will not be emitted\nunless either the <code>--pending-deprecation</code> command-line flag, or the\n<code>NODE_PENDING_DEPRECATION=1</code> environment variable, is set. Pending deprecations\nare used to provide a kind of selective \"early warning\" mechanism that\ndevelopers may leverage to detect deprecated API usage.</p>",
              "displayName": "`NODE_PENDING_DEPRECATION=1`"
            },
            {
              "textRaw": "`NODE_PENDING_PIPE_INSTANCES=instances`",
              "name": "`node_pending_pipe_instances=instances`",
              "type": "module",
              "desc": "<p>Set the number of pending pipe instance handles when the pipe server is waiting\nfor connections. This setting applies to Windows only.</p>",
              "displayName": "`NODE_PENDING_PIPE_INSTANCES=instances`"
            },
            {
              "textRaw": "`NODE_PRESERVE_SYMLINKS=1`",
              "name": "`node_preserve_symlinks=1`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.1.0"
                ],
                "changes": []
              },
              "desc": "<p>When set to <code>1</code>, instructs the module loader to preserve symbolic links when\nresolving and caching modules.</p>",
              "displayName": "`NODE_PRESERVE_SYMLINKS=1`"
            },
            {
              "textRaw": "`NODE_REDIRECT_WARNINGS=file`",
              "name": "`node_redirect_warnings=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>When set, process warnings will be emitted to the given file instead of\nprinting to stderr. The file will be created if it does not exist, and will be\nappended to if it does. If an error occurs while attempting to write the\nwarning to the file, the warning will be written to stderr instead. This is\nequivalent to using the <code>--redirect-warnings=file</code> command-line flag.</p>",
              "displayName": "`NODE_REDIRECT_WARNINGS=file`"
            },
            {
              "textRaw": "`NODE_REPL_EXTERNAL_MODULE=file`",
              "name": "`node_repl_external_module=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.0.0",
                  "v12.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.3.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52905",
                    "description": "Remove the possibility to use this env var with kDisableNodeOptionsEnv for embedders."
                  }
                ]
              },
              "desc": "<p>Path to a Node.js module which will be loaded in place of the built-in REPL.\nOverriding this value to an empty string (<code>''</code>) will use the built-in REPL.</p>",
              "displayName": "`NODE_REPL_EXTERNAL_MODULE=file`"
            },
            {
              "textRaw": "`NODE_REPL_HISTORY=file`",
              "name": "`node_repl_history=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Path to the file used to store the persistent REPL history. The default path is\n<code>~/.node_repl_history</code>, which is overridden by this variable. Setting the value\nto an empty string (<code>''</code> or <code>' '</code>) disables persistent REPL history.</p>",
              "displayName": "`NODE_REPL_HISTORY=file`"
            },
            {
              "textRaw": "`NODE_SKIP_PLATFORM_CHECK=value`",
              "name": "`node_skip_platform_check=value`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.5.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>value</code> equals <code>'1'</code>, the check for a supported platform is skipped during\nNode.js startup. Node.js might not execute correctly. Any issues encountered\non unsupported platforms will not be fixed.</p>",
              "displayName": "`NODE_SKIP_PLATFORM_CHECK=value`"
            },
            {
              "textRaw": "`NODE_TEST_CONTEXT=value`",
              "name": "`node_test_context=value`",
              "type": "module",
              "desc": "<p>If <code>value</code> equals <code>'child'</code>, test reporter options will be overridden and test\noutput will be sent to stdout in the TAP format. If any other value is provided,\nNode.js makes no guarantees about the reporter format used or its stability.</p>",
              "displayName": "`NODE_TEST_CONTEXT=value`"
            },
            {
              "textRaw": "`NODE_TLS_REJECT_UNAUTHORIZED=value`",
              "name": "`node_tls_reject_unauthorized=value`",
              "type": "module",
              "desc": "<p>If <code>value</code> equals <code>'0'</code>, certificate validation is disabled for TLS connections.\nThis makes TLS, and HTTPS by extension, insecure. The use of this environment\nvariable is strongly discouraged.</p>",
              "displayName": "`NODE_TLS_REJECT_UNAUTHORIZED=value`"
            },
            {
              "textRaw": "`NODE_USE_ENV_PROXY=1`",
              "name": "`node_use_env_proxy=1`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.0.0",
                  "v22.21.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "desc": "<p>When enabled, Node.js parses the <code>HTTP_PROXY</code>, <code>HTTPS_PROXY</code> and <code>NO_PROXY</code>\nenvironment variables during startup, and tunnels requests over the\nspecified proxy.</p>\n<p>This can also be enabled using the <a href=\"#--use-env-proxy\"><code>--use-env-proxy</code></a> command-line flag.\nWhen both are set, <code>--use-env-proxy</code> takes precedence.</p>",
              "displayName": "`NODE_USE_ENV_PROXY=1`"
            },
            {
              "textRaw": "`NODE_USE_SYSTEM_CA=1`",
              "name": "`node_use_system_ca=1`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.6.0",
                  "v22.19.0"
                ],
                "changes": []
              },
              "desc": "<p>Node.js uses the trusted CA certificates present in the system store along with\nthe <code>--use-bundled-ca</code> option and the <code>NODE_EXTRA_CA_CERTS</code> environment variable.</p>\n<p>This can also be enabled using the <a href=\"#--use-system-ca\"><code>--use-system-ca</code></a> command-line flag.\nWhen both are set, <code>--use-system-ca</code> takes precedence.</p>",
              "displayName": "`NODE_USE_SYSTEM_CA=1`"
            },
            {
              "textRaw": "`NODE_V8_COVERAGE=dir`",
              "name": "`node_v8_coverage=dir`",
              "type": "module",
              "desc": "<p>When set, Node.js will begin outputting <a href=\"https://v8project.blogspot.com/2017/12/javascript-code-coverage.html\">V8 JavaScript code coverage</a> and\n<a href=\"https://tc39.es/ecma426/\">Source Map</a> data to the directory provided as an argument (coverage\ninformation is written as JSON to files with a <code>coverage</code> prefix).</p>\n<p><code>NODE_V8_COVERAGE</code> will automatically propagate to subprocesses, making it\neasier to instrument applications that call the <code>child_process.spawn()</code> family\nof functions. <code>NODE_V8_COVERAGE</code> can be set to an empty string, to prevent\npropagation.</p>",
              "modules": [
                {
                  "textRaw": "Coverage output",
                  "name": "coverage_output",
                  "type": "module",
                  "desc": "<p>Coverage is output as an array of <a href=\"https://chromedevtools.github.io/devtools-protocol/tot/Profiler#type-ScriptCoverage\">ScriptCoverage</a> objects on the top-level\nkey <code>result</code>:</p>\n<pre><code class=\"language-json\">{\n  \"result\": [\n    {\n      \"scriptId\": \"67\",\n      \"url\": \"internal/tty.js\",\n      \"functions\": []\n    }\n  ]\n}\n</code></pre>",
                  "displayName": "Coverage output"
                },
                {
                  "textRaw": "Source map cache",
                  "name": "source_map_cache",
                  "type": "module",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "desc": "<p>If found, source map data is appended to the top-level key <code>source-map-cache</code>\non the JSON coverage object.</p>\n<p><code>source-map-cache</code> is an object with keys representing the files source maps\nwere extracted from, and values which include the raw source-map URL\n(in the key <code>url</code>), the parsed Source Map v3 information (in the key <code>data</code>),\nand the line lengths of the source file (in the key <code>lineLengths</code>).</p>\n<pre><code class=\"language-json\">{\n  \"result\": [\n    {\n      \"scriptId\": \"68\",\n      \"url\": \"file:///absolute/path/to/source.js\",\n      \"functions\": []\n    }\n  ],\n  \"source-map-cache\": {\n    \"file:///absolute/path/to/source.js\": {\n      \"url\": \"./path-to-map.json\",\n      \"data\": {\n        \"version\": 3,\n        \"sources\": [\n          \"file:///absolute/path/to/original.js\"\n        ],\n        \"names\": [\n          \"Foo\",\n          \"console\",\n          \"info\"\n        ],\n        \"mappings\": \"MAAMA,IACJC,YAAaC\",\n        \"sourceRoot\": \"./\"\n      },\n      \"lineLengths\": [\n        13,\n        62,\n        38,\n        27\n      ]\n    }\n  }\n}\n</code></pre>",
                  "displayName": "Source map cache"
                }
              ],
              "displayName": "`NODE_V8_COVERAGE=dir`"
            },
            {
              "textRaw": "`NO_COLOR=<any>`",
              "name": "`no_color=<any>`",
              "type": "module",
              "desc": "<p><a href=\"https://no-color.org\"><code>NO_COLOR</code></a>  is an alias for <code>NODE_DISABLE_COLORS</code>. The value of the\nenvironment variable is arbitrary.</p>",
              "displayName": "`NO_COLOR=<any>`"
            },
            {
              "textRaw": "`OPENSSL_CONF=file`",
              "name": "`openssl_conf=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v6.11.0"
                ],
                "changes": []
              },
              "desc": "<p>Load an OpenSSL configuration file on startup. Among other uses, this can be\nused to enable FIPS-compliant crypto if Node.js is built with\n<code>./configure --openssl-fips</code>.</p>\n<p>If the <a href=\"#--openssl-configfile\"><code>--openssl-config</code></a> command-line option is used, the environment\nvariable is ignored.</p>",
              "displayName": "`OPENSSL_CONF=file`"
            },
            {
              "textRaw": "`SSL_CERT_DIR=dir`",
              "name": "`ssl_cert_dir=dir`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>--use-openssl-ca</code> is enabled, or if <code>--use-system-ca</code> is enabled on\nplatforms other than macOS and Windows, this overrides and sets OpenSSL's directory\ncontaining trusted certificates.</p>\n<p>Be aware that unless the child environment is explicitly set, this environment\nvariable will be inherited by any child processes, and if they use OpenSSL, it\nmay cause them to trust the same CAs as node.</p>",
              "displayName": "`SSL_CERT_DIR=dir`"
            },
            {
              "textRaw": "`SSL_CERT_FILE=file`",
              "name": "`ssl_cert_file=file`",
              "type": "module",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>--use-openssl-ca</code> is enabled, or if <code>--use-system-ca</code> is enabled on\nplatforms other than macOS and Windows, this overrides and sets OpenSSL's file\ncontaining trusted certificates.</p>\n<p>Be aware that unless the child environment is explicitly set, this environment\nvariable will be inherited by any child processes, and if they use OpenSSL, it\nmay cause them to trust the same CAs as node.</p>",
              "displayName": "`SSL_CERT_FILE=file`"
            },
            {
              "textRaw": "`TZ`",
              "name": "`tz`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.2.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38642",
                    "description": "Changing the TZ variable using process.env.TZ = changes the timezone on Windows as well."
                  },
                  {
                    "version": [
                      "v13.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/20026",
                    "description": "Changing the TZ variable using process.env.TZ = changes the timezone on POSIX systems."
                  }
                ]
              },
              "desc": "<p>The <code>TZ</code> environment variable is used to specify the timezone configuration.</p>\n<p>While Node.js does not support all of the various <a href=\"https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html\">ways that <code>TZ</code> is handled in\nother environments</a>, it does support basic <a href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones\">timezone IDs</a> (such as\n<code>'Etc/UTC'</code>, <code>'Europe/Paris'</code>, or <code>'America/New_York'</code>).\nIt may support a few other abbreviations or aliases, but these are strongly\ndiscouraged and not guaranteed.</p>\n<pre><code class=\"language-console\">$ TZ=Europe/Dublin node -pe \"new Date().toString()\"\nWed May 12 2021 20:30:48 GMT+0100 (Irish Standard Time)\n</code></pre>",
              "displayName": "`TZ`"
            },
            {
              "textRaw": "`UV_THREADPOOL_SIZE=size`",
              "name": "`uv_threadpool_size=size`",
              "type": "module",
              "desc": "<p>Set the number of threads used in libuv's threadpool to <code>size</code> threads.</p>\n<p>Asynchronous system APIs are used by Node.js whenever possible, but where they\ndo not exist, libuv's threadpool is used to create asynchronous node APIs based\non synchronous system APIs. Node.js APIs that use the threadpool are:</p>\n<ul>\n<li>all <code>fs</code> APIs, other than the file watcher APIs and those that are explicitly\nsynchronous</li>\n<li>asynchronous crypto APIs such as <code>crypto.pbkdf2()</code>, <code>crypto.scrypt()</code>,\n<code>crypto.randomBytes()</code>, <code>crypto.randomFill()</code>, <code>crypto.generateKeyPair()</code></li>\n<li><code>dns.lookup()</code></li>\n<li>all <code>zlib</code> APIs, other than those that are explicitly synchronous</li>\n</ul>\n<p>Because libuv's threadpool has a fixed size, it means that if for whatever\nreason any of these APIs takes a long time, other (seemingly unrelated) APIs\nthat run in libuv's threadpool will experience degraded performance. In order to\nmitigate this issue, one potential solution is to increase the size of libuv's\nthreadpool by setting the <code>'UV_THREADPOOL_SIZE'</code> environment variable to a value\ngreater than <code>4</code> (its current default value). However, setting this from inside\nthe process using <code>process.env.UV_THREADPOOL_SIZE=size</code> is not guaranteed to work\nas the threadpool would have been created as part of the runtime initialisation\nmuch before user code is run. For more information, see the <a href=\"https://docs.libuv.org/en/latest/threadpool.html\">libuv threadpool documentation</a>.</p>",
              "displayName": "`UV_THREADPOOL_SIZE=size`"
            }
          ],
          "displayName": "Environment variables"
        },
        {
          "textRaw": "Useful V8 options",
          "name": "useful_v8_options",
          "type": "misc",
          "desc": "<p>V8 has its own set of CLI options. Any V8 CLI option that is provided to <code>node</code>\nwill be passed on to V8 to handle. V8's options have <em>no stability guarantee</em>.\nThe V8 team themselves don't consider them to be part of their formal API,\nand reserve the right to change them at any time. Likewise, they are not\ncovered by the Node.js stability guarantees. Many of the V8\noptions are of interest only to V8 developers. Despite this, there is a small\nset of V8 options that are widely applicable to Node.js, and they are\ndocumented here:</p>",
          "modules": [
            {
              "textRaw": "`--abort-on-uncaught-exception`",
              "name": "`--abort-on-uncaught-exception`",
              "type": "module",
              "displayName": "`--abort-on-uncaught-exception`"
            },
            {
              "textRaw": "`--disallow-code-generation-from-strings`",
              "name": "`--disallow-code-generation-from-strings`",
              "type": "module",
              "displayName": "`--disallow-code-generation-from-strings`"
            },
            {
              "textRaw": "`--enable-etw-stack-walking`",
              "name": "`--enable-etw-stack-walking`",
              "type": "module",
              "displayName": "`--enable-etw-stack-walking`"
            },
            {
              "textRaw": "`--expose-gc`",
              "name": "`--expose-gc`",
              "type": "module",
              "displayName": "`--expose-gc`"
            },
            {
              "textRaw": "`--harmony-shadow-realm`",
              "name": "`--harmony-shadow-realm`",
              "type": "module",
              "displayName": "`--harmony-shadow-realm`"
            },
            {
              "textRaw": "`--heap-snapshot-on-oom`",
              "name": "`--heap-snapshot-on-oom`",
              "type": "module",
              "displayName": "`--heap-snapshot-on-oom`"
            },
            {
              "textRaw": "`--interpreted-frames-native-stack`",
              "name": "`--interpreted-frames-native-stack`",
              "type": "module",
              "displayName": "`--interpreted-frames-native-stack`"
            },
            {
              "textRaw": "`--jitless`",
              "name": "`--jitless`",
              "type": "module",
              "displayName": "`--jitless`"
            },
            {
              "textRaw": "`--max-heap-size`",
              "name": "`--max-heap-size`",
              "type": "module",
              "desc": "<p>Specifies the maximum heap size (in megabytes) for the process.</p>\n<p>This option is typically used to limit the amount of memory the process can use for its JavaScript heap.</p>\n<p><a id=\"--max-old-space-sizesize-in-megabytes\"></a></p>",
              "displayName": "`--max-heap-size`"
            },
            {
              "textRaw": "`--max-old-space-size=SIZE` (in MiB)",
              "name": "`--max-old-space-size=size`_(in_mib)",
              "type": "module",
              "desc": "<p>Sets the max memory size of V8's old memory section. As memory\nconsumption approaches the limit, V8 will spend more time on\ngarbage collection in an effort to free unused memory.</p>\n<p>On a machine with 2 GiB of memory, consider setting this to\n1536 (1.5 GiB) to leave some memory for other uses and avoid swapping.</p>\n<pre><code class=\"language-bash\">node --max-old-space-size=1536 index.js\n</code></pre>\n<p><a id=\"--max-semi-space-sizesize-in-megabytes\"></a></p>",
              "displayName": "`--max-old-space-size=SIZE` (in MiB)"
            },
            {
              "textRaw": "`--max-semi-space-size=SIZE` (in MiB)",
              "name": "`--max-semi-space-size=size`_(in_mib)",
              "type": "module",
              "desc": "<p>Sets the maximum <a href=\"https://www.memorymanagement.org/glossary/s.html#semi.space\">semi-space</a> size for V8's <a href=\"https://v8.dev/blog/orinoco-parallel-scavenger\">scavenge garbage collector</a> in\nMiB (mebibytes).\nIncreasing the max size of a semi-space may improve throughput for Node.js at\nthe cost of more memory consumption.</p>\n<p>Since the young generation size of the V8 heap is three times (see\n<a href=\"https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.3.129/src/heap/heap.cc#328\"><code>YoungGenerationSizeFromSemiSpaceSize</code></a> in V8) the size of the semi-space,\nan increase of 1 MiB to semi-space applies to each of the three individual\nsemi-spaces and causes the heap size to increase by 3 MiB. The throughput\nimprovement depends on your workload (see <a href=\"https://github.com/nodejs/node/issues/42511\">#42511</a>).</p>\n<p>The default value depends on the memory limit. For example, on 64-bit systems\nwith a memory limit of 512 MiB, the max size of a semi-space defaults to 1 MiB.\nFor memory limits up to and including 2GiB, the default max size of a\nsemi-space will be less than 16 MiB on 64-bit systems.</p>\n<p>To get the best configuration for your application, you should try different\nmax-semi-space-size values when running benchmarks for your application.</p>\n<p>For example, benchmark on a 64-bit systems:</p>\n<pre><code class=\"language-bash\">for MiB in 16 32 64 128; do\n    node --max-semi-space-size=$MiB index.js\ndone\n</code></pre>",
              "displayName": "`--max-semi-space-size=SIZE` (in MiB)"
            },
            {
              "textRaw": "`--perf-basic-prof`",
              "name": "`--perf-basic-prof`",
              "type": "module",
              "displayName": "`--perf-basic-prof`"
            },
            {
              "textRaw": "`--perf-basic-prof-only-functions`",
              "name": "`--perf-basic-prof-only-functions`",
              "type": "module",
              "displayName": "`--perf-basic-prof-only-functions`"
            },
            {
              "textRaw": "`--perf-prof`",
              "name": "`--perf-prof`",
              "type": "module",
              "displayName": "`--perf-prof`"
            },
            {
              "textRaw": "`--perf-prof-unwinding-info`",
              "name": "`--perf-prof-unwinding-info`",
              "type": "module",
              "displayName": "`--perf-prof-unwinding-info`"
            },
            {
              "textRaw": "`--prof`",
              "name": "`--prof`",
              "type": "module",
              "displayName": "`--prof`"
            },
            {
              "textRaw": "`--security-revert`",
              "name": "`--security-revert`",
              "type": "module",
              "displayName": "`--security-revert`"
            },
            {
              "textRaw": "`--stack-trace-limit=limit`",
              "name": "`--stack-trace-limit=limit`",
              "type": "module",
              "desc": "<p>The maximum number of stack frames to collect in an error's stack trace.\nSetting it to 0 disables stack trace collection. The default value is 10.</p>\n<pre><code class=\"language-bash\">node --stack-trace-limit=12 -p -e \"Error.stackTraceLimit\" # prints 12\n</code></pre>",
              "displayName": "`--stack-trace-limit=limit`"
            }
          ],
          "displayName": "Useful V8 options"
        }
      ],
      "source": "doc/api/cli.md"
    },
    {
      "textRaw": "Debugger",
      "name": "Debugger",
      "introduced_in": "v0.9.12",
      "type": "misc",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>Node.js includes a command-line debugging utility. The Node.js debugger client\nis not a full-featured debugger, but simple stepping and inspection are\npossible.</p>\n<p>The debugger supports two modes of operation: <a href=\"#interactive-mode\">interactive mode</a> and <a href=\"#probe-mode\">non-interactive probe mode</a>.</p>",
      "miscs": [
        {
          "textRaw": "Interactive mode",
          "name": "interactive_mode",
          "type": "misc",
          "desc": "<pre><code class=\"language-console\">$ node inspect [--port=&#x3C;port>] [&#x3C;node-option> ...] [&#x3C;script> [&#x3C;script-args>] | &#x3C;host>:&#x3C;port> | -p &#x3C;pid>]\n</code></pre>\n<p>To use it, start Node.js with the <code>inspect</code> argument followed by the path to the\nscript to debug.</p>\n<pre><code class=\"language-console\">$ node inspect myscript.js\n&#x3C; Debugger listening on ws://127.0.0.1:9229/621111f9-ffcb-4e82-b718-48a145fa5db8\n&#x3C; For help, see: https://nodejs.org/learn/getting-started/debugging\n&#x3C;\nconnecting to 127.0.0.1:9229 ... ok\n&#x3C; Debugger attached.\n&#x3C;\n ok\nBreak on start in myscript.js:2\n  1 // myscript.js\n> 2 global.x = 5;\n  3 setTimeout(() => {\n  4   debugger;\ndebug>\n</code></pre>\n<p>The debugger automatically breaks on the first executable line. To instead\nrun until the first breakpoint (specified by a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/debugger\"><code>debugger</code></a> statement), set\nthe <code>NODE_INSPECT_RESUME_ON_START</code> environment variable to <code>1</code>.</p>\n<pre><code class=\"language-console\">$ cat myscript.js\n// myscript.js\nglobal.x = 5;\nsetTimeout(() => {\n  debugger;\n  console.log('world');\n}, 1000);\nconsole.log('hello');\n$ NODE_INSPECT_RESUME_ON_START=1 node inspect myscript.js\n&#x3C; Debugger listening on ws://127.0.0.1:9229/f1ed133e-7876-495b-83ae-c32c6fc319c2\n&#x3C; For help, see: https://nodejs.org/learn/getting-started/debugging\n&#x3C;\nconnecting to 127.0.0.1:9229 ... ok\n&#x3C; Debugger attached.\n&#x3C;\n&#x3C; hello\n&#x3C;\nbreak in myscript.js:4\n  2 global.x = 5;\n  3 setTimeout(() => {\n> 4   debugger;\n  5   console.log('world');\n  6 }, 1000);\ndebug> next\nbreak in myscript.js:5\n  3 setTimeout(() => {\n  4   debugger;\n> 5   console.log('world');\n  6 }, 1000);\n  7 console.log('hello');\ndebug> repl\nPress Ctrl+C to leave debug repl\n> x\n5\n> 2 + 2\n4\ndebug> next\n&#x3C; world\n&#x3C;\nbreak in myscript.js:6\n  4   debugger;\n  5   console.log('world');\n> 6 }, 1000);\n  7 console.log('hello');\n  8\ndebug> .exit\n$\n</code></pre>\n<p>The <code>repl</code> command allows code to be evaluated remotely. The <code>next</code> command\nsteps to the next line. Type <code>help</code> to see what other commands are available.</p>\n<p>Pressing <code>enter</code> without typing a command will repeat the previous debugger\ncommand.</p>",
          "modules": [
            {
              "textRaw": "Watchers",
              "name": "watchers",
              "type": "module",
              "desc": "<p>It is possible to watch expression and variable values while debugging. On\nevery breakpoint, each expression from the watchers list will be evaluated\nin the current context and displayed immediately before the breakpoint's\nsource code listing.</p>\n<p>To begin watching an expression, type <code>watch('my_expression')</code>. The command\n<code>watchers</code> will print the active watchers. To remove a watcher, type\n<code>unwatch('my_expression')</code>.</p>",
              "displayName": "Watchers"
            }
          ],
          "displayName": "Interactive mode"
        },
        {
          "textRaw": "Command reference",
          "name": "command_reference",
          "type": "misc",
          "modules": [
            {
              "textRaw": "Stepping",
              "name": "stepping",
              "type": "module",
              "desc": "<ul>\n<li><code>cont</code>, <code>c</code>: Continue execution</li>\n<li><code>next</code>, <code>n</code>: Step next</li>\n<li><code>step</code>, <code>s</code>: Step in</li>\n<li><code>out</code>, <code>o</code>: Step out</li>\n<li><code>pause</code>: Pause running code (like pause button in Developer Tools)</li>\n</ul>",
              "modules": [
                {
                  "textRaw": "Breakpoints",
                  "name": "breakpoints",
                  "type": "module",
                  "desc": "<ul>\n<li><code>setBreakpoint()</code>, <code>sb()</code>: Set breakpoint on current line</li>\n<li><code>setBreakpoint(line)</code>, <code>sb(line)</code>: Set breakpoint on specific line</li>\n<li><code>setBreakpoint('fn()')</code>, <code>sb(...)</code>: Set breakpoint on a first statement in\nfunction's body</li>\n<li><code>setBreakpoint('script.js', 1)</code>, <code>sb(...)</code>: Set breakpoint on first line of\n<code>script.js</code></li>\n<li><code>setBreakpoint('script.js', 1, 'num &#x3C; 4')</code>, <code>sb(...)</code>: Set conditional\nbreakpoint on first line of <code>script.js</code> that only breaks when <code>num &#x3C; 4</code>\nevaluates to <code>true</code></li>\n<li><code>clearBreakpoint('script.js', 1)</code>, <code>cb(...)</code>: Clear breakpoint in <code>script.js</code>\non line 1</li>\n</ul>\n<p>It is also possible to set a breakpoint in a file (module) that\nis not loaded yet:</p>\n<pre><code class=\"language-console\">$ node inspect main.js\n&#x3C; Debugger listening on ws://127.0.0.1:9229/48a5b28a-550c-471b-b5e1-d13dd7165df9\n&#x3C; For help, see: https://nodejs.org/learn/getting-started/debugging\n&#x3C;\nconnecting to 127.0.0.1:9229 ... ok\n&#x3C; Debugger attached.\n&#x3C;\nBreak on start in main.js:1\n> 1 const mod = require('./mod.js');\n  2 mod.hello();\n  3 mod.hello();\ndebug> setBreakpoint('mod.js', 22)\nWarning: script 'mod.js' was not loaded yet.\ndebug> c\nbreak in mod.js:22\n 20 // USE OR OTHER DEALINGS IN THE SOFTWARE.\n 21\n>22 exports.hello = function() {\n 23   return 'hello from module';\n 24 };\ndebug>\n</code></pre>\n<p>It is also possible to set a conditional breakpoint that only breaks when a\ngiven expression evaluates to <code>true</code>:</p>\n<pre><code class=\"language-console\">$ node inspect main.js\n&#x3C; Debugger listening on ws://127.0.0.1:9229/ce24daa8-3816-44d4-b8ab-8273c8a66d35\n&#x3C; For help, see: https://nodejs.org/learn/getting-started/debugging\n&#x3C;\nconnecting to 127.0.0.1:9229 ... ok\n&#x3C; Debugger attached.\nBreak on start in main.js:7\n  5 }\n  6\n> 7 addOne(10);\n  8 addOne(-1);\n  9\ndebug> setBreakpoint('main.js', 4, 'num &#x3C; 0')\n  1 'use strict';\n  2\n  3 function addOne(num) {\n> 4   return num + 1;\n  5 }\n  6\n  7 addOne(10);\n  8 addOne(-1);\n  9\ndebug> cont\nbreak in main.js:4\n  2\n  3 function addOne(num) {\n> 4   return num + 1;\n  5 }\n  6\ndebug> exec('num')\n-1\ndebug>\n</code></pre>",
                  "displayName": "Breakpoints"
                },
                {
                  "textRaw": "Information",
                  "name": "information",
                  "type": "module",
                  "desc": "<ul>\n<li><code>backtrace</code>, <code>bt</code>: Print backtrace of current execution frame</li>\n<li><code>list(5)</code>: List scripts source code with 5 line context (5 lines before and\nafter)</li>\n<li><code>watch(expr)</code>: Add expression to watch list</li>\n<li><code>unwatch(expr)</code>: Remove expression from watch list</li>\n<li><code>unwatch(index)</code>: Remove expression at specific index from watch list</li>\n<li><code>watchers</code>: List all watchers and their values (automatically listed on each\nbreakpoint)</li>\n<li><code>repl</code>: Open debugger's repl for evaluation in debugging script's context</li>\n<li><code>exec expr</code>, <code>p expr</code>: Execute an expression in debugging script's context and\nprint its value</li>\n<li><code>profile</code>: Start CPU profiling session</li>\n<li><code>profileEnd</code>: Stop current CPU profiling session</li>\n<li><code>profiles</code>: List all completed CPU profiling sessions</li>\n<li><code>profiles[n].save(filepath = 'node.cpuprofile')</code>: Save CPU profiling session\nto disk as JSON</li>\n<li><code>takeHeapSnapshot(filepath = 'node.heapsnapshot')</code>: Take a heap snapshot\nand save to disk as JSON</li>\n</ul>",
                  "displayName": "Information"
                },
                {
                  "textRaw": "Execution control",
                  "name": "execution_control",
                  "type": "module",
                  "desc": "<ul>\n<li><code>run</code>: Run script (automatically runs on debugger's start)</li>\n<li><code>restart</code>: Restart script</li>\n<li><code>kill</code>: Kill script</li>\n</ul>",
                  "displayName": "Execution control"
                },
                {
                  "textRaw": "Various",
                  "name": "various",
                  "type": "module",
                  "desc": "<ul>\n<li><code>scripts</code>: List all loaded scripts</li>\n<li><code>version</code>: Display V8's version</li>\n</ul>",
                  "displayName": "Various"
                }
              ],
              "displayName": "Stepping"
            }
          ],
          "displayName": "Command reference"
        },
        {
          "textRaw": "Probe mode",
          "name": "probe_mode",
          "type": "misc",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": [
              {
                "version": "v26.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/63437",
                "description": "Add `probe_failure` terminal `error` event for inspector-side mid-session failures, and `error.details` for additional context on per-hit and terminal errors."
              },
              {
                "version": "v26.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/63286",
                "description": "JSON report schema bumped to v2. Probe `target` is now `{ suffix, line, column? }` instead of an array. Each \"hit\" event carries a `location` field reporting the actual evaluation location.  When the probe does not specify a column, it binds to the first executable column instead of defaulting to 1."
              }
            ]
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p><code>node inspect</code> supports a non-interactive probe mode for inspecting runtime values\nin an application via the flag <code>--probe</code>.</p>\n<p>Currently, probe mode only supports launching a new process from the entry point\nscript specified on the command line.</p>\n<p>The probe mode sets one or more source breakpoints, evaluates specified\nexpressions whenever the execution reaches a breakpoint, and prints one\nfinal report of all the evaluated expressions when the session ends\n(either on normal completion, error, or timeout). This allows developers to perform\nprintf-style debugging without having to modify the application code and\nclean up afterwards. It also supports structured JSON output for tool use.</p>\n<pre><code class=\"language-console\">$ node inspect --probe &#x3C;file>:&#x3C;line>[:&#x3C;col>] --expr &#x3C;expr>\n              [--probe &#x3C;file>:&#x3C;line>[:&#x3C;col>] --expr &#x3C;expr> ...]\n              [--json] [--preview] [--timeout=&#x3C;ms>] [--port=&#x3C;port>]\n              [--] [&#x3C;node-option> ...] &#x3C;script> [&#x3C;script-args> ...]\n</code></pre>\n<ul>\n<li><code>--probe &#x3C;file>:&#x3C;line>[:&#x3C;col>]</code>: Source location of the probe. When execution\nreaches the location, the provided expressions are evaluated and printed in\nthe output. <code>&#x3C;file></code> matches the URL suffix of the script to probe.\n<code>&#x3C;line></code> and <code>&#x3C;col></code> numbers are 1-based. When <code>&#x3C;col></code> is omitted, the probe\nbinds to the first executable column on the line.</li>\n<li><code>--expr &#x3C;expr></code>: JavaScript expression to evaluate whenever execution reaches\nthe location specified by the preceding <code>--probe</code>.\nMust immediately follow the <code>--probe</code> it belongs to.</li>\n<li><code>--timeout=&#x3C;ms></code>: A global wall-clock deadline for the entire probe session.\nThe default is <code>30000</code>. This can be used to probe a long-running application\nthat can be terminated externally.</li>\n<li><code>--json</code>: If used, prints a structured JSON report instead of the default text report.</li>\n<li><code>--preview</code>: If used, non-primitive values will include CDP property previews for\nobject-like JSON probe values.</li>\n<li><code>--port=&#x3C;port></code>: Selects the local inspector port where the probing session\nwill listen. Defaults to <code>0</code>, which requests a random port.</li>\n<li><code>--</code> is optional unless the child needs its own Node.js flags.</li>\n</ul>\n<p>Additional rules about the <code>--probe</code> and <code>--expr</code> arguments:</p>\n<ul>\n<li><code>--probe &#x3C;file>:&#x3C;line>[:&#x3C;col>]</code> and <code>--expr &#x3C;expr></code> are strict pairs. Each\n<code>--probe</code> must be followed immediately by exactly one <code>--expr</code>.</li>\n<li><code>--timeout</code>, <code>--json</code>, <code>--preview</code>, and <code>--port</code> are global probe options\nfor the whole probe session. They may appear before or between probe pairs,\nbut not between a <code>--probe</code> and its matching <code>--expr</code>.</li>\n<li>If additional Node.js execution arguments need to be passed to the child\nscript, <code>--</code> must be used to separate the probe options from the Node.js\noptions for the child script.</li>\n</ul>\n<p>Example:</p>\n<pre><code class=\"language-console\">$ node inspect --probe app.js:10 --expr \"user\"\n               --probe src/utils.js:5:15 --expr \"config.options\"\n               --json --preview -- --no-warnings app.js --arg-for-app=foo\n</code></pre>",
          "modules": [
            {
              "textRaw": "Probe output format",
              "name": "probe_output_format",
              "type": "module",
              "desc": "<p>When the probe session ends, the probing process prints a final report of all the probe hits and results.</p>\n<p>Consider this script:</p>\n<pre><code class=\"language-js\">// cli.js\nlet maxRSS = 0;\nfor (let i = 0; i &#x3C; 2; i++) {\n  const { rss } = process.memoryUsage();\n  maxRSS = Math.max(maxRSS, rss);\n}\n</code></pre>\n<p>Without <code>--json</code>, by default the output is printed in a human-readable text format:</p>\n<pre><code class=\"language-console\">$ node inspect --probe cli.js:5 --expr 'rss' cli.js\nHit 1 at file:///path/to/cli.js:5:3\n  rss = 54935552\nHit 2 at file:///path/to/cli.js:5:3\n  rss = 55083008\nCompleted\n</code></pre>\n<p>The original <code>&#x3C;file>:&#x3C;line>[:&#x3C;col>]</code> passed to <code>--probe</code> may be resolved to a different\nlocation to ensure it's pausable, or it can match multiple loaded scripts, so the actual\nevaluation location helps disambiguate the results.</p>\n<p>Primitive results are printed directly, while objects and arrays use Chrome\nDevTools Protocol preview data when available. Other non-primitive values\nfall back to the Chrome DevTools Protocol <code>description</code> string.\nExpression failures are recorded as <code>[error] ...</code> lines and do not fail\nthe overall session. If richer text formatting is needed, wrap the expression\nin <code>JSON.stringify(...)</code> or <code>util.inspect(...)</code>.</p>\n<p>When <code>--json</code> is used, the output shape looks like this:</p>\n<pre><code class=\"language-console\">$ node inspect --json --probe cli.js:5 --expr 'rss' cli.js\n{\"v\":2,\"probes\":[{\"expr\":\"rss\",\"target\":{\"suffix\":\"cli.js\",\"line\":5}}],\"results\":[{\"probe\":0,\"event\":\"hit\",\"hit\":1,\"location\":{\"url\":\"file:///path/to/cli.js\",\"line\":5,\"column\":3},\"result\":{\"type\":\"number\",\"value\":55443456,\"description\":\"55443456\"}},{\"probe\":0,\"event\":\"hit\",\"hit\":2,\"location\":{\"url\":\"file:///path/to/cli.js\",\"line\":5,\"column\":3},\"result\":{\"type\":\"number\",\"value\":55574528,\"description\":\"55574528\"}},{\"event\":\"completed\"}]}\n</code></pre>\n<pre><code class=\"language-json\">{\n  \"v\": 2, // Probe JSON schema version.\n  \"probes\": [\n    {\n      \"expr\": \"rss\", // The expression paired with --probe.\n      \"target\": {\n        // The user's probe specification. `suffix` is the raw &#x3C;file> passed\n        // to --probe and is matched as a path-separator-anchored suffix\n        // against every loaded script's URL. `column` is present only if the\n        // user supplied `:col`. The actual evaluation location may differ\n        // from the target and will be reported in each hit's `location` field.\n        \"suffix\": \"cli.js\",\n        \"line\": 5\n      }\n    }\n  ],\n  \"results\": [\n    {\n      \"probe\": 0, // Index into probes[].\n      \"event\": \"hit\", // Hit events are recorded in observation order.\n      \"hit\": 1, // 1-based hit count for this probe.\n      \"location\": {\n        // The actual location where the execution is paused to evaluate\n        // the expression of the probe. This may differ from the probe's\n        // target due to pausability adjustments or multiple matches.\n        \"url\": \"file:///path/to/cli.js\",\n        \"line\": 5,\n        \"column\": 3\n      },\n      \"result\": {\n        \"type\": \"number\",\n        \"value\": 55443456,\n        \"description\": \"55443456\"\n      }\n      // If the probe expression throws, fails, or never completes, the entry\n      // carries an `error` field instead of `result` with the shape\n      // `{ message: string, details?: object }`. The `message` and `details`\n      // content is informational only and may change between releases.\n    },\n    {\n      \"probe\": 0,\n      \"event\": \"hit\",\n      \"hit\": 2,\n      \"location\": { \"url\": \"file:///path/to/cli.js\", \"line\": 5, \"column\": 3 },\n      \"result\": {\n        \"type\": \"number\",\n        \"value\": 55574528,\n        \"description\": \"55574528\"\n      }\n    },\n    {\n      \"event\": \"completed\"\n      // The final entry is always a terminal event, for example:\n      // 1. { \"event\": \"completed\" }\n      // 2. { \"event\": \"miss\", \"pending\": [0, 1] }\n      // 3. {\n      //      \"event\": \"timeout\",\n      //      \"pending\": [0],\n      //      \"error\": {\n      //       \"code\": \"probe_timeout\",\n      //       \"message\": \"Timed out after 30000ms waiting for probes: app.js:10\"\n      //      }\n      //    }\n      // 4. {\n      //      \"event\": \"error\",\n      //      \"pending\": [0],\n      //      \"error\": {\n      //       \"code\": \"probe_target_exit\",\n      //       \"exitCode\": 1,\n      //       \"stderr\": \"Error: boom\",\n      //       \"message\": \"Target exited with code 1 before probes: app.js:10\"\n      //      }\n      //    }\n      // 5. {\n      //      \"event\": \"error\",\n      //      \"pending\": [1],\n      //      \"error\": {\n      //       \"code\": \"probe_failure\",\n      //       \"probe\": 0,\n      //       \"stderr\": \"...\",\n      //       \"message\": \"Target process exited during probe evaluation before probes: app.js:12. If the failure repeats, review the probe expression.\",\n      //       \"details\": { \"lastCdpMethod\": \"Debugger.evaluateOnCallFrame\" }\n      //      }\n      //    }\n    }\n  ]\n}\n</code></pre>",
              "displayName": "Probe output format"
            },
            {
              "textRaw": "Output and exit codes",
              "name": "output_and_exit_codes",
              "type": "module",
              "desc": "<p>Probe mode only prints the final probe report to stdout, and otherwise silences\nstdout/stderr from the child process. When the probing session ends,\nthe probing process typically exits with code <code>0</code> and prints a final report to\nstdout. If the child process exits with a non-zero code before the probe\nsession ends, or the probe session cannot complete for another reason, the\nfinal report records a terminal <code>error</code> event.</p>\n<p>When <code>error.code</code> is <code>'probe_failure'</code> or <code>'probe_timeout'</code>, the probing process\nexits with a non-zero code, indicating recorded hits may be incomplete.\nIn this case, <code>error.message</code> will contain recovery hints, and <code>error.probe</code>,\nwhen present, is an index into the report's <code>probes</code> array that identifies\nthe possible culprit probe on a best-effort basis to help guide debugging.</p>\n<p>Invalid arguments and fatal launch or connect failures may cause the\nprobing process to exit with a non-zero code and print an error message\nto stderr without a final probe report.</p>",
              "displayName": "Output and exit codes"
            },
            {
              "textRaw": "Probing multiple expressions at the same execution point",
              "name": "probing_multiple_expressions_at_the_same_execution_point",
              "type": "module",
              "desc": "<p>When multiple <code>--probe</code>/<code>--expr</code> pairs share the same <code>--probe</code>, the\nexpressions will be evaluated on the same pause in the order they appear\non the command line.</p>\n<pre><code class=\"language-js\">// app.js\nconst x = { x: 42 };       // line 2\nconst y = { y: 35 };       // line 3\nconst z = { ...x, ...y };  // line 4\n</code></pre>\n<pre><code class=\"language-console\">$ node inspect --probe app.js:4 --expr 'x' --probe app.js:4 --expr 'y' -- app.js\n</code></pre>\n<p>Prints</p>\n<pre><code class=\"language-text\">Hit 1 at file:///path/to/app.js:4:1\n  x = {x: 42}\nHit 1 at file:///path/to/app.js:4:1\n  y = {y: 35}\nCompleted\n</code></pre>\n<pre><code class=\"language-console\">$ node inspect --probe app.js:4 --expr 'x' --probe app.js:4 --expr 'y' --json --preview -- app.js\n</code></pre>\n<p>Prints</p>\n<pre><code class=\"language-json\">{\"v\":2,\"probes\":[{\"expr\":\"x\",\"target\":{\"suffix\":\"app.js\",\"line\":4}},{\"expr\":\"y\",\"target\":{\"suffix\":\"app.js\",\"line\":4}}],\"results\":[{\"probe\":0,\"event\":\"hit\",\"hit\":1,\"location\":{\"url\":\"file:///path/to/app.js\",\"line\":4,\"column\":1},\"result\":{\"type\":\"object\",\"description\":\"Object\",\"preview\":{\"type\":\"object\",\"description\":\"Object\",\"overflow\":false,\"properties\":[{\"name\":\"x\",\"type\":\"number\",\"value\":\"42\"}]}}},{\"probe\":1,\"event\":\"hit\",\"hit\":1,\"location\":{\"url\":\"file:///path/to/app.js\",\"line\":4,\"column\":1},\"result\":{\"type\":\"object\",\"description\":\"Object\",\"preview\":{\"type\":\"object\",\"description\":\"Object\",\"overflow\":false,\"properties\":[{\"name\":\"y\",\"type\":\"number\",\"value\":\"35\"}]}}},{\"event\":\"completed\"}]}\n</code></pre>",
              "displayName": "Probing multiple expressions at the same execution point"
            },
            {
              "textRaw": "Selecting the probe location",
              "name": "selecting_the_probe_location",
              "type": "module",
              "desc": "<p>The expressions are evaluated in the lexical scope of the probe location when\nexecution reaches it. Avoid probing a variable declared by <code>let</code> or <code>const</code> at its\ndeclaration site, as this leads to a <code>ReferenceError</code> caused by\naccessing the variable in its temporal dead zone (TDZ).</p>\n<pre><code class=\"language-js\">// app.js\nconst x = 42;        // line 2\nconsole.log(x);      // line 3\n</code></pre>\n<pre><code class=\"language-console\">$ node inspect --probe app.js:1 --expr 'x' app.js\nHit 1 at file:///path/to/app.js:1:1\n  [error] x = ReferenceError: Cannot access 'x' from debugger\n  ...\nCompleted\n</code></pre>\n<p>Instead, probe at a location where the variable is already initialized:</p>\n<pre><code class=\"language-console\">$ node inspect --probe app.js:3 --expr 'x' app.js\nHit 1 at file:///path/to/app.js:3:1\n  x = 42\nCompleted\n</code></pre>\n<p>The <code>&#x3C;file></code> argument is matched as a path suffix of every loaded\nscript URL, anchored on a path separator. Passing only a basename\nmatches every loaded script with that basename, similar to how native\ndebuggers typically match breakpoints, while passing a partial path\nnarrows the match. Given:</p>\n<pre><code class=\"language-text\">project/\n  - src/utils.js\n  - lib/utils.js\n</code></pre>\n<p><code>--probe utils.js:10</code> binds to <em>both</em> files and produces one hit per match.\nEach hit carries its own <code>location</code> field identifying where the expression\nwas actually executed, so consumers can attribute the result to one of the\ntwo files accurately. To disambiguate at bind time, specify a fuller path\nthat only matches the intended file:</p>\n<pre><code class=\"language-console\">$ node inspect --probe src/utils.js:10 --expr 'x' main.js   # matches only src/utils.js\n</code></pre>",
              "displayName": "Selecting the probe location"
            }
          ],
          "displayName": "Probe mode"
        },
        {
          "textRaw": "Advanced usage",
          "name": "advanced_usage",
          "type": "misc",
          "modules": [
            {
              "textRaw": "V8 inspector integration for Node.js",
              "name": "v8_inspector_integration_for_node.js",
              "type": "module",
              "desc": "<p>V8 Inspector integration allows attaching Chrome DevTools to Node.js\ninstances for debugging and profiling. It uses the\n<a href=\"https://chromedevtools.github.io/devtools-protocol/\">Chrome DevTools Protocol</a>.</p>\n<p>V8 Inspector can be enabled by passing the <code>--inspect</code> flag when starting a\nNode.js application. It is also possible to supply a custom port with that flag,\ne.g. <code>--inspect=9222</code> will accept DevTools connections on port 9222.</p>\n<p>Using the <code>--inspect</code> flag will execute the code immediately before debugger is connected.\nThis means that the code will start running before you can start debugging, which might\nnot be ideal if you want to debug from the very beginning.</p>\n<p>In such cases, you have two alternatives:</p>\n<ol>\n<li><code>--inspect-wait</code> flag: This flag will wait for debugger to be attached before executing the code.\nThis allows you to start debugging right from the beginning of the execution.</li>\n<li><code>--inspect-brk</code> flag: Unlike <code>--inspect</code>, this flag will break on the first line of the code\nas soon as debugger is attached. This is useful when you want to debug the code step by step\nfrom the very beginning, without any code execution prior to debugging.</li>\n</ol>\n<p>So, when deciding between <code>--inspect</code>, <code>--inspect-wait</code>, and <code>--inspect-brk</code>, consider whether you want\nthe code to start executing immediately, wait for debugger to be attached before execution,\nor break on the first line for step-by-step debugging.</p>\n<pre><code class=\"language-console\">$ node --inspect index.js\nDebugger listening on ws://127.0.0.1:9229/dc9010dd-f8b8-4ac5-a510-c1a114ec7d29\nFor help, see: https://nodejs.org/learn/getting-started/debugging\n</code></pre>\n<p>(In the example above, the UUID dc9010dd-f8b8-4ac5-a510-c1a114ec7d29\nat the end of the URL is generated on the fly, it varies in different\ndebugging sessions.)</p>",
              "displayName": "V8 inspector integration for Node.js"
            }
          ],
          "displayName": "Advanced usage"
        }
      ],
      "source": "doc/api/debugger.md"
    },
    {
      "textRaw": "Deprecated APIs",
      "name": "Deprecated APIs",
      "introduced_in": "v7.7.0",
      "type": "misc",
      "desc": "<p>Node.js APIs might be deprecated for any of the following reasons:</p>\n<ul>\n<li>Use of the API is unsafe.</li>\n<li>An improved alternative API is available.</li>\n<li>Breaking changes to the API are expected in a future major release.</li>\n</ul>\n<p>Node.js uses four kinds of deprecations:</p>\n<ul>\n<li>Documentation-only</li>\n<li>Application (non-<code>node_modules</code> code only)</li>\n<li>Runtime (all code)</li>\n<li>End-of-Life</li>\n</ul>\n<p>A Documentation-only deprecation is one that is expressed only within the\nNode.js API docs. These generate no side-effects while running Node.js.\nSome Documentation-only deprecations trigger a runtime warning when launched\nwith <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a> flag (or its alternative,\n<code>NODE_PENDING_DEPRECATION=1</code> environment variable), similarly to Runtime\ndeprecations below. Documentation-only deprecations that support that flag\nare explicitly labeled as such in the\n<a href=\"#list-of-deprecated-apis\">list of Deprecated APIs</a>.</p>\n<p>An Application deprecation for only non-<code>node_modules</code> code will, by default,\ngenerate a process warning that will be printed to <code>stderr</code> the first time\nthe deprecated API is used in code that's not loaded from <code>node_modules</code>.\nWhen the <a href=\"cli.html#--throw-deprecation\"><code>--throw-deprecation</code></a> command-line flag is used, a Runtime\ndeprecation will cause an error to be thrown. When\n<a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a> is used, warnings will also be emitted for\ncode loaded from <code>node_modules</code>.</p>\n<p>A runtime deprecation for all code is similar to the runtime deprecation\nfor non-<code>node_modules</code> code, except that it also emits a warning for\ncode loaded from <code>node_modules</code>.</p>\n<p>An End-of-Life deprecation is used when functionality is or will soon be removed\nfrom Node.js.</p>",
      "miscs": [
        {
          "textRaw": "Revoking deprecations",
          "name": "revoking_deprecations",
          "type": "misc",
          "desc": "<p>Occasionally, the deprecation of an API might be reversed. In such situations,\nthis document will be updated with information relevant to the decision.\nHowever, the deprecation identifier will not be modified.</p>",
          "displayName": "Revoking deprecations"
        },
        {
          "textRaw": "List of deprecated APIs",
          "name": "list_of_deprecated_apis",
          "type": "misc",
          "modules": [
            {
              "textRaw": "DEP0001: `http.OutgoingMessage.prototype.flush`",
              "name": "dep0001:_`http.outgoingmessage.prototype.flush`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31164",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v1.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/1156",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>OutgoingMessage.prototype.flush()</code> has been removed. Use\n<code>OutgoingMessage.prototype.flushHeaders()</code> instead.</p>",
              "displayName": "DEP0001: `http.OutgoingMessage.prototype.flush`"
            },
            {
              "textRaw": "DEP0002: `require('_linklist')`",
              "name": "dep0002:_`require('_linklist')`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12113",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3078",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>_linklist</code> module is deprecated. Please use a userland alternative.</p>",
              "displayName": "DEP0002: `require('_linklist')`"
            },
            {
              "textRaw": "DEP0003: `_writableState.buffer`",
              "name": "dep0003:_`_writablestate.buffer`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31165",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.15",
                    "pr-url": "https://github.com/nodejs/node-v0.x-archive/pull/8826",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>_writableState.buffer</code> has been removed. Use <code>_writableState.getBuffer()</code>\ninstead.</p>",
              "displayName": "DEP0003: `_writableState.buffer`"
            },
            {
              "textRaw": "DEP0004: `CryptoStream.prototype.readyState`",
              "name": "dep0004:_`cryptostream.prototype.readystate`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17882",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.4.0",
                    "commit": "9c7f89bf56abd37a796fea621ad2e47dd33d2b82",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>CryptoStream.prototype.readyState</code> property was removed.</p>",
              "displayName": "DEP0004: `CryptoStream.prototype.readyState`"
            },
            {
              "textRaw": "DEP0005: `Buffer()` constructor",
              "name": "dep0005:_`buffer()`_constructor",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19524",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4682",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Application (non-<code>node_modules</code> code only)</p>\n<p>The <code>Buffer()</code> function and <code>new Buffer()</code> constructor are deprecated due to\nAPI usability issues that can lead to accidental security issues.</p>\n<p>As an alternative, use one of the following methods of constructing <code>Buffer</code>\nobjects:</p>\n<ul>\n<li><a href=\"buffer.html#static-method-bufferallocsize-fill-encoding\"><code>Buffer.alloc(size[, fill[, encoding]])</code></a>: Create a <code>Buffer</code> with\n<em>initialized</em> memory.</li>\n<li><a href=\"buffer.html#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe(size)</code></a>: Create a <code>Buffer</code> with\n<em>uninitialized</em> memory.</li>\n<li><a href=\"buffer.html#static-method-bufferallocunsafeslowsize\"><code>Buffer.allocUnsafeSlow(size)</code></a>: Create a <code>Buffer</code> with <em>uninitialized</em>\nmemory.</li>\n<li><a href=\"buffer.html#static-method-bufferfromarray\"><code>Buffer.from(array)</code></a>: Create a <code>Buffer</code> with a copy of <code>array</code></li>\n<li><a href=\"buffer.html#static-method-bufferfromarraybuffer-byteoffset-length\"><code>Buffer.from(arrayBuffer[, byteOffset[, length]])</code></a> -\nCreate a <code>Buffer</code> that wraps the given <code>arrayBuffer</code>.</li>\n<li><a href=\"buffer.html#static-method-bufferfrombuffer\"><code>Buffer.from(buffer)</code></a>: Create a <code>Buffer</code> that copies <code>buffer</code>.</li>\n<li><a href=\"buffer.html#static-method-bufferfromstring-encoding\"><code>Buffer.from(string[, encoding])</code></a>: Create a <code>Buffer</code>\nthat copies <code>string</code>.</li>\n</ul>\n<p>Without <code>--pending-deprecation</code>, runtime warnings occur only for code not in\n<code>node_modules</code>. This means there will not be deprecation warnings for\n<code>Buffer()</code> usage in dependencies. With <code>--pending-deprecation</code>, a runtime\nwarning results no matter where the <code>Buffer()</code> usage occurs.</p>",
              "displayName": "DEP0005: `Buffer()` constructor"
            },
            {
              "textRaw": "DEP0006: `child_process` `options.customFds`",
              "name": "dep0006:_`child_process`_`options.customfds`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25279",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.14",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v0.5.10",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Within the <a href=\"child_process.html\"><code>child_process</code></a> module's <code>spawn()</code>, <code>fork()</code>, and <code>exec()</code>\nmethods, the <code>options.customFds</code> option is deprecated. The <code>options.stdio</code>\noption should be used instead.</p>",
              "displayName": "DEP0006: `child_process` `options.customFds`"
            },
            {
              "textRaw": "DEP0007: Replace `cluster` `worker.suicide` with `worker.exitedAfterDisconnect`",
              "name": "dep0007:_replace_`cluster`_`worker.suicide`_with_`worker.exitedafterdisconnect`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13702",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3747",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3743",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>In an earlier version of the Node.js <code>cluster</code>, a boolean property with the name\n<code>suicide</code> was added to the <code>Worker</code> object. The intent of this property was to\nprovide an indication of how and why the <code>Worker</code> instance exited. In Node.js\n6.0.0, the old property was deprecated and replaced with a new\n<a href=\"cluster.html#workerexitedafterdisconnect\"><code>worker.exitedAfterDisconnect</code></a> property. The old property name did not\nprecisely describe the actual semantics and was unnecessarily emotion-laden.</p>",
              "displayName": "DEP0007: Replace `cluster` `worker.suicide` with `worker.exitedAfterDisconnect`"
            },
            {
              "textRaw": "DEP0008: `require('node:constants')`",
              "name": "dep0008:_`require('node:constants')`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6534",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <code>node:constants</code> module is deprecated. When requiring access to constants\nrelevant to specific Node.js builtin modules, developers should instead refer\nto the <code>constants</code> property exposed by the relevant module. For instance,\n<code>require('node:fs').constants</code> and <code>require('node:os').constants</code>.</p>",
              "displayName": "DEP0008: `require('node:constants')`"
            },
            {
              "textRaw": "DEP0009: `crypto.pbkdf2` without digest",
              "name": "dep0009:_`crypto.pbkdf2`_without_digest",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31166",
                    "description": "End-of-Life (for `digest === null`)."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22861",
                    "description": "Runtime deprecation (for `digest === null`)."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11305",
                    "description": "End-of-Life (for `digest === undefined`)."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4047",
                    "description": "Runtime deprecation (for `digest === undefined`)."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Use of the <a href=\"crypto.html#cryptopbkdf2password-salt-iterations-keylen-digest-callback\"><code>crypto.pbkdf2()</code></a> API without specifying a digest was deprecated\nin Node.js 6.0 because the method defaulted to using the non-recommended\n<code>'SHA1'</code> digest. Previously, a deprecation warning was printed. Starting in\nNode.js 8.0.0, calling <code>crypto.pbkdf2()</code> or <code>crypto.pbkdf2Sync()</code> with\n<code>digest</code> set to <code>undefined</code> will throw a <code>TypeError</code>.</p>\n<p>Beginning in Node.js 11.0.0, calling these functions with <code>digest</code> set to\n<code>null</code> would print a deprecation warning to align with the behavior when <code>digest</code>\nis <code>undefined</code>.</p>\n<p>Now, however, passing either <code>undefined</code> or <code>null</code> will throw a <code>TypeError</code>.</p>",
              "displayName": "DEP0009: `crypto.pbkdf2` without digest"
            },
            {
              "textRaw": "DEP0010: `crypto.createCredentials`",
              "name": "dep0010:_`crypto.createcredentials`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21153",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.13",
                    "pr-url": "https://github.com/nodejs/node-v0.x-archive/pull/7265",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>crypto.createCredentials()</code> API was removed. Please use\n<a href=\"tls.html#tlscreatesecurecontextoptions\"><code>tls.createSecureContext()</code></a> instead.</p>",
              "displayName": "DEP0010: `crypto.createCredentials`"
            },
            {
              "textRaw": "DEP0011: `crypto.Credentials`",
              "name": "dep0011:_`crypto.credentials`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21153",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.13",
                    "pr-url": "https://github.com/nodejs/node-v0.x-archive/pull/7265",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>crypto.Credentials</code> class was removed. Please use <a href=\"tls.html#tlscreatesecurecontextoptions\"><code>tls.SecureContext</code></a>\ninstead.</p>",
              "displayName": "DEP0011: `crypto.Credentials`"
            },
            {
              "textRaw": "DEP0012: `Domain.dispose`",
              "name": "dep0012:_`domain.dispose`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15412",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.7",
                    "pr-url": "https://github.com/nodejs/node-v0.x-archive/pull/5021",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>Domain.dispose()</code> has been removed. Recover from failed I/O actions\nexplicitly via error event handlers set on the domain instead.</p>",
              "displayName": "DEP0012: `Domain.dispose`"
            },
            {
              "textRaw": "DEP0013: `fs` asynchronous function without callback",
              "name": "dep0013:_`fs`_asynchronous_function_without_callback",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18668",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Calling an asynchronous function without a callback throws a <code>TypeError</code>\nin Node.js 10.0.0 onwards. See <a href=\"https://github.com/nodejs/node/pull/12562\">https://github.com/nodejs/node/pull/12562</a>.</p>",
              "displayName": "DEP0013: `fs` asynchronous function without callback"
            },
            {
              "textRaw": "DEP0014: `fs.read` legacy String interface",
              "name": "dep0014:_`fs.read`_legacy_string_interface",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9683",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4525",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v0.1.96",
                    "commit": "c93e0aaf062081db3ec40ac45b3e2c979d5759d6",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <a href=\"fs.html#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a> legacy <code>String</code> interface is deprecated. Use the <code>Buffer</code>\nAPI as mentioned in the documentation instead.</p>",
              "displayName": "DEP0014: `fs.read` legacy String interface"
            },
            {
              "textRaw": "DEP0015: `fs.readSync` legacy String interface",
              "name": "dep0015:_`fs.readsync`_legacy_string_interface",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9683",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4525",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v0.1.96",
                    "commit": "c93e0aaf062081db3ec40ac45b3e2c979d5759d6",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <a href=\"fs.html#fsreadsyncfd-buffer-offset-length-position\"><code>fs.readSync()</code></a> legacy <code>String</code> interface is deprecated. Use the\n<code>Buffer</code> API as mentioned in the documentation instead.</p>",
              "displayName": "DEP0015: `fs.readSync` legacy String interface"
            },
            {
              "textRaw": "DEP0016: `GLOBAL`/`root`",
              "name": "dep0016:_`global`/`root`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31167",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/1838",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>GLOBAL</code> and <code>root</code> aliases for the <code>global</code> property were deprecated\nin Node.js 6.0.0 and have since been removed.</p>",
              "displayName": "DEP0016: `GLOBAL`/`root`"
            },
            {
              "textRaw": "DEP0017: `Intl.v8BreakIterator`",
              "name": "dep0017:_`intl.v8breakiterator`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15238",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8908",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>Intl.v8BreakIterator</code> was a non-standard extension and has been removed.\nSee <a href=\"https://github.com/tc39/proposal-intl-segmenter\"><code>Intl.Segmenter</code></a>.</p>",
              "displayName": "DEP0017: `Intl.v8BreakIterator`"
            },
            {
              "textRaw": "DEP0018: Unhandled promise rejections",
              "name": "dep0018:_unhandled_promise_rejections",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35316",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8217",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Unhandled promise rejections are deprecated. By default, promise rejections\nthat are not handled terminate the Node.js process with a non-zero exit\ncode. To change the way Node.js treats unhandled rejections, use the\n<a href=\"cli.html#--unhandled-rejectionsmode\"><code>--unhandled-rejections</code></a> command-line option.</p>",
              "displayName": "DEP0018: Unhandled promise rejections"
            },
            {
              "textRaw": "DEP0019: `require('.')` resolved outside directory",
              "name": "dep0019:_`require('.')`_resolved_outside_directory",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26973",
                    "description": "Removed functionality."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v1.8.1",
                    "pr-url": "https://github.com/nodejs/node/pull/1363",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>In certain cases, <code>require('.')</code> could resolve outside the package directory.\nThis behavior has been removed.</p>",
              "displayName": "DEP0019: `require('.')` resolved outside directory"
            },
            {
              "textRaw": "DEP0020: `Server.connections`",
              "name": "dep0020:_`server.connections`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33647",
                    "description": "Server.connections has been removed."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.9.7",
                    "pr-url": "https://github.com/nodejs/node-v0.x-archive/pull/4595",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>Server.connections</code> property was deprecated in Node.js 0.9.7 and has\nbeen removed. Please use the <a href=\"net.html#servergetconnectionscallback\"><code>Server.getConnections()</code></a> method instead.</p>",
              "displayName": "DEP0020: `Server.connections`"
            },
            {
              "textRaw": "DEP0021: `Server.listenFD`",
              "name": "dep0021:_`server.listenfd`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27127",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.7.12",
                    "commit": "41421ff9da1288aa241a5e9dcf915b685ade1c23",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>Server.listenFD()</code> method was deprecated and removed. Please use\n<a href=\"net.html#serverlistenhandle-backlog-callback\"><code>Server.listen({fd: &#x3C;number>})</code></a> instead.</p>",
              "displayName": "DEP0021: `Server.listenFD`"
            },
            {
              "textRaw": "DEP0022: `os.tmpDir()`",
              "name": "dep0022:_`os.tmpdir()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31169",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6739",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>os.tmpDir()</code> API was deprecated in Node.js 7.0.0 and has since been\nremoved. Please use <a href=\"os.html#ostmpdir\"><code>os.tmpdir()</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/tmpdir-to-tmpdir\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/tmpDir-to-tmpdir\n</code></pre>",
              "displayName": "DEP0022: `os.tmpDir()`"
            },
            {
              "textRaw": "DEP0023: `os.getNetworkInterfaces()`",
              "name": "dep0023:_`os.getnetworkinterfaces()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25280",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.6.0",
                    "commit": "37bb37d151fb6ee4696730e63ff28bb7a4924f97",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>os.getNetworkInterfaces()</code> method is deprecated. Please use the\n<a href=\"os.html#osnetworkinterfaces\"><code>os.networkInterfaces()</code></a> method instead.</p>",
              "displayName": "DEP0023: `os.getNetworkInterfaces()`"
            },
            {
              "textRaw": "DEP0024: `REPLServer.prototype.convertToContext()`",
              "name": "dep0024:_`replserver.prototype.converttocontext()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13434",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7829",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>REPLServer.prototype.convertToContext()</code> API has been removed.</p>",
              "displayName": "DEP0024: `REPLServer.prototype.convertToContext()`"
            },
            {
              "textRaw": "DEP0025: `require('node:sys')`",
              "name": "dep0025:_`require('node:sys')`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v1.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/317",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <code>node:sys</code> module is deprecated. Please use the <a href=\"util.html\"><code>util</code></a> module instead.</p>",
              "displayName": "DEP0025: `require('node:sys')`"
            },
            {
              "textRaw": "DEP0026: `util.print()`",
              "name": "dep0026:_`util.print()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25377",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.3",
                    "commit": "896b2aa7074fc886efd7dd0a397d694763cac7ce",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>util.print()</code> has been removed. Please use <a href=\"console.html#consolelogdata-args\"><code>console.log()</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-print-to-console-log\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-print-to-console-log\n</code></pre>",
              "displayName": "DEP0026: `util.print()`"
            },
            {
              "textRaw": "DEP0027: `util.puts()`",
              "name": "dep0027:_`util.puts()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25377",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.3",
                    "commit": "896b2aa7074fc886efd7dd0a397d694763cac7ce",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>util.puts()</code> has been removed. Please use <a href=\"console.html#consolelogdata-args\"><code>console.log()</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-print-to-console-log\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-print-to-console-log\n</code></pre>",
              "displayName": "DEP0027: `util.puts()`"
            },
            {
              "textRaw": "DEP0028: `util.debug()`",
              "name": "dep0028:_`util.debug()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25377",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.3",
                    "commit": "896b2aa7074fc886efd7dd0a397d694763cac7ce",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>util.debug()</code> has been removed. Please use <a href=\"console.html#consoleerrordata-args\"><code>console.error()</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-print-to-console-log\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-print-to-console-log\n</code></pre>",
              "displayName": "DEP0028: `util.debug()`"
            },
            {
              "textRaw": "DEP0029: `util.error()`",
              "name": "dep0029:_`util.error()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25377",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.3",
                    "commit": "896b2aa7074fc886efd7dd0a397d694763cac7ce",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>util.error()</code> has been removed. Please use <a href=\"console.html#consoleerrordata-args\"><code>console.error()</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-print-to-console-log\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-print-to-console-log\n</code></pre>",
              "displayName": "DEP0029: `util.error()`"
            },
            {
              "textRaw": "DEP0030: `SlowBuffer`",
              "name": "dep0030:_`slowbuffer`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58220",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55175",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5833",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>SlowBuffer</code> class has been removed. Please use\n<a href=\"buffer.html#static-method-bufferallocunsafeslowsize\"><code>Buffer.allocUnsafeSlow(size)</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/slow-buffer-to-buffer-alloc-unsafe-slow\">source</a>).</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/slow-buffer-to-buffer-alloc-unsafe-slow\n</code></pre>",
              "displayName": "DEP0030: `SlowBuffer`"
            },
            {
              "textRaw": "DEP0031: `ecdh.setPublicKey()`",
              "name": "dep0031:_`ecdh.setpublickey()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58620",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v5.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3511",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <a href=\"crypto.html#ecdhsetpublickeypublickey-encoding\"><code>ecdh.setPublicKey()</code></a> method is now deprecated as its inclusion in\nthe API is not useful.</p>",
              "displayName": "DEP0031: `ecdh.setPublicKey()`"
            },
            {
              "textRaw": "DEP0032: `node:domain` module",
              "name": "dep0032:_`node:domain`_module",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v1.4.2",
                    "pr-url": "https://github.com/nodejs/node/pull/943",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"domain.html\"><code>domain</code></a> module is deprecated and should not be used.</p>",
              "displayName": "DEP0032: `node:domain` module"
            },
            {
              "textRaw": "DEP0033: `EventEmitter.listenerCount()`",
              "name": "dep0033:_`eventemitter.listenercount()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v25.4.0",
                      "v24.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60214",
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v3.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2349",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Revoked</p>\n<p>The <a href=\"events.html#eventslistenercountemitterortarget-eventname\"><code>events.listenerCount(emitter, eventName)</code></a> API was deprecated, as it\nprovided identical functionality to <a href=\"events.html#emitterlistenercounteventname-listener\"><code>emitter.listenerCount(eventName)</code></a>. The\ndeprecation was revoked because this function has been repurposed to also\naccept <a href=\"events.html#class-eventtarget\"><code>&#x3C;EventTarget></code></a> arguments.</p>",
              "displayName": "DEP0033: `EventEmitter.listenerCount()`"
            },
            {
              "textRaw": "DEP0034: `fs.exists(path, callback)`",
              "name": "dep0034:_`fs.exists(path,_callback)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v1.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/166",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"fs.html#fsexistspath-callback\"><code>fs.exists(path, callback)</code></a> API is deprecated. Please use\n<a href=\"fs.html#fsstatpath-options-callback\"><code>fs.stat()</code></a> or <a href=\"fs.html#fsaccesspath-mode-callback\"><code>fs.access()</code></a> instead.</p>",
              "displayName": "DEP0034: `fs.exists(path, callback)`"
            },
            {
              "textRaw": "DEP0035: `fs.lchmod(path, mode, callback)`",
              "name": "dep0035:_`fs.lchmod(path,_mode,_callback)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.4.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"fs.html#fslchmodpath-mode-callback\"><code>fs.lchmod(path, mode, callback)</code></a> API is deprecated.</p>",
              "displayName": "DEP0035: `fs.lchmod(path, mode, callback)`"
            },
            {
              "textRaw": "DEP0036: `fs.lchmodSync(path, mode)`",
              "name": "dep0036:_`fs.lchmodsync(path,_mode)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.4.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"fs.html#fslchmodsyncpath-mode\"><code>fs.lchmodSync(path, mode)</code></a> API is deprecated.</p>",
              "displayName": "DEP0036: `fs.lchmodSync(path, mode)`"
            },
            {
              "textRaw": "DEP0037: `fs.lchown(path, uid, gid, callback)`",
              "name": "dep0037:_`fs.lchown(path,_uid,_gid,_callback)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.4.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Deprecation revoked</p>\n<p>The <a href=\"fs.html#fslchownpath-uid-gid-callback\"><code>fs.lchown(path, uid, gid, callback)</code></a> API was deprecated. The\ndeprecation was revoked because the requisite supporting APIs were added in\nlibuv.</p>",
              "displayName": "DEP0037: `fs.lchown(path, uid, gid, callback)`"
            },
            {
              "textRaw": "DEP0038: `fs.lchownSync(path, uid, gid)`",
              "name": "dep0038:_`fs.lchownsync(path,_uid,_gid)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.4.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Deprecation revoked</p>\n<p>The <a href=\"fs.html#fslchownsyncpath-uid-gid\"><code>fs.lchownSync(path, uid, gid)</code></a> API was deprecated. The deprecation was\nrevoked because the requisite supporting APIs were added in libuv.</p>",
              "displayName": "DEP0038: `fs.lchownSync(path, uid, gid)`"
            },
            {
              "textRaw": "DEP0039: `require.extensions`",
              "name": "dep0039:_`require.extensions`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.10.6",
                    "commit": "7bd8a5a2a60b75266f89f9a32877d55294a3881c",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"modules.html#requireextensions\"><code>require.extensions</code></a> property is deprecated.</p>",
              "displayName": "DEP0039: `require.extensions`"
            },
            {
              "textRaw": "DEP0040: `node:punycode` module",
              "name": "dep0040:_`node:punycode`_module",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56632",
                    "description": "Application deprecation."
                  },
                  {
                    "version": "v21.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/47202",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v16.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/38444",
                    "description": "Added support for `--pending-deprecation`."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7941",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Application (non-<code>node_modules</code> code only)</p>\n<p>The <a href=\"punycode.html\"><code>punycode</code></a> module is deprecated. Please use a userland alternative\ninstead.</p>",
              "displayName": "DEP0040: `node:punycode` module"
            },
            {
              "textRaw": "DEP0041: `NODE_REPL_HISTORY_FILE` environment variable",
              "name": "dep0041:_`node_repl_history_file`_environment_variable",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13876",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v3.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2224",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>NODE_REPL_HISTORY_FILE</code> environment variable was removed. Please use\n<code>NODE_REPL_HISTORY</code> instead.</p>",
              "displayName": "DEP0041: `NODE_REPL_HISTORY_FILE` environment variable"
            },
            {
              "textRaw": "DEP0042: `tls.CryptoStream`",
              "name": "dep0042:_`tls.cryptostream`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17882",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v0.11.3",
                    "commit": "af80e7bc6e6f33c582eb1f7d37c7f5bbe9f910f7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>tls.CryptoStream</code> class was removed. Please use\n<a href=\"tls.html#class-tlstlssocket\"><code>tls.TLSSocket</code></a> instead.</p>",
              "displayName": "DEP0042: `tls.CryptoStream`"
            },
            {
              "textRaw": "DEP0043: `tls.SecurePair`",
              "name": "dep0043:_`tls.securepair`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57361",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11349",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6063",
                    "description": "Documentation-only deprecation."
                  },
                  {
                    "version": "v0.11.15",
                    "pr-url": [
                      "https://github.com/nodejs/node-v0.x-archive/pull/8695",
                      "https://github.com/nodejs/node-v0.x-archive/pull/8700"
                    ],
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": "v0.11.3",
                    "commit": "af80e7bc6e6f33c582eb1f7d37c7f5bbe9f910f7",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>tls.SecurePair</code> class is deprecated. Please use\n<a href=\"tls.html#class-tlstlssocket\"><code>tls.TLSSocket</code></a> instead.</p>",
              "displayName": "DEP0043: `tls.SecurePair`"
            },
            {
              "textRaw": "DEP0044: `util.isArray()`",
              "name": "dep0044:_`util.isarray()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <a href=\"util.html#utilisarrayobject\"><code>util.isArray()</code></a> API is deprecated. Please use <code>Array.isArray()</code>\ninstead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0044: `util.isArray()`"
            },
            {
              "textRaw": "DEP0045: `util.isBoolean()`",
              "name": "dep0045:_`util.isboolean()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isBoolean()</code> API has been removed. Please use\n<code>typeof arg === 'boolean'</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0045: `util.isBoolean()`"
            },
            {
              "textRaw": "DEP0046: `util.isBuffer()`",
              "name": "dep0046:_`util.isbuffer()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isBuffer()</code> API has been removed. Please use\n<a href=\"buffer.html#static-method-bufferisbufferobj\"><code>Buffer.isBuffer()</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0046: `util.isBuffer()`"
            },
            {
              "textRaw": "DEP0047: `util.isDate()`",
              "name": "dep0047:_`util.isdate()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isDate()</code> API has been removed. Please use\n<code>arg instanceof Date</code> instead.</p>\n<p>Also for stronger approaches, consider using:\n<code>Date.prototype.toString.call(arg) === '[object Date]' &#x26;&#x26; !isNaN(arg)</code>.\nThis can also be used in a <code>try/catch</code> block to handle invalid date objects.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0047: `util.isDate()`"
            },
            {
              "textRaw": "DEP0048: `util.isError()`",
              "name": "dep0048:_`util.iserror()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isError()</code> API has been removed. Please use <code>Error.isError(arg)</code>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0048: `util.isError()`"
            },
            {
              "textRaw": "DEP0049: `util.isFunction()`",
              "name": "dep0049:_`util.isfunction()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isFunction()</code> API has been removed. Please use\n<code>typeof arg === 'function'</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0049: `util.isFunction()`"
            },
            {
              "textRaw": "DEP0050: `util.isNull()`",
              "name": "dep0050:_`util.isnull()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isNull()</code> API has been removed. Please use\n<code>arg === null</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0050: `util.isNull()`"
            },
            {
              "textRaw": "DEP0051: `util.isNullOrUndefined()`",
              "name": "dep0051:_`util.isnullorundefined()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isNullOrUndefined()</code> API has been removed. Please use\n<code>arg === null || arg === undefined</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0051: `util.isNullOrUndefined()`"
            },
            {
              "textRaw": "DEP0052: `util.isNumber()`",
              "name": "dep0052:_`util.isnumber()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isNumber()</code> API has been removed. Please use\n<code>typeof arg === 'number'</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0052: `util.isNumber()`"
            },
            {
              "textRaw": "DEP0053: `util.isObject()`",
              "name": "dep0053:_`util.isobject()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isObject()</code> API has been removed. Please use\n<code>arg &#x26;&#x26; typeof arg === 'object'</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0053: `util.isObject()`"
            },
            {
              "textRaw": "DEP0054: `util.isPrimitive()`",
              "name": "dep0054:_`util.isprimitive()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isPrimitive()</code> API has been removed. Please use <code>Object(arg) !== arg</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0054: `util.isPrimitive()`"
            },
            {
              "textRaw": "DEP0055: `util.isRegExp()`",
              "name": "dep0055:_`util.isregexp()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isRegExp()</code> API has been removed. Please use\n<code>arg instanceof RegExp</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0055: `util.isRegExp()`"
            },
            {
              "textRaw": "DEP0056: `util.isString()`",
              "name": "dep0056:_`util.isstring()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isString()</code> API has been removed. Please use\n<code>typeof arg === 'string'</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0056: `util.isString()`"
            },
            {
              "textRaw": "DEP0057: `util.isSymbol()`",
              "name": "dep0057:_`util.issymbol()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isSymbol()</code> API has been removed. Please use\n<code>typeof arg === 'symbol'</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0057: `util.isSymbol()`"
            },
            {
              "textRaw": "DEP0058: `util.isUndefined()`",
              "name": "dep0058:_`util.isundefined()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v6.12.0",
                      "v4.8.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": [
                      "v4.0.0",
                      "v3.3.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/2447",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.isUndefined()</code> API has been removed. Please use\n<code>arg === undefined</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>",
              "displayName": "DEP0058: `util.isUndefined()`"
            },
            {
              "textRaw": "DEP0059: `util.log()`",
              "name": "dep0059:_`util.log()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52744",
                    "description": "End-of-Life deprecation."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6161",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.log()</code> API has been removed because it's an unmaintained\nlegacy API that was exposed to user land by accident. Instead,\nconsider the following alternatives based on your specific needs:</p>\n<ul>\n<li>\n<p><strong>Third-Party Logging Libraries</strong></p>\n</li>\n<li>\n<p><strong>Use <code>console.log(new Date().toLocaleString(), message)</code></strong></p>\n</li>\n</ul>\n<p>By adopting one of these alternatives, you can transition away from <code>util.log()</code>\nand choose a logging strategy that aligns with the specific\nrequirements and complexity of your application.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-log-to-console-log\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-log-to-console-log\n</code></pre>",
              "displayName": "DEP0059: `util.log()`"
            },
            {
              "textRaw": "DEP0060: `util._extend()`",
              "name": "dep0060:_`util._extend()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50488",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4903",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <a href=\"util.html#util_extendtarget-source\"><code>util._extend()</code></a> API is deprecated because it's an unmaintained\nlegacy API that was exposed to user land by accident.\nPlease use <code>target = Object.assign(target, source)</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-extend-to-object-assign\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-extend-to-object-assign\n</code></pre>",
              "displayName": "DEP0060: `util._extend()`"
            },
            {
              "textRaw": "DEP0061: `fs.SyncWriteStream`",
              "name": "dep0061:_`fs.syncwritestream`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20735",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10467",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6749",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>fs.SyncWriteStream</code> class was never intended to be a publicly accessible\nAPI and has been removed. No alternative API is available. Please use a userland\nalternative.</p>",
              "displayName": "DEP0061: `fs.SyncWriteStream`"
            },
            {
              "textRaw": "DEP0062: `node --debug`",
              "name": "dep0062:_`node_--debug`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25828",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10970",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>--debug</code> activates the legacy V8 debugger interface, which was removed as\nof V8 5.8. It is replaced by Inspector which is activated with <code>--inspect</code>\ninstead.</p>",
              "displayName": "DEP0062: `node --debug`"
            },
            {
              "textRaw": "DEP0063: `ServerResponse.prototype.writeHeader()`",
              "name": "dep0063:_`serverresponse.prototype.writeheader()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60635",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59060",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11355",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>node:http</code> module <code>ServerResponse.prototype.writeHeader()</code> API is\ndeprecated. Please use <code>ServerResponse.prototype.writeHead()</code> instead.</p>\n<p>The <code>ServerResponse.prototype.writeHeader()</code> method was never documented as an\nofficially supported API.</p>",
              "displayName": "DEP0063: `ServerResponse.prototype.writeHeader()`"
            },
            {
              "textRaw": "DEP0064: `tls.createSecurePair()`",
              "name": "dep0064:_`tls.createsecurepair()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57361",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11349",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v6.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10116",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6063",
                    "description": "Documentation-only deprecation."
                  },
                  {
                    "version": "v0.11.15",
                    "pr-url": [
                      "https://github.com/nodejs/node-v0.x-archive/pull/8695",
                      "https://github.com/nodejs/node-v0.x-archive/pull/8700"
                    ],
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": "v0.11.3",
                    "commit": "af80e7bc6e6f33c582eb1f7d37c7f5bbe9f910f7",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>tls.createSecurePair()</code> API was deprecated in documentation in Node.js\n0.11.3. Users should use <code>tls.Socket</code> instead.</p>",
              "displayName": "DEP0064: `tls.createSecurePair()`"
            },
            {
              "textRaw": "DEP0065: `repl.REPL_MODE_MAGIC` and `NODE_REPL_MODE=magic`",
              "name": "dep0065:_`repl.repl_mode_magic`_and_`node_repl_mode=magic`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19187",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11599",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>node:repl</code> module's <code>REPL_MODE_MAGIC</code> constant, used for <code>replMode</code> option,\nhas been removed. Its behavior has been functionally identical to that of\n<code>REPL_MODE_SLOPPY</code> since Node.js 6.0.0, when V8 5.0 was imported. Please use\n<code>REPL_MODE_SLOPPY</code> instead.</p>\n<p>The <code>NODE_REPL_MODE</code> environment variable is used to set the underlying\n<code>replMode</code> of an interactive <code>node</code> session. Its value, <code>magic</code>, is also\nremoved. Please use <code>sloppy</code> instead.</p>",
              "displayName": "DEP0065: `repl.REPL_MODE_MAGIC` and `NODE_REPL_MODE=magic`"
            },
            {
              "textRaw": "DEP0066: `OutgoingMessage.prototype._headers, OutgoingMessage.prototype._headerNames`",
              "name": "dep0066:_`outgoingmessage.prototype._headers,_outgoingmessage.prototype._headernames`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57551",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24167",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10941",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>node:http</code> module <code>OutgoingMessage.prototype._headers</code> and\n<code>OutgoingMessage.prototype._headerNames</code> properties are deprecated. Use one of\nthe public methods (e.g. <code>OutgoingMessage.prototype.getHeader()</code>,\n<code>OutgoingMessage.prototype.getHeaders()</code>,\n<code>OutgoingMessage.prototype.getHeaderNames()</code>,\n<code>OutgoingMessage.prototype.getRawHeaderNames()</code>,\n<code>OutgoingMessage.prototype.hasHeader()</code>,\n<code>OutgoingMessage.prototype.removeHeader()</code>,\n<code>OutgoingMessage.prototype.setHeader()</code>) for working with outgoing headers.</p>\n<p>The <code>OutgoingMessage.prototype._headers</code> and\n<code>OutgoingMessage.prototype._headerNames</code> properties were never documented as\nofficially supported properties.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/http-outgoingmessage-headers\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/http-outgoingmessage-headers\n</code></pre>",
              "displayName": "DEP0066: `OutgoingMessage.prototype._headers, OutgoingMessage.prototype._headerNames`"
            },
            {
              "textRaw": "DEP0067: `OutgoingMessage.prototype._renderHeaders`",
              "name": "dep0067:_`outgoingmessage.prototype._renderheaders`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10941",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <code>node:http</code> module <code>OutgoingMessage.prototype._renderHeaders()</code> API is\ndeprecated.</p>\n<p>The <code>OutgoingMessage.prototype._renderHeaders</code> property was never documented as\nan officially supported API.</p>",
              "displayName": "DEP0067: `OutgoingMessage.prototype._renderHeaders`"
            },
            {
              "textRaw": "DEP0068: `node debug`",
              "name": "dep0068:_`node_debug`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33648",
                    "description": "The legacy `node debug` command was removed."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11441",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>node debug</code> corresponds to the legacy CLI debugger which has been replaced with\na V8-inspector based CLI debugger available through <code>node inspect</code>.</p>",
              "displayName": "DEP0068: `node debug`"
            },
            {
              "textRaw": "DEP0069: `vm.runInDebugContext(string)`",
              "name": "dep0069:_`vm.runindebugcontext(string)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13295",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12815",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12243",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>DebugContext has been removed in V8 and is not available in Node.js 10+.</p>\n<p>DebugContext was an experimental API.</p>",
              "displayName": "DEP0069: `vm.runInDebugContext(string)`"
            },
            {
              "textRaw": "DEP0070: `async_hooks.currentId()`",
              "name": "dep0070:_`async_hooks.currentid()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14414",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v8.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13490",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>async_hooks.currentId()</code> was renamed to <code>async_hooks.executionAsyncId()</code> for\nclarity.</p>\n<p>This change was made while <code>async_hooks</code> was an experimental API.</p>",
              "displayName": "DEP0070: `async_hooks.currentId()`"
            },
            {
              "textRaw": "DEP0071: `async_hooks.triggerId()`",
              "name": "dep0071:_`async_hooks.triggerid()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14414",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v8.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13490",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>async_hooks.triggerId()</code> was renamed to <code>async_hooks.triggerAsyncId()</code> for\nclarity.</p>\n<p>This change was made while <code>async_hooks</code> was an experimental API.</p>",
              "displayName": "DEP0071: `async_hooks.triggerId()`"
            },
            {
              "textRaw": "DEP0072: `async_hooks.AsyncResource.triggerId()`",
              "name": "dep0072:_`async_hooks.asyncresource.triggerid()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14414",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v8.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13490",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>async_hooks.AsyncResource.triggerId()</code> was renamed to\n<code>async_hooks.AsyncResource.triggerAsyncId()</code> for clarity.</p>\n<p>This change was made while <code>async_hooks</code> was an experimental API.</p>",
              "displayName": "DEP0072: `async_hooks.AsyncResource.triggerId()`"
            },
            {
              "textRaw": "DEP0073: Several internal properties of `net.Server`",
              "name": "dep0073:_several_internal_properties_of_`net.server`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17141",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14449",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Accessing several internal, undocumented properties of <code>net.Server</code> instances\nwith inappropriate names is deprecated.</p>\n<p>As the original API was undocumented and not generally useful for non-internal\ncode, no replacement API is provided.</p>",
              "displayName": "DEP0073: Several internal properties of `net.Server`"
            },
            {
              "textRaw": "DEP0074: `REPLServer.bufferedCommand`",
              "name": "dep0074:_`replserver.bufferedcommand`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33286",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13687",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>REPLServer.bufferedCommand</code> property was deprecated in favor of\n<a href=\"repl.html#replserverclearbufferedcommand\"><code>REPLServer.clearBufferedCommand()</code></a>.</p>",
              "displayName": "DEP0074: `REPLServer.bufferedCommand`"
            },
            {
              "textRaw": "DEP0075: `REPLServer.parseREPLKeyword()`",
              "name": "dep0075:_`replserver.parsereplkeyword()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33286",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14223",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>REPLServer.parseREPLKeyword()</code> was removed from userland visibility.</p>",
              "displayName": "DEP0075: `REPLServer.parseREPLKeyword()`"
            },
            {
              "textRaw": "DEP0076: `tls.parseCertString()`",
              "name": "dep0076:_`tls.parsecertstring()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41479",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14249",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v8.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14245",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>tls.parseCertString()</code> was a trivial parsing helper that was made public by\nmistake. While it was supposed to parse certificate subject and issuer strings,\nit never handled multi-value Relative Distinguished Names correctly.</p>\n<p>Earlier versions of this document suggested using <code>querystring.parse()</code> as an\nalternative to <code>tls.parseCertString()</code>. However, <code>querystring.parse()</code> also does\nnot handle all certificate subjects correctly and should not be used.</p>",
              "displayName": "DEP0076: `tls.parseCertString()`"
            },
            {
              "textRaw": "DEP0077: `Module._debug()`",
              "name": "dep0077:_`module._debug()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58473",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13948",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>Module._debug()</code> has been removed.</p>\n<p>The <code>Module._debug()</code> function was never documented as an officially\nsupported API.</p>",
              "displayName": "DEP0077: `Module._debug()`"
            },
            {
              "textRaw": "DEP0078: `REPLServer.turnOffEditorMode()`",
              "name": "dep0078:_`replserver.turnoffeditormode()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33286",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15136",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>REPLServer.turnOffEditorMode()</code> was removed from userland visibility.</p>",
              "displayName": "DEP0078: `REPLServer.turnOffEditorMode()`"
            },
            {
              "textRaw": "DEP0079: Custom inspection function on objects via `.inspect()`",
              "name": "dep0079:_custom_inspection_function_on_objects_via_`.inspect()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20722",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16393",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v8.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15631",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Using a property named <code>inspect</code> on an object to specify a custom inspection\nfunction for <a href=\"util.html#utilinspectobject-options\"><code>util.inspect()</code></a> is deprecated. Use <a href=\"util.html#utilinspectcustom\"><code>util.inspect.custom</code></a>\ninstead. For backward compatibility with Node.js prior to version 6.4.0, both\ncan be specified.</p>",
              "displayName": "DEP0079: Custom inspection function on objects via `.inspect()`"
            },
            {
              "textRaw": "DEP0080: `path._makeLong()`",
              "name": "dep0080:_`path._makelong()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14956",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The internal <code>path._makeLong()</code> was not intended for public use. However,\nuserland modules have found it useful. The internal API is deprecated\nand replaced with an identical, public <code>path.toNamespacedPath()</code> method.</p>",
              "displayName": "DEP0080: `path._makeLong()`"
            },
            {
              "textRaw": "DEP0081: `fs.truncate()` using a file descriptor",
              "name": "dep0081:_`fs.truncate()`_using_a_file_descriptor",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57567",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15990",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>fs.truncate()</code> <code>fs.truncateSync()</code> usage with a file descriptor is\ndeprecated. Please use <code>fs.ftruncate()</code> or <code>fs.ftruncateSync()</code> to work with\nfile descriptors.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/fs-truncate-fd-deprecation\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/fs-truncate-fd-deprecation\n</code></pre>",
              "displayName": "DEP0081: `fs.truncate()` using a file descriptor"
            },
            {
              "textRaw": "DEP0082: `REPLServer.prototype.memory()`",
              "name": "dep0082:_`replserver.prototype.memory()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33286",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16242",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>REPLServer.prototype.memory()</code> is only necessary for the internal mechanics of\nthe <code>REPLServer</code> itself. Do not use this function.</p>",
              "displayName": "DEP0082: `REPLServer.prototype.memory()`"
            },
            {
              "textRaw": "DEP0083: Disabling ECDH by setting `ecdhCurve` to `false`",
              "name": "dep0083:_disabling_ecdh_by_setting_`ecdhcurve`_to_`false`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19794",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v9.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16130",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>ecdhCurve</code> option to <code>tls.createSecureContext()</code> and <code>tls.TLSSocket</code> could\nbe set to <code>false</code> to disable ECDH entirely on the server only. This mode was\ndeprecated in preparation for migrating to OpenSSL 1.1.0 and consistency with\nthe client and is now unsupported. Use the <code>ciphers</code> parameter instead.</p>",
              "displayName": "DEP0083: Disabling ECDH by setting `ecdhCurve` to `false`"
            },
            {
              "textRaw": "DEP0084: requiring bundled internal dependencies",
              "name": "dep0084:_requiring_bundled_internal_dependencies",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25138",
                    "description": "This functionality has been removed."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16392",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Since Node.js versions 4.4.0 and 5.2.0, several modules only intended for\ninternal usage were mistakenly exposed to user code through <code>require()</code>. These\nmodules were:</p>\n<ul>\n<li><code>v8/tools/codemap</code></li>\n<li><code>v8/tools/consarray</code></li>\n<li><code>v8/tools/csvparser</code></li>\n<li><code>v8/tools/logreader</code></li>\n<li><code>v8/tools/profile_view</code></li>\n<li><code>v8/tools/profile</code></li>\n<li><code>v8/tools/SourceMap</code></li>\n<li><code>v8/tools/splaytree</code></li>\n<li><code>v8/tools/tickprocessor-driver</code></li>\n<li><code>v8/tools/tickprocessor</code></li>\n<li><code>node-inspect/lib/_inspect</code> (from 7.6.0)</li>\n<li><code>node-inspect/lib/internal/inspect_client</code> (from 7.6.0)</li>\n<li><code>node-inspect/lib/internal/inspect_repl</code> (from 7.6.0)</li>\n</ul>\n<p>The <code>v8/*</code> modules do not have any exports, and if not imported in a specific\norder would in fact throw errors. As such there are virtually no legitimate use\ncases for importing them through <code>require()</code>.</p>\n<p>On the other hand, <code>node-inspect</code> can be installed locally through a package\nmanager, as it is published on the npm registry under the same name. No source\ncode modification is necessary if that is done.</p>",
              "displayName": "DEP0084: requiring bundled internal dependencies"
            },
            {
              "textRaw": "DEP0085: AsyncHooks sensitive API",
              "name": "dep0085:_asynchooks_sensitive_api",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17147",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v9.4.0",
                      "v8.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/16972",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The AsyncHooks sensitive API was never documented and had various minor issues.\nUse the <code>AsyncResource</code> API instead. See\n<a href=\"https://github.com/nodejs/node/issues/15572\">https://github.com/nodejs/node/issues/15572</a>.</p>",
              "displayName": "DEP0085: AsyncHooks sensitive API"
            },
            {
              "textRaw": "DEP0086: Remove `runInAsyncIdScope`",
              "name": "dep0086:_remove_`runinasyncidscope`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17147",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v9.4.0",
                      "v8.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/16972",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>runInAsyncIdScope</code> doesn't emit the <code>'before'</code> or <code>'after'</code> event and can thus\ncause a lot of issues. See <a href=\"https://github.com/nodejs/node/issues/14328\">https://github.com/nodejs/node/issues/14328</a>.</p>",
              "displayName": "DEP0086: Remove `runInAsyncIdScope`"
            },
            {
              "textRaw": "DEP0089: `require('node:assert')`",
              "name": "dep0089:_`require('node:assert')`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28892",
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": [
                      "v9.9.0",
                      "v8.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/17002",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Deprecation revoked</p>\n<p>Importing assert directly was not recommended as the exposed functions use\nloose equality checks. The deprecation was revoked because use of the\n<code>node:assert</code> module is not discouraged, and the deprecation caused developer\nconfusion.</p>",
              "displayName": "DEP0089: `require('node:assert')`"
            },
            {
              "textRaw": "DEP0090: Invalid GCM authentication tag lengths",
              "name": "dep0090:_invalid_gcm_authentication_tag_lengths",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17825",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18017",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Node.js used to support all GCM authentication tag lengths which are accepted by\nOpenSSL when calling <a href=\"crypto.html#deciphersetauthtagbuffer-encoding\"><code>decipher.setAuthTag()</code></a>. Beginning with Node.js\nv11.0.0, only authentication tag lengths of 128, 120, 112, 104, 96, 64, and 32\nbits are allowed. Authentication tags of other lengths are invalid per\n<a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf\">NIST SP 800-38D</a>.</p>",
              "displayName": "DEP0090: Invalid GCM authentication tag lengths"
            },
            {
              "textRaw": "DEP0091: `crypto.DEFAULT_ENCODING`",
              "name": "dep0091:_`crypto.default_encoding`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/47182",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18333",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>crypto.DEFAULT_ENCODING</code> property only existed for compatibility with\nNode.js releases prior to versions 0.9.3 and has been removed.</p>",
              "displayName": "DEP0091: `crypto.DEFAULT_ENCODING`"
            },
            {
              "textRaw": "DEP0092: Top-level `this` bound to `module.exports`",
              "name": "dep0092:_top-level_`this`_bound_to_`module.exports`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16878",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Assigning properties to the top-level <code>this</code> as an alternative\nto <code>module.exports</code> is deprecated. Developers should use <code>exports</code>\nor <code>module.exports</code> instead.</p>",
              "displayName": "DEP0092: Top-level `this` bound to `module.exports`"
            },
            {
              "textRaw": "DEP0093: `crypto.fips` is deprecated and replaced",
              "name": "dep0093:_`crypto.fips`_is_deprecated_and_replaced",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55019",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18335",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <a href=\"crypto.html#cryptofips\"><code>crypto.fips</code></a> property is deprecated. Please use <code>crypto.setFips()</code>\nand <code>crypto.getFips()</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/crypto-fips-to-getFips\">source</a>).</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/crypto-fips-to-getFips\n</code></pre>",
              "displayName": "DEP0093: `crypto.fips` is deprecated and replaced"
            },
            {
              "textRaw": "DEP0094: Using `assert.fail()` with more than one argument",
              "name": "dep0094:_using_`assert.fail()`_with_more_than_one_argument",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58532",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18418",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Using <code>assert.fail()</code> with more than one argument is deprecated. Use\n<code>assert.fail()</code> with only one argument or use a different <code>node:assert</code> module\nmethod.</p>",
              "displayName": "DEP0094: Using `assert.fail()` with more than one argument"
            },
            {
              "textRaw": "DEP0095: `timers.enroll()`",
              "name": "dep0095:_`timers.enroll()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/56966",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18066",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>timers.enroll()</code> has been removed. Please use the publicly documented\n<a href=\"timers.html#settimeoutcallback-delay-args\"><code>setTimeout()</code></a> or <a href=\"timers.html#setintervalcallback-delay-args\"><code>setInterval()</code></a> instead.</p>",
              "displayName": "DEP0095: `timers.enroll()`"
            },
            {
              "textRaw": "DEP0096: `timers.unenroll()`",
              "name": "dep0096:_`timers.unenroll()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/56966",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18066",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>timers.unenroll()</code> has been removed. Please use the publicly documented\n<a href=\"timers.html#cleartimeouttimeout\"><code>clearTimeout()</code></a> or <a href=\"timers.html#clearintervaltimeout\"><code>clearInterval()</code></a> instead.</p>",
              "displayName": "DEP0096: `timers.unenroll()`"
            },
            {
              "textRaw": "DEP0097: `MakeCallback` with `domain` property",
              "name": "dep0097:_`makecallback`_with_`domain`_property",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17417",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Users of <code>MakeCallback</code> that add the <code>domain</code> property to carry context,\nshould start using the <code>async_context</code> variant of <code>MakeCallback</code> or\n<code>CallbackScope</code>, or the high-level <code>AsyncResource</code> class.</p>",
              "displayName": "DEP0097: `MakeCallback` with `domain` property"
            },
            {
              "textRaw": "DEP0098: AsyncHooks embedder `AsyncResource.emitBefore` and `AsyncResource.emitAfter` APIs",
              "name": "dep0098:_asynchooks_embedder_`asyncresource.emitbefore`_and_`asyncresource.emitafter`_apis",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26530",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v10.0.0",
                      "v9.6.0",
                      "v8.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/18632",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The embedded API provided by AsyncHooks exposes <code>.emitBefore()</code> and\n<code>.emitAfter()</code> methods which are very easy to use incorrectly which can lead\nto unrecoverable errors.</p>\n<p>Use <a href=\"async_context.html#asyncresourceruninasyncscopefn-thisarg-args\"><code>asyncResource.runInAsyncScope()</code></a> API instead which provides a much\nsafer, and more convenient, alternative. See\n<a href=\"https://github.com/nodejs/node/pull/18513\">https://github.com/nodejs/node/pull/18513</a>.</p>",
              "displayName": "DEP0098: AsyncHooks embedder `AsyncResource.emitBefore` and `AsyncResource.emitAfter` APIs"
            },
            {
              "textRaw": "DEP0099: Async context-unaware `node::MakeCallback` C++ APIs",
              "name": "dep0099:_async_context-unaware_`node::makecallback`_c++_apis",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18632",
                    "description": "Compile-time deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Compile-time</p>\n<p>Certain versions of <code>node::MakeCallback</code> APIs available to native addons are\ndeprecated. Please use the versions of the API that accept an <code>async_context</code>\nparameter.</p>",
              "displayName": "DEP0099: Async context-unaware `node::MakeCallback` C++ APIs"
            },
            {
              "textRaw": "DEP0100: `process.assert()`",
              "name": "dep0100:_`process.assert()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55035",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18666",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v0.3.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>process.assert()</code> is deprecated. Please use the <a href=\"assert.html\"><code>assert</code></a> module instead.</p>\n<p>This was never a documented feature.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/process-assert-to-node-assert\">source</a>).</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/process-assert-to-node-assert\n</code></pre>",
              "displayName": "DEP0100: `process.assert()`"
            },
            {
              "textRaw": "DEP0101: `--with-lttng`",
              "name": "dep0101:_`--with-lttng`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18982",
                    "description": "End-of-Life."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>--with-lttng</code> compile-time option has been removed.</p>",
              "displayName": "DEP0101: `--with-lttng`"
            },
            {
              "textRaw": "DEP0102: Using `noAssert` in `Buffer#(read|write)` operations",
              "name": "dep0102:_using_`noassert`_in_`buffer#(read|write)`_operations",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "End-of-Life."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Using the <code>noAssert</code> argument has no functionality anymore. All input is\nverified regardless of the value of <code>noAssert</code>. Skipping the verification\ncould lead to hard-to-find errors and crashes.</p>",
              "displayName": "DEP0102: Using `noAssert` in `Buffer#(read|write)` operations"
            },
            {
              "textRaw": "DEP0103: `process.binding('util').is[...]` typechecks",
              "name": "dep0103:_`process.binding('util').is[...]`_typechecks",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22004",
                    "description": "Superseded by [DEP0111](#DEP0111)."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18415",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>Using <code>process.binding()</code> in general should be avoided. The type checking\nmethods in particular can be replaced by using <a href=\"util.html#utiltypes\"><code>util.types</code></a>.</p>\n<p>This deprecation has been superseded by the deprecation of the\n<code>process.binding()</code> API (<a href=\"#DEP0111\">DEP0111</a>).</p>",
              "displayName": "DEP0103: `process.binding('util').is[...]` typechecks"
            },
            {
              "textRaw": "DEP0104: `process.env` string coercion",
              "name": "dep0104:_`process.env`_string_coercion",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18990",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>When assigning a non-string property to <a href=\"process.html#processenv\"><code>process.env</code></a>, the assigned value is\nimplicitly converted to a string. This behavior is deprecated if the assigned\nvalue is not a string, boolean, or number. In the future, such assignment might\nresult in a thrown error. Please convert the property to a string before\nassigning it to <code>process.env</code>.</p>",
              "displayName": "DEP0104: `process.env` string coercion"
            },
            {
              "textRaw": "DEP0105: `decipher.finaltol`",
              "name": "dep0105:_`decipher.finaltol`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19941",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19353",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>decipher.finaltol()</code> has never been documented and was an alias for\n<a href=\"crypto.html#decipherfinaloutputencoding\"><code>decipher.final()</code></a>. This API has been removed, and it is recommended to use\n<a href=\"crypto.html#decipherfinaloutputencoding\"><code>decipher.final()</code></a> instead.</p>",
              "displayName": "DEP0105: `decipher.finaltol`"
            },
            {
              "textRaw": "DEP0106: `crypto.createCipher` and `crypto.createDecipher`",
              "name": "dep0106:_`crypto.createcipher`_and_`crypto.createdecipher`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/50973",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22089",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19343",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>crypto.createCipher()</code> and <code>crypto.createDecipher()</code> have been removed\nas they use a weak key derivation function (MD5 with no salt) and static\ninitialization vectors.\nIt is recommended to derive a key using\n<a href=\"crypto.html#cryptopbkdf2password-salt-iterations-keylen-digest-callback\"><code>crypto.pbkdf2()</code></a> or <a href=\"crypto.html#cryptoscryptpassword-salt-keylen-options-callback\"><code>crypto.scrypt()</code></a> with random salts and to use\n<a href=\"crypto.html#cryptocreatecipherivalgorithm-key-iv-options\"><code>crypto.createCipheriv()</code></a> and <a href=\"crypto.html#cryptocreatedecipherivalgorithm-key-iv-options\"><code>crypto.createDecipheriv()</code></a> to obtain the\n<a href=\"crypto.html#class-cipheriv\"><code>Cipheriv</code></a> and <a href=\"crypto.html#class-decipheriv\"><code>Decipheriv</code></a> objects respectively.</p>",
              "displayName": "DEP0106: `crypto.createCipher` and `crypto.createDecipher`"
            },
            {
              "textRaw": "DEP0107: `tls.convertNPNProtocols()`",
              "name": "dep0107:_`tls.convertnpnprotocols()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20736",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19403",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>This was an undocumented helper function not intended for use outside Node.js\ncore and obsoleted by the removal of NPN (Next Protocol Negotiation) support.</p>",
              "displayName": "DEP0107: `tls.convertNPNProtocols()`"
            },
            {
              "textRaw": "DEP0108: `zlib.bytesRead`",
              "name": "dep0108:_`zlib.bytesread`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55020",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23308",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19414",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Deprecated alias for <a href=\"zlib.html#zlibbyteswritten\"><code>zlib.bytesWritten</code></a>. This original name was chosen\nbecause it also made sense to interpret the value as the number of bytes\nread by the engine, but is inconsistent with other streams in Node.js that\nexpose values under these names.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/zlib-bytesread-to-byteswritten\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/zlib-bytesread-to-byteswritten\n</code></pre>",
              "displayName": "DEP0108: `zlib.bytesRead`"
            },
            {
              "textRaw": "DEP0109: `http`, `https`, and `tls` support for invalid URLs",
              "name": "dep0109:_`http`,_`https`,_and_`tls`_support_for_invalid_urls",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36853",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20270",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Some previously supported (but strictly invalid) URLs were accepted through the\n<a href=\"http.html#httprequestoptions-callback\"><code>http.request()</code></a>, <a href=\"http.html#httpgetoptions-callback\"><code>http.get()</code></a>, <a href=\"https.html#httpsrequestoptions-callback\"><code>https.request()</code></a>,\n<a href=\"https.html#httpsgetoptions-callback\"><code>https.get()</code></a>, and <a href=\"tls.html#tlscheckserveridentityhostname-cert\"><code>tls.checkServerIdentity()</code></a> APIs because those were\naccepted by the legacy <code>url.parse()</code> API. The mentioned APIs now use the WHATWG\nURL parser that requires strictly valid URLs. Passing an invalid URL is\ndeprecated and support will be removed in the future.</p>",
              "displayName": "DEP0109: `http`, `https`, and `tls` support for invalid URLs"
            },
            {
              "textRaw": "DEP0110: `vm.Script` cached data",
              "name": "dep0110:_`vm.script`_cached_data",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20300",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <code>produceCachedData</code> option is deprecated. Use\n<a href=\"vm.html#scriptcreatecacheddata\"><code>script.createCachedData()</code></a> instead.</p>",
              "displayName": "DEP0110: `vm.Script` cached data"
            },
            {
              "textRaw": "DEP0111: `process.binding()`",
              "name": "dep0111:_`process.binding()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26500",
                    "description": "Added support for `--pending-deprecation`."
                  },
                  {
                    "version": "v10.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22004",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p><code>process.binding()</code> is for use by Node.js internal code only.</p>\n<p>While <code>process.binding()</code> has not reached End-of-Life status in general, it is\nunavailable when the <a href=\"permissions.html#permission-model\">permission model</a> is enabled.</p>",
              "displayName": "DEP0111: `process.binding()`"
            },
            {
              "textRaw": "DEP0112: `dgram` private APIs",
              "name": "dep0112:_`dgram`_private_apis",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58474",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22011",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>node:dgram</code> module previously contained several APIs that were never meant\nto accessed outside of Node.js core: <code>Socket.prototype._handle</code>,\n<code>Socket.prototype._receiving</code>, <code>Socket.prototype._bindState</code>,\n<code>Socket.prototype._queue</code>, <code>Socket.prototype._reuseAddr</code>,\n<code>Socket.prototype._healthCheck()</code>, <code>Socket.prototype._stopReceiving()</code>, and\n<code>dgram._createSocketHandle()</code>. These have been removed.</p>",
              "displayName": "DEP0112: `dgram` private APIs"
            },
            {
              "textRaw": "DEP0113: `Cipher.setAuthTag()`, `Decipher.getAuthTag()`",
              "name": "dep0113:_`cipher.setauthtag()`,_`decipher.getauthtag()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26249",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22126",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>Cipher.setAuthTag()</code> and <code>Decipher.getAuthTag()</code> are no longer available. They\nwere never documented and would throw when called.</p>",
              "displayName": "DEP0113: `Cipher.setAuthTag()`, `Decipher.getAuthTag()`"
            },
            {
              "textRaw": "DEP0114: `crypto._toBuf()`",
              "name": "dep0114:_`crypto._tobuf()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25338",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22501",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>crypto._toBuf()</code> function was not designed to be used by modules outside\nof Node.js core and was removed.</p>",
              "displayName": "DEP0114: `crypto._toBuf()`"
            },
            {
              "textRaw": "DEP0115: `crypto.prng()`, `crypto.pseudoRandomBytes()`, `crypto.rng()`",
              "name": "dep0115:_`crypto.prng()`,_`crypto.pseudorandombytes()`,_`crypto.rng()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": [
                      "https://github.com/nodejs/node/pull/22519",
                      "https://github.com/nodejs/node/pull/23017"
                    ],
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>In recent versions of Node.js, there is no difference between\n<a href=\"crypto.html#cryptorandombytessize-callback\"><code>crypto.randomBytes()</code></a> and <code>crypto.pseudoRandomBytes()</code>. The latter is\ndeprecated along with the undocumented aliases <code>crypto.prng()</code> and\n<code>crypto.rng()</code> in favor of <a href=\"crypto.html#cryptorandombytessize-callback\"><code>crypto.randomBytes()</code></a> and might be removed in a\nfuture release.</p>",
              "displayName": "DEP0115: `crypto.prng()`, `crypto.pseudoRandomBytes()`, `crypto.rng()`"
            },
            {
              "textRaw": "DEP0116: Legacy URL API",
              "name": "dep0116:_legacy_url_api",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55017",
                    "description": "DEP0169 covers also `url.format()` and `url.resolve()`."
                  },
                  {
                    "version": [
                      "v19.0.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44919",
                    "description": "DEP0169 deprecates `url.parse()` again."
                  },
                  {
                    "version": [
                      "v15.13.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37784",
                    "description": "Deprecation revoked. Status changed to \"Legacy\"."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22715",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Deprecation revoked</p>\n<p>The <a href=\"url.html#legacy-url-api\">legacy URL API</a> is deprecated. This includes <a href=\"url.html#urlformaturlobject\"><code>url.format()</code></a>,\n<a href=\"url.html#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a>, <a href=\"url.html#urlresolvefrom-to\"><code>url.resolve()</code></a>, and the <a href=\"url.html#legacy-urlobject\">legacy <code>urlObject</code></a>. Please\nuse the <a href=\"url.html#the-whatwg-url-api\">WHATWG URL API</a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/node-url-to-whatwg-url\">source</a>).</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/node-url-to-whatwg-url\n</code></pre>",
              "displayName": "DEP0116: Legacy URL API"
            },
            {
              "textRaw": "DEP0117: Native crypto handles",
              "name": "dep0117:_native_crypto_handles",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27011",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22747",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Previous versions of Node.js exposed handles to internal native objects through\nthe <code>_handle</code> property of the <code>Cipher</code>, <code>Decipher</code>, <code>DiffieHellman</code>,\n<code>DiffieHellmanGroup</code>, <code>ECDH</code>, <code>Hash</code>, <code>Hmac</code>, <code>Sign</code>, and <code>Verify</code> classes.\nThe <code>_handle</code> property has been removed because improper use of the native\nobject can lead to crashing the application.</p>",
              "displayName": "DEP0117: Native crypto handles"
            },
            {
              "textRaw": "DEP0118: `dns.lookup()` support for a falsy host name",
              "name": "dep0118:_`dns.lookup()`_support_for_a_falsy_host_name",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58619",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23173",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Previous versions of Node.js supported <code>dns.lookup()</code> with a falsy host name\nlike <code>dns.lookup(false)</code> due to backward compatibility. This has been removed.</p>",
              "displayName": "DEP0118: `dns.lookup()` support for a falsy host name"
            },
            {
              "textRaw": "DEP0119: `process.binding('uv').errname()` private API",
              "name": "dep0119:_`process.binding('uv').errname()`_private_api",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23597",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p><code>process.binding('uv').errname()</code> is deprecated. Please use\n<a href=\"util.html#utilgetsystemerrornameerr\"><code>util.getSystemErrorName()</code></a> instead.</p>",
              "displayName": "DEP0119: `process.binding('uv').errname()` private API"
            },
            {
              "textRaw": "DEP0120: Windows Performance Counter support",
              "name": "dep0120:_windows_performance_counter_support",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24862",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22485",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Windows Performance Counter support has been removed from Node.js. The\nundocumented <code>COUNTER_NET_SERVER_CONNECTION()</code>,\n<code>COUNTER_NET_SERVER_CONNECTION_CLOSE()</code>, <code>COUNTER_HTTP_SERVER_REQUEST()</code>,\n<code>COUNTER_HTTP_SERVER_RESPONSE()</code>, <code>COUNTER_HTTP_CLIENT_REQUEST()</code>, and\n<code>COUNTER_HTTP_CLIENT_RESPONSE()</code> functions have been deprecated.</p>",
              "displayName": "DEP0120: Windows Performance Counter support"
            },
            {
              "textRaw": "DEP0121: `net._setSimultaneousAccepts()`",
              "name": "dep0121:_`net._setsimultaneousaccepts()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57550",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23760",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The undocumented <code>net._setSimultaneousAccepts()</code> function was originally\nintended for debugging and performance tuning when using the\n<code>node:child_process</code> and <code>node:cluster</code> modules on Windows. The function is not\ngenerally useful and is being removed. See discussion here:\n<a href=\"https://github.com/nodejs/node/issues/18391\">https://github.com/nodejs/node/issues/18391</a></p>",
              "displayName": "DEP0121: `net._setSimultaneousAccepts()`"
            },
            {
              "textRaw": "DEP0122: `tls` `Server.prototype.setOptions()`",
              "name": "dep0122:_`tls`_`server.prototype.setoptions()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57339",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23820",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Please use <code>Server.prototype.setSecureContext()</code> instead.</p>",
              "displayName": "DEP0122: `tls` `Server.prototype.setOptions()`"
            },
            {
              "textRaw": "DEP0123: setting the TLS ServerName to an IP address",
              "name": "dep0123:_setting_the_tls_servername_to_an_ip_address",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58533",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23329",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Setting the TLS ServerName to an IP address is not permitted by\n<a href=\"https://tools.ietf.org/html/rfc6066#section-3\">RFC 6066</a>.</p>",
              "displayName": "DEP0123: setting the TLS ServerName to an IP address"
            },
            {
              "textRaw": "DEP0124: using `REPLServer.rli`",
              "name": "dep0124:_using_`replserver.rli`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33286",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26260",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>This property is a reference to the instance itself.</p>",
              "displayName": "DEP0124: using `REPLServer.rli`"
            },
            {
              "textRaw": "DEP0125: `require('node:_stream_wrap')`",
              "name": "dep0125:_`require('node:_stream_wrap')`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60657",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26245",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>node:_stream_wrap</code> module is deprecated.</p>",
              "displayName": "DEP0125: `require('node:_stream_wrap')`"
            },
            {
              "textRaw": "DEP0126: `timers.active()`",
              "name": "dep0126:_`timers.active()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/56966",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26760",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The previously undocumented <code>timers.active()</code> has been removed.\nPlease use the publicly documented <a href=\"timers.html#timeoutrefresh\"><code>timeout.refresh()</code></a> instead.\nIf re-referencing the timeout is necessary, <a href=\"timers.html#timeoutref\"><code>timeout.ref()</code></a> can be used\nwith no performance impact since Node.js 10.</p>",
              "displayName": "DEP0126: `timers.active()`"
            },
            {
              "textRaw": "DEP0127: `timers._unrefActive()`",
              "name": "dep0127:_`timers._unrefactive()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/56966",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v11.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26760",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The previously undocumented and \"private\" <code>timers._unrefActive()</code> has been removed.\nPlease use the publicly documented <a href=\"timers.html#timeoutrefresh\"><code>timeout.refresh()</code></a> instead.\nIf unreferencing the timeout is necessary, <a href=\"timers.html#timeoutunref\"><code>timeout.unref()</code></a> can be used\nwith no performance impact since Node.js 10.</p>",
              "displayName": "DEP0127: `timers._unrefActive()`"
            },
            {
              "textRaw": "DEP0128: modules with an invalid `main` entry and an `index.js` file",
              "name": "dep0128:_modules_with_an_invalid_`main`_entry_and_an_`index.js`_file",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37204",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26823",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Modules that have an invalid <code>main</code> entry (e.g., <code>./does-not-exist.js</code>) and\nalso have an <code>index.js</code> file in the top level directory will resolve the\n<code>index.js</code> file. That is deprecated and is going to throw an error in future\nNode.js versions.</p>",
              "displayName": "DEP0128: modules with an invalid `main` entry and an `index.js` file"
            },
            {
              "textRaw": "DEP0129: `ChildProcess._channel`",
              "name": "dep0129:_`childprocess._channel`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58527",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27949",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v11.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26982",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>_channel</code> property of child process objects returned by <code>spawn()</code> and\nsimilar functions is not intended for public use. Use <code>ChildProcess.channel</code>\ninstead.</p>",
              "displayName": "DEP0129: `ChildProcess._channel`"
            },
            {
              "textRaw": "DEP0130: `Module.createRequireFromPath()`",
              "name": "dep0130:_`module.createrequirefrompath()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37201",
                    "description": "End-of-life."
                  },
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27951",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v12.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27405",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Use <a href=\"module.html#modulecreaterequirefilename\"><code>module.createRequire()</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/create-require-from-path\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/create-require-from-path\n</code></pre>",
              "displayName": "DEP0130: `Module.createRequireFromPath()`"
            },
            {
              "textRaw": "DEP0131: Legacy HTTP parser",
              "name": "dep0131:_legacy_http_parser",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29589",
                    "description": "This feature has been removed."
                  },
                  {
                    "version": "v12.22.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37603",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v12.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27498",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The legacy HTTP parser, used by default in versions of Node.js prior to 12.0.0,\nis deprecated and has been removed in v13.0.0. Prior to v13.0.0, the\n<code>--http-parser=legacy</code> command-line flag could be used to revert to using the\nlegacy parser.</p>",
              "displayName": "DEP0131: Legacy HTTP parser"
            },
            {
              "textRaw": "DEP0132: `worker.terminate()` with callback",
              "name": "dep0132:_`worker.terminate()`_with_callback",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58528",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v12.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28021",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Passing a callback to <a href=\"worker_threads.html#workerterminate\"><code>worker.terminate()</code></a> is deprecated. Use the returned\n<code>Promise</code> instead, or a listener to the worker's <code>'exit'</code> event.</p>",
              "displayName": "DEP0132: `worker.terminate()` with callback"
            },
            {
              "textRaw": "DEP0133: `http` `connection`",
              "name": "dep0133:_`http`_`connection`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29015",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Prefer <a href=\"http.html#responsesocket\"><code>response.socket</code></a> over <a href=\"http.html#responseconnection\"><code>response.connection</code></a> and\n<a href=\"http.html#requestsocket\"><code>request.socket</code></a> over <a href=\"http.html#requestconnection\"><code>request.connection</code></a>.</p>",
              "displayName": "DEP0133: `http` `connection`"
            },
            {
              "textRaw": "DEP0134: `process._tickCallback`",
              "name": "dep0134:_`process._tickcallback`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29781",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>The <code>process._tickCallback</code> property was never documented as\nan officially supported API.</p>",
              "displayName": "DEP0134: `process._tickCallback`"
            },
            {
              "textRaw": "DEP0135: `WriteStream.open()` and `ReadStream.open()` are internal",
              "name": "dep0135:_`writestream.open()`_and_`readstream.open()`_are_internal",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58529",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29061",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><a href=\"fs.html#class-fswritestream\"><code>WriteStream.open()</code></a> and <a href=\"fs.html#class-fsreadstream\"><code>ReadStream.open()</code></a> are undocumented internal\nAPIs that do not make sense to use in userland. File streams should always be\nopened through their corresponding factory methods <a href=\"fs.html#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a>\nand <a href=\"fs.html#fscreatereadstreampath-options\"><code>fs.createReadStream()</code></a>) or by passing a file descriptor in options.</p>",
              "displayName": "DEP0135: `WriteStream.open()` and `ReadStream.open()` are internal"
            },
            {
              "textRaw": "DEP0136: `http` `finished`",
              "name": "dep0136:_`http`_`finished`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v13.4.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/28679",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p><a href=\"http.html#responsefinished\"><code>response.finished</code></a> indicates whether <a href=\"http.html#responseenddata-encoding-callback\"><code>response.end()</code></a> has been\ncalled, not whether <code>'finish'</code> has been emitted and the underlying data\nis flushed.</p>\n<p>Use <a href=\"http.html#responsewritablefinished\"><code>response.writableFinished</code></a> or <a href=\"http.html#responsewritableended\"><code>response.writableEnded</code></a>\naccordingly instead to avoid the ambiguity.</p>\n<p>To maintain existing behavior <code>response.finished</code> should be replaced with\n<code>response.writableEnded</code>.</p>",
              "displayName": "DEP0136: `http` `finished`"
            },
            {
              "textRaw": "DEP0137: Closing fs.FileHandle on garbage collection",
              "name": "dep0137:_closing_fs.filehandle_on_garbage_collection",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58536",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28396",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Allowing a <a href=\"fs.html#class-filehandle\"><code>fs.FileHandle</code></a> object to be closed on garbage collection used\nto be allowed, but now throws an error.</p>\n<p>Please ensure that all <code>fs.FileHandle</code> objects are explicitly closed using\n<code>FileHandle.prototype.close()</code> when the <code>fs.FileHandle</code> is no longer needed:</p>\n<pre><code class=\"language-js\">const fsPromises = require('node:fs').promises;\nasync function openAndClose() {\n  let filehandle;\n  try {\n    filehandle = await fsPromises.open('thefile.txt', 'r');\n  } finally {\n    if (filehandle !== undefined)\n      await filehandle.close();\n  }\n}\n</code></pre>",
              "displayName": "DEP0137: Closing fs.FileHandle on garbage collection"
            },
            {
              "textRaw": "DEP0138: `process.mainModule`",
              "name": "dep0138:_`process.mainmodule`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32232",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p><a href=\"process.html#processmainmodule\"><code>process.mainModule</code></a> is a CommonJS-only feature while <code>process</code> global\nobject is shared with non-CommonJS environment. Its use within ECMAScript\nmodules is unsupported.</p>\n<p>It is deprecated in favor of <a href=\"modules.html#accessing-the-main-module\"><code>require.main</code></a>, because it serves the same\npurpose and is only available on CommonJS environment.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/process-main-module\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/process-main-module\n</code></pre>",
              "displayName": "DEP0138: `process.mainModule`"
            },
            {
              "textRaw": "DEP0139: `process.umask()` with no arguments",
              "name": "dep0139:_`process.umask()`_with_no_arguments",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v14.0.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32499",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Calling <code>process.umask()</code> with no argument causes the process-wide umask to be\nwritten twice. This introduces a race condition between threads, and is a\npotential security vulnerability. There is no safe, cross-platform alternative\nAPI.</p>",
              "displayName": "DEP0139: `process.umask()` with no arguments"
            },
            {
              "textRaw": "DEP0140: Use `request.destroy()` instead of `request.abort()`",
              "name": "dep0140:_use_`request.destroy()`_instead_of_`request.abort()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v14.1.0",
                      "v13.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32807",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Use <a href=\"http.html#requestdestroyerror\"><code>request.destroy()</code></a> instead of <a href=\"http.html#requestabort\"><code>request.abort()</code></a>.</p>",
              "displayName": "DEP0140: Use `request.destroy()` instead of `request.abort()`"
            },
            {
              "textRaw": "DEP0141: `repl.inputStream` and `repl.outputStream`",
              "name": "dep0141:_`repl.inputstream`_and_`repl.outputstream`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33294",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>The <code>node:repl</code> module exported the input and output stream twice. Use <code>.input</code>\ninstead of <code>.inputStream</code> and <code>.output</code> instead of <code>.outputStream</code>.</p>",
              "displayName": "DEP0141: `repl.inputStream` and `repl.outputStream`"
            },
            {
              "textRaw": "DEP0142: `repl._builtinLibs`",
              "name": "dep0142:_`repl._builtinlibs`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33294",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>The <code>node:repl</code> module exports a <code>_builtinLibs</code> property that contains an array\nof built-in modules. It was incomplete so far and instead it's better to rely\nupon <code>require('node:module').builtinModules</code>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/repl-builtin-modules\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/repl-builtin-modules\n</code></pre>",
              "displayName": "DEP0142: `repl._builtinLibs`"
            },
            {
              "textRaw": "DEP0143: `Transform._transformState`",
              "name": "dep0143:_`transform._transformstate`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33105",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v14.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33126",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>Transform._transformState</code> will be removed in future versions where it is\nno longer required due to simplification of the implementation.</p>",
              "displayName": "DEP0143: `Transform._transformState`"
            },
            {
              "textRaw": "DEP0144: `module.parent`",
              "name": "dep0144:_`module.parent`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v14.6.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32217",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>A CommonJS module can access the first module that required it using\n<code>module.parent</code>. This feature is deprecated because it does not work\nconsistently in the presence of ECMAScript modules and because it gives an\ninaccurate representation of the CommonJS module graph.</p>\n<p>Some modules use it to check if they are the entry point of the current process.\nInstead, it is recommended to compare <code>require.main</code> and <code>module</code>:</p>\n<pre><code class=\"language-js\">if (require.main === module) {\n  // Code section that will run only if current file is the entry point.\n}\n</code></pre>\n<p>When looking for the CommonJS modules that have required the current one,\n<code>require.cache</code> and <code>module.children</code> can be used:</p>\n<pre><code class=\"language-js\">const moduleParents = Object.values(require.cache)\n  .filter((m) => m.children.includes(module));\n</code></pre>",
              "displayName": "DEP0144: `module.parent`"
            },
            {
              "textRaw": "DEP0145: `socket.bufferSize`",
              "name": "dep0145:_`socket.buffersize`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34088",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p><a href=\"net.html#socketbuffersize\"><code>socket.bufferSize</code></a> is just an alias for <a href=\"stream.html#writablewritablelength\"><code>writable.writableLength</code></a>.</p>",
              "displayName": "DEP0145: `socket.bufferSize`"
            },
            {
              "textRaw": "DEP0146: `new crypto.Certificate()`",
              "name": "dep0146:_`new_crypto.certificate()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v14.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34697",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"crypto.html#legacy-api\"><code>crypto.Certificate()</code> constructor</a> is deprecated. Use\n<a href=\"crypto.html#class-certificate\">static methods of <code>crypto.Certificate()</code></a> instead.</p>",
              "displayName": "DEP0146: `new crypto.Certificate()`"
            },
            {
              "textRaw": "DEP0147: `fs.rmdir(path, { recursive: true })`",
              "name": "dep0147:_`fs.rmdir(path,_{_recursive:_true_})`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58616",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37302",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35562",
                    "description": "Runtime deprecation for permissive behavior."
                  },
                  {
                    "version": "v14.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35579",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>fs.rmdir</code>, <code>fs.rmdirSync</code>, and <code>fs.promises.rmdir</code> methods used\nto support a <code>recursive</code> option. That option has been removed.</p>\n<p>Use <code>fs.rm(path, { recursive: true, force: true })</code>,\n<code>fs.rmSync(path, { recursive: true, force: true })</code> or\n<code>fs.promises.rm(path, { recursive: true, force: true })</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/rmdir\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/rmdir\n</code></pre>",
              "displayName": "DEP0147: `fs.rmdir(path, { recursive: true })`"
            },
            {
              "textRaw": "DEP0148: Folder mappings in `\"exports\"` (trailing `\"/\"`)",
              "name": "dep0148:_folder_mappings_in_`\"exports\"`_(trailing_`\"/\"`)",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40121",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37215",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v15.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35747",
                    "description": "Runtime deprecation for self-referencing imports."
                  },
                  {
                    "version": "v14.13.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34718",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Using a trailing <code>\"/\"</code> to define subpath folder mappings in the\n<a href=\"packages.html#subpath-exports\">subpath exports</a> or <a href=\"packages.html#subpath-imports\">subpath imports</a> fields is no longer supported.\nUse <a href=\"packages.html#subpath-patterns\">subpath patterns</a> instead.</p>",
              "displayName": "DEP0148: Folder mappings in `\"exports\"` (trailing `\"/\"`)"
            },
            {
              "textRaw": "DEP0149: `http.IncomingMessage#connection`",
              "name": "dep0149:_`http.incomingmessage#connection`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33768",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Prefer <a href=\"http.html#messagesocket\"><code>message.socket</code></a> over <a href=\"http.html#messageconnection\"><code>message.connection</code></a>.</p>",
              "displayName": "DEP0149: `http.IncomingMessage#connection`"
            },
            {
              "textRaw": "DEP0150: Changing the value of `process.config`",
              "name": "dep0150:_changing_the_value_of_`process.config`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/43627",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36902",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>process.config</code> property provides access to Node.js compile-time settings.\nHowever, the property is mutable and therefore subject to tampering. The ability\nto change the value will be removed in a future version of Node.js.</p>",
              "displayName": "DEP0150: Changing the value of `process.config`"
            },
            {
              "textRaw": "DEP0151: Main index lookup and extension searching",
              "name": "dep0151:_main_index_lookup_and_extension_searching",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37206",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v15.8.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/36918",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Previously, <code>index.js</code> and extension searching lookups would apply to\n<code>import 'pkg'</code> main entry point resolution, even when resolving ES modules.</p>\n<p>With this deprecation, all ES module main entry point resolutions require\nan explicit <a href=\"packages.html#main-entry-point-export\"><code>\"exports\"</code> or <code>\"main\"</code> entry</a> with the exact file extension.</p>",
              "displayName": "DEP0151: Main index lookup and extension searching"
            },
            {
              "textRaw": "DEP0152: Extension PerformanceEntry properties",
              "name": "dep0152:_extension_performanceentry_properties",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58531",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37136",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>'gc'</code>, <code>'http2'</code>, and <code>'http'</code> <a href=\"perf_hooks.html#class-performanceentry\"><code>&#x3C;PerformanceEntry></code></a> object types used to have\nadditional properties assigned to them that provide additional information.\nThese properties are now available within the standard <code>detail</code> property\nof the <code>PerformanceEntry</code> object. The deprecated accessors have been\nremoved.</p>",
              "displayName": "DEP0152: Extension PerformanceEntry properties"
            },
            {
              "textRaw": "DEP0153: `dns.lookup` and `dnsPromises.lookup` options type coercion",
              "name": "dep0153:_`dns.lookup`_and_`dnspromises.lookup`_options_type_coercion",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41431",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39793",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v16.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/38906",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Using a non-nullish non-integer value for <code>family</code> option, a non-nullish\nnon-number value for <code>hints</code> option, a non-nullish non-boolean value for <code>all</code>\noption, or a non-nullish non-boolean value for <code>verbatim</code> option in\n<a href=\"dns.html#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and <a href=\"dns.html#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a> throws an\n<code>ERR_INVALID_ARG_TYPE</code> error.</p>",
              "displayName": "DEP0153: `dns.lookup` and `dnsPromises.lookup` options type coercion"
            },
            {
              "textRaw": "DEP0154: RSA-PSS generate key pair options",
              "name": "dep0154:_rsa-pss_generate_key_pair_options",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58706",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/45653",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39927",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Use  <code>'hashAlgorithm'</code> instead of <code>'hash'</code>, and <code>'mgf1HashAlgorithm'</code> instead of <code>'mgf1Hash'</code>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/crypto-rsa-pss-update\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/crypto-rsa-pss-update\n</code></pre>",
              "displayName": "DEP0154: RSA-PSS generate key pair options"
            },
            {
              "textRaw": "DEP0155: Trailing slashes in pattern specifier resolutions",
              "name": "dep0155:_trailing_slashes_in_pattern_specifier_resolutions",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40117",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40039",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The remapping of specifiers ending in <code>\"/\"</code> like <code>import 'pkg/x/'</code> is deprecated\nfor package <code>\"exports\"</code> and <code>\"imports\"</code> pattern resolutions.</p>",
              "displayName": "DEP0155: Trailing slashes in pattern specifier resolutions"
            },
            {
              "textRaw": "DEP0156: `.aborted` property and `'abort'`, `'aborted'` event in `http`",
              "name": "dep0156:_`.aborted`_property_and_`'abort'`,_`'aborted'`_event_in_`http`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v17.0.0",
                      "v16.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/36670",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Move to <a href=\"stream.html#stream\"><code>&#x3C;Stream></code></a> API instead, as the <a href=\"http.html#class-httpclientrequest\"><code>http.ClientRequest</code></a>,\n<a href=\"http.html#class-httpserverresponse\"><code>http.ServerResponse</code></a>, and <a href=\"http.html#class-httpincomingmessage\"><code>http.IncomingMessage</code></a> are all stream-based.\nCheck <code>stream.destroyed</code> instead of the <code>.aborted</code> property, and listen for\n<code>'close'</code> instead of <code>'abort'</code>, <code>'aborted'</code> event.</p>\n<p>The <code>.aborted</code> property and <code>'abort'</code> event are only useful for detecting\n<code>.abort()</code> calls. For closing a request early, use the Stream\n<code>.destroy([error])</code> then check the <code>.destroyed</code> property and <code>'close'</code> event\nshould have the same effect. The receiving end should also check the\n<a href=\"stream.html#readablereadableended\"><code>readable.readableEnded</code></a> value on <a href=\"http.html#class-httpincomingmessage\"><code>http.IncomingMessage</code></a> to get whether\nit was an aborted or graceful destroy.</p>",
              "displayName": "DEP0156: `.aborted` property and `'abort'`, `'aborted'` event in `http`"
            },
            {
              "textRaw": "DEP0157: Thenable support in streams",
              "name": "dep0157:_thenable_support_in_streams",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40773",
                    "description": "End-of-life."
                  },
                  {
                    "version": [
                      "v17.2.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/40860",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>An undocumented feature of Node.js streams was to support thenables in\nimplementation methods. This is now deprecated, use callbacks instead and avoid\nuse of async function for streams implementation methods.</p>\n<p>This feature caused users to encounter unexpected problems where the user\nimplements the function in callback style but uses e.g. an async method which\nwould cause an error since mixing promise and callback semantics is not valid.</p>\n<pre><code class=\"language-js\">const w = new Writable({\n  async final(callback) {\n    await someOp();\n    callback();\n  },\n});\n</code></pre>",
              "displayName": "DEP0157: Thenable support in streams"
            },
            {
              "textRaw": "DEP0158: `buffer.slice(start, end)`",
              "name": "dep0158:_`buffer.slice(start,_end)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v17.5.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41596",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>This method was deprecated because it is not compatible with\n<code>Uint8Array.prototype.slice()</code>, which is a superclass of <code>Buffer</code>.</p>\n<p>Use <a href=\"buffer.html#bufsubarraystart-end\"><code>buffer.subarray</code></a> which does the same thing instead.</p>",
              "displayName": "DEP0158: `buffer.slice(start, end)`"
            },
            {
              "textRaw": "DEP0159: `ERR_INVALID_CALLBACK`",
              "name": "dep0159:_`err_invalid_callback`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "End-of-Life."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>This error code was removed due to adding more confusion to\nthe errors used for value type validation.</p>",
              "displayName": "DEP0159: `ERR_INVALID_CALLBACK`"
            },
            {
              "textRaw": "DEP0160: `process.on('multipleResolves', handler)`",
              "name": "dep0160:_`process.on('multipleresolves',_handler)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58707",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41896",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v17.6.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41872",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>This event was deprecated and removed because it did not work with V8 promise\ncombinators which diminished its usefulness.</p>",
              "displayName": "DEP0160: `process.on('multipleResolves', handler)`"
            },
            {
              "textRaw": "DEP0161: `process._getActiveRequests()` and `process._getActiveHandles()`",
              "name": "dep0161:_`process._getactiverequests()`_and_`process._getactivehandles()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v17.6.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41587",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <code>process._getActiveHandles()</code> and <code>process._getActiveRequests()</code>\nfunctions are not intended for public use and can be removed in future\nreleases.</p>\n<p>Use <a href=\"process.html#processgetactiveresourcesinfo\"><code>process.getActiveResourcesInfo()</code></a> to get a list of types of active\nresources and not the actual references.</p>",
              "displayName": "DEP0161: `process._getActiveRequests()` and `process._getActiveHandles()`"
            },
            {
              "textRaw": "DEP0162: `fs.write()`, `fs.writeFileSync()` coercion to string",
              "name": "dep0162:_`fs.write()`,_`fs.writefilesync()`_coercion_to_string",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42796",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42607",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v17.8.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42149",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Implicit coercion of objects with own <code>toString</code> property, passed as second\nparameter in <a href=\"fs.html#fswritefd-buffer-offset-length-position-callback\"><code>fs.write()</code></a>, <a href=\"fs.html#fswritefilefile-data-options-callback\"><code>fs.writeFile()</code></a>, <a href=\"fs.html#fsappendfilepath-data-options-callback\"><code>fs.appendFile()</code></a>,\n<a href=\"fs.html#fswritefilesyncfile-data-options\"><code>fs.writeFileSync()</code></a>, and <a href=\"fs.html#fsappendfilesyncpath-data-options\"><code>fs.appendFileSync()</code></a> is deprecated.\nConvert them to primitive strings.</p>",
              "displayName": "DEP0162: `fs.write()`, `fs.writeFileSync()` coercion to string"
            },
            {
              "textRaw": "DEP0163: `channel.subscribe(onMessage)`, `channel.unsubscribe(onMessage)`",
              "name": "dep0163:_`channel.subscribe(onmessage)`,_`channel.unsubscribe(onmessage)`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.8.0",
                      "v22.20.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59758",
                    "description": "Deprecation revoked."
                  },
                  {
                    "version": [
                      "v18.7.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42714",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Deprecation revoked</p>\n<p>These methods were deprecated because their use could leave the channel object\nvulnerable to being garbage-collected if not strongly referenced by the user.\nThe deprecation was revoked because channel objects are now resistant to\ngarbage collection when the channel has active subscribers.</p>",
              "displayName": "DEP0163: `channel.subscribe(onMessage)`, `channel.unsubscribe(onMessage)`"
            },
            {
              "textRaw": "DEP0164: `process.exit(code)`, `process.exitCode` coercion to integer",
              "name": "dep0164:_`process.exit(code)`,_`process.exitcode`_coercion_to_integer",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/43716",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44711",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v18.10.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44714",
                    "description": "Documentation-only deprecation of `process.exitCode` integer coercion."
                  },
                  {
                    "version": [
                      "v18.7.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/43738",
                    "description": "Documentation-only deprecation of `process.exit(code)` integer coercion."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Values other than <code>undefined</code>, <code>null</code>, integer numbers, and integer strings\n(e.g., <code>'1'</code>) are deprecated as value for the <code>code</code> parameter in\n<a href=\"process.html#processexitcode\"><code>process.exit()</code></a> and as value to assign to <a href=\"process.html#processexitcode_1\"><code>process.exitCode</code></a>.</p>",
              "displayName": "DEP0164: `process.exit(code)`, `process.exitCode` coercion to integer"
            },
            {
              "textRaw": "DEP0165: `--trace-atomics-wait`",
              "name": "dep0165:_`--trace-atomics-wait`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52747",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/51179",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44093",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>--trace-atomics-wait</code> flag has been removed because\nit uses the V8 hook <code>SetAtomicsWaitCallback</code>,\nthat will be removed in a future V8 release.</p>",
              "displayName": "DEP0165: `--trace-atomics-wait`"
            },
            {
              "textRaw": "DEP0166: Double slashes in imports and exports targets",
              "name": "dep0166:_double_slashes_in_imports_and_exports_targets",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44495",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v18.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44477",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Package imports and exports targets mapping into paths including a double slash\n(of <em>\"/\"</em> or <em>\"\\\"</em>) are deprecated and will fail with a resolution validation\nerror in a future release. This same deprecation also applies to pattern matches\nstarting or ending in a slash.</p>",
              "displayName": "DEP0166: Double slashes in imports and exports targets"
            },
            {
              "textRaw": "DEP0167: Weak `DiffieHellmanGroup` instances (`modp1`, `modp2`, `modp5`)",
              "name": "dep0167:_weak_`diffiehellmangroup`_instances_(`modp1`,_`modp2`,_`modp5`)",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v18.10.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44588",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The well-known MODP groups <code>modp1</code>, <code>modp2</code>, and <code>modp5</code> are deprecated because\nthey are not secure against practical attacks. See <a href=\"https://www.rfc-editor.org/rfc/rfc8247#section-2.4\">RFC 8247 Section 2.4</a> for\ndetails.</p>\n<p>These groups might be removed in future versions of Node.js. Applications that\nrely on these groups should evaluate using stronger MODP groups instead.</p>",
              "displayName": "DEP0167: Weak `DiffieHellmanGroup` instances (`modp1`, `modp2`, `modp5`)"
            },
            {
              "textRaw": "DEP0168: Unhandled exception in Node-API callbacks",
              "name": "dep0168:_unhandled_exception_in_node-api_callbacks",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v18.3.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/36510",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The implicit suppression of uncaught exceptions in Node-API callbacks is now\ndeprecated.</p>\n<p>Set the flag <a href=\"cli.html#--force-node-api-uncaught-exceptions-policy\"><code>--force-node-api-uncaught-exceptions-policy</code></a> to force Node.js\nto emit an <a href=\"process.html#event-uncaughtexception\"><code>'uncaughtException'</code></a> event if the exception is not handled in\nNode-API callbacks.</p>",
              "displayName": "DEP0168: Unhandled exception in Node-API callbacks"
            },
            {
              "textRaw": "DEP0169: Insecure url.parse()",
              "name": "dep0169:_insecure_url.parse()",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55017",
                    "description": "Application deprecation."
                  },
                  {
                    "version": [
                      "v19.9.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47203",
                    "description": "Added support for `--pending-deprecation`."
                  },
                  {
                    "version": [
                      "v19.0.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44919",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Application (non-<code>node_modules</code> code only)</p>\n<p><a href=\"url.html#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a> behavior is not standardized and prone to errors that\nhave security implications. Use the <a href=\"url.html#the-whatwg-url-api\">WHATWG URL API</a> instead. CVEs are not\nissued for <code>url.parse()</code> vulnerabilities.</p>\n<p>Calling <a href=\"url.html#urlformaturlstring\"><code>url.format(urlString)</code></a> or <a href=\"url.html#urlresolvefrom-to\"><code>url.resolve()</code></a> invokes <code>url.parse()</code>\ninternally, and is therefore also covered by this deprecation.</p>",
              "displayName": "DEP0169: Insecure url.parse()"
            },
            {
              "textRaw": "DEP0170: Invalid port when using `url.parse()`",
              "name": "dep0170:_invalid_port_when_using_`url.parse()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58617",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v20.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/45526",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v19.2.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/45576",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><a href=\"url.html#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a> used to accept URLs with ports that are not numbers. This\nbehavior might result in host name spoofing with unexpected input. These URLs\nwill throw an error (which the <a href=\"url.html#the-whatwg-url-api\">WHATWG URL API</a> also does).</p>",
              "displayName": "DEP0170: Invalid port when using `url.parse()`"
            },
            {
              "textRaw": "DEP0171: Setters for `http.IncomingMessage` headers and trailers",
              "name": "dep0171:_setters_for_`http.incomingmessage`_headers_and_trailers",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v19.3.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/45697",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>In a future version of Node.js, <a href=\"http.html#messageheaders\"><code>message.headers</code></a>,\n<a href=\"http.html#messageheadersdistinct\"><code>message.headersDistinct</code></a>, <a href=\"http.html#messagetrailers\"><code>message.trailers</code></a>, and\n<a href=\"http.html#messagetrailersdistinct\"><code>message.trailersDistinct</code></a> will be read-only.</p>",
              "displayName": "DEP0171: Setters for `http.IncomingMessage` headers and trailers"
            },
            {
              "textRaw": "DEP0172: The `asyncResource` property of `AsyncResource` bound functions",
              "name": "dep0172:_the_`asyncresource`_property_of_`asyncresource`_bound_functions",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58618",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46432",
                    "description": "Runtime-deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Older versions of Node.js would add the <code>asyncResource</code> when a function is\nbound to an <code>AsyncResource</code>. It no longer does.</p>",
              "displayName": "DEP0172: The `asyncResource` property of `AsyncResource` bound functions"
            },
            {
              "textRaw": "DEP0173: the `assert.CallTracker` class",
              "name": "dep0173:_the_`assert.calltracker`_class",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/00000",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v20.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/47740",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>assert.CallTracker</code> API has been removed.</p>",
              "displayName": "DEP0173: the `assert.CallTracker` class"
            },
            {
              "textRaw": "DEP0174: calling `promisify` on a function that returns a `Promise`",
              "name": "dep0174:_calling_`promisify`_on_a_function_that_returns_a_`promise`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v21.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49609",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v20.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49647",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Calling <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify</code></a> on a function that returns a <code>Promise</code> will ignore\nthe result of said promise, which can lead to unhandled promise rejections.</p>",
              "displayName": "DEP0174: calling `promisify` on a function that returns a `Promise`"
            },
            {
              "textRaw": "DEP0175: `util.toUSVString`",
              "name": "dep0175:_`util.tousvstring`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v20.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49725",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#utiltousvstringstring\"><code>util.toUSVString()</code></a> API is deprecated. Please use\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toWellFormed\"><code>String.prototype.toWellFormed</code></a> instead.</p>",
              "displayName": "DEP0175: `util.toUSVString`"
            },
            {
              "textRaw": "DEP0176: `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK`",
              "name": "dep0176:_`fs.f_ok`,_`fs.r_ok`,_`fs.w_ok`,_`fs.x_ok`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55862",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49686",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v20.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49683",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p><code>F_OK</code>, <code>R_OK</code>, <code>W_OK</code> and <code>X_OK</code> getters exposed directly on <code>node:fs</code> were\nremoved. Get them from <code>fs.constants</code> or <code>fs.promises.constants</code> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/fs-access-mode-constants\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/fs-access-mode-constants\n</code></pre>",
              "displayName": "DEP0176: `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, `fs.X_OK`"
            },
            {
              "textRaw": "DEP0177: `util.types.isWebAssemblyCompiledModule`",
              "name": "dep0177:_`util.types.iswebassemblycompiledmodule`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v21.7.0",
                      "v20.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/51442",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v21.3.0",
                      "v20.11.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50486",
                    "description": "A deprecation code has been assigned."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32116",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>util.types.isWebAssemblyCompiledModule</code> API has been removed.\nPlease use <code>value instanceof WebAssembly.Module</code> instead.</p>",
              "displayName": "DEP0177: `util.types.isWebAssemblyCompiledModule`"
            },
            {
              "textRaw": "DEP0178: `dirent.path`",
              "name": "dep0178:_`dirent.path`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55548",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/51050",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v21.5.0",
                      "v20.12.0",
                      "v18.20.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/51020",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>dirent.path</code> property has been removed due to its lack of consistency across\nrelease lines. Please use <a href=\"fs.html#direntparentpath\"><code>dirent.parentPath</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/dirent-path-to-parent-path\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/dirent-path-to-parent-path\n</code></pre>",
              "displayName": "DEP0178: `dirent.path`"
            },
            {
              "textRaw": "DEP0179: `Hash` constructor",
              "name": "dep0179:_`hash`_constructor",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/51880",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v21.5.0",
                      "v20.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/51077",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Calling <code>Hash</code> class directly with <code>Hash()</code> or <code>new Hash()</code> is\ndeprecated due to being internals, not intended for public use.\nPlease use the <a href=\"crypto.html#cryptocreatehashalgorithm-options\"><code>crypto.createHash()</code></a> method to create Hash instances.</p>",
              "displayName": "DEP0179: `Hash` constructor"
            },
            {
              "textRaw": "DEP0180: `fs.Stats` constructor",
              "name": "dep0180:_`fs.stats`_constructor",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52067",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v20.13.0",
                    "pr-url": "https://github.com/nodejs/node/pull/51879",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Calling <code>fs.Stats</code> class directly with <code>Stats()</code> or <code>new Stats()</code> is\ndeprecated due to being internals, not intended for public use.</p>",
              "displayName": "DEP0180: `fs.Stats` constructor"
            },
            {
              "textRaw": "DEP0181: `Hmac` constructor",
              "name": "dep0181:_`hmac`_constructor",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v22.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52071",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v20.13.0",
                    "pr-url": "https://github.com/nodejs/node/pull/51881",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Calling <code>Hmac</code> class directly with <code>Hmac()</code> or <code>new Hmac()</code> is\ndeprecated due to being internals, not intended for public use.\nPlease use the <a href=\"crypto.html#cryptocreatehmacalgorithm-key-options\"><code>crypto.createHmac()</code></a> method to create Hmac instances.</p>",
              "displayName": "DEP0181: `Hmac` constructor"
            },
            {
              "textRaw": "DEP0182: Short GCM authentication tags without explicit `authTagLength`",
              "name": "dep0182:_short_gcm_authentication_tags_without_explicit_`authtaglength`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61084",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52552",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v20.13.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52345",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>For ciphers in GCM mode, the <a href=\"crypto.html#deciphersetauthtagbuffer-encoding\"><code>decipher.setAuthTag()</code></a> function used to accept\nauthentication tags of any valid length (see also <a href=\"#DEP0090\">DEP0090</a>). This\nexception has been removed to better align with recommendations per\n<a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf\">NIST SP 800-38D</a>, and applications that intend to use authentication tags\nthat are shorter than the default authentication tag length (i.e., shorter than\n16 bytes for AES-GCM) must explicitly set the <code>authTagLength</code> option of the\n<a href=\"crypto.html#cryptocreatedecipherivalgorithm-key-iv-options\"><code>crypto.createDecipheriv()</code></a> function to the appropriate length.</p>",
              "displayName": "DEP0182: Short GCM authentication tags without explicit `authTagLength`"
            },
            {
              "textRaw": "DEP0183: OpenSSL engine-based APIs",
              "name": "dep0183:_openssl_engine-based_apis",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53329",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>OpenSSL 3 has deprecated support for custom engines with a recommendation to\nswitch to its new provider model. The <code>clientCertEngine</code> option for\n<code>https.request()</code>, <a href=\"tls.html#tlscreatesecurecontextoptions\"><code>tls.createSecureContext()</code></a>, and <a href=\"tls.html#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a>;\nthe <code>privateKeyEngine</code> and <code>privateKeyIdentifier</code> for <a href=\"tls.html#tlscreatesecurecontextoptions\"><code>tls.createSecureContext()</code></a>;\nand <a href=\"crypto.html#cryptosetengineengine-flags\"><code>crypto.setEngine()</code></a> all depend on this functionality from OpenSSL.</p>",
              "displayName": "DEP0183: OpenSSL engine-based APIs"
            },
            {
              "textRaw": "DEP0184: Instantiating `node:zlib` classes without `new`",
              "name": "dep0184:_instantiating_`node:zlib`_classes_without_`new`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55718",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v22.9.0",
                      "v20.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/54708",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Instantiating classes without the <code>new</code> qualifier exported by the <code>node:zlib</code> module is deprecated.\nIt is recommended to use the <code>new</code> qualifier instead. This applies to all Zlib classes, such as <code>Deflate</code>,\n<code>DeflateRaw</code>, <code>Gunzip</code>, <code>Inflate</code>, <code>InflateRaw</code>, <code>Unzip</code>, and <code>Zlib</code>.</p>",
              "displayName": "DEP0184: Instantiating `node:zlib` classes without `new`"
            },
            {
              "textRaw": "DEP0185: Instantiating `node:repl` classes without `new`",
              "name": "dep0185:_instantiating_`node:repl`_classes_without_`new`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59495",
                    "description": "End-of-Life."
                  },
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/54869",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v22.9.0",
                      "v20.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/54842",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>Instantiating classes without the <code>new</code> qualifier exported by the <code>node:repl</code> module is deprecated.\nThe <code>new</code> qualifier must be used instead. This applies to all REPL classes, including\n<code>REPLServer</code> and <code>Recoverable</code>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/repl-classes-with-new\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/repl-classes-with-new\n</code></pre>",
              "displayName": "DEP0185: Instantiating `node:repl` classes without `new`"
            },
            {
              "textRaw": "DEP0187: Passing invalid argument types to `fs.existsSync`",
              "name": "dep0187:_passing_invalid_argument_types_to_`fs.existssync`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55753",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v23.4.0",
                      "v22.13.0",
                      "v20.19.3"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55892",
                    "description": "Documentation-only."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Passing non-supported argument types is deprecated and, instead of returning <code>false</code>,\nwill throw an error in a future version.</p>",
              "displayName": "DEP0187: Passing invalid argument types to `fs.existsSync`"
            },
            {
              "textRaw": "DEP0188: `process.features.ipv6` and `process.features.uv`",
              "name": "dep0188:_`process.features.ipv6`_and_`process.features.uv`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v23.4.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55545",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>These properties are unconditionally <code>true</code>. Any checks based on these properties are redundant.</p>",
              "displayName": "DEP0188: `process.features.ipv6` and `process.features.uv`"
            },
            {
              "textRaw": "DEP0189: `process.features.tls_*`",
              "name": "dep0189:_`process.features.tls_*`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v23.4.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55545",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p><code>process.features.tls_alpn</code>, <code>process.features.tls_ocsp</code>, and <code>process.features.tls_sni</code> are\ndeprecated, as their values are guaranteed to be identical to that of <code>process.features.tls</code>.</p>",
              "displayName": "DEP0189: `process.features.tls_*`"
            },
            {
              "textRaw": "DEP0190: Passing `args` to `node:child_process` `execFile`/`spawn` with `shell` option",
              "name": "dep0190:_passing_`args`_to_`node:child_process`_`execfile`/`spawn`_with_`shell`_option",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57199",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v23.11.0",
                      "v22.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57389",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>When an <code>args</code> array is passed to <a href=\"child_process.html#child_processexecfilefile-args-options-callback\"><code>child_process.execFile</code></a> or <a href=\"child_process.html#child_processspawncommand-args-options\"><code>child_process.spawn</code></a> with the option\n<code>{ shell: true }</code> or <code>{ shell: '/path/to/shell' }</code>, the values are not escaped, only space-separated,\nwhich can lead to shell injection.</p>",
              "displayName": "DEP0190: Passing `args` to `node:child_process` `execFile`/`spawn` with `shell` option"
            },
            {
              "textRaw": "DEP0191: `repl.builtinModules`",
              "name": "dep0191:_`repl.builtinmodules`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57508",
                    "description": "Documentation-only deprecation with `--pending-deprecation` support."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only (supports <a href=\"cli.html#--pending-deprecation\"><code>--pending-deprecation</code></a>)</p>\n<p>The <code>node:repl</code> module exports a <code>builtinModules</code> property that contains an array\nof built-in modules. This was incomplete and matched the already deprecated\n<code>repl._builtinLibs</code> (<a href=\"#dep0142-repl_builtinlibs\">DEP0142</a>) instead it's better to rely\nupon <code>require('node:module').builtinModules</code>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/repl-builtin-modules\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/repl-builtin-modules\n</code></pre>",
              "displayName": "DEP0191: `repl.builtinModules`"
            },
            {
              "textRaw": "DEP0192: `require('node:_tls_common')` and `require('node:_tls_wrap')`",
              "name": "dep0192:_`require('node:_tls_common')`_and_`require('node:_tls_wrap')`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.2.0",
                      "v22.17.0",
                      "v20.19.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57643",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>The <code>node:_tls_common</code> and <code>node:_tls_wrap</code> modules are deprecated as they should be considered\nan internal nodejs implementation rather than a public facing API, use <code>node:tls</code> instead.</p>",
              "displayName": "DEP0192: `require('node:_tls_common')` and `require('node:_tls_wrap')`"
            },
            {
              "textRaw": "DEP0193: `require('node:_stream_*')`",
              "name": "dep0193:_`require('node:_stream_*')`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60657",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v24.2.0",
                      "v22.17.0",
                      "v20.19.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58337",
                    "description": "Runtime deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The <code>node:_stream_duplex</code>, <code>node:_stream_passthrough</code>, <code>node:_stream_readable</code>, <code>node:_stream_transform</code>,\n<code>node:_stream_wrap</code> and <code>node:_stream_writable</code> modules are deprecated as they should be considered\nan internal nodejs implementation rather than a public facing API, use <code>node:stream</code> instead.</p>",
              "displayName": "DEP0193: `require('node:_stream_*')`"
            },
            {
              "textRaw": "DEP0194: HTTP/2 priority signaling",
              "name": "dep0194:_http/2_priority_signaling",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58293",
                    "description": "End-of-Life."
                  },
                  {
                    "version": [
                      "v24.2.0",
                      "v22.17.0",
                      "v20.19.6"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58313",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: End-of-Life</p>\n<p>The support for priority signaling has been removed following its deprecation in the <a href=\"https://datatracker.ietf.org/doc/html/rfc9113#section-5.3.1\">RFC 9113</a>.</p>",
              "displayName": "DEP0194: HTTP/2 priority signaling"
            },
            {
              "textRaw": "DEP0195: Instantiating `node:http` classes without `new`",
              "name": "dep0195:_instantiating_`node:http`_classes_without_`new`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.2.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58518",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Instantiating classes without the <code>new</code> qualifier exported by the <code>node:http</code> module is deprecated.\nIt is recommended to use the <code>new</code> qualifier instead. This applies to all http classes, such as\n<code>OutgoingMessage</code>, <code>IncomingMessage</code>, <code>ServerResponse</code> and <code>ClientRequest</code>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/http-classes-with-new\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/http-classes-with-new\n</code></pre>",
              "displayName": "DEP0195: Instantiating `node:http` classes without `new`"
            },
            {
              "textRaw": "DEP0196: Calling `node:child_process` functions with `options.shell` as an empty string",
              "name": "dep0196:_calling_`node:child_process`_functions_with_`options.shell`_as_an_empty_string",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.2.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58564",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Calling the process-spawning functions with <code>{ shell: '' }</code> is almost certainly\nunintentional, and can cause aberrant behavior.</p>\n<p>To make <a href=\"child_process.html#child_processexecfilefile-args-options-callback\"><code>child_process.execFile</code></a> or <a href=\"child_process.html#child_processspawncommand-args-options\"><code>child_process.spawn</code></a> invoke the\ndefault shell, use <code>{ shell: true }</code>. If the intention is not to invoke a shell\n(default behavior), either omit the <code>shell</code> option, or set it to <code>false</code> or a\nnullish value.</p>\n<p>To make <a href=\"child_process.html#child_processexeccommand-options-callback\"><code>child_process.exec</code></a> invoke the default shell, either omit the\n<code>shell</code> option, or set it to a nullish value. If the intention is not to invoke\na shell, use <a href=\"child_process.html#child_processexecfilefile-args-options-callback\"><code>child_process.execFile</code></a> instead.</p>",
              "displayName": "DEP0196: Calling `node:child_process` functions with `options.shell` as an empty string"
            },
            {
              "textRaw": "DEP0197: `util.types.isNativeError()`",
              "name": "dep0197:_`util.types.isnativeerror()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.2.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58262",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <a href=\"util.html#utiltypesisnativeerrorvalue\"><code>util.types.isNativeError</code></a> API is deprecated. Please use <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError\"><code>Error.isError</code></a> instead.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/types-is-native-error\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/types-is-native-error\n</code></pre>",
              "displayName": "DEP0197: `util.types.isNativeError()`"
            },
            {
              "textRaw": "DEP0198: Creating SHAKE-128 and SHAKE-256 digests without an explicit `options.outputLength`",
              "name": "dep0198:_creating_shake-128_and_shake-256_digests_without_an_explicit_`options.outputlength`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59008",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": [
                      "v24.4.0",
                      "v22.18.0",
                      "v20.19.5"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58942",
                    "description": "Documentation-only deprecation with support for `--pending-deprecation`."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Creating SHAKE-128 and SHAKE-256 digests without an explicit <code>options.outputLength</code> is deprecated.</p>",
              "displayName": "DEP0198: Creating SHAKE-128 and SHAKE-256 digests without an explicit `options.outputLength`"
            },
            {
              "textRaw": "DEP0199: `require('node:_http_*')`",
              "name": "dep0199:_`require('node:_http_*')`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.6.0",
                      "v22.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59293",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <code>node:_http_agent</code>, <code>node:_http_client</code>, <code>node:_http_common</code>, <code>node:_http_incoming</code>,\n<code>node:_http_outgoing</code> and <code>node:_http_server</code> modules are deprecated as they should be considered\nan internal nodejs implementation rather than a public facing API, use <code>node:http</code> instead.</p>",
              "displayName": "DEP0199: `require('node:_http_*')`"
            },
            {
              "textRaw": "DEP0200: Closing fs.Dir on garbage collection",
              "name": "dep0200:_closing_fs.dir_on_garbage_collection",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v24.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59839",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Allowing a <a href=\"fs.html#class-fsdir\"><code>fs.Dir</code></a> object to be closed on garbage collection is\ndeprecated. In the future, doing so might result in a thrown error that will\nterminate the process.</p>\n<p>Please ensure that all <code>fs.Dir</code> objects are explicitly closed using\n<code>Dir.prototype.close()</code> or <code>using</code> keyword:</p>\n<pre><code class=\"language-mjs\">import { opendir } from 'node:fs/promises';\n\n{\n  await using dir = await opendir('/async/disposable/directory');\n} // Closed by dir[Symbol.asyncDispose]()\n\n{\n  using dir = await opendir('/sync/disposable/directory');\n} // Closed by dir[Symbol.dispose]()\n\n{\n  const dir = await opendir('/unconditionally/iterated/directory');\n  for await (const entry of dir) {\n    // process an entry\n  } // Closed by iterator\n}\n\n{\n  let dir;\n  try {\n    dir = await opendir('/legacy/closeable/directory');\n  } finally {\n    await dir?.close();\n  }\n}\n</code></pre>",
              "displayName": "DEP0200: Closing fs.Dir on garbage collection"
            },
            {
              "textRaw": "DEP0201: Passing `options.type` to `Duplex.toWeb()`",
              "name": "dep0201:_passing_`options.type`_to_`duplex.toweb()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62173",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61632",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Passing the <code>type</code> option to <a href=\"stream.html#streamduplextowebstreamduplex-options\"><code>Duplex.toWeb()</code></a> is deprecated. To specify the\ntype of the readable half of the constructed readable-writable pair, use the\n<code>readableType</code> option instead.</p>",
              "displayName": "DEP0201: Passing `options.type` to `Duplex.toWeb()`"
            },
            {
              "textRaw": "DEP0202: `Http1IncomingMessage` and `Http1ServerResponse` options of HTTP/2 servers",
              "name": "dep0202:_`http1incomingmessage`_and_`http1serverresponse`_options_of_http/2_servers",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61713",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>The <code>Http1IncomingMessage</code> and <code>Http1ServerResponse</code> options of\n<a href=\"http2.html#http2createserveroptions-onrequesthandler\"><code>http2.createServer()</code></a> and <a href=\"http2.html#http2createsecureserveroptions-onrequesthandler\"><code>http2.createSecureServer()</code></a> are\ndeprecated. Use <code>http1Options.IncomingMessage</code> and\n<code>http1Options.ServerResponse</code> instead.</p>\n<pre><code class=\"language-cjs\">// Deprecated\nconst server = http2.createSecureServer({\n  allowHTTP1: true,\n  Http1IncomingMessage: MyIncomingMessage,\n  Http1ServerResponse: MyServerResponse,\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Use this instead\nconst server = http2.createSecureServer({\n  allowHTTP1: true,\n  http1Options: {\n    IncomingMessage: MyIncomingMessage,\n    ServerResponse: MyServerResponse,\n  },\n});\n</code></pre>",
              "displayName": "DEP0202: `Http1IncomingMessage` and `Http1ServerResponse` options of HTTP/2 servers"
            },
            {
              "textRaw": "DEP0203: Passing `CryptoKey` to `node:crypto` APIs",
              "name": "dep0203:_passing_`cryptokey`_to_`node:crypto`_apis",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v25.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62321",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Passing a <a href=\"webcrypto.html#class-cryptokey\"><code>CryptoKey</code></a> to <code>node:crypto</code> functions is deprecated and\nwill throw an error in a future version. This includes\n<a href=\"crypto.html#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>, <a href=\"crypto.html#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>,\n<a href=\"crypto.html#cryptosignalgorithm-data-key-callback\"><code>crypto.sign()</code></a>, <a href=\"crypto.html#cryptoverifyalgorithm-data-key-signature-callback\"><code>crypto.verify()</code></a>,\n<a href=\"crypto.html#cryptopublicencryptkey-buffer\"><code>crypto.publicEncrypt()</code></a>, <a href=\"crypto.html#cryptopublicdecryptkey-buffer\"><code>crypto.publicDecrypt()</code></a>,\n<a href=\"crypto.html#cryptoprivateencryptprivatekey-buffer\"><code>crypto.privateEncrypt()</code></a>, <a href=\"crypto.html#cryptoprivatedecryptprivatekey-buffer\"><code>crypto.privateDecrypt()</code></a>,\n<a href=\"crypto.html#signsignprivatekey-outputencoding\"><code>Sign.prototype.sign()</code></a>, <a href=\"crypto.html#verifyverifyobject-signature-signatureencoding\"><code>Verify.prototype.verify()</code></a>,\n<a href=\"crypto.html#cryptocreatehmacalgorithm-key-options\"><code>crypto.createHmac()</code></a>, <a href=\"crypto.html#cryptocreatecipherivalgorithm-key-iv-options\"><code>crypto.createCipheriv()</code></a>,\n<a href=\"crypto.html#cryptocreatedecipherivalgorithm-key-iv-options\"><code>crypto.createDecipheriv()</code></a>, <a href=\"crypto.html#cryptoencapsulatekey-callback\"><code>crypto.encapsulate()</code></a>, and\n<a href=\"crypto.html#cryptodecapsulatekey-ciphertext-callback\"><code>crypto.decapsulate()</code></a>.</p>",
              "displayName": "DEP0203: Passing `CryptoKey` to `node:crypto` APIs"
            },
            {
              "textRaw": "DEP0204: `KeyObject.from()` with non-extractable `CryptoKey`",
              "name": "dep0204:_`keyobject.from()`_with_non-extractable_`cryptokey`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v25.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62321",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p>Passing a non-extractable <a href=\"webcrypto.html#class-cryptokey\"><code>CryptoKey</code></a> to <a href=\"crypto.html#static-method-keyobjectfromkey\"><code>KeyObject.from()</code></a> is\ndeprecated and will throw an error in a future version.</p>",
              "displayName": "DEP0204: `KeyObject.from()` with non-extractable `CryptoKey`"
            },
            {
              "textRaw": "DEP0205: `module.register()`",
              "name": "dep0205:_`module.register()`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62401",
                    "description": "Runtime deprecation."
                  },
                  {
                    "version": "v25.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62395",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Runtime</p>\n<p><a href=\"module.html#moduleregisterspecifier-parenturl-options\"><code>module.register()</code></a> is deprecated. Use <a href=\"module.html#moduleregisterhooksoptions\"><code>module.registerHooks()</code></a>\ninstead.</p>\n<p>The <code>module.register()</code> API provides off-thread async hooks for customizing ES modules;\nthe <code>module.registerHooks()</code> API provides similar hooks that are synchronous, in-thread, and\nwork for all types of modules.\nSupporting async hooks has proven to be complex, involving worker threads orchestration, and there are issues\nthat have proven unresolveable. See <a href=\"module.html#caveats-of-asynchronous-customization-hooks\">caveats of asynchronous customization hooks</a>. Please migrate to\n<code>module.registerHooks()</code> as soon as possible as <code>module.register()</code> will be\nremoved in a future version of Node.js.</p>",
              "displayName": "DEP0205: `module.register()`"
            },
            {
              "textRaw": "DEP0206: Calling `digest()` on an already-finalized `Hmac` instance",
              "name": "dep0206:_calling_`digest()`_on_an_already-finalized_`hmac`_instance",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v26.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/63121",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "desc": "<p>Type: Documentation-only</p>\n<p>Calling <code>hmac.digest()</code> more than once returns an empty buffer instead of\nthrowing an error. This behavior is inconsistent with <code>hash.digest()</code> and\nmay lead to subtle bugs. Calling <code>hmac.digest()</code> on a finalized <code>Hmac</code> instance\nwill throw an error in a future version.</p>",
              "displayName": "DEP0206: Calling `digest()` on an already-finalized `Hmac` instance"
            }
          ],
          "displayName": "List of deprecated APIs"
        }
      ],
      "source": "doc/api/deprecations.md"
    },
    {
      "textRaw": "Errors",
      "name": "Errors",
      "introduced_in": "v4.0.0",
      "type": "misc",
      "desc": "<p>Applications running in Node.js will generally experience the following\ncategories of errors:</p>\n<ul>\n<li>Standard JavaScript errors such as <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/EvalError\"><code>&#x3C;EvalError></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError\"><code>&#x3C;SyntaxError></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RangeError\"><code>&#x3C;RangeError></code></a>,\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError\"><code>&#x3C;ReferenceError></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError\"><code>&#x3C;TypeError></code></a>, and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/URIError\"><code>&#x3C;URIError></code></a>.</li>\n<li>Standard <code>DOMException</code>s.</li>\n<li>System errors triggered by underlying operating system constraints such\nas attempting to open a file that does not exist or attempting to send data\nover a closed socket.</li>\n<li><code>AssertionError</code>s are a special class of error that can be triggered when\nNode.js detects an exceptional logic violation that should never occur. These\nare raised typically by the <code>node:assert</code> module.</li>\n<li>User-specified errors triggered by application code.</li>\n</ul>\n<p>All JavaScript and system errors raised by Node.js inherit from, or are\ninstances of, the standard JavaScript <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> class and are guaranteed\nto provide <em>at least</em> the properties available on that class.</p>\n<p>The <a href=\"#errormessage\"><code>error.message</code></a> property of errors raised by Node.js may be changed in\nany versions. Use <a href=\"#errorcode\"><code>error.code</code></a> to identify an error instead. For a\n<code>DOMException</code>, use <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/DOMException/name\"><code>domException.name</code></a> to identify its type.</p>",
      "miscs": [
        {
          "textRaw": "Error propagation and interception",
          "name": "Error propagation and interception",
          "type": "misc",
          "desc": "<p>Node.js supports several mechanisms for propagating and handling errors that\noccur while an application is running. How these errors are reported and\nhandled depends entirely on the type of <code>Error</code> and the style of the API that is\ncalled.</p>\n<p>All JavaScript errors are handled as exceptions that <em>immediately</em> generate\nand throw an error using the standard JavaScript <code>throw</code> mechanism. These\nare handled using the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch\"><code>try…catch</code> construct</a> provided by the\nJavaScript language.</p>\n<pre><code class=\"language-js\">// Throws with a ReferenceError because z is not defined.\ntry {\n  const m = 1;\n  const n = m + z;\n} catch (err) {\n  // Handle the error here.\n}\n</code></pre>\n<p>Any use of the JavaScript <code>throw</code> mechanism will raise an exception that\n<em>must</em> be handled or the Node.js process will exit immediately.</p>\n<p>With few exceptions, <em>Synchronous</em> APIs (any blocking method that does not\nreturn a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> nor accept a <code>callback</code> function, such as\n<a href=\"fs.html#fsreadfilesyncpath-options\"><code>fs.readFileSync</code></a>), will use <code>throw</code> to report errors.</p>\n<p>Errors that occur within <em>Asynchronous APIs</em> may be reported in multiple ways:</p>\n<ul>\n<li>\n<p>Some asynchronous methods returns a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a>, you should always take into\naccount that it might be rejected. See <a href=\"cli.html#--unhandled-rejectionsmode\"><code>--unhandled-rejections</code></a> flag for\nhow the process will react to an unhandled promise rejection.</p>\n<pre><code class=\"language-js\">const fs = require('node:fs/promises');\n\n(async () => {\n  let data;\n  try {\n    data = await fs.readFile('a file that does not exist');\n  } catch (err) {\n    console.error('There was an error reading the file!', err);\n    return;\n  }\n  // Otherwise handle the data\n})();\n</code></pre>\n</li>\n<li>\n<p>Most asynchronous methods that accept a <code>callback</code> function will accept an\n<code>Error</code> object passed as the first argument to that function. If that first\nargument is not <code>null</code> and is an instance of <code>Error</code>, then an error occurred\nthat should be handled.</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nfs.readFile('a file that does not exist', (err, data) => {\n  if (err) {\n    console.error('There was an error reading the file!', err);\n    return;\n  }\n  // Otherwise handle the data\n});\n</code></pre>\n</li>\n<li>\n<p>When an asynchronous method is called on an object that is an\n<a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a>, errors can be routed to that object's <code>'error'</code> event.</p>\n<pre><code class=\"language-js\">const net = require('node:net');\nconst connection = net.connect('localhost');\n\n// Adding an 'error' event handler to a stream:\nconnection.on('error', (err) => {\n  // If the connection is reset by the server, or if it can't\n  // connect at all, or on any sort of error encountered by\n  // the connection, the error will be sent here.\n  console.error(err);\n});\n\nconnection.pipe(process.stdout);\n</code></pre>\n</li>\n<li>\n<p>A handful of typically asynchronous methods in the Node.js API may still\nuse the <code>throw</code> mechanism to raise exceptions that must be handled using\n<code>try…catch</code>. There is no comprehensive list of such methods; please\nrefer to the documentation of each method to determine the appropriate\nerror handling mechanism required.</p>\n</li>\n</ul>\n<p>The use of the <code>'error'</code> event mechanism is most common for <a href=\"stream.html\">stream-based</a>\nand <a href=\"events.html#class-eventemitter\">event emitter-based</a> APIs, which themselves represent a series of\nasynchronous operations over time (as opposed to a single operation that may\npass or fail).</p>\n<p>For <em>all</em> <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a> objects, if an <code>'error'</code> event handler is not\nprovided, the error will be thrown, causing the Node.js process to report an\nuncaught exception and crash unless either: a handler has been registered for\nthe <a href=\"process.html#event-uncaughtexception\"><code>'uncaughtException'</code></a> event, or the deprecated <a href=\"domain.html\"><code>node:domain</code></a>\nmodule is used.</p>\n<pre><code class=\"language-js\">const EventEmitter = require('node:events');\nconst ee = new EventEmitter();\n\nsetImmediate(() => {\n  // This will crash the process because no 'error' event\n  // handler has been added.\n  ee.emit('error', new Error('This will crash'));\n});\n</code></pre>\n<p>Errors generated in this way <em>cannot</em> be intercepted using <code>try…catch</code> as\nthey are thrown <em>after</em> the calling code has already exited.</p>\n<p>Developers must refer to the documentation for each method to determine\nexactly how errors raised by those methods are propagated.</p>"
        },
        {
          "textRaw": "Exceptions vs. errors",
          "name": "Exceptions vs. errors",
          "type": "misc",
          "desc": "<p>A JavaScript exception is a value that is thrown as a result of an invalid\noperation or as the target of a <code>throw</code> statement. While it is not required\nthat these values are instances of <code>Error</code> or classes which inherit from\n<code>Error</code>, all exceptions thrown by Node.js or the JavaScript runtime <em>will</em> be\ninstances of <code>Error</code>.</p>\n<p>Some exceptions are <em>unrecoverable</em> at the JavaScript layer. Such exceptions\nwill <em>always</em> cause the Node.js process to crash. Examples include <code>assert()</code>\nchecks or <code>abort()</code> calls in the C++ layer.</p>"
        },
        {
          "textRaw": "OpenSSL errors",
          "name": "openssl_errors",
          "type": "misc",
          "desc": "<p>Errors originating in <code>crypto</code> or <code>tls</code> are of class <code>Error</code>, and in addition to\nthe standard <code>.code</code> and <code>.message</code> properties, may have some additional\nOpenSSL-specific properties.</p>",
          "properties": [
            {
              "textRaw": "`error.opensslErrorStack`",
              "name": "opensslErrorStack",
              "type": "property",
              "desc": "<p>An array of errors that can give context to where in the OpenSSL library an\nerror originates from.</p>"
            },
            {
              "textRaw": "`error.function`",
              "name": "function",
              "type": "property",
              "desc": "<p>The OpenSSL function the error originates in.</p>"
            },
            {
              "textRaw": "`error.library`",
              "name": "library",
              "type": "property",
              "desc": "<p>The OpenSSL library the error originates in.</p>"
            },
            {
              "textRaw": "`error.reason`",
              "name": "reason",
              "type": "property",
              "desc": "<p>A human-readable string describing the reason for the error.</p>\n<p><a id=\"nodejs-error-codes\"></a></p>"
            }
          ],
          "displayName": "OpenSSL errors"
        },
        {
          "textRaw": "Node.js error codes",
          "name": "node.js_error_codes",
          "type": "misc",
          "desc": "<p><a id=\"ABORT_ERR\"></a></p>",
          "modules": [
            {
              "textRaw": "`ABORT_ERR`",
              "name": "`abort_err`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used when an operation has been aborted (typically using an <code>AbortController</code>).</p>\n<p>APIs <em>not</em> using <code>AbortSignal</code>s typically do not raise an error with this code.</p>\n<p>This code does not use the regular <code>ERR_*</code> convention Node.js errors use in\norder to be compatible with the web platform's <code>AbortError</code>.</p>\n<p><a id=\"ERR_ACCESS_DENIED\"></a></p>",
              "displayName": "`ABORT_ERR`"
            },
            {
              "textRaw": "`ERR_ACCESS_DENIED`",
              "name": "`err_access_denied`",
              "type": "module",
              "desc": "<p>A special type of error that is triggered whenever Node.js tries to get access\nto a resource restricted by the <a href=\"permissions.html#permission-model\">Permission Model</a>.</p>\n<p><a id=\"ERR_AMBIGUOUS_ARGUMENT\"></a></p>",
              "displayName": "`ERR_ACCESS_DENIED`"
            },
            {
              "textRaw": "`ERR_AMBIGUOUS_ARGUMENT`",
              "name": "`err_ambiguous_argument`",
              "type": "module",
              "desc": "<p>A function argument is being used in a way that suggests that the function\nsignature may be misunderstood. This is thrown by the <code>node:assert</code> module when\nthe <code>message</code> parameter in <code>assert.throws(block, message)</code> matches the error\nmessage thrown by <code>block</code> because that usage suggests that the user believes\n<code>message</code> is the expected message rather than the message the <code>AssertionError</code>\nwill display if <code>block</code> does not throw.</p>\n<p><a id=\"ERR_ARG_NOT_ITERABLE\"></a></p>",
              "displayName": "`ERR_AMBIGUOUS_ARGUMENT`"
            },
            {
              "textRaw": "`ERR_ARG_NOT_ITERABLE`",
              "name": "`err_arg_not_iterable`",
              "type": "module",
              "desc": "<p>An iterable argument (i.e. a value that works with <code>for...of</code> loops) was\nrequired, but not provided to a Node.js API.</p>\n<p><a id=\"ERR_ASSERTION\"></a></p>",
              "displayName": "`ERR_ARG_NOT_ITERABLE`"
            },
            {
              "textRaw": "`ERR_ASSERTION`",
              "name": "`err_assertion`",
              "type": "module",
              "desc": "<p>A special type of error that can be triggered whenever Node.js detects an\nexceptional logic violation that should never occur. These are raised typically\nby the <code>node:assert</code> module.</p>\n<p><a id=\"ERR_ASYNC_CALLBACK\"></a></p>",
              "displayName": "`ERR_ASSERTION`"
            },
            {
              "textRaw": "`ERR_ASYNC_CALLBACK`",
              "name": "`err_async_callback`",
              "type": "module",
              "desc": "<p>An attempt was made to register something that is not a function as an\n<code>AsyncHooks</code> callback.</p>\n<p><a id=\"ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLED\"></a></p>",
              "displayName": "`ERR_ASYNC_CALLBACK`"
            },
            {
              "textRaw": "`ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLED`",
              "name": "`err_async_loader_request_never_settled`",
              "type": "module",
              "desc": "<p>An operation related to module loading is customized by an asynchronous loader\nhook that never settled the promise before the loader thread exits.</p>\n<p><a id=\"ERR_ASYNC_TYPE\"></a></p>",
              "displayName": "`ERR_ASYNC_LOADER_REQUEST_NEVER_SETTLED`"
            },
            {
              "textRaw": "`ERR_ASYNC_TYPE`",
              "name": "`err_async_type`",
              "type": "module",
              "desc": "<p>The type of an asynchronous resource was invalid. Users are also able\nto define their own types if using the public embedder API.</p>\n<p><a id=\"ERR_BROTLI_COMPRESSION_FAILED\"></a></p>",
              "displayName": "`ERR_ASYNC_TYPE`"
            },
            {
              "textRaw": "`ERR_BROTLI_COMPRESSION_FAILED`",
              "name": "`err_brotli_compression_failed`",
              "type": "module",
              "desc": "<p>Data passed to a Brotli stream was not successfully compressed.</p>\n<p><a id=\"ERR_BROTLI_INVALID_PARAM\"></a></p>",
              "displayName": "`ERR_BROTLI_COMPRESSION_FAILED`"
            },
            {
              "textRaw": "`ERR_BROTLI_INVALID_PARAM`",
              "name": "`err_brotli_invalid_param`",
              "type": "module",
              "desc": "<p>An invalid parameter key was passed during construction of a Brotli stream.</p>\n<p><a id=\"ERR_BUFFER_CONTEXT_NOT_AVAILABLE\"></a></p>",
              "displayName": "`ERR_BROTLI_INVALID_PARAM`"
            },
            {
              "textRaw": "`ERR_BUFFER_CONTEXT_NOT_AVAILABLE`",
              "name": "`err_buffer_context_not_available`",
              "type": "module",
              "desc": "<p>An attempt was made to create a Node.js <code>Buffer</code> instance from addon or embedder\ncode, while in a JS engine Context that is not associated with a Node.js\ninstance. The data passed to the <code>Buffer</code> method will have been released\nby the time the method returns.</p>\n<p>When encountering this error, a possible alternative to creating a <code>Buffer</code>\ninstance is to create a normal <code>Uint8Array</code>, which only differs in the\nprototype of the resulting object. <code>Uint8Array</code>s are generally accepted in all\nNode.js core APIs where <code>Buffer</code>s are; they are available in all Contexts.</p>\n<p><a id=\"ERR_BUFFER_OUT_OF_BOUNDS\"></a></p>",
              "displayName": "`ERR_BUFFER_CONTEXT_NOT_AVAILABLE`"
            },
            {
              "textRaw": "`ERR_BUFFER_OUT_OF_BOUNDS`",
              "name": "`err_buffer_out_of_bounds`",
              "type": "module",
              "desc": "<p>An operation outside the bounds of a <code>Buffer</code> was attempted.</p>\n<p><a id=\"ERR_BUFFER_TOO_LARGE\"></a></p>",
              "displayName": "`ERR_BUFFER_OUT_OF_BOUNDS`"
            },
            {
              "textRaw": "`ERR_BUFFER_TOO_LARGE`",
              "name": "`err_buffer_too_large`",
              "type": "module",
              "desc": "<p>An attempt has been made to create a <code>Buffer</code> larger than the maximum allowed\nsize.</p>\n<p><a id=\"ERR_CANNOT_WATCH_SIGINT\"></a></p>",
              "displayName": "`ERR_BUFFER_TOO_LARGE`"
            },
            {
              "textRaw": "`ERR_CANNOT_WATCH_SIGINT`",
              "name": "`err_cannot_watch_sigint`",
              "type": "module",
              "desc": "<p>Node.js was unable to watch for the <code>SIGINT</code> signal.</p>\n<p><a id=\"ERR_CHILD_CLOSED_BEFORE_REPLY\"></a></p>",
              "displayName": "`ERR_CANNOT_WATCH_SIGINT`"
            },
            {
              "textRaw": "`ERR_CHILD_CLOSED_BEFORE_REPLY`",
              "name": "`err_child_closed_before_reply`",
              "type": "module",
              "desc": "<p>A child process was closed before the parent received a reply.</p>\n<p><a id=\"ERR_CHILD_PROCESS_IPC_REQUIRED\"></a></p>",
              "displayName": "`ERR_CHILD_CLOSED_BEFORE_REPLY`"
            },
            {
              "textRaw": "`ERR_CHILD_PROCESS_IPC_REQUIRED`",
              "name": "`err_child_process_ipc_required`",
              "type": "module",
              "desc": "<p>Used when a child process is being forked without specifying an IPC channel.</p>\n<p><a id=\"ERR_CHILD_PROCESS_STDIO_MAXBUFFER\"></a></p>",
              "displayName": "`ERR_CHILD_PROCESS_IPC_REQUIRED`"
            },
            {
              "textRaw": "`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`",
              "name": "`err_child_process_stdio_maxbuffer`",
              "type": "module",
              "desc": "<p>Used when the main process is trying to read data from the child process's\nSTDERR/STDOUT, and the data's length is longer than the <code>maxBuffer</code> option.</p>\n<p><a id=\"ERR_CLOSED_MESSAGE_PORT\"></a></p>",
              "displayName": "`ERR_CHILD_PROCESS_STDIO_MAXBUFFER`"
            },
            {
              "textRaw": "`ERR_CLOSED_MESSAGE_PORT`",
              "name": "`err_closed_message_port`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.2.0",
                      "v14.17.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38510",
                    "description": "The error message was reintroduced."
                  },
                  {
                    "version": "v11.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26487",
                    "description": "The error message was removed."
                  }
                ]
              },
              "desc": "<p>There was an attempt to use a <code>MessagePort</code> instance in a closed\nstate, usually after <code>.close()</code> has been called.</p>\n<p><a id=\"ERR_CONSOLE_WRITABLE_STREAM\"></a></p>",
              "displayName": "`ERR_CLOSED_MESSAGE_PORT`"
            },
            {
              "textRaw": "`ERR_CONSOLE_WRITABLE_STREAM`",
              "name": "`err_console_writable_stream`",
              "type": "module",
              "desc": "<p><code>Console</code> was instantiated without <code>stdout</code> stream, or <code>Console</code> has a\nnon-writable <code>stdout</code> or <code>stderr</code> stream.</p>\n<p><a id=\"ERR_CONSTRUCT_CALL_INVALID\"></a></p>",
              "displayName": "`ERR_CONSOLE_WRITABLE_STREAM`"
            },
            {
              "textRaw": "`ERR_CONSTRUCT_CALL_INVALID`",
              "name": "`err_construct_call_invalid`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.5.0"
                ],
                "changes": []
              },
              "desc": "<p>A class constructor was called that is not callable.</p>\n<p><a id=\"ERR_CONSTRUCT_CALL_REQUIRED\"></a></p>",
              "displayName": "`ERR_CONSTRUCT_CALL_INVALID`"
            },
            {
              "textRaw": "`ERR_CONSTRUCT_CALL_REQUIRED`",
              "name": "`err_construct_call_required`",
              "type": "module",
              "desc": "<p>A constructor for a class was called without <code>new</code>.</p>\n<p><a id=\"ERR_CONTEXT_NOT_INITIALIZED\"></a></p>",
              "displayName": "`ERR_CONSTRUCT_CALL_REQUIRED`"
            },
            {
              "textRaw": "`ERR_CONTEXT_NOT_INITIALIZED`",
              "name": "`err_context_not_initialized`",
              "type": "module",
              "desc": "<p>The vm context passed into the API is not yet initialized. This could happen\nwhen an error occurs (and is caught) during the creation of the\ncontext, for example, when the allocation fails or the maximum call stack\nsize is reached when the context is created.</p>\n<p><a id=\"ERR_CPU_PROFILE_ALREADY_STARTED\"></a></p>",
              "displayName": "`ERR_CONTEXT_NOT_INITIALIZED`"
            },
            {
              "textRaw": "`ERR_CPU_PROFILE_ALREADY_STARTED`",
              "name": "`err_cpu_profile_already_started`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.8.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "desc": "<p>The CPU profile with the given name is already started.</p>\n<p><a id=\"ERR_CPU_PROFILE_NOT_STARTED\"></a></p>",
              "displayName": "`ERR_CPU_PROFILE_ALREADY_STARTED`"
            },
            {
              "textRaw": "`ERR_CPU_PROFILE_NOT_STARTED`",
              "name": "`err_cpu_profile_not_started`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.8.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "desc": "<p>The CPU profile with the given name is not started.</p>\n<p><a id=\"ERR_CPU_PROFILE_TOO_MANY\"></a></p>",
              "displayName": "`ERR_CPU_PROFILE_NOT_STARTED`"
            },
            {
              "textRaw": "`ERR_CPU_PROFILE_TOO_MANY`",
              "name": "`err_cpu_profile_too_many`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.8.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "desc": "<p>There are too many CPU profiles being collected.</p>\n<p><a id=\"ERR_CRYPTO_ARGON2_NOT_SUPPORTED\"></a></p>",
              "displayName": "`ERR_CPU_PROFILE_TOO_MANY`"
            },
            {
              "textRaw": "`ERR_CRYPTO_ARGON2_NOT_SUPPORTED`",
              "name": "`err_crypto_argon2_not_supported`",
              "type": "module",
              "desc": "<p>Argon2 is not supported by the current version of OpenSSL being used.</p>\n<p><a id=\"ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED\"></a></p>",
              "displayName": "`ERR_CRYPTO_ARGON2_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED`",
              "name": "`err_crypto_custom_engine_not_supported`",
              "type": "module",
              "desc": "<p>An OpenSSL engine was requested (for example, through the <code>clientCertEngine</code> or\n<code>privateKeyEngine</code> TLS options) that is not supported by the version of OpenSSL\nbeing used, likely due to the compile-time flag <code>OPENSSL_NO_ENGINE</code>.</p>\n<p><a id=\"ERR_CRYPTO_ECDH_INVALID_FORMAT\"></a></p>",
              "displayName": "`ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_ECDH_INVALID_FORMAT`",
              "name": "`err_crypto_ecdh_invalid_format`",
              "type": "module",
              "desc": "<p>An invalid value for the <code>format</code> argument was passed to the <code>crypto.ECDH()</code>\nclass <code>getPublicKey()</code> method.</p>\n<p><a id=\"ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY\"></a></p>",
              "displayName": "`ERR_CRYPTO_ECDH_INVALID_FORMAT`"
            },
            {
              "textRaw": "`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY`",
              "name": "`err_crypto_ecdh_invalid_public_key`",
              "type": "module",
              "desc": "<p>An invalid value for the <code>key</code> argument has been passed to the\n<code>crypto.ECDH()</code> class <code>computeSecret()</code> method. It means that the public\nkey lies outside of the elliptic curve.</p>\n<p><a id=\"ERR_CRYPTO_ENGINE_UNKNOWN\"></a></p>",
              "displayName": "`ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY`"
            },
            {
              "textRaw": "`ERR_CRYPTO_ENGINE_UNKNOWN`",
              "name": "`err_crypto_engine_unknown`",
              "type": "module",
              "desc": "<p>An invalid crypto engine identifier was passed to\n<a href=\"crypto.html#cryptosetengineengine-flags\"><code>require('node:crypto').setEngine()</code></a>.</p>\n<p><a id=\"ERR_CRYPTO_FIPS_FORCED\"></a></p>",
              "displayName": "`ERR_CRYPTO_ENGINE_UNKNOWN`"
            },
            {
              "textRaw": "`ERR_CRYPTO_FIPS_FORCED`",
              "name": "`err_crypto_fips_forced`",
              "type": "module",
              "desc": "<p>The <a href=\"cli.html#--force-fips\"><code>--force-fips</code></a> command-line argument was used but there was an attempt\nto enable or disable FIPS mode in the <code>node:crypto</code> module.</p>\n<p><a id=\"ERR_CRYPTO_FIPS_UNAVAILABLE\"></a></p>",
              "displayName": "`ERR_CRYPTO_FIPS_FORCED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_FIPS_UNAVAILABLE`",
              "name": "`err_crypto_fips_unavailable`",
              "type": "module",
              "desc": "<p>An attempt was made to enable or disable FIPS mode, but FIPS mode was not\navailable.</p>\n<p><a id=\"ERR_CRYPTO_HASH_FINALIZED\"></a></p>",
              "displayName": "`ERR_CRYPTO_FIPS_UNAVAILABLE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_HASH_FINALIZED`",
              "name": "`err_crypto_hash_finalized`",
              "type": "module",
              "desc": "<p><a href=\"crypto.html#hashdigestencoding\"><code>hash.digest()</code></a> was called multiple times. The <code>hash.digest()</code> method must\nbe called no more than one time per instance of a <code>Hash</code> object.</p>\n<p><a id=\"ERR_CRYPTO_HASH_UPDATE_FAILED\"></a></p>",
              "displayName": "`ERR_CRYPTO_HASH_FINALIZED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_HASH_UPDATE_FAILED`",
              "name": "`err_crypto_hash_update_failed`",
              "type": "module",
              "desc": "<p><a href=\"crypto.html#hashupdatedata-inputencoding\"><code>hash.update()</code></a> failed for any reason. This should rarely, if ever, happen.</p>\n<p><a id=\"ERR_CRYPTO_INCOMPATIBLE_KEY\"></a></p>",
              "displayName": "`ERR_CRYPTO_HASH_UPDATE_FAILED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INCOMPATIBLE_KEY`",
              "name": "`err_crypto_incompatible_key`",
              "type": "module",
              "desc": "<p>The given crypto keys are incompatible with the attempted operation.</p>\n<p><a id=\"ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS\"></a></p>",
              "displayName": "`ERR_CRYPTO_INCOMPATIBLE_KEY`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS`",
              "name": "`err_crypto_incompatible_key_options`",
              "type": "module",
              "desc": "<p>The selected public or private key encoding is incompatible with other options.</p>\n<p><a id=\"ERR_CRYPTO_INITIALIZATION_FAILED\"></a></p>",
              "displayName": "`ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INITIALIZATION_FAILED`",
              "name": "`err_crypto_initialization_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Initialization of the crypto subsystem failed.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_AUTH_TAG\"></a></p>",
              "displayName": "`ERR_CRYPTO_INITIALIZATION_FAILED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_AUTH_TAG`",
              "name": "`err_crypto_invalid_auth_tag`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid authentication tag was provided.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_COUNTER\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_AUTH_TAG`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_COUNTER`",
              "name": "`err_crypto_invalid_counter`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid counter was provided for a counter-mode cipher.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_CURVE\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_COUNTER`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_CURVE`",
              "name": "`err_crypto_invalid_curve`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid elliptic-curve was provided.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_DIGEST\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_CURVE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_DIGEST`",
              "name": "`err_crypto_invalid_digest`",
              "type": "module",
              "desc": "<p>An invalid <a href=\"crypto.html#cryptogethashes\">crypto digest algorithm</a> was specified.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_IV\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_DIGEST`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_IV`",
              "name": "`err_crypto_invalid_iv`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid initialization vector was provided.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_JWK\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_IV`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_JWK`",
              "name": "`err_crypto_invalid_jwk`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid JSON Web Key was provided.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_KEYLEN\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_JWK`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_KEYLEN`",
              "name": "`err_crypto_invalid_keylen`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid key length was provided.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_KEYPAIR\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_KEYLEN`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_KEYPAIR`",
              "name": "`err_crypto_invalid_keypair`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid key pair was provided.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_KEYTYPE\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_KEYPAIR`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_KEYTYPE`",
              "name": "`err_crypto_invalid_keytype`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid key type was provided.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_KEYTYPE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE`",
              "name": "`err_crypto_invalid_key_object_type`",
              "type": "module",
              "desc": "<p>The given crypto key object's type is invalid for the attempted operation.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_MESSAGELEN\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_MESSAGELEN`",
              "name": "`err_crypto_invalid_messagelen`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid message length was provided.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_SCRYPT_PARAMS\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_MESSAGELEN`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_SCRYPT_PARAMS`",
              "name": "`err_crypto_invalid_scrypt_params`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>One or more <a href=\"crypto.html#cryptoscryptpassword-salt-keylen-options-callback\"><code>crypto.scrypt()</code></a> or <a href=\"crypto.html#cryptoscryptsyncpassword-salt-keylen-options\"><code>crypto.scryptSync()</code></a> parameters are\noutside their legal range.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_STATE\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_SCRYPT_PARAMS`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_STATE`",
              "name": "`err_crypto_invalid_state`",
              "type": "module",
              "desc": "<p>A crypto method was used on an object that was in an invalid state. For\ninstance, calling <a href=\"crypto.html#ciphergetauthtag\"><code>cipher.getAuthTag()</code></a> before calling <code>cipher.final()</code>.</p>\n<p><a id=\"ERR_CRYPTO_INVALID_TAG_LENGTH\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_STATE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_INVALID_TAG_LENGTH`",
              "name": "`err_crypto_invalid_tag_length`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An invalid authentication tag length was provided.</p>\n<p><a id=\"ERR_CRYPTO_JOB_INIT_FAILED\"></a></p>",
              "displayName": "`ERR_CRYPTO_INVALID_TAG_LENGTH`"
            },
            {
              "textRaw": "`ERR_CRYPTO_JOB_INIT_FAILED`",
              "name": "`err_crypto_job_init_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Initialization of an asynchronous crypto operation failed.</p>\n<p><a id=\"ERR_CRYPTO_JWK_UNSUPPORTED_CURVE\"></a></p>",
              "displayName": "`ERR_CRYPTO_JOB_INIT_FAILED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_JWK_UNSUPPORTED_CURVE`",
              "name": "`err_crypto_jwk_unsupported_curve`",
              "type": "module",
              "desc": "<p>Key's Elliptic Curve is not registered for use in the\n<a href=\"https://www.iana.org/assignments/jose/jose.xhtml#web-key-elliptic-curve\">JSON Web Key Elliptic Curve Registry</a>.</p>\n<p><a id=\"ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE\"></a></p>",
              "displayName": "`ERR_CRYPTO_JWK_UNSUPPORTED_CURVE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE`",
              "name": "`err_crypto_jwk_unsupported_key_type`",
              "type": "module",
              "desc": "<p>Key's Asymmetric Key Type is not registered for use in the\n<a href=\"https://www.iana.org/assignments/jose/jose.xhtml#web-key-types\">JSON Web Key Types Registry</a>.</p>\n<p><a id=\"ERR_CRYPTO_KEM_NOT_SUPPORTED\"></a></p>",
              "displayName": "`ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_KEM_NOT_SUPPORTED`",
              "name": "`err_crypto_kem_not_supported`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "desc": "<p>Attempted to use KEM operations while Node.js was not compiled with\nOpenSSL with KEM support.</p>\n<p><a id=\"ERR_CRYPTO_OPERATION_FAILED\"></a></p>",
              "displayName": "`ERR_CRYPTO_KEM_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_OPERATION_FAILED`",
              "name": "`err_crypto_operation_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A crypto operation failed for an otherwise unspecified reason.</p>\n<p><a id=\"ERR_CRYPTO_PBKDF2_ERROR\"></a></p>",
              "displayName": "`ERR_CRYPTO_OPERATION_FAILED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_PBKDF2_ERROR`",
              "name": "`err_crypto_pbkdf2_error`",
              "type": "module",
              "desc": "<p>The PBKDF2 algorithm failed for unspecified reasons. OpenSSL does not provide\nmore details and therefore neither does Node.js.</p>\n<p><a id=\"ERR_CRYPTO_SCRYPT_NOT_SUPPORTED\"></a></p>",
              "displayName": "`ERR_CRYPTO_PBKDF2_ERROR`"
            },
            {
              "textRaw": "`ERR_CRYPTO_SCRYPT_NOT_SUPPORTED`",
              "name": "`err_crypto_scrypt_not_supported`",
              "type": "module",
              "desc": "<p>Node.js was compiled without <code>scrypt</code> support. Not possible with the official\nrelease binaries but can happen with custom builds, including distro builds.</p>\n<p><a id=\"ERR_CRYPTO_SIGN_KEY_REQUIRED\"></a></p>",
              "displayName": "`ERR_CRYPTO_SCRYPT_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_SIGN_KEY_REQUIRED`",
              "name": "`err_crypto_sign_key_required`",
              "type": "module",
              "desc": "<p>A signing <code>key</code> was not provided to the <a href=\"crypto.html#signsignprivatekey-outputencoding\"><code>sign.sign()</code></a> method.</p>\n<p><a id=\"ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH\"></a></p>",
              "displayName": "`ERR_CRYPTO_SIGN_KEY_REQUIRED`"
            },
            {
              "textRaw": "`ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH`",
              "name": "`err_crypto_timing_safe_equal_length`",
              "type": "module",
              "desc": "<p><a href=\"crypto.html#cryptotimingsafeequala-b\"><code>crypto.timingSafeEqual()</code></a> was called with <code>Buffer</code>, <code>TypedArray</code>, or\n<code>DataView</code> arguments of different lengths.</p>\n<p><a id=\"ERR_CRYPTO_UNKNOWN_CIPHER\"></a></p>",
              "displayName": "`ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH`"
            },
            {
              "textRaw": "`ERR_CRYPTO_UNKNOWN_CIPHER`",
              "name": "`err_crypto_unknown_cipher`",
              "type": "module",
              "desc": "<p>An unknown cipher was specified.</p>\n<p><a id=\"ERR_CRYPTO_UNKNOWN_DH_GROUP\"></a></p>",
              "displayName": "`ERR_CRYPTO_UNKNOWN_CIPHER`"
            },
            {
              "textRaw": "`ERR_CRYPTO_UNKNOWN_DH_GROUP`",
              "name": "`err_crypto_unknown_dh_group`",
              "type": "module",
              "desc": "<p>An unknown Diffie-Hellman group name was given. See\n<a href=\"crypto.html#cryptogetdiffiehellmangroupname\"><code>crypto.getDiffieHellman()</code></a> for a list of valid group names.</p>\n<p><a id=\"ERR_CRYPTO_UNSUPPORTED_OPERATION\"></a></p>",
              "displayName": "`ERR_CRYPTO_UNKNOWN_DH_GROUP`"
            },
            {
              "textRaw": "`ERR_CRYPTO_UNSUPPORTED_OPERATION`",
              "name": "`err_crypto_unsupported_operation`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt to invoke an unsupported crypto operation was made.</p>\n<p><a id=\"ERR_DEBUGGER_ERROR\"></a></p>",
              "displayName": "`ERR_CRYPTO_UNSUPPORTED_OPERATION`"
            },
            {
              "textRaw": "`ERR_DEBUGGER_ERROR`",
              "name": "`err_debugger_error`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.4.0",
                  "v14.17.4"
                ],
                "changes": []
              },
              "desc": "<p>An error occurred with the <a href=\"debugger.html\">debugger</a>.</p>\n<p><a id=\"ERR_DEBUGGER_STARTUP_ERROR\"></a></p>",
              "displayName": "`ERR_DEBUGGER_ERROR`"
            },
            {
              "textRaw": "`ERR_DEBUGGER_STARTUP_ERROR`",
              "name": "`err_debugger_startup_error`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.4.0",
                  "v14.17.4"
                ],
                "changes": []
              },
              "desc": "<p>The <a href=\"debugger.html\">debugger</a> timed out waiting for the required host/port to be free.</p>\n<p><a id=\"ERR_DIR_CLOSED\"></a></p>",
              "displayName": "`ERR_DEBUGGER_STARTUP_ERROR`"
            },
            {
              "textRaw": "`ERR_DIR_CLOSED`",
              "name": "`err_dir_closed`",
              "type": "module",
              "desc": "<p>The <a href=\"fs.html#class-fsdir\"><code>fs.Dir</code></a> was previously closed.</p>\n<p><a id=\"ERR_DIR_CONCURRENT_OPERATION\"></a></p>",
              "displayName": "`ERR_DIR_CLOSED`"
            },
            {
              "textRaw": "`ERR_DIR_CONCURRENT_OPERATION`",
              "name": "`err_dir_concurrent_operation`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.3.0"
                ],
                "changes": []
              },
              "desc": "<p>A synchronous read or close call was attempted on an <a href=\"fs.html#class-fsdir\"><code>fs.Dir</code></a> which has\nongoing asynchronous operations.</p>\n<p><a id=\"ERR_DLOPEN_DISABLED\"></a></p>",
              "displayName": "`ERR_DIR_CONCURRENT_OPERATION`"
            },
            {
              "textRaw": "`ERR_DLOPEN_DISABLED`",
              "name": "`err_dlopen_disabled`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.10.0",
                  "v14.19.0"
                ],
                "changes": []
              },
              "desc": "<p>Loading native addons has been disabled using <a href=\"cli.html#--no-addons\"><code>--no-addons</code></a>.</p>\n<p><a id=\"ERR_DLOPEN_FAILED\"></a></p>",
              "displayName": "`ERR_DLOPEN_DISABLED`"
            },
            {
              "textRaw": "`ERR_DLOPEN_FAILED`",
              "name": "`err_dlopen_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A call to <code>process.dlopen()</code> failed.</p>\n<p><a id=\"ERR_DNS_SET_SERVERS_FAILED\"></a></p>",
              "displayName": "`ERR_DLOPEN_FAILED`"
            },
            {
              "textRaw": "`ERR_DNS_SET_SERVERS_FAILED`",
              "name": "`err_dns_set_servers_failed`",
              "type": "module",
              "desc": "<p><code>c-ares</code> failed to set the DNS server.</p>\n<p><a id=\"ERR_DOMAIN_CALLBACK_NOT_AVAILABLE\"></a></p>",
              "displayName": "`ERR_DNS_SET_SERVERS_FAILED`"
            },
            {
              "textRaw": "`ERR_DOMAIN_CALLBACK_NOT_AVAILABLE`",
              "name": "`err_domain_callback_not_available`",
              "type": "module",
              "desc": "<p>The <code>node:domain</code> module was not usable since it could not establish the\nrequired error handling hooks, because\n<a href=\"process.html#processsetuncaughtexceptioncapturecallbackfn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> had been called at an\nearlier point in time.</p>\n<p><a id=\"ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE\"></a></p>",
              "displayName": "`ERR_DOMAIN_CALLBACK_NOT_AVAILABLE`"
            },
            {
              "textRaw": "`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`",
              "name": "`err_domain_cannot_set_uncaught_exception_capture`",
              "type": "module",
              "desc": "<p><a href=\"process.html#processsetuncaughtexceptioncapturecallbackfn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> could not be called\nbecause the <code>node:domain</code> module has been loaded at an earlier point in time.</p>\n<p>The stack trace is extended to include the point in time at which the\n<code>node:domain</code> module had been loaded.</p>\n<p><a id=\"ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION\"></a></p>",
              "displayName": "`ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE`"
            },
            {
              "textRaw": "`ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION`",
              "name": "`err_duplicate_startup_snapshot_main_function`",
              "type": "module",
              "desc": "<p><a href=\"v8.html#v8startupsnapshotsetdeserializemainfunctioncallback-data\"><code>v8.startupSnapshot.setDeserializeMainFunction()</code></a> could not be called\nbecause it had already been called before.</p>\n<p><a id=\"ERR_ENCODING_INVALID_ENCODED_DATA\"></a></p>",
              "displayName": "`ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION`"
            },
            {
              "textRaw": "`ERR_ENCODING_INVALID_ENCODED_DATA`",
              "name": "`err_encoding_invalid_encoded_data`",
              "type": "module",
              "desc": "<p>Data provided to <code>TextDecoder()</code> API was invalid according to the encoding\nprovided.</p>\n<p><a id=\"ERR_ENCODING_NOT_SUPPORTED\"></a></p>",
              "displayName": "`ERR_ENCODING_INVALID_ENCODED_DATA`"
            },
            {
              "textRaw": "`ERR_ENCODING_NOT_SUPPORTED`",
              "name": "`err_encoding_not_supported`",
              "type": "module",
              "desc": "<p>Encoding provided to <code>TextDecoder()</code> API was not one of the\n<a href=\"util.html#whatwg-supported-encodings\">WHATWG Supported Encodings</a>.</p>\n<p><a id=\"ERR_EVAL_ESM_CANNOT_PRINT\"></a></p>",
              "displayName": "`ERR_ENCODING_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_EVAL_ESM_CANNOT_PRINT`",
              "name": "`err_eval_esm_cannot_print`",
              "type": "module",
              "desc": "<p><code>--print</code> cannot be used with ESM input.</p>\n<p><a id=\"ERR_EVENT_RECURSION\"></a></p>",
              "displayName": "`ERR_EVAL_ESM_CANNOT_PRINT`"
            },
            {
              "textRaw": "`ERR_EVENT_RECURSION`",
              "name": "`err_event_recursion`",
              "type": "module",
              "desc": "<p>Thrown when an attempt is made to recursively dispatch an event on <code>EventTarget</code>.</p>\n<p><a id=\"ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE\"></a></p>",
              "displayName": "`ERR_EVENT_RECURSION`"
            },
            {
              "textRaw": "`ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE`",
              "name": "`err_execution_environment_not_available`",
              "type": "module",
              "desc": "<p>The JS execution context is not associated with a Node.js environment.\nThis may occur when Node.js is used as an embedded library and some hooks\nfor the JS engine are not set up properly.</p>\n<p><a id=\"ERR_FALSY_VALUE_REJECTION\"></a></p>",
              "displayName": "`ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE`"
            },
            {
              "textRaw": "`ERR_FALSY_VALUE_REJECTION`",
              "name": "`err_falsy_value_rejection`",
              "type": "module",
              "desc": "<p>A <code>Promise</code> that was callbackified via <code>util.callbackify()</code> was rejected with a\nfalsy value.</p>\n<p><a id=\"ERR_FEATURE_UNAVAILABLE_ON_PLATFORM\"></a></p>",
              "displayName": "`ERR_FALSY_VALUE_REJECTION`"
            },
            {
              "textRaw": "`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`",
              "name": "`err_feature_unavailable_on_platform`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Used when a feature that is not available\nto the current platform which is running Node.js is used.</p>\n<p><a id=\"ERR_FFI_CALL_FAILED\"></a></p>",
              "displayName": "`ERR_FEATURE_UNAVAILABLE_ON_PLATFORM`"
            },
            {
              "textRaw": "`ERR_FFI_CALL_FAILED`",
              "name": "`err_ffi_call_failed`",
              "type": "module",
              "desc": "<p>A low-level FFI call failed.</p>\n<p><a id=\"ERR_FFI_INVALID_POINTER\"></a></p>",
              "displayName": "`ERR_FFI_CALL_FAILED`"
            },
            {
              "textRaw": "`ERR_FFI_INVALID_POINTER`",
              "name": "`err_ffi_invalid_pointer`",
              "type": "module",
              "desc": "<p>An invalid pointer was passed to an FFI operation.</p>\n<p><a id=\"ERR_FFI_LIBRARY_CLOSED\"></a></p>",
              "displayName": "`ERR_FFI_INVALID_POINTER`"
            },
            {
              "textRaw": "`ERR_FFI_LIBRARY_CLOSED`",
              "name": "`err_ffi_library_closed`",
              "type": "module",
              "desc": "<p>An operation was attempted on an FFI dynamic library after it was closed.</p>\n<p><a id=\"ERR_FS_CP_DIR_TO_NON_DIR\"></a></p>",
              "displayName": "`ERR_FFI_LIBRARY_CLOSED`"
            },
            {
              "textRaw": "`ERR_FS_CP_DIR_TO_NON_DIR`",
              "name": "`err_fs_cp_dir_to_non_dir`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to copy a directory to a non-directory (file, symlink,\netc.) using <a href=\"fs.html#fscpsrc-dest-options-callback\"><code>fs.cp()</code></a>.</p>\n<p><a id=\"ERR_FS_CP_EEXIST\"></a></p>",
              "displayName": "`ERR_FS_CP_DIR_TO_NON_DIR`"
            },
            {
              "textRaw": "`ERR_FS_CP_EEXIST`",
              "name": "`err_fs_cp_eexist`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to copy over a file that already existed with\n<a href=\"fs.html#fscpsrc-dest-options-callback\"><code>fs.cp()</code></a>, with the <code>force</code> and <code>errorOnExist</code> set to <code>true</code>.</p>\n<p><a id=\"ERR_FS_CP_EINVAL\"></a></p>",
              "displayName": "`ERR_FS_CP_EEXIST`"
            },
            {
              "textRaw": "`ERR_FS_CP_EINVAL`",
              "name": "`err_fs_cp_einval`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>When using <a href=\"fs.html#fscpsrc-dest-options-callback\"><code>fs.cp()</code></a>, <code>src</code> or <code>dest</code> pointed to an invalid path.</p>\n<p><a id=\"ERR_FS_CP_FIFO_PIPE\"></a></p>",
              "displayName": "`ERR_FS_CP_EINVAL`"
            },
            {
              "textRaw": "`ERR_FS_CP_FIFO_PIPE`",
              "name": "`err_fs_cp_fifo_pipe`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to copy a named pipe with <a href=\"fs.html#fscpsrc-dest-options-callback\"><code>fs.cp()</code></a>.</p>\n<p><a id=\"ERR_FS_CP_NON_DIR_TO_DIR\"></a></p>",
              "displayName": "`ERR_FS_CP_FIFO_PIPE`"
            },
            {
              "textRaw": "`ERR_FS_CP_NON_DIR_TO_DIR`",
              "name": "`err_fs_cp_non_dir_to_dir`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to copy a non-directory (file, symlink, etc.) to a directory\nusing <a href=\"fs.html#fscpsrc-dest-options-callback\"><code>fs.cp()</code></a>.</p>\n<p><a id=\"ERR_FS_CP_SOCKET\"></a></p>",
              "displayName": "`ERR_FS_CP_NON_DIR_TO_DIR`"
            },
            {
              "textRaw": "`ERR_FS_CP_SOCKET`",
              "name": "`err_fs_cp_socket`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to copy to a socket with <a href=\"fs.html#fscpsrc-dest-options-callback\"><code>fs.cp()</code></a>.</p>\n<p><a id=\"ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY\"></a></p>",
              "displayName": "`ERR_FS_CP_SOCKET`"
            },
            {
              "textRaw": "`ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY`",
              "name": "`err_fs_cp_symlink_to_subdirectory`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>When using <a href=\"fs.html#fscpsrc-dest-options-callback\"><code>fs.cp()</code></a>, a symlink in <code>dest</code> pointed to a subdirectory\nof <code>src</code>.</p>\n<p><a id=\"ERR_FS_CP_UNKNOWN\"></a></p>",
              "displayName": "`ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY`"
            },
            {
              "textRaw": "`ERR_FS_CP_UNKNOWN`",
              "name": "`err_fs_cp_unknown`",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to copy to an unknown file type with <a href=\"fs.html#fscpsrc-dest-options-callback\"><code>fs.cp()</code></a>.</p>\n<p><a id=\"ERR_FS_EISDIR\"></a></p>",
              "displayName": "`ERR_FS_CP_UNKNOWN`"
            },
            {
              "textRaw": "`ERR_FS_EISDIR`",
              "name": "`err_fs_eisdir`",
              "type": "module",
              "desc": "<p>Path is a directory.</p>\n<p><a id=\"ERR_FS_FILE_TOO_LARGE\"></a></p>",
              "displayName": "`ERR_FS_EISDIR`"
            },
            {
              "textRaw": "`ERR_FS_FILE_TOO_LARGE`",
              "name": "`err_fs_file_too_large`",
              "type": "module",
              "desc": "<p>An attempt was made to read a file larger than the supported 2 GiB limit for\n<code>fs.readFile()</code>. This is not a limitation of <code>Buffer</code>, but an internal I/O constraint.\nFor handling larger files, consider using <code>fs.createReadStream()</code> to read the\nfile in chunks.</p>\n<p><a id=\"ERR_FS_WATCH_QUEUE_OVERFLOW\"></a></p>",
              "displayName": "`ERR_FS_FILE_TOO_LARGE`"
            },
            {
              "textRaw": "`ERR_FS_WATCH_QUEUE_OVERFLOW`",
              "name": "`err_fs_watch_queue_overflow`",
              "type": "module",
              "desc": "<p>The number of file system events queued without being handled exceeded the size specified in\n<code>maxQueue</code> in <code>fs.watch()</code>.</p>\n<p><a id=\"ERR_HTTP2_ALTSVC_INVALID_ORIGIN\"></a></p>",
              "displayName": "`ERR_FS_WATCH_QUEUE_OVERFLOW`"
            },
            {
              "textRaw": "`ERR_HTTP2_ALTSVC_INVALID_ORIGIN`",
              "name": "`err_http2_altsvc_invalid_origin`",
              "type": "module",
              "desc": "<p>HTTP/2 ALTSVC frames require a valid origin.</p>\n<p><a id=\"ERR_HTTP2_ALTSVC_LENGTH\"></a></p>",
              "displayName": "`ERR_HTTP2_ALTSVC_INVALID_ORIGIN`"
            },
            {
              "textRaw": "`ERR_HTTP2_ALTSVC_LENGTH`",
              "name": "`err_http2_altsvc_length`",
              "type": "module",
              "desc": "<p>HTTP/2 ALTSVC frames are limited to a maximum of 16,382 payload bytes.</p>\n<p><a id=\"ERR_HTTP2_CONNECT_AUTHORITY\"></a></p>",
              "displayName": "`ERR_HTTP2_ALTSVC_LENGTH`"
            },
            {
              "textRaw": "`ERR_HTTP2_CONNECT_AUTHORITY`",
              "name": "`err_http2_connect_authority`",
              "type": "module",
              "desc": "<p>For HTTP/2 requests using the <code>CONNECT</code> method, the <code>:authority</code> pseudo-header\nis required.</p>\n<p><a id=\"ERR_HTTP2_CONNECT_PATH\"></a></p>",
              "displayName": "`ERR_HTTP2_CONNECT_AUTHORITY`"
            },
            {
              "textRaw": "`ERR_HTTP2_CONNECT_PATH`",
              "name": "`err_http2_connect_path`",
              "type": "module",
              "desc": "<p>For HTTP/2 requests using the <code>CONNECT</code> method, the <code>:path</code> pseudo-header is\nforbidden.</p>\n<p><a id=\"ERR_HTTP2_CONNECT_SCHEME\"></a></p>",
              "displayName": "`ERR_HTTP2_CONNECT_PATH`"
            },
            {
              "textRaw": "`ERR_HTTP2_CONNECT_SCHEME`",
              "name": "`err_http2_connect_scheme`",
              "type": "module",
              "desc": "<p>For HTTP/2 requests using the <code>CONNECT</code> method, the <code>:scheme</code> pseudo-header is\nforbidden.</p>\n<p><a id=\"ERR_HTTP2_ERROR\"></a></p>",
              "displayName": "`ERR_HTTP2_CONNECT_SCHEME`"
            },
            {
              "textRaw": "`ERR_HTTP2_ERROR`",
              "name": "`err_http2_error`",
              "type": "module",
              "desc": "<p>A non-specific HTTP/2 error has occurred.</p>\n<p><a id=\"ERR_HTTP2_GOAWAY_SESSION\"></a></p>",
              "displayName": "`ERR_HTTP2_ERROR`"
            },
            {
              "textRaw": "`ERR_HTTP2_GOAWAY_SESSION`",
              "name": "`err_http2_goaway_session`",
              "type": "module",
              "desc": "<p>New HTTP/2 Streams may not be opened after the <code>Http2Session</code> has received a\n<code>GOAWAY</code> frame from the connected peer.</p>\n<p><a id=\"ERR_HTTP2_HEADERS_AFTER_RESPOND\"></a></p>",
              "displayName": "`ERR_HTTP2_GOAWAY_SESSION`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADERS_AFTER_RESPOND`",
              "name": "`err_http2_headers_after_respond`",
              "type": "module",
              "desc": "<p>An additional headers was specified after an HTTP/2 response was initiated.</p>\n<p><a id=\"ERR_HTTP2_HEADERS_SENT\"></a></p>",
              "displayName": "`ERR_HTTP2_HEADERS_AFTER_RESPOND`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADERS_SENT`",
              "name": "`err_http2_headers_sent`",
              "type": "module",
              "desc": "<p>An attempt was made to send multiple response headers.</p>\n<p><a id=\"ERR_HTTP2_HEADER_SINGLE_VALUE\"></a></p>",
              "displayName": "`ERR_HTTP2_HEADERS_SENT`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADER_SINGLE_VALUE`",
              "name": "`err_http2_header_single_value`",
              "type": "module",
              "desc": "<p>Multiple values were provided for an HTTP/2 header field that was required to\nhave only a single value.</p>\n<p><a id=\"ERR_HTTP2_INFO_STATUS_NOT_ALLOWED\"></a></p>",
              "displayName": "`ERR_HTTP2_HEADER_SINGLE_VALUE`"
            },
            {
              "textRaw": "`ERR_HTTP2_INFO_STATUS_NOT_ALLOWED`",
              "name": "`err_http2_info_status_not_allowed`",
              "type": "module",
              "desc": "<p>Informational HTTP status codes (<code>1xx</code>) may not be set as the response status\ncode on HTTP/2 responses.</p>\n<p><a id=\"ERR_HTTP2_INVALID_CONNECTION_HEADERS\"></a></p>",
              "displayName": "`ERR_HTTP2_INFO_STATUS_NOT_ALLOWED`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_CONNECTION_HEADERS`",
              "name": "`err_http2_invalid_connection_headers`",
              "type": "module",
              "desc": "<p>HTTP/1 connection specific headers are forbidden to be used in HTTP/2\nrequests and responses.</p>\n<p><a id=\"ERR_HTTP2_INVALID_HEADER_VALUE\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_CONNECTION_HEADERS`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_HEADER_VALUE`",
              "name": "`err_http2_invalid_header_value`",
              "type": "module",
              "desc": "<p>An invalid HTTP/2 header value was specified.</p>\n<p><a id=\"ERR_HTTP2_INVALID_INFO_STATUS\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_HEADER_VALUE`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_INFO_STATUS`",
              "name": "`err_http2_invalid_info_status`",
              "type": "module",
              "desc": "<p>An invalid HTTP informational status code has been specified. Informational\nstatus codes must be an integer between <code>100</code> and <code>199</code> (inclusive).</p>\n<p><a id=\"ERR_HTTP2_INVALID_ORIGIN\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_INFO_STATUS`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_ORIGIN`",
              "name": "`err_http2_invalid_origin`",
              "type": "module",
              "desc": "<p>HTTP/2 <code>ORIGIN</code> frames require a valid origin.</p>\n<p><a id=\"ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_ORIGIN`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH`",
              "name": "`err_http2_invalid_packed_settings_length`",
              "type": "module",
              "desc": "<p>Input <code>Buffer</code> and <code>Uint8Array</code> instances passed to the\n<code>http2.getUnpackedSettings()</code> API must have a length that is a multiple of\nsix.</p>\n<p><a id=\"ERR_HTTP2_INVALID_PSEUDOHEADER\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_PSEUDOHEADER`",
              "name": "`err_http2_invalid_pseudoheader`",
              "type": "module",
              "desc": "<p>Only valid HTTP/2 pseudoheaders (<code>:status</code>, <code>:path</code>, <code>:authority</code>, <code>:scheme</code>,\nand <code>:method</code>) may be used.</p>\n<p><a id=\"ERR_HTTP2_INVALID_SESSION\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_PSEUDOHEADER`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_SESSION`",
              "name": "`err_http2_invalid_session`",
              "type": "module",
              "desc": "<p>An action was performed on an <code>Http2Session</code> object that had already been\ndestroyed.</p>\n<p><a id=\"ERR_HTTP2_INVALID_SETTING_VALUE\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_SESSION`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_SETTING_VALUE`",
              "name": "`err_http2_invalid_setting_value`",
              "type": "module",
              "desc": "<p>An invalid value has been specified for an HTTP/2 setting.</p>\n<p><a id=\"ERR_HTTP2_INVALID_STREAM\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_SETTING_VALUE`"
            },
            {
              "textRaw": "`ERR_HTTP2_INVALID_STREAM`",
              "name": "`err_http2_invalid_stream`",
              "type": "module",
              "desc": "<p>An operation was performed on a stream that had already been destroyed.</p>\n<p><a id=\"ERR_HTTP2_MAX_PENDING_SETTINGS_ACK\"></a></p>",
              "displayName": "`ERR_HTTP2_INVALID_STREAM`"
            },
            {
              "textRaw": "`ERR_HTTP2_MAX_PENDING_SETTINGS_ACK`",
              "name": "`err_http2_max_pending_settings_ack`",
              "type": "module",
              "desc": "<p>Whenever an HTTP/2 <code>SETTINGS</code> frame is sent to a connected peer, the peer is\nrequired to send an acknowledgment that it has received and applied the new\n<code>SETTINGS</code>. By default, a maximum number of unacknowledged <code>SETTINGS</code> frames may\nbe sent at any given time. This error code is used when that limit has been\nreached.</p>\n<p><a id=\"ERR_HTTP2_NESTED_PUSH\"></a></p>",
              "displayName": "`ERR_HTTP2_MAX_PENDING_SETTINGS_ACK`"
            },
            {
              "textRaw": "`ERR_HTTP2_NESTED_PUSH`",
              "name": "`err_http2_nested_push`",
              "type": "module",
              "desc": "<p>An attempt was made to initiate a new push stream from within a push stream.\nNested push streams are not permitted.</p>\n<p><a id=\"ERR_HTTP2_NO_MEM\"></a></p>",
              "displayName": "`ERR_HTTP2_NESTED_PUSH`"
            },
            {
              "textRaw": "`ERR_HTTP2_NO_MEM`",
              "name": "`err_http2_no_mem`",
              "type": "module",
              "desc": "<p>Out of memory when using the <code>http2session.setLocalWindowSize(windowSize)</code> API.</p>\n<p><a id=\"ERR_HTTP2_NO_SOCKET_MANIPULATION\"></a></p>",
              "displayName": "`ERR_HTTP2_NO_MEM`"
            },
            {
              "textRaw": "`ERR_HTTP2_NO_SOCKET_MANIPULATION`",
              "name": "`err_http2_no_socket_manipulation`",
              "type": "module",
              "desc": "<p>An attempt was made to directly manipulate (read, write, pause, resume, etc.) a\nsocket attached to an <code>Http2Session</code>.</p>\n<p><a id=\"ERR_HTTP2_ORIGIN_LENGTH\"></a></p>",
              "displayName": "`ERR_HTTP2_NO_SOCKET_MANIPULATION`"
            },
            {
              "textRaw": "`ERR_HTTP2_ORIGIN_LENGTH`",
              "name": "`err_http2_origin_length`",
              "type": "module",
              "desc": "<p>HTTP/2 <code>ORIGIN</code> frames are limited to a length of 16382 bytes.</p>\n<p><a id=\"ERR_HTTP2_OUT_OF_STREAMS\"></a></p>",
              "displayName": "`ERR_HTTP2_ORIGIN_LENGTH`"
            },
            {
              "textRaw": "`ERR_HTTP2_OUT_OF_STREAMS`",
              "name": "`err_http2_out_of_streams`",
              "type": "module",
              "desc": "<p>The number of streams created on a single HTTP/2 session reached the maximum\nlimit.</p>\n<p><a id=\"ERR_HTTP2_PAYLOAD_FORBIDDEN\"></a></p>",
              "displayName": "`ERR_HTTP2_OUT_OF_STREAMS`"
            },
            {
              "textRaw": "`ERR_HTTP2_PAYLOAD_FORBIDDEN`",
              "name": "`err_http2_payload_forbidden`",
              "type": "module",
              "desc": "<p>A message payload was specified for an HTTP response code for which a payload is\nforbidden.</p>\n<p><a id=\"ERR_HTTP2_PING_CANCEL\"></a></p>",
              "displayName": "`ERR_HTTP2_PAYLOAD_FORBIDDEN`"
            },
            {
              "textRaw": "`ERR_HTTP2_PING_CANCEL`",
              "name": "`err_http2_ping_cancel`",
              "type": "module",
              "desc": "<p>An HTTP/2 ping was canceled.</p>\n<p><a id=\"ERR_HTTP2_PING_LENGTH\"></a></p>",
              "displayName": "`ERR_HTTP2_PING_CANCEL`"
            },
            {
              "textRaw": "`ERR_HTTP2_PING_LENGTH`",
              "name": "`err_http2_ping_length`",
              "type": "module",
              "desc": "<p>HTTP/2 ping payloads must be exactly 8 bytes in length.</p>\n<p><a id=\"ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED\"></a></p>",
              "displayName": "`ERR_HTTP2_PING_LENGTH`"
            },
            {
              "textRaw": "`ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED`",
              "name": "`err_http2_pseudoheader_not_allowed`",
              "type": "module",
              "desc": "<p>An HTTP/2 pseudo-header has been used inappropriately. Pseudo-headers are header\nkey names that begin with the <code>:</code> prefix.</p>\n<p><a id=\"ERR_HTTP2_PUSH_DISABLED\"></a></p>",
              "displayName": "`ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED`"
            },
            {
              "textRaw": "`ERR_HTTP2_PUSH_DISABLED`",
              "name": "`err_http2_push_disabled`",
              "type": "module",
              "desc": "<p>An attempt was made to create a push stream, which had been disabled by the\nclient.</p>\n<p><a id=\"ERR_HTTP2_SEND_FILE\"></a></p>",
              "displayName": "`ERR_HTTP2_PUSH_DISABLED`"
            },
            {
              "textRaw": "`ERR_HTTP2_SEND_FILE`",
              "name": "`err_http2_send_file`",
              "type": "module",
              "desc": "<p>An attempt was made to use the <code>Http2Stream.prototype.responseWithFile()</code> API to\nsend a directory.</p>\n<p><a id=\"ERR_HTTP2_SEND_FILE_NOSEEK\"></a></p>",
              "displayName": "`ERR_HTTP2_SEND_FILE`"
            },
            {
              "textRaw": "`ERR_HTTP2_SEND_FILE_NOSEEK`",
              "name": "`err_http2_send_file_noseek`",
              "type": "module",
              "desc": "<p>An attempt was made to use the <code>Http2Stream.prototype.responseWithFile()</code> API to\nsend something other than a regular file, but <code>offset</code> or <code>length</code> options were\nprovided.</p>\n<p><a id=\"ERR_HTTP2_SESSION_ERROR\"></a></p>",
              "displayName": "`ERR_HTTP2_SEND_FILE_NOSEEK`"
            },
            {
              "textRaw": "`ERR_HTTP2_SESSION_ERROR`",
              "name": "`err_http2_session_error`",
              "type": "module",
              "desc": "<p>The <code>Http2Session</code> closed with a non-zero error code.</p>\n<p><a id=\"ERR_HTTP2_SETTINGS_CANCEL\"></a></p>",
              "displayName": "`ERR_HTTP2_SESSION_ERROR`"
            },
            {
              "textRaw": "`ERR_HTTP2_SETTINGS_CANCEL`",
              "name": "`err_http2_settings_cancel`",
              "type": "module",
              "desc": "<p>The <code>Http2Session</code> settings canceled.</p>\n<p><a id=\"ERR_HTTP2_SOCKET_BOUND\"></a></p>",
              "displayName": "`ERR_HTTP2_SETTINGS_CANCEL`"
            },
            {
              "textRaw": "`ERR_HTTP2_SOCKET_BOUND`",
              "name": "`err_http2_socket_bound`",
              "type": "module",
              "desc": "<p>An attempt was made to connect a <code>Http2Session</code> object to a <code>net.Socket</code> or\n<code>tls.TLSSocket</code> that had already been bound to another <code>Http2Session</code> object.</p>\n<p><a id=\"ERR_HTTP2_SOCKET_UNBOUND\"></a></p>",
              "displayName": "`ERR_HTTP2_SOCKET_BOUND`"
            },
            {
              "textRaw": "`ERR_HTTP2_SOCKET_UNBOUND`",
              "name": "`err_http2_socket_unbound`",
              "type": "module",
              "desc": "<p>An attempt was made to use the <code>socket</code> property of an <code>Http2Session</code> that\nhas already been closed.</p>\n<p><a id=\"ERR_HTTP2_STATUS_101\"></a></p>",
              "displayName": "`ERR_HTTP2_SOCKET_UNBOUND`"
            },
            {
              "textRaw": "`ERR_HTTP2_STATUS_101`",
              "name": "`err_http2_status_101`",
              "type": "module",
              "desc": "<p>Use of the <code>101</code> Informational status code is forbidden in HTTP/2.</p>\n<p><a id=\"ERR_HTTP2_STATUS_INVALID\"></a></p>",
              "displayName": "`ERR_HTTP2_STATUS_101`"
            },
            {
              "textRaw": "`ERR_HTTP2_STATUS_INVALID`",
              "name": "`err_http2_status_invalid`",
              "type": "module",
              "desc": "<p>An invalid HTTP status code has been specified. Status codes must be an integer\nbetween <code>100</code> and <code>599</code> (inclusive).</p>\n<p><a id=\"ERR_HTTP2_STREAM_CANCEL\"></a></p>",
              "displayName": "`ERR_HTTP2_STATUS_INVALID`"
            },
            {
              "textRaw": "`ERR_HTTP2_STREAM_CANCEL`",
              "name": "`err_http2_stream_cancel`",
              "type": "module",
              "desc": "<p>An <code>Http2Stream</code> was destroyed before any data was transmitted to the connected\npeer.</p>\n<p><a id=\"ERR_HTTP2_STREAM_ERROR\"></a></p>",
              "displayName": "`ERR_HTTP2_STREAM_CANCEL`"
            },
            {
              "textRaw": "`ERR_HTTP2_STREAM_ERROR`",
              "name": "`err_http2_stream_error`",
              "type": "module",
              "desc": "<p>A non-zero error code was been specified in an <code>RST_STREAM</code> frame.</p>\n<p><a id=\"ERR_HTTP2_STREAM_SELF_DEPENDENCY\"></a></p>",
              "displayName": "`ERR_HTTP2_STREAM_ERROR`"
            },
            {
              "textRaw": "`ERR_HTTP2_STREAM_SELF_DEPENDENCY`",
              "name": "`err_http2_stream_self_dependency`",
              "type": "module",
              "desc": "<p>When setting the priority for an HTTP/2 stream, the stream may be marked as\na dependency for a parent stream. This error code is used when an attempt is\nmade to mark a stream and dependent of itself.</p>\n<p><a id=\"ERR_HTTP2_TOO_MANY_CUSTOM_SETTINGS\"></a></p>",
              "displayName": "`ERR_HTTP2_STREAM_SELF_DEPENDENCY`"
            },
            {
              "textRaw": "`ERR_HTTP2_TOO_MANY_CUSTOM_SETTINGS`",
              "name": "`err_http2_too_many_custom_settings`",
              "type": "module",
              "desc": "<p>The number of supported custom settings (10) has been exceeded.</p>\n<p><a id=\"ERR_HTTP2_TOO_MANY_INVALID_FRAMES\"></a></p>",
              "displayName": "`ERR_HTTP2_TOO_MANY_CUSTOM_SETTINGS`"
            },
            {
              "textRaw": "`ERR_HTTP2_TOO_MANY_INVALID_FRAMES`",
              "name": "`err_http2_too_many_invalid_frames`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The limit of acceptable invalid HTTP/2 protocol frames sent by the peer,\nas specified through the <code>maxSessionInvalidFrames</code> option, has been exceeded.</p>\n<p><a id=\"ERR_HTTP2_TRAILERS_ALREADY_SENT\"></a></p>",
              "displayName": "`ERR_HTTP2_TOO_MANY_INVALID_FRAMES`"
            },
            {
              "textRaw": "`ERR_HTTP2_TRAILERS_ALREADY_SENT`",
              "name": "`err_http2_trailers_already_sent`",
              "type": "module",
              "desc": "<p>Trailing headers have already been sent on the <code>Http2Stream</code>.</p>\n<p><a id=\"ERR_HTTP2_TRAILERS_NOT_READY\"></a></p>",
              "displayName": "`ERR_HTTP2_TRAILERS_ALREADY_SENT`"
            },
            {
              "textRaw": "`ERR_HTTP2_TRAILERS_NOT_READY`",
              "name": "`err_http2_trailers_not_ready`",
              "type": "module",
              "desc": "<p>The <code>http2stream.sendTrailers()</code> method cannot be called until after the\n<code>'wantTrailers'</code> event is emitted on an <code>Http2Stream</code> object. The\n<code>'wantTrailers'</code> event will only be emitted if the <code>waitForTrailers</code> option\nis set for the <code>Http2Stream</code>.</p>\n<p><a id=\"ERR_HTTP2_UNSUPPORTED_PROTOCOL\"></a></p>",
              "displayName": "`ERR_HTTP2_TRAILERS_NOT_READY`"
            },
            {
              "textRaw": "`ERR_HTTP2_UNSUPPORTED_PROTOCOL`",
              "name": "`err_http2_unsupported_protocol`",
              "type": "module",
              "desc": "<p><code>http2.connect()</code> was passed a URL that uses any protocol other than <code>http:</code> or\n<code>https:</code>.</p>\n<p><a id=\"ERR_HTTP_BODY_NOT_ALLOWED\"></a></p>",
              "displayName": "`ERR_HTTP2_UNSUPPORTED_PROTOCOL`"
            },
            {
              "textRaw": "`ERR_HTTP_BODY_NOT_ALLOWED`",
              "name": "`err_http_body_not_allowed`",
              "type": "module",
              "desc": "<p>An error is thrown when writing to an HTTP response which does not allow\ncontents.</p>\n<p><a id=\"ERR_HTTP_CONTENT_LENGTH_MISMATCH\"></a></p>",
              "displayName": "`ERR_HTTP_BODY_NOT_ALLOWED`"
            },
            {
              "textRaw": "`ERR_HTTP_CONTENT_LENGTH_MISMATCH`",
              "name": "`err_http_content_length_mismatch`",
              "type": "module",
              "desc": "<p>Response body size doesn't match with the specified content-length header value.</p>\n<p><a id=\"ERR_HTTP_HEADERS_SENT\"></a></p>",
              "displayName": "`ERR_HTTP_CONTENT_LENGTH_MISMATCH`"
            },
            {
              "textRaw": "`ERR_HTTP_HEADERS_SENT`",
              "name": "`err_http_headers_sent`",
              "type": "module",
              "desc": "<p>An attempt was made to add more headers after the headers had already been sent.</p>\n<p><a id=\"ERR_HTTP_INVALID_HEADER_VALUE\"></a></p>",
              "displayName": "`ERR_HTTP_HEADERS_SENT`"
            },
            {
              "textRaw": "`ERR_HTTP_INVALID_HEADER_VALUE`",
              "name": "`err_http_invalid_header_value`",
              "type": "module",
              "desc": "<p>An invalid HTTP header value was specified.</p>\n<p><a id=\"ERR_HTTP_INVALID_STATUS_CODE\"></a></p>",
              "displayName": "`ERR_HTTP_INVALID_HEADER_VALUE`"
            },
            {
              "textRaw": "`ERR_HTTP_INVALID_STATUS_CODE`",
              "name": "`err_http_invalid_status_code`",
              "type": "module",
              "desc": "<p>Status code was outside the regular status code range (100-999).</p>\n<p><a id=\"ERR_HTTP_REQUEST_TIMEOUT\"></a></p>",
              "displayName": "`ERR_HTTP_INVALID_STATUS_CODE`"
            },
            {
              "textRaw": "`ERR_HTTP_REQUEST_TIMEOUT`",
              "name": "`err_http_request_timeout`",
              "type": "module",
              "desc": "<p>The client has not sent the entire request within the allowed time.</p>\n<p><a id=\"ERR_HTTP_SOCKET_ASSIGNED\"></a></p>",
              "displayName": "`ERR_HTTP_REQUEST_TIMEOUT`"
            },
            {
              "textRaw": "`ERR_HTTP_SOCKET_ASSIGNED`",
              "name": "`err_http_socket_assigned`",
              "type": "module",
              "desc": "<p>The given <a href=\"http.html#class-httpserverresponse\"><code>ServerResponse</code></a> was already assigned a socket.</p>\n<p><a id=\"ERR_HTTP_SOCKET_ENCODING\"></a></p>",
              "displayName": "`ERR_HTTP_SOCKET_ASSIGNED`"
            },
            {
              "textRaw": "`ERR_HTTP_SOCKET_ENCODING`",
              "name": "`err_http_socket_encoding`",
              "type": "module",
              "desc": "<p>Changing the socket encoding is not allowed per <a href=\"https://tools.ietf.org/html/rfc7230#section-3\">RFC 7230 Section 3</a>.</p>\n<p><a id=\"ERR_HTTP_TRAILER_INVALID\"></a></p>",
              "displayName": "`ERR_HTTP_SOCKET_ENCODING`"
            },
            {
              "textRaw": "`ERR_HTTP_TRAILER_INVALID`",
              "name": "`err_http_trailer_invalid`",
              "type": "module",
              "desc": "<p>The <code>Trailer</code> header was set even though the transfer encoding does not support\nthat.</p>\n<p><a id=\"ERR_ILLEGAL_CONSTRUCTOR\"></a></p>",
              "displayName": "`ERR_HTTP_TRAILER_INVALID`"
            },
            {
              "textRaw": "`ERR_ILLEGAL_CONSTRUCTOR`",
              "name": "`err_illegal_constructor`",
              "type": "module",
              "desc": "<p>An attempt was made to construct an object using a non-public constructor.</p>\n<p><a id=\"ERR_IMPORT_ATTRIBUTE_MISSING\"></a></p>",
              "displayName": "`ERR_ILLEGAL_CONSTRUCTOR`"
            },
            {
              "textRaw": "`ERR_IMPORT_ATTRIBUTE_MISSING`",
              "name": "`err_import_attribute_missing`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.1.0"
                ],
                "changes": []
              },
              "desc": "<p>An import attribute is missing, preventing the specified module to be imported.</p>\n<p><a id=\"ERR_IMPORT_ATTRIBUTE_TYPE_INCOMPATIBLE\"></a></p>",
              "displayName": "`ERR_IMPORT_ATTRIBUTE_MISSING`"
            },
            {
              "textRaw": "`ERR_IMPORT_ATTRIBUTE_TYPE_INCOMPATIBLE`",
              "name": "`err_import_attribute_type_incompatible`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.1.0"
                ],
                "changes": []
              },
              "desc": "<p>An import <code>type</code> attribute was provided, but the specified module is of a\ndifferent type.</p>\n<p><a id=\"ERR_IMPORT_ATTRIBUTE_UNSUPPORTED\"></a></p>",
              "displayName": "`ERR_IMPORT_ATTRIBUTE_TYPE_INCOMPATIBLE`"
            },
            {
              "textRaw": "`ERR_IMPORT_ATTRIBUTE_UNSUPPORTED`",
              "name": "`err_import_attribute_unsupported`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.0.0",
                  "v20.10.0",
                  "v18.19.0"
                ],
                "changes": []
              },
              "desc": "<p>An import attribute is not supported by this version of Node.js.</p>\n<p><a id=\"ERR_INCOMPATIBLE_OPTION_PAIR\"></a></p>",
              "displayName": "`ERR_IMPORT_ATTRIBUTE_UNSUPPORTED`"
            },
            {
              "textRaw": "`ERR_INCOMPATIBLE_OPTION_PAIR`",
              "name": "`err_incompatible_option_pair`",
              "type": "module",
              "desc": "<p>An option pair is incompatible with each other and cannot be used at the same\ntime.</p>\n<p><a id=\"ERR_INPUT_TYPE_NOT_ALLOWED\"></a></p>",
              "displayName": "`ERR_INCOMPATIBLE_OPTION_PAIR`"
            },
            {
              "textRaw": "`ERR_INPUT_TYPE_NOT_ALLOWED`",
              "name": "`err_input_type_not_allowed`",
              "type": "module",
              "desc": "<p>The <code>--input-type</code> flag was used to attempt to execute a file. This flag can\nonly be used with input via <code>--eval</code>, <code>--print</code>, or <code>STDIN</code>.</p>\n<p><a id=\"ERR_INSPECTOR_ALREADY_ACTIVATED\"></a></p>",
              "displayName": "`ERR_INPUT_TYPE_NOT_ALLOWED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_ALREADY_ACTIVATED`",
              "name": "`err_inspector_already_activated`",
              "type": "module",
              "desc": "<p>While using the <code>node:inspector</code> module, an attempt was made to activate the\ninspector when it already started to listen on a port. Use <code>inspector.close()</code>\nbefore activating it on a different address.</p>\n<p><a id=\"ERR_INSPECTOR_ALREADY_CONNECTED\"></a></p>",
              "displayName": "`ERR_INSPECTOR_ALREADY_ACTIVATED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_ALREADY_CONNECTED`",
              "name": "`err_inspector_already_connected`",
              "type": "module",
              "desc": "<p>While using the <code>node:inspector</code> module, an attempt was made to connect when the\ninspector was already connected.</p>\n<p><a id=\"ERR_INSPECTOR_CLOSED\"></a></p>",
              "displayName": "`ERR_INSPECTOR_ALREADY_CONNECTED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_CLOSED`",
              "name": "`err_inspector_closed`",
              "type": "module",
              "desc": "<p>While using the <code>node:inspector</code> module, an attempt was made to use the\ninspector after the session had already closed.</p>\n<p><a id=\"ERR_INSPECTOR_COMMAND\"></a></p>",
              "displayName": "`ERR_INSPECTOR_CLOSED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_COMMAND`",
              "name": "`err_inspector_command`",
              "type": "module",
              "desc": "<p>An error occurred while issuing a command via the <code>node:inspector</code> module.</p>\n<p><a id=\"ERR_INSPECTOR_NOT_ACTIVE\"></a></p>",
              "displayName": "`ERR_INSPECTOR_COMMAND`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_NOT_ACTIVE`",
              "name": "`err_inspector_not_active`",
              "type": "module",
              "desc": "<p>The <code>inspector</code> is not active when <code>inspector.waitForDebugger()</code> is called.</p>\n<p><a id=\"ERR_INSPECTOR_NOT_AVAILABLE\"></a></p>",
              "displayName": "`ERR_INSPECTOR_NOT_ACTIVE`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_NOT_AVAILABLE`",
              "name": "`err_inspector_not_available`",
              "type": "module",
              "desc": "<p>The <code>node:inspector</code> module is not available for use.</p>\n<p><a id=\"ERR_INSPECTOR_NOT_CONNECTED\"></a></p>",
              "displayName": "`ERR_INSPECTOR_NOT_AVAILABLE`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_NOT_CONNECTED`",
              "name": "`err_inspector_not_connected`",
              "type": "module",
              "desc": "<p>While using the <code>node:inspector</code> module, an attempt was made to use the\ninspector before it was connected.</p>\n<p><a id=\"ERR_INSPECTOR_NOT_WORKER\"></a></p>",
              "displayName": "`ERR_INSPECTOR_NOT_CONNECTED`"
            },
            {
              "textRaw": "`ERR_INSPECTOR_NOT_WORKER`",
              "name": "`err_inspector_not_worker`",
              "type": "module",
              "desc": "<p>An API was called on the main thread that can only be used from\nthe worker thread.</p>\n<p><a id=\"ERR_INTERNAL_ASSERTION\"></a></p>",
              "displayName": "`ERR_INSPECTOR_NOT_WORKER`"
            },
            {
              "textRaw": "`ERR_INTERNAL_ASSERTION`",
              "name": "`err_internal_assertion`",
              "type": "module",
              "desc": "<p>There was a bug in Node.js or incorrect usage of Node.js internals.\nTo fix the error, open an issue at <a href=\"https://github.com/nodejs/node/issues\">https://github.com/nodejs/node/issues</a>.</p>\n<p><a id=\"ERR_INVALID_ADDRESS\"></a></p>",
              "displayName": "`ERR_INTERNAL_ASSERTION`"
            },
            {
              "textRaw": "`ERR_INVALID_ADDRESS`",
              "name": "`err_invalid_address`",
              "type": "module",
              "desc": "<p>The provided address is not understood by the Node.js API.</p>\n<p><a id=\"ERR_INVALID_ADDRESS_FAMILY\"></a></p>",
              "displayName": "`ERR_INVALID_ADDRESS`"
            },
            {
              "textRaw": "`ERR_INVALID_ADDRESS_FAMILY`",
              "name": "`err_invalid_address_family`",
              "type": "module",
              "desc": "<p>The provided address family is not understood by the Node.js API.</p>\n<p><a id=\"ERR_INVALID_ARG_TYPE\"></a></p>",
              "displayName": "`ERR_INVALID_ADDRESS_FAMILY`"
            },
            {
              "textRaw": "`ERR_INVALID_ARG_TYPE`",
              "name": "`err_invalid_arg_type`",
              "type": "module",
              "desc": "<p>An argument of the wrong type was passed to a Node.js API.</p>\n<p><a id=\"ERR_INVALID_ARG_VALUE\"></a></p>",
              "displayName": "`ERR_INVALID_ARG_TYPE`"
            },
            {
              "textRaw": "`ERR_INVALID_ARG_VALUE`",
              "name": "`err_invalid_arg_value`",
              "type": "module",
              "desc": "<p>An invalid or unsupported value was passed for a given argument.</p>\n<p><a id=\"ERR_INVALID_ASYNC_ID\"></a></p>",
              "displayName": "`ERR_INVALID_ARG_VALUE`"
            },
            {
              "textRaw": "`ERR_INVALID_ASYNC_ID`",
              "name": "`err_invalid_async_id`",
              "type": "module",
              "desc": "<p>An invalid <code>asyncId</code> or <code>triggerAsyncId</code> was passed using <code>AsyncHooks</code>. An id\nless than -1 should never happen.</p>\n<p><a id=\"ERR_INVALID_BUFFER_SIZE\"></a></p>",
              "displayName": "`ERR_INVALID_ASYNC_ID`"
            },
            {
              "textRaw": "`ERR_INVALID_BUFFER_SIZE`",
              "name": "`err_invalid_buffer_size`",
              "type": "module",
              "desc": "<p>A swap was performed on a <code>Buffer</code> but its size was not compatible with the\noperation.</p>\n<p><a id=\"ERR_INVALID_CHAR\"></a></p>",
              "displayName": "`ERR_INVALID_BUFFER_SIZE`"
            },
            {
              "textRaw": "`ERR_INVALID_CHAR`",
              "name": "`err_invalid_char`",
              "type": "module",
              "desc": "<p>Invalid characters were detected in headers.</p>\n<p><a id=\"ERR_INVALID_CURSOR_POS\"></a></p>",
              "displayName": "`ERR_INVALID_CHAR`"
            },
            {
              "textRaw": "`ERR_INVALID_CURSOR_POS`",
              "name": "`err_invalid_cursor_pos`",
              "type": "module",
              "desc": "<p>A cursor on a given stream cannot be moved to a specified row without a\nspecified column.</p>\n<p><a id=\"ERR_INVALID_FD\"></a></p>",
              "displayName": "`ERR_INVALID_CURSOR_POS`"
            },
            {
              "textRaw": "`ERR_INVALID_FD`",
              "name": "`err_invalid_fd`",
              "type": "module",
              "desc": "<p>A file descriptor ('fd') was not valid (e.g. it was a negative value).</p>\n<p><a id=\"ERR_INVALID_FD_TYPE\"></a></p>",
              "displayName": "`ERR_INVALID_FD`"
            },
            {
              "textRaw": "`ERR_INVALID_FD_TYPE`",
              "name": "`err_invalid_fd_type`",
              "type": "module",
              "desc": "<p>A file descriptor ('fd') type was not valid.</p>\n<p><a id=\"ERR_INVALID_FILE_URL_HOST\"></a></p>",
              "displayName": "`ERR_INVALID_FD_TYPE`"
            },
            {
              "textRaw": "`ERR_INVALID_FILE_URL_HOST`",
              "name": "`err_invalid_file_url_host`",
              "type": "module",
              "desc": "<p>A Node.js API that consumes <code>file:</code> URLs (such as certain functions in the\n<a href=\"fs.html\"><code>fs</code></a> module) encountered a file URL with an incompatible host. This\nsituation can only occur on Unix-like systems where only <code>localhost</code> or an empty\nhost is supported.</p>\n<p><a id=\"ERR_INVALID_FILE_URL_PATH\"></a></p>",
              "displayName": "`ERR_INVALID_FILE_URL_HOST`"
            },
            {
              "textRaw": "`ERR_INVALID_FILE_URL_PATH`",
              "name": "`err_invalid_file_url_path`",
              "type": "module",
              "desc": "<p>A Node.js API that consumes <code>file:</code> URLs (such as certain functions in the\n<a href=\"fs.html\"><code>fs</code></a> module) encountered a file URL with an incompatible path. The exact\nsemantics for determining whether a path can be used is platform-dependent.</p>\n<p>The thrown error object includes an <code>input</code> property that contains the URL object\nof the invalid <code>file:</code> URL.</p>\n<p><a id=\"ERR_INVALID_HANDLE_TYPE\"></a></p>",
              "displayName": "`ERR_INVALID_FILE_URL_PATH`"
            },
            {
              "textRaw": "`ERR_INVALID_HANDLE_TYPE`",
              "name": "`err_invalid_handle_type`",
              "type": "module",
              "desc": "<p>An attempt was made to send an unsupported \"handle\" over an IPC communication\nchannel to a child process. See <a href=\"child_process.html#subprocesssendmessage-sendhandle-options-callback\"><code>subprocess.send()</code></a> and <a href=\"process.html#processsendmessage-sendhandle-options-callback\"><code>process.send()</code></a>\nfor more information.</p>\n<p><a id=\"ERR_INVALID_HTTP_TOKEN\"></a></p>",
              "displayName": "`ERR_INVALID_HANDLE_TYPE`"
            },
            {
              "textRaw": "`ERR_INVALID_HTTP_TOKEN`",
              "name": "`err_invalid_http_token`",
              "type": "module",
              "desc": "<p>An invalid HTTP token was supplied.</p>\n<p><a id=\"ERR_INVALID_IP_ADDRESS\"></a></p>",
              "displayName": "`ERR_INVALID_HTTP_TOKEN`"
            },
            {
              "textRaw": "`ERR_INVALID_IP_ADDRESS`",
              "name": "`err_invalid_ip_address`",
              "type": "module",
              "desc": "<p>An IP address is not valid.</p>\n<p><a id=\"ERR_INVALID_MIME_SYNTAX\"></a></p>",
              "displayName": "`ERR_INVALID_IP_ADDRESS`"
            },
            {
              "textRaw": "`ERR_INVALID_MIME_SYNTAX`",
              "name": "`err_invalid_mime_syntax`",
              "type": "module",
              "desc": "<p>The syntax of a MIME is not valid.</p>\n<p><a id=\"ERR_INVALID_MODULE\"></a></p>",
              "displayName": "`ERR_INVALID_MIME_SYNTAX`"
            },
            {
              "textRaw": "`ERR_INVALID_MODULE`",
              "name": "`err_invalid_module`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to load a module that does not exist or was otherwise not\nvalid.</p>\n<p><a id=\"ERR_INVALID_MODULE_SPECIFIER\"></a></p>",
              "displayName": "`ERR_INVALID_MODULE`"
            },
            {
              "textRaw": "`ERR_INVALID_MODULE_SPECIFIER`",
              "name": "`err_invalid_module_specifier`",
              "type": "module",
              "desc": "<p>The imported module string is an invalid URL, package name, or package subpath\nspecifier.</p>\n<p><a id=\"ERR_INVALID_OBJECT_DEFINE_PROPERTY\"></a></p>",
              "displayName": "`ERR_INVALID_MODULE_SPECIFIER`"
            },
            {
              "textRaw": "`ERR_INVALID_OBJECT_DEFINE_PROPERTY`",
              "name": "`err_invalid_object_define_property`",
              "type": "module",
              "desc": "<p>An error occurred while setting an invalid attribute on the property of\nan object.</p>\n<p><a id=\"ERR_INVALID_PACKAGE_CONFIG\"></a></p>",
              "displayName": "`ERR_INVALID_OBJECT_DEFINE_PROPERTY`"
            },
            {
              "textRaw": "`ERR_INVALID_PACKAGE_CONFIG`",
              "name": "`err_invalid_package_config`",
              "type": "module",
              "desc": "<p>An invalid <a href=\"packages.html#nodejs-packagejson-field-definitions\"><code>package.json</code></a> file failed parsing.</p>\n<p><a id=\"ERR_INVALID_PACKAGE_TARGET\"></a></p>",
              "displayName": "`ERR_INVALID_PACKAGE_CONFIG`"
            },
            {
              "textRaw": "`ERR_INVALID_PACKAGE_TARGET`",
              "name": "`err_invalid_package_target`",
              "type": "module",
              "desc": "<p>The <code>package.json</code> <a href=\"packages.html#exports\"><code>\"exports\"</code></a> field contains an invalid target mapping\nvalue for the attempted module resolution.</p>\n<p><a id=\"ERR_INVALID_PROTOCOL\"></a></p>",
              "displayName": "`ERR_INVALID_PACKAGE_TARGET`"
            },
            {
              "textRaw": "`ERR_INVALID_PROTOCOL`",
              "name": "`err_invalid_protocol`",
              "type": "module",
              "desc": "<p>An invalid <code>options.protocol</code> was passed to <code>http.request()</code>.</p>\n<p><a id=\"ERR_INVALID_REPL_EVAL_CONFIG\"></a></p>",
              "displayName": "`ERR_INVALID_PROTOCOL`"
            },
            {
              "textRaw": "`ERR_INVALID_REPL_EVAL_CONFIG`",
              "name": "`err_invalid_repl_eval_config`",
              "type": "module",
              "desc": "<p>Both <code>breakEvalOnSigint</code> and <code>eval</code> options were set in the <a href=\"repl.html\"><code>REPL</code></a> config,\nwhich is not supported.</p>\n<p><a id=\"ERR_INVALID_REPL_INPUT\"></a></p>",
              "displayName": "`ERR_INVALID_REPL_EVAL_CONFIG`"
            },
            {
              "textRaw": "`ERR_INVALID_REPL_INPUT`",
              "name": "`err_invalid_repl_input`",
              "type": "module",
              "desc": "<p>The input may not be used in the <a href=\"repl.html\"><code>REPL</code></a>. The conditions under which this\nerror is used are described in the <a href=\"repl.html\"><code>REPL</code></a> documentation.</p>\n<p><a id=\"ERR_INVALID_RETURN_PROPERTY\"></a></p>",
              "displayName": "`ERR_INVALID_REPL_INPUT`"
            },
            {
              "textRaw": "`ERR_INVALID_RETURN_PROPERTY`",
              "name": "`err_invalid_return_property`",
              "type": "module",
              "desc": "<p>Thrown in case a function option does not provide a valid value for one of its\nreturned object properties on execution.</p>\n<p><a id=\"ERR_INVALID_RETURN_PROPERTY_VALUE\"></a></p>",
              "displayName": "`ERR_INVALID_RETURN_PROPERTY`"
            },
            {
              "textRaw": "`ERR_INVALID_RETURN_PROPERTY_VALUE`",
              "name": "`err_invalid_return_property_value`",
              "type": "module",
              "desc": "<p>Thrown in case a function option does not provide an expected value\ntype for one of its returned object properties on execution.</p>\n<p><a id=\"ERR_INVALID_RETURN_VALUE\"></a></p>",
              "displayName": "`ERR_INVALID_RETURN_PROPERTY_VALUE`"
            },
            {
              "textRaw": "`ERR_INVALID_RETURN_VALUE`",
              "name": "`err_invalid_return_value`",
              "type": "module",
              "desc": "<p>Thrown in case a function option does not return an expected value\ntype on execution, such as when a function is expected to return a promise.</p>\n<p><a id=\"ERR_INVALID_STATE\"></a></p>",
              "displayName": "`ERR_INVALID_RETURN_VALUE`"
            },
            {
              "textRaw": "`ERR_INVALID_STATE`",
              "name": "`err_invalid_state`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Indicates that an operation cannot be completed due to an invalid state.\nFor instance, an object may have already been destroyed, or may be\nperforming another operation.</p>\n<p><a id=\"ERR_INVALID_SYNC_FORK_INPUT\"></a></p>",
              "displayName": "`ERR_INVALID_STATE`"
            },
            {
              "textRaw": "`ERR_INVALID_SYNC_FORK_INPUT`",
              "name": "`err_invalid_sync_fork_input`",
              "type": "module",
              "desc": "<p>A <code>Buffer</code>, <code>TypedArray</code>, <code>DataView</code>, or <code>string</code> was provided as stdio input to\nan asynchronous fork. See the documentation for the <a href=\"child_process.html\"><code>child_process</code></a> module\nfor more information.</p>\n<p><a id=\"ERR_INVALID_THIS\"></a></p>",
              "displayName": "`ERR_INVALID_SYNC_FORK_INPUT`"
            },
            {
              "textRaw": "`ERR_INVALID_THIS`",
              "name": "`err_invalid_this`",
              "type": "module",
              "desc": "<p>A Node.js API function was called with an incompatible <code>this</code> value.</p>\n<pre><code class=\"language-js\">const urlSearchParams = new URLSearchParams('foo=bar&#x26;baz=new');\n\nconst buf = Buffer.alloc(1);\nurlSearchParams.has.call(buf, 'foo');\n// Throws a TypeError with code 'ERR_INVALID_THIS'\n</code></pre>\n<p><a id=\"ERR_INVALID_TUPLE\"></a></p>",
              "displayName": "`ERR_INVALID_THIS`"
            },
            {
              "textRaw": "`ERR_INVALID_TUPLE`",
              "name": "`err_invalid_tuple`",
              "type": "module",
              "desc": "<p>An element in the <code>iterable</code> provided to the <a href=\"url.html#the-whatwg-url-api\">WHATWG</a>\n<a href=\"url.html#new-urlsearchparamsiterable\"><code>URLSearchParams</code> constructor</a> did not\nrepresent a <code>[name, value]</code> tuple – that is, if an element is not iterable, or\ndoes not consist of exactly two elements.</p>\n<p><a id=\"ERR_INVALID_TYPESCRIPT_SYNTAX\"></a></p>",
              "displayName": "`ERR_INVALID_TUPLE`"
            },
            {
              "textRaw": "`ERR_INVALID_TYPESCRIPT_SYNTAX`",
              "name": "`err_invalid_typescript_syntax`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56610",
                    "description": "This error is no longer thrown on valid yet unsupported syntax."
                  }
                ]
              },
              "desc": "<p>The provided TypeScript syntax is not valid.</p>\n<p><a id=\"ERR_INVALID_URI\"></a></p>",
              "displayName": "`ERR_INVALID_TYPESCRIPT_SYNTAX`"
            },
            {
              "textRaw": "`ERR_INVALID_URI`",
              "name": "`err_invalid_uri`",
              "type": "module",
              "desc": "<p>An invalid URI was passed.</p>\n<p><a id=\"ERR_INVALID_URL\"></a></p>",
              "displayName": "`ERR_INVALID_URI`"
            },
            {
              "textRaw": "`ERR_INVALID_URL`",
              "name": "`err_invalid_url`",
              "type": "module",
              "desc": "<p>An invalid URL was passed to the <a href=\"url.html#the-whatwg-url-api\">WHATWG</a> <a href=\"url.html#new-urlinput-base\"><code>URL</code>\nconstructor</a> or the legacy <a href=\"url.html#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a> to be parsed.\nThe thrown error object typically has an additional property <code>'input'</code> that\ncontains the URL that failed to parse.</p>\n<p><a id=\"ERR_INVALID_URL_PATTERN\"></a></p>",
              "displayName": "`ERR_INVALID_URL`"
            },
            {
              "textRaw": "`ERR_INVALID_URL_PATTERN`",
              "name": "`err_invalid_url_pattern`",
              "type": "module",
              "desc": "<p>An invalid URLPattern was passed to the <a href=\"url.html#the-whatwg-url-api\">WHATWG</a>\n<a href=\"url.html#new-urlpatternstring-baseurl-options\"><code>URLPattern</code> constructor</a> to be parsed.</p>\n<p><a id=\"ERR_INVALID_URL_SCHEME\"></a></p>",
              "displayName": "`ERR_INVALID_URL_PATTERN`"
            },
            {
              "textRaw": "`ERR_INVALID_URL_SCHEME`",
              "name": "`err_invalid_url_scheme`",
              "type": "module",
              "desc": "<p>An attempt was made to use a URL of an incompatible scheme (protocol) for a\nspecific purpose. It is only used in the <a href=\"url.html#the-whatwg-url-api\">WHATWG URL API</a> support in the\n<a href=\"fs.html\"><code>fs</code></a> module (which only accepts URLs with <code>'file'</code> scheme), but may be used\nin other Node.js APIs as well in the future.</p>\n<p><a id=\"ERR_IPC_CHANNEL_CLOSED\"></a></p>",
              "displayName": "`ERR_INVALID_URL_SCHEME`"
            },
            {
              "textRaw": "`ERR_IPC_CHANNEL_CLOSED`",
              "name": "`err_ipc_channel_closed`",
              "type": "module",
              "desc": "<p>An attempt was made to use an IPC communication channel that was already closed.</p>\n<p><a id=\"ERR_IPC_DISCONNECTED\"></a></p>",
              "displayName": "`ERR_IPC_CHANNEL_CLOSED`"
            },
            {
              "textRaw": "`ERR_IPC_DISCONNECTED`",
              "name": "`err_ipc_disconnected`",
              "type": "module",
              "desc": "<p>An attempt was made to disconnect an IPC communication channel that was already\ndisconnected. See the documentation for the <a href=\"child_process.html\"><code>child_process</code></a> module\nfor more information.</p>\n<p><a id=\"ERR_IPC_ONE_PIPE\"></a></p>",
              "displayName": "`ERR_IPC_DISCONNECTED`"
            },
            {
              "textRaw": "`ERR_IPC_ONE_PIPE`",
              "name": "`err_ipc_one_pipe`",
              "type": "module",
              "desc": "<p>An attempt was made to create a child Node.js process using more than one IPC\ncommunication channel. See the documentation for the <a href=\"child_process.html\"><code>child_process</code></a> module\nfor more information.</p>\n<p><a id=\"ERR_IPC_SYNC_FORK\"></a></p>",
              "displayName": "`ERR_IPC_ONE_PIPE`"
            },
            {
              "textRaw": "`ERR_IPC_SYNC_FORK`",
              "name": "`err_ipc_sync_fork`",
              "type": "module",
              "desc": "<p>An attempt was made to open an IPC communication channel with a synchronously\nforked Node.js process. See the documentation for the <a href=\"child_process.html\"><code>child_process</code></a> module\nfor more information.</p>\n<p><a id=\"ERR_IP_BLOCKED\"></a></p>",
              "displayName": "`ERR_IPC_SYNC_FORK`"
            },
            {
              "textRaw": "`ERR_IP_BLOCKED`",
              "name": "`err_ip_blocked`",
              "type": "module",
              "desc": "<p>IP is blocked by <code>net.BlockList</code>.</p>\n<p><a id=\"ERR_LOADER_CHAIN_INCOMPLETE\"></a></p>",
              "displayName": "`ERR_IP_BLOCKED`"
            },
            {
              "textRaw": "`ERR_LOADER_CHAIN_INCOMPLETE`",
              "name": "`err_loader_chain_incomplete`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.6.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>An ESM loader hook returned without calling <code>next()</code> and without explicitly\nsignaling a short circuit.</p>\n<p><a id=\"ERR_LOAD_SQLITE_EXTENSION\"></a></p>",
              "displayName": "`ERR_LOADER_CHAIN_INCOMPLETE`"
            },
            {
              "textRaw": "`ERR_LOAD_SQLITE_EXTENSION`",
              "name": "`err_load_sqlite_extension`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.5.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "desc": "<p>An error occurred while loading a SQLite extension.</p>\n<p><a id=\"ERR_MEMORY_ALLOCATION_FAILED\"></a></p>",
              "displayName": "`ERR_LOAD_SQLITE_EXTENSION`"
            },
            {
              "textRaw": "`ERR_MEMORY_ALLOCATION_FAILED`",
              "name": "`err_memory_allocation_failed`",
              "type": "module",
              "desc": "<p>An attempt was made to allocate memory (usually in the C++ layer) but it\nfailed.</p>\n<p><a id=\"ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE\"></a></p>",
              "displayName": "`ERR_MEMORY_ALLOCATION_FAILED`"
            },
            {
              "textRaw": "`ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE`",
              "name": "`err_message_target_context_unavailable`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "desc": "<p>A message posted to a <a href=\"worker_threads.html#class-messageport\"><code>MessagePort</code></a> could not be deserialized in the target\n<a href=\"vm.html\">vm</a> <code>Context</code>. Not all Node.js objects can be successfully instantiated in\nany context at this time, and attempting to transfer them using <code>postMessage()</code>\ncan fail on the receiving side in that case.</p>\n<p><a id=\"ERR_METHOD_NOT_IMPLEMENTED\"></a></p>",
              "displayName": "`ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE`"
            },
            {
              "textRaw": "`ERR_METHOD_NOT_IMPLEMENTED`",
              "name": "`err_method_not_implemented`",
              "type": "module",
              "desc": "<p>A method is required but not implemented.</p>\n<p><a id=\"ERR_MISSING_ARGS\"></a></p>",
              "displayName": "`ERR_METHOD_NOT_IMPLEMENTED`"
            },
            {
              "textRaw": "`ERR_MISSING_ARGS`",
              "name": "`err_missing_args`",
              "type": "module",
              "desc": "<p>A required argument of a Node.js API was not passed. This is only used for\nstrict compliance with the API specification (which in some cases may accept\n<code>func(undefined)</code> but not <code>func()</code>). In most native Node.js APIs,\n<code>func(undefined)</code> and <code>func()</code> are treated identically, and the\n<a href=\"#err_invalid_arg_type\"><code>ERR_INVALID_ARG_TYPE</code></a> error code may be used instead.</p>\n<p><a id=\"ERR_MISSING_OPTION\"></a></p>",
              "displayName": "`ERR_MISSING_ARGS`"
            },
            {
              "textRaw": "`ERR_MISSING_OPTION`",
              "name": "`err_missing_option`",
              "type": "module",
              "desc": "<p>For APIs that accept options objects, some options might be mandatory. This code\nis thrown if a required option is missing.</p>\n<p><a id=\"ERR_MISSING_PASSPHRASE\"></a></p>",
              "displayName": "`ERR_MISSING_OPTION`"
            },
            {
              "textRaw": "`ERR_MISSING_PASSPHRASE`",
              "name": "`err_missing_passphrase`",
              "type": "module",
              "desc": "<p>An attempt was made to read an encrypted key without specifying a passphrase.</p>\n<p><a id=\"ERR_MISSING_PLATFORM_FOR_WORKER\"></a></p>",
              "displayName": "`ERR_MISSING_PASSPHRASE`"
            },
            {
              "textRaw": "`ERR_MISSING_PLATFORM_FOR_WORKER`",
              "name": "`err_missing_platform_for_worker`",
              "type": "module",
              "desc": "<p>The V8 platform used by this instance of Node.js does not support creating\nWorkers. This is caused by lack of embedder support for Workers. In particular,\nthis error will not occur with standard builds of Node.js.</p>\n<p><a id=\"ERR_MODULE_LINK_MISMATCH\"></a></p>",
              "displayName": "`ERR_MISSING_PLATFORM_FOR_WORKER`"
            },
            {
              "textRaw": "`ERR_MODULE_LINK_MISMATCH`",
              "name": "`err_module_link_mismatch`",
              "type": "module",
              "desc": "<p>A module can not be linked because the same module requests in it are not\nresolved to the same module.</p>\n<p><a id=\"ERR_MODULE_NOT_FOUND\"></a></p>",
              "displayName": "`ERR_MODULE_LINK_MISMATCH`"
            },
            {
              "textRaw": "`ERR_MODULE_NOT_FOUND`",
              "name": "`err_module_not_found`",
              "type": "module",
              "desc": "<p>A module file could not be resolved by the ECMAScript modules loader while\nattempting an <code>import</code> operation or when loading the program entry point.</p>\n<p><a id=\"ERR_MULTIPLE_CALLBACK\"></a></p>",
              "displayName": "`ERR_MODULE_NOT_FOUND`"
            },
            {
              "textRaw": "`ERR_MULTIPLE_CALLBACK`",
              "name": "`err_multiple_callback`",
              "type": "module",
              "desc": "<p>A callback was called more than once.</p>\n<p>A callback is almost always meant to only be called once as the query\ncan either be fulfilled or rejected but not both at the same time. The latter\nwould be possible by calling a callback more than once.</p>\n<p><a id=\"ERR_NAPI_CONS_FUNCTION\"></a></p>",
              "displayName": "`ERR_MULTIPLE_CALLBACK`"
            },
            {
              "textRaw": "`ERR_NAPI_CONS_FUNCTION`",
              "name": "`err_napi_cons_function`",
              "type": "module",
              "desc": "<p>While using <code>Node-API</code>, a constructor passed was not a function.</p>\n<p><a id=\"ERR_NAPI_INVALID_DATAVIEW_ARGS\"></a></p>",
              "displayName": "`ERR_NAPI_CONS_FUNCTION`"
            },
            {
              "textRaw": "`ERR_NAPI_INVALID_DATAVIEW_ARGS`",
              "name": "`err_napi_invalid_dataview_args`",
              "type": "module",
              "desc": "<p>While calling <code>napi_create_dataview()</code>, a given <code>offset</code> was outside the bounds\nof the dataview or <code>offset + length</code> was larger than a length of given <code>buffer</code>.</p>\n<p><a id=\"ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT\"></a></p>",
              "displayName": "`ERR_NAPI_INVALID_DATAVIEW_ARGS`"
            },
            {
              "textRaw": "`ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT`",
              "name": "`err_napi_invalid_typedarray_alignment`",
              "type": "module",
              "desc": "<p>While calling <code>napi_create_typedarray()</code>, the provided <code>offset</code> was not a\nmultiple of the element size.</p>\n<p><a id=\"ERR_NAPI_INVALID_TYPEDARRAY_LENGTH\"></a></p>",
              "displayName": "`ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT`"
            },
            {
              "textRaw": "`ERR_NAPI_INVALID_TYPEDARRAY_LENGTH`",
              "name": "`err_napi_invalid_typedarray_length`",
              "type": "module",
              "desc": "<p>While calling <code>napi_create_typedarray()</code>, <code>(length * size_of_element) + byte_offset</code> was larger than the length of given <code>buffer</code>.</p>\n<p><a id=\"ERR_NAPI_TSFN_CALL_JS\"></a></p>",
              "displayName": "`ERR_NAPI_INVALID_TYPEDARRAY_LENGTH`"
            },
            {
              "textRaw": "`ERR_NAPI_TSFN_CALL_JS`",
              "name": "`err_napi_tsfn_call_js`",
              "type": "module",
              "desc": "<p>An error occurred while invoking the JavaScript portion of the thread-safe\nfunction.</p>\n<p><a id=\"ERR_NAPI_TSFN_GET_UNDEFINED\"></a></p>",
              "displayName": "`ERR_NAPI_TSFN_CALL_JS`"
            },
            {
              "textRaw": "`ERR_NAPI_TSFN_GET_UNDEFINED`",
              "name": "`err_napi_tsfn_get_undefined`",
              "type": "module",
              "desc": "<p>An error occurred while attempting to retrieve the JavaScript <code>undefined</code>\nvalue.</p>\n<p><a id=\"ERR_NON_CONTEXT_AWARE_DISABLED\"></a></p>",
              "displayName": "`ERR_NAPI_TSFN_GET_UNDEFINED`"
            },
            {
              "textRaw": "`ERR_NON_CONTEXT_AWARE_DISABLED`",
              "name": "`err_non_context_aware_disabled`",
              "type": "module",
              "desc": "<p>A non-context-aware native addon was loaded in a process that disallows them.</p>\n<p><a id=\"ERR_NOT_BUILDING_SNAPSHOT\"></a></p>",
              "displayName": "`ERR_NON_CONTEXT_AWARE_DISABLED`"
            },
            {
              "textRaw": "`ERR_NOT_BUILDING_SNAPSHOT`",
              "name": "`err_not_building_snapshot`",
              "type": "module",
              "desc": "<p>An attempt was made to use operations that can only be used when building\nV8 startup snapshot even though Node.js isn't building one.</p>\n<p><a id=\"ERR_NOT_IN_SINGLE_EXECUTABLE_APPLICATION\"></a></p>",
              "displayName": "`ERR_NOT_BUILDING_SNAPSHOT`"
            },
            {
              "textRaw": "`ERR_NOT_IN_SINGLE_EXECUTABLE_APPLICATION`",
              "name": "`err_not_in_single_executable_application`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "desc": "<p>The operation cannot be performed when it's not in a single-executable\napplication.</p>\n<p><a id=\"ERR_NOT_SUPPORTED_IN_SNAPSHOT\"></a></p>",
              "displayName": "`ERR_NOT_IN_SINGLE_EXECUTABLE_APPLICATION`"
            },
            {
              "textRaw": "`ERR_NOT_SUPPORTED_IN_SNAPSHOT`",
              "name": "`err_not_supported_in_snapshot`",
              "type": "module",
              "desc": "<p>An attempt was made to perform operations that are not supported when\nbuilding a startup snapshot.</p>\n<p><a id=\"ERR_NO_CRYPTO\"></a></p>",
              "displayName": "`ERR_NOT_SUPPORTED_IN_SNAPSHOT`"
            },
            {
              "textRaw": "`ERR_NO_CRYPTO`",
              "name": "`err_no_crypto`",
              "type": "module",
              "desc": "<p>An attempt was made to use crypto features while Node.js was not compiled with\nOpenSSL crypto support.</p>\n<p><a id=\"ERR_NO_ICU\"></a></p>",
              "displayName": "`ERR_NO_CRYPTO`"
            },
            {
              "textRaw": "`ERR_NO_ICU`",
              "name": "`err_no_icu`",
              "type": "module",
              "desc": "<p>An attempt was made to use features that require <a href=\"intl.html#internationalization-support\">ICU</a>, but Node.js was not\ncompiled with ICU support.</p>\n<p><a id=\"ERR_NO_TEMPORAL\"></a></p>",
              "displayName": "`ERR_NO_ICU`"
            },
            {
              "textRaw": "`ERR_NO_TEMPORAL`",
              "name": "`err_no_temporal`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.2.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to use features that require <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Temporal\"><code>Temporal</code></a>, but Node.js was not\ncompiled with <code>Temporal</code> support or it has been disabled in the current environment\n(for example, when running with <code>--no-harmony-temporal</code>).</p>\n<p><a id=\"ERR_NO_TYPESCRIPT\"></a></p>",
              "displayName": "`ERR_NO_TEMPORAL`"
            },
            {
              "textRaw": "`ERR_NO_TYPESCRIPT`",
              "name": "`err_no_typescript`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.12.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to use features that require <a href=\"typescript.html#type-stripping\">Native TypeScript support</a>, but Node.js was not\ncompiled with TypeScript support.</p>\n<p><a id=\"ERR_OPERATION_FAILED\"></a></p>",
              "displayName": "`ERR_NO_TYPESCRIPT`"
            },
            {
              "textRaw": "`ERR_OPERATION_FAILED`",
              "name": "`err_operation_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An operation failed. This is typically used to signal the general failure\nof an asynchronous operation.</p>\n<p><a id=\"ERR_OPTIONS_BEFORE_BOOTSTRAPPING\"></a></p>",
              "displayName": "`ERR_OPERATION_FAILED`"
            },
            {
              "textRaw": "`ERR_OPTIONS_BEFORE_BOOTSTRAPPING`",
              "name": "`err_options_before_bootstrapping`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.10.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "desc": "<p>An attempt was made to get options before the bootstrapping was completed.</p>\n<p><a id=\"ERR_OUT_OF_RANGE\"></a></p>",
              "displayName": "`ERR_OPTIONS_BEFORE_BOOTSTRAPPING`"
            },
            {
              "textRaw": "`ERR_OUT_OF_RANGE`",
              "name": "`err_out_of_range`",
              "type": "module",
              "desc": "<p>A given value is out of the accepted range.</p>\n<p><a id=\"ERR_PACKAGE_IMPORT_NOT_DEFINED\"></a></p>",
              "displayName": "`ERR_OUT_OF_RANGE`"
            },
            {
              "textRaw": "`ERR_PACKAGE_IMPORT_NOT_DEFINED`",
              "name": "`err_package_import_not_defined`",
              "type": "module",
              "desc": "<p>The <code>package.json</code> <a href=\"packages.html#imports\"><code>\"imports\"</code></a> field does not define the given internal\npackage specifier mapping.</p>\n<p><a id=\"ERR_PACKAGE_PATH_NOT_EXPORTED\"></a></p>",
              "displayName": "`ERR_PACKAGE_IMPORT_NOT_DEFINED`"
            },
            {
              "textRaw": "`ERR_PACKAGE_PATH_NOT_EXPORTED`",
              "name": "`err_package_path_not_exported`",
              "type": "module",
              "desc": "<p>The <code>package.json</code> <a href=\"packages.html#exports\"><code>\"exports\"</code></a> field does not export the requested subpath.\nBecause exports are encapsulated, private internal modules that are not exported\ncannot be imported through the package resolution, unless using an absolute URL.</p>\n<p><a id=\"ERR_PARSE_ARGS_INVALID_OPTION_VALUE\"></a></p>",
              "displayName": "`ERR_PACKAGE_PATH_NOT_EXPORTED`"
            },
            {
              "textRaw": "`ERR_PARSE_ARGS_INVALID_OPTION_VALUE`",
              "name": "`err_parse_args_invalid_option_value`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>When <code>strict</code> set to <code>true</code>, thrown by <a href=\"util.html#utilparseargsconfig\"><code>util.parseArgs()</code></a> if a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a>\nvalue is provided for an option of type <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, or if a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>\nvalue is provided for an option of type <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a>.</p>\n<p><a id=\"ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL\"></a></p>",
              "displayName": "`ERR_PARSE_ARGS_INVALID_OPTION_VALUE`"
            },
            {
              "textRaw": "`ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL`",
              "name": "`err_parse_args_unexpected_positional`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Thrown by <a href=\"util.html#utilparseargsconfig\"><code>util.parseArgs()</code></a>, when a positional argument is provided and\n<code>allowPositionals</code> is set to <code>false</code>.</p>\n<p><a id=\"ERR_PARSE_ARGS_UNKNOWN_OPTION\"></a></p>",
              "displayName": "`ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL`"
            },
            {
              "textRaw": "`ERR_PARSE_ARGS_UNKNOWN_OPTION`",
              "name": "`err_parse_args_unknown_option`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>When <code>strict</code> set to <code>true</code>, thrown by <a href=\"util.html#utilparseargsconfig\"><code>util.parseArgs()</code></a> if an argument\nis not configured in <code>options</code>.</p>\n<p><a id=\"ERR_PERFORMANCE_INVALID_TIMESTAMP\"></a></p>",
              "displayName": "`ERR_PARSE_ARGS_UNKNOWN_OPTION`"
            },
            {
              "textRaw": "`ERR_PERFORMANCE_INVALID_TIMESTAMP`",
              "name": "`err_performance_invalid_timestamp`",
              "type": "module",
              "desc": "<p>An invalid timestamp value was provided for a performance mark or measure.</p>\n<p><a id=\"ERR_PERFORMANCE_MEASURE_INVALID_OPTIONS\"></a></p>",
              "displayName": "`ERR_PERFORMANCE_INVALID_TIMESTAMP`"
            },
            {
              "textRaw": "`ERR_PERFORMANCE_MEASURE_INVALID_OPTIONS`",
              "name": "`err_performance_measure_invalid_options`",
              "type": "module",
              "desc": "<p>Invalid options were provided for a performance measure.</p>\n<p><a id=\"ERR_PROTO_ACCESS\"></a></p>",
              "displayName": "`ERR_PERFORMANCE_MEASURE_INVALID_OPTIONS`"
            },
            {
              "textRaw": "`ERR_PROTO_ACCESS`",
              "name": "`err_proto_access`",
              "type": "module",
              "desc": "<p>Accessing <code>Object.prototype.__proto__</code> has been forbidden using\n<a href=\"cli.html#--disable-protomode\"><code>--disable-proto=throw</code></a>. <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getPrototypeOf\"><code>Object.getPrototypeOf</code></a> and\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf\"><code>Object.setPrototypeOf</code></a> should be used to get and set the prototype of an\nobject.</p>\n<p><a id=\"ERR_PROXY_INVALID_CONFIG\"></a></p>",
              "displayName": "`ERR_PROTO_ACCESS`"
            },
            {
              "textRaw": "`ERR_PROXY_INVALID_CONFIG`",
              "name": "`err_proxy_invalid_config`",
              "type": "module",
              "desc": "<p>Failed to proxy a request because the proxy configuration is invalid.</p>\n<p><a id=\"ERR_PROXY_TUNNEL\"></a></p>",
              "displayName": "`ERR_PROXY_INVALID_CONFIG`"
            },
            {
              "textRaw": "`ERR_PROXY_TUNNEL`",
              "name": "`err_proxy_tunnel`",
              "type": "module",
              "desc": "<p>Failed to establish proxy tunnel when <code>NODE_USE_ENV_PROXY</code> or <code>--use-env-proxy</code> is enabled.</p>\n<p><a id=\"ERR_QUIC_APPLICATION_ERROR\"></a></p>",
              "displayName": "`ERR_PROXY_TUNNEL`"
            },
            {
              "textRaw": "`ERR_QUIC_APPLICATION_ERROR`",
              "name": "`err_quic_application_error`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>A QUIC application error occurred.</p>\n<p><a id=\"ERR_QUIC_CONNECTION_FAILED\"></a></p>",
              "displayName": "`ERR_QUIC_APPLICATION_ERROR`"
            },
            {
              "textRaw": "`ERR_QUIC_CONNECTION_FAILED`",
              "name": "`err_quic_connection_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Establishing a QUIC connection failed.</p>\n<p><a id=\"ERR_QUIC_ENDPOINT_CLOSED\"></a></p>",
              "displayName": "`ERR_QUIC_CONNECTION_FAILED`"
            },
            {
              "textRaw": "`ERR_QUIC_ENDPOINT_CLOSED`",
              "name": "`err_quic_endpoint_closed`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>A QUIC Endpoint closed with an error.</p>\n<p><a id=\"ERR_QUIC_OPEN_STREAM_FAILED\"></a></p>",
              "displayName": "`ERR_QUIC_ENDPOINT_CLOSED`"
            },
            {
              "textRaw": "`ERR_QUIC_OPEN_STREAM_FAILED`",
              "name": "`err_quic_open_stream_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>Opening a QUIC stream failed.</p>\n<p><a id=\"ERR_QUIC_STREAM_ABORTED\"></a></p>",
              "displayName": "`ERR_QUIC_OPEN_STREAM_FAILED`"
            },
            {
              "textRaw": "`ERR_QUIC_STREAM_ABORTED`",
              "name": "`err_quic_stream_aborted`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.2.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>The Node.js error code for a <a href=\"quic.html#class-quicerror\"><code>QuicError</code></a> thrown to abort a QUIC stream\nor session with an explicit application or transport error code.</p>\n<p><a id=\"ERR_QUIC_STREAM_RESET\"></a></p>",
              "displayName": "`ERR_QUIC_STREAM_ABORTED`"
            },
            {
              "textRaw": "`ERR_QUIC_STREAM_RESET`",
              "name": "`err_quic_stream_reset`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.2.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>A QUIC stream was reset by the peer. The error includes the reset code\nprovided by the peer.</p>\n<p><a id=\"ERR_QUIC_TRANSPORT_ERROR\"></a></p>",
              "displayName": "`ERR_QUIC_STREAM_RESET`"
            },
            {
              "textRaw": "`ERR_QUIC_TRANSPORT_ERROR`",
              "name": "`err_quic_transport_error`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>A QUIC transport error occurred.</p>\n<p><a id=\"ERR_QUIC_VERSION_NEGOTIATION_ERROR\"></a></p>",
              "displayName": "`ERR_QUIC_TRANSPORT_ERROR`"
            },
            {
              "textRaw": "`ERR_QUIC_VERSION_NEGOTIATION_ERROR`",
              "name": "`err_quic_version_negotiation_error`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>A QUIC session failed because version negotiation is required.</p>\n<p><a id=\"ERR_REQUIRE_ASYNC_MODULE\"></a></p>",
              "displayName": "`ERR_QUIC_VERSION_NEGOTIATION_ERROR`"
            },
            {
              "textRaw": "`ERR_REQUIRE_ASYNC_MODULE`",
              "name": "`err_require_async_module`",
              "type": "module",
              "desc": "<p>When trying to <code>require()</code> a <a href=\"esm.html\">ES Module</a>, the module turns out to be asynchronous.\nThat is, it contains top-level await.</p>\n<p>To see where the top-level await is, use\n<code>--experimental-print-required-tla</code> (this would execute the modules\nbefore looking for the top-level awaits).</p>\n<p><a id=\"ERR_REQUIRE_CYCLE_MODULE\"></a></p>",
              "displayName": "`ERR_REQUIRE_ASYNC_MODULE`"
            },
            {
              "textRaw": "`ERR_REQUIRE_CYCLE_MODULE`",
              "name": "`err_require_cycle_module`",
              "type": "module",
              "desc": "<p>When trying to <code>require()</code> a <a href=\"esm.html\">ES Module</a>, a CommonJS to ESM or ESM to CommonJS edge\nparticipates in an immediate cycle.\nThis is not allowed because ES Modules cannot be evaluated while they are\nalready being evaluated.</p>\n<p>To avoid the cycle, the <code>require()</code> call involved in a cycle should not happen\nat the top-level of either an ES Module (via <code>createRequire()</code>) or a CommonJS\nmodule, and should be done lazily in an inner function.</p>\n<p><a id=\"ERR_REQUIRE_ESM\"></a></p>",
              "displayName": "`ERR_REQUIRE_CYCLE_MODULE`"
            },
            {
              "textRaw": "`ERR_REQUIRE_ESM`",
              "name": "`err_require_esm`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v23.0.0",
                      "v22.12.0",
                      "v20.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55085",
                    "description": "require() now supports loading synchronous ES modules by default."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "desc": "<p>An attempt was made to <code>require()</code> an <a href=\"esm.html\">ES Module</a>.</p>\n<p>This error has been deprecated since <code>require()</code> now supports loading synchronous\nES modules. When <code>require()</code> encounters an ES module that contains top-level\n<code>await</code>, it will throw <a href=\"#err_require_async_module\"><code>ERR_REQUIRE_ASYNC_MODULE</code></a> instead.</p>\n<p><a id=\"ERR_REQUIRE_ESM_RACE_CONDITION\"></a></p>",
              "displayName": "`ERR_REQUIRE_ESM`"
            },
            {
              "textRaw": "`ERR_REQUIRE_ESM_RACE_CONDITION`",
              "name": "`err_require_esm_race_condition`",
              "type": "module",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental.",
              "desc": "<p>An attempt was made to <code>require()</code> an <a href=\"esm.html\">ES Module</a> while another <code>import()</code> call\nwas already in progress to load it asynchronously.</p>\n<p><a id=\"ERR_SCRIPT_EXECUTION_INTERRUPTED\"></a></p>",
              "displayName": "`ERR_REQUIRE_ESM_RACE_CONDITION`"
            },
            {
              "textRaw": "`ERR_SCRIPT_EXECUTION_INTERRUPTED`",
              "name": "`err_script_execution_interrupted`",
              "type": "module",
              "desc": "<p>Script execution was interrupted by <code>SIGINT</code> (For\nexample, <kbd>Ctrl</kbd>+<kbd>C</kbd> was pressed.)</p>\n<p><a id=\"ERR_SCRIPT_EXECUTION_TIMEOUT\"></a></p>",
              "displayName": "`ERR_SCRIPT_EXECUTION_INTERRUPTED`"
            },
            {
              "textRaw": "`ERR_SCRIPT_EXECUTION_TIMEOUT`",
              "name": "`err_script_execution_timeout`",
              "type": "module",
              "desc": "<p>Script execution timed out, possibly due to bugs in the script being executed.</p>\n<p><a id=\"ERR_SERVER_ALREADY_LISTEN\"></a></p>",
              "displayName": "`ERR_SCRIPT_EXECUTION_TIMEOUT`"
            },
            {
              "textRaw": "`ERR_SERVER_ALREADY_LISTEN`",
              "name": "`err_server_already_listen`",
              "type": "module",
              "desc": "<p>The <a href=\"net.html#serverlisten\"><code>server.listen()</code></a> method was called while a <code>net.Server</code> was already\nlistening. This applies to all instances of <code>net.Server</code>, including HTTP, HTTPS,\nand HTTP/2 <code>Server</code> instances.</p>\n<p><a id=\"ERR_SERVER_NOT_RUNNING\"></a></p>",
              "displayName": "`ERR_SERVER_ALREADY_LISTEN`"
            },
            {
              "textRaw": "`ERR_SERVER_NOT_RUNNING`",
              "name": "`err_server_not_running`",
              "type": "module",
              "desc": "<p>The <a href=\"net.html#serverclosecallback\"><code>server.close()</code></a> method was called when a <code>net.Server</code> was not\nrunning. This applies to all instances of <code>net.Server</code>, including HTTP, HTTPS,\nand HTTP/2 <code>Server</code> instances.</p>\n<p><a id=\"ERR_SINGLE_EXECUTABLE_APPLICATION_ASSET_NOT_FOUND\"></a></p>",
              "displayName": "`ERR_SERVER_NOT_RUNNING`"
            },
            {
              "textRaw": "`ERR_SINGLE_EXECUTABLE_APPLICATION_ASSET_NOT_FOUND`",
              "name": "`err_single_executable_application_asset_not_found`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "desc": "<p>A key was passed to single executable application APIs to identify an asset,\nbut no match could be found.</p>\n<p><a id=\"ERR_SOCKET_ALREADY_BOUND\"></a></p>",
              "displayName": "`ERR_SINGLE_EXECUTABLE_APPLICATION_ASSET_NOT_FOUND`"
            },
            {
              "textRaw": "`ERR_SOCKET_ALREADY_BOUND`",
              "name": "`err_socket_already_bound`",
              "type": "module",
              "desc": "<p>An attempt was made to bind a socket that has already been bound.</p>\n<p><a id=\"ERR_SOCKET_BAD_BUFFER_SIZE\"></a></p>",
              "displayName": "`ERR_SOCKET_ALREADY_BOUND`"
            },
            {
              "textRaw": "`ERR_SOCKET_BAD_BUFFER_SIZE`",
              "name": "`err_socket_bad_buffer_size`",
              "type": "module",
              "desc": "<p>An invalid (negative) size was passed for either the <code>recvBufferSize</code> or\n<code>sendBufferSize</code> options in <a href=\"dgram.html#dgramcreatesocketoptions-callback\"><code>dgram.createSocket()</code></a>.</p>\n<p><a id=\"ERR_SOCKET_BAD_PORT\"></a></p>",
              "displayName": "`ERR_SOCKET_BAD_BUFFER_SIZE`"
            },
            {
              "textRaw": "`ERR_SOCKET_BAD_PORT`",
              "name": "`err_socket_bad_port`",
              "type": "module",
              "desc": "<p>An API function expecting a port >= 0 and &#x3C; 65536 received an invalid value.</p>\n<p><a id=\"ERR_SOCKET_BAD_TYPE\"></a></p>",
              "displayName": "`ERR_SOCKET_BAD_PORT`"
            },
            {
              "textRaw": "`ERR_SOCKET_BAD_TYPE`",
              "name": "`err_socket_bad_type`",
              "type": "module",
              "desc": "<p>An API function expecting a socket type (<code>udp4</code> or <code>udp6</code>) received an invalid\nvalue.</p>\n<p><a id=\"ERR_SOCKET_BUFFER_SIZE\"></a></p>",
              "displayName": "`ERR_SOCKET_BAD_TYPE`"
            },
            {
              "textRaw": "`ERR_SOCKET_BUFFER_SIZE`",
              "name": "`err_socket_buffer_size`",
              "type": "module",
              "desc": "<p>While using <a href=\"dgram.html#dgramcreatesocketoptions-callback\"><code>dgram.createSocket()</code></a>, the size of the receive or send <code>Buffer</code>\ncould not be determined.</p>\n<p><a id=\"ERR_SOCKET_CLOSED\"></a></p>",
              "displayName": "`ERR_SOCKET_BUFFER_SIZE`"
            },
            {
              "textRaw": "`ERR_SOCKET_CLOSED`",
              "name": "`err_socket_closed`",
              "type": "module",
              "desc": "<p>An attempt was made to operate on an already closed socket.</p>\n<p><a id=\"ERR_SOCKET_CLOSED_BEFORE_CONNECTION\"></a></p>",
              "displayName": "`ERR_SOCKET_CLOSED`"
            },
            {
              "textRaw": "`ERR_SOCKET_CLOSED_BEFORE_CONNECTION`",
              "name": "`err_socket_closed_before_connection`",
              "type": "module",
              "desc": "<p>When calling <a href=\"net.html#socketwritedata-encoding-callback\"><code>net.Socket.write()</code></a> on a connecting socket and the socket was\nclosed before the connection was established.</p>\n<p><a id=\"ERR_SOCKET_CONNECTION_TIMEOUT\"></a></p>",
              "displayName": "`ERR_SOCKET_CLOSED_BEFORE_CONNECTION`"
            },
            {
              "textRaw": "`ERR_SOCKET_CONNECTION_TIMEOUT`",
              "name": "`err_socket_connection_timeout`",
              "type": "module",
              "desc": "<p>The socket was unable to connect to any address returned by the DNS within the\nallowed timeout when using the family autoselection algorithm.</p>\n<p><a id=\"ERR_SOCKET_DGRAM_IS_CONNECTED\"></a></p>",
              "displayName": "`ERR_SOCKET_CONNECTION_TIMEOUT`"
            },
            {
              "textRaw": "`ERR_SOCKET_DGRAM_IS_CONNECTED`",
              "name": "`err_socket_dgram_is_connected`",
              "type": "module",
              "desc": "<p>A <a href=\"dgram.html#socketconnectport-address-callback\"><code>dgram.connect()</code></a> call was made on an already connected socket.</p>\n<p><a id=\"ERR_SOCKET_DGRAM_NOT_CONNECTED\"></a></p>",
              "displayName": "`ERR_SOCKET_DGRAM_IS_CONNECTED`"
            },
            {
              "textRaw": "`ERR_SOCKET_DGRAM_NOT_CONNECTED`",
              "name": "`err_socket_dgram_not_connected`",
              "type": "module",
              "desc": "<p>A <a href=\"dgram.html#socketdisconnect\"><code>dgram.disconnect()</code></a> or <a href=\"dgram.html#socketremoteaddress\"><code>dgram.remoteAddress()</code></a> call was made on a\ndisconnected socket.</p>\n<p><a id=\"ERR_SOCKET_DGRAM_NOT_RUNNING\"></a></p>",
              "displayName": "`ERR_SOCKET_DGRAM_NOT_CONNECTED`"
            },
            {
              "textRaw": "`ERR_SOCKET_DGRAM_NOT_RUNNING`",
              "name": "`err_socket_dgram_not_running`",
              "type": "module",
              "desc": "<p>A call was made and the UDP subsystem was not running.</p>\n<p><a id=\"ERR_SOURCE_MAP_CORRUPT\"></a></p>",
              "displayName": "`ERR_SOCKET_DGRAM_NOT_RUNNING`"
            },
            {
              "textRaw": "`ERR_SOURCE_MAP_CORRUPT`",
              "name": "`err_source_map_corrupt`",
              "type": "module",
              "desc": "<p>The source map could not be parsed because it does not exist, or is corrupt.</p>\n<p><a id=\"ERR_SOURCE_MAP_MISSING_SOURCE\"></a></p>",
              "displayName": "`ERR_SOURCE_MAP_CORRUPT`"
            },
            {
              "textRaw": "`ERR_SOURCE_MAP_MISSING_SOURCE`",
              "name": "`err_source_map_missing_source`",
              "type": "module",
              "desc": "<p>A file imported from a source map was not found.</p>\n<p><a id=\"ERR_SOURCE_PHASE_NOT_DEFINED\"></a></p>",
              "displayName": "`ERR_SOURCE_MAP_MISSING_SOURCE`"
            },
            {
              "textRaw": "`ERR_SOURCE_PHASE_NOT_DEFINED`",
              "name": "`err_source_phase_not_defined`",
              "type": "module",
              "meta": {
                "added": [
                  "v24.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The provided module import does not provide a source phase imports representation for source phase\nimport syntax <code>import source x from 'x'</code> or <code>import.source(x)</code>.</p>\n<p><a id=\"ERR_SQLITE_ERROR\"></a></p>",
              "displayName": "`ERR_SOURCE_PHASE_NOT_DEFINED`"
            },
            {
              "textRaw": "`ERR_SQLITE_ERROR`",
              "name": "`err_sqlite_error`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "desc": "<p>An error was returned from <a href=\"sqlite.html\">SQLite</a>.</p>\n<p><a id=\"ERR_SRI_PARSE\"></a></p>",
              "displayName": "`ERR_SQLITE_ERROR`"
            },
            {
              "textRaw": "`ERR_SRI_PARSE`",
              "name": "`err_sri_parse`",
              "type": "module",
              "desc": "<p>A string was provided for a Subresource Integrity check, but was unable to be\nparsed. Check the format of integrity attributes by looking at the\n<a href=\"https://www.w3.org/TR/SRI/#the-integrity-attribute\">Subresource Integrity specification</a>.</p>\n<p><a id=\"ERR_STREAM_ALREADY_FINISHED\"></a></p>",
              "displayName": "`ERR_SRI_PARSE`"
            },
            {
              "textRaw": "`ERR_STREAM_ALREADY_FINISHED`",
              "name": "`err_stream_already_finished`",
              "type": "module",
              "desc": "<p>A stream method was called that cannot complete because the stream was\nfinished.</p>\n<p><a id=\"ERR_STREAM_CANNOT_PIPE\"></a></p>",
              "displayName": "`ERR_STREAM_ALREADY_FINISHED`"
            },
            {
              "textRaw": "`ERR_STREAM_CANNOT_PIPE`",
              "name": "`err_stream_cannot_pipe`",
              "type": "module",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#readablepipedestination-options\"><code>stream.pipe()</code></a> on a <a href=\"stream.html#class-streamwritable\"><code>Writable</code></a> stream.</p>\n<p><a id=\"ERR_STREAM_DESTROYED\"></a></p>",
              "displayName": "`ERR_STREAM_CANNOT_PIPE`"
            },
            {
              "textRaw": "`ERR_STREAM_DESTROYED`",
              "name": "`err_stream_destroyed`",
              "type": "module",
              "desc": "<p>A stream method was called that cannot complete because the stream was\ndestroyed using <code>stream.destroy()</code>.</p>\n<p><a id=\"ERR_STREAM_ITER_MISSING_FLAG\"></a></p>",
              "displayName": "`ERR_STREAM_DESTROYED`"
            },
            {
              "textRaw": "`ERR_STREAM_ITER_MISSING_FLAG`",
              "name": "`err_stream_iter_missing_flag`",
              "type": "module",
              "desc": "<p>A stream/iter API was used without the <code>--experimental-stream-iter</code> CLI flag\nenabled.</p>\n<p><a id=\"ERR_STREAM_NULL_VALUES\"></a></p>",
              "displayName": "`ERR_STREAM_ITER_MISSING_FLAG`"
            },
            {
              "textRaw": "`ERR_STREAM_NULL_VALUES`",
              "name": "`err_stream_null_values`",
              "type": "module",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#writablewritechunk-encoding-callback\"><code>stream.write()</code></a> with a <code>null</code> chunk.</p>\n<p><a id=\"ERR_STREAM_PREMATURE_CLOSE\"></a></p>",
              "displayName": "`ERR_STREAM_NULL_VALUES`"
            },
            {
              "textRaw": "`ERR_STREAM_PREMATURE_CLOSE`",
              "name": "`err_stream_premature_close`",
              "type": "module",
              "desc": "<p>An error returned by <code>stream.finished()</code> and <code>stream.pipeline()</code>, when a stream\nor a pipeline ends non gracefully with no explicit error.</p>\n<p><a id=\"ERR_STREAM_PUSH_AFTER_EOF\"></a></p>",
              "displayName": "`ERR_STREAM_PREMATURE_CLOSE`"
            },
            {
              "textRaw": "`ERR_STREAM_PUSH_AFTER_EOF`",
              "name": "`err_stream_push_after_eof`",
              "type": "module",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#readablepushchunk-encoding\"><code>stream.push()</code></a> after a <code>null</code>(EOF) had been\npushed to the stream.</p>\n<p><a id=\"ERR_STREAM_UNABLE_TO_PIPE\"></a></p>",
              "displayName": "`ERR_STREAM_PUSH_AFTER_EOF`"
            },
            {
              "textRaw": "`ERR_STREAM_UNABLE_TO_PIPE`",
              "name": "`err_stream_unable_to_pipe`",
              "type": "module",
              "desc": "<p>An attempt was made to pipe to a closed or destroyed stream in a pipeline.</p>\n<p><a id=\"ERR_STREAM_UNSHIFT_AFTER_END_EVENT\"></a></p>",
              "displayName": "`ERR_STREAM_UNABLE_TO_PIPE`"
            },
            {
              "textRaw": "`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`",
              "name": "`err_stream_unshift_after_end_event`",
              "type": "module",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#readableunshiftchunk-encoding\"><code>stream.unshift()</code></a> after the <code>'end'</code> event was\nemitted.</p>\n<p><a id=\"ERR_STREAM_WRAP\"></a></p>",
              "displayName": "`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`"
            },
            {
              "textRaw": "`ERR_STREAM_WRAP`",
              "name": "`err_stream_wrap`",
              "type": "module",
              "desc": "<p>Prevents an abort if a string decoder was set on the Socket or if the decoder\nis in <code>objectMode</code>.</p>\n<pre><code class=\"language-js\">const Socket = require('node:net').Socket;\nconst instance = new Socket();\n\ninstance.setEncoding('utf8');\n</code></pre>\n<p><a id=\"ERR_STREAM_WRITE_AFTER_END\"></a></p>",
              "displayName": "`ERR_STREAM_WRAP`"
            },
            {
              "textRaw": "`ERR_STREAM_WRITE_AFTER_END`",
              "name": "`err_stream_write_after_end`",
              "type": "module",
              "desc": "<p>An attempt was made to call <a href=\"stream.html#writablewritechunk-encoding-callback\"><code>stream.write()</code></a> after <code>stream.end()</code> has been\ncalled.</p>\n<p><a id=\"ERR_STRING_TOO_LONG\"></a></p>",
              "displayName": "`ERR_STREAM_WRITE_AFTER_END`"
            },
            {
              "textRaw": "`ERR_STRING_TOO_LONG`",
              "name": "`err_string_too_long`",
              "type": "module",
              "desc": "<p>An attempt has been made to create a string longer than the maximum allowed\nlength.</p>\n<p><a id=\"ERR_SYNTHETIC\"></a></p>",
              "displayName": "`ERR_STRING_TOO_LONG`"
            },
            {
              "textRaw": "`ERR_SYNTHETIC`",
              "name": "`err_synthetic`",
              "type": "module",
              "desc": "<p>An artificial error object used to capture the call stack for diagnostic\nreports.</p>\n<p><a id=\"ERR_SYSTEM_ERROR\"></a></p>",
              "displayName": "`ERR_SYNTHETIC`"
            },
            {
              "textRaw": "`ERR_SYSTEM_ERROR`",
              "name": "`err_system_error`",
              "type": "module",
              "desc": "<p>An unspecified or non-specific system error has occurred within the Node.js\nprocess. The error object will have an <code>err.info</code> object property with\nadditional details.</p>\n<p><a id=\"ERR_TEST_FAILURE\"></a></p>",
              "displayName": "`ERR_SYSTEM_ERROR`"
            },
            {
              "textRaw": "`ERR_TEST_FAILURE`",
              "name": "`err_test_failure`",
              "type": "module",
              "desc": "<p>This error represents a failed test. Additional information about the failure\nis available via the <code>cause</code> property. The <code>failureType</code> property specifies\nwhat the test was doing when the failure occurred.</p>\n<p><a id=\"ERR_TLS_ALPN_CALLBACK_INVALID_RESULT\"></a></p>",
              "displayName": "`ERR_TEST_FAILURE`"
            },
            {
              "textRaw": "`ERR_TLS_ALPN_CALLBACK_INVALID_RESULT`",
              "name": "`err_tls_alpn_callback_invalid_result`",
              "type": "module",
              "desc": "<p>This error is thrown when an <code>ALPNCallback</code> returns a value that is not in the\nlist of ALPN protocols offered by the client.</p>\n<p><a id=\"ERR_TLS_ALPN_CALLBACK_WITH_PROTOCOLS\"></a></p>",
              "displayName": "`ERR_TLS_ALPN_CALLBACK_INVALID_RESULT`"
            },
            {
              "textRaw": "`ERR_TLS_ALPN_CALLBACK_WITH_PROTOCOLS`",
              "name": "`err_tls_alpn_callback_with_protocols`",
              "type": "module",
              "desc": "<p>This error is thrown when creating a <code>TLSServer</code> if the TLS options include\nboth <code>ALPNProtocols</code> and <code>ALPNCallback</code>. These options are mutually exclusive.</p>\n<p><a id=\"ERR_TLS_CERT_ALTNAME_FORMAT\"></a></p>",
              "displayName": "`ERR_TLS_ALPN_CALLBACK_WITH_PROTOCOLS`"
            },
            {
              "textRaw": "`ERR_TLS_CERT_ALTNAME_FORMAT`",
              "name": "`err_tls_cert_altname_format`",
              "type": "module",
              "desc": "<p>This error is thrown by <code>checkServerIdentity</code> if a user-supplied\n<code>subjectaltname</code> property violates encoding rules. Certificate objects produced\nby Node.js itself always comply with encoding rules and will never cause\nthis error.</p>\n<p><a id=\"ERR_TLS_CERT_ALTNAME_INVALID\"></a></p>",
              "displayName": "`ERR_TLS_CERT_ALTNAME_FORMAT`"
            },
            {
              "textRaw": "`ERR_TLS_CERT_ALTNAME_INVALID`",
              "name": "`err_tls_cert_altname_invalid`",
              "type": "module",
              "desc": "<p>While using TLS, the host name/IP of the peer did not match any of the\n<code>subjectAltNames</code> in its certificate.</p>\n<p><a id=\"ERR_TLS_DH_PARAM_SIZE\"></a></p>",
              "displayName": "`ERR_TLS_CERT_ALTNAME_INVALID`"
            },
            {
              "textRaw": "`ERR_TLS_DH_PARAM_SIZE`",
              "name": "`err_tls_dh_param_size`",
              "type": "module",
              "desc": "<p>While using TLS, the parameter offered for the Diffie-Hellman (<code>DH</code>)\nkey-agreement protocol is too small. By default, the key length must be greater\nthan or equal to 1024 bits to avoid vulnerabilities, even though it is strongly\nrecommended to use 2048 bits or larger for stronger security.</p>\n<p><a id=\"ERR_TLS_HANDSHAKE_TIMEOUT\"></a></p>",
              "displayName": "`ERR_TLS_DH_PARAM_SIZE`"
            },
            {
              "textRaw": "`ERR_TLS_HANDSHAKE_TIMEOUT`",
              "name": "`err_tls_handshake_timeout`",
              "type": "module",
              "desc": "<p>A TLS/SSL handshake timed out. In this case, the server must also abort the\nconnection.</p>\n<p><a id=\"ERR_TLS_INVALID_CONTEXT\"></a></p>",
              "displayName": "`ERR_TLS_HANDSHAKE_TIMEOUT`"
            },
            {
              "textRaw": "`ERR_TLS_INVALID_CONTEXT`",
              "name": "`err_tls_invalid_context`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.3.0"
                ],
                "changes": []
              },
              "desc": "<p>The context must be a <code>SecureContext</code>.</p>\n<p><a id=\"ERR_TLS_INVALID_PROTOCOL_METHOD\"></a></p>",
              "displayName": "`ERR_TLS_INVALID_CONTEXT`"
            },
            {
              "textRaw": "`ERR_TLS_INVALID_PROTOCOL_METHOD`",
              "name": "`err_tls_invalid_protocol_method`",
              "type": "module",
              "desc": "<p>The specified <code>secureProtocol</code> method is invalid. It is either unknown, or\ndisabled because it is insecure.</p>\n<p><a id=\"ERR_TLS_INVALID_PROTOCOL_VERSION\"></a></p>",
              "displayName": "`ERR_TLS_INVALID_PROTOCOL_METHOD`"
            },
            {
              "textRaw": "`ERR_TLS_INVALID_PROTOCOL_VERSION`",
              "name": "`err_tls_invalid_protocol_version`",
              "type": "module",
              "desc": "<p>Valid TLS protocol versions are <code>'TLSv1'</code>, <code>'TLSv1.1'</code>, or <code>'TLSv1.2'</code>.</p>\n<p><a id=\"ERR_TLS_INVALID_STATE\"></a></p>",
              "displayName": "`ERR_TLS_INVALID_PROTOCOL_VERSION`"
            },
            {
              "textRaw": "`ERR_TLS_INVALID_STATE`",
              "name": "`err_tls_invalid_state`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.10.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>The TLS socket must be connected and securely established. Ensure the 'secure'\nevent is emitted before continuing.</p>\n<p><a id=\"ERR_TLS_PROTOCOL_VERSION_CONFLICT\"></a></p>",
              "displayName": "`ERR_TLS_INVALID_STATE`"
            },
            {
              "textRaw": "`ERR_TLS_PROTOCOL_VERSION_CONFLICT`",
              "name": "`err_tls_protocol_version_conflict`",
              "type": "module",
              "desc": "<p>Attempting to set a TLS protocol <code>minVersion</code> or <code>maxVersion</code> conflicts with an\nattempt to set the <code>secureProtocol</code> explicitly. Use one mechanism or the other.</p>\n<p><a id=\"ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED\"></a></p>",
              "displayName": "`ERR_TLS_PROTOCOL_VERSION_CONFLICT`"
            },
            {
              "textRaw": "`ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED`",
              "name": "`err_tls_psk_set_identity_hint_failed`",
              "type": "module",
              "desc": "<p>Failed to set PSK identity hint. Hint may be too long.</p>\n<p><a id=\"ERR_TLS_RENEGOTIATION_DISABLED\"></a></p>",
              "displayName": "`ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED`"
            },
            {
              "textRaw": "`ERR_TLS_RENEGOTIATION_DISABLED`",
              "name": "`err_tls_renegotiation_disabled`",
              "type": "module",
              "desc": "<p>An attempt was made to renegotiate TLS on a socket instance with renegotiation\ndisabled.</p>\n<p><a id=\"ERR_TLS_RENEGOTIATION_UNSUPPORTED\"></a></p>",
              "displayName": "`ERR_TLS_RENEGOTIATION_DISABLED`"
            },
            {
              "textRaw": "`ERR_TLS_RENEGOTIATION_UNSUPPORTED`",
              "name": "`err_tls_renegotiation_unsupported`",
              "type": "module",
              "desc": "<p>An attempt was made to renegotiate TLS, but the TLS implementation does not\nsupport caller-initiated renegotiation.</p>\n<p><a id=\"ERR_TLS_REQUIRED_SERVER_NAME\"></a></p>",
              "displayName": "`ERR_TLS_RENEGOTIATION_UNSUPPORTED`"
            },
            {
              "textRaw": "`ERR_TLS_REQUIRED_SERVER_NAME`",
              "name": "`err_tls_required_server_name`",
              "type": "module",
              "desc": "<p>While using TLS, the <code>server.addContext()</code> method was called without providing\na host name in the first parameter.</p>\n<p><a id=\"ERR_TLS_SESSION_ATTACK\"></a></p>",
              "displayName": "`ERR_TLS_REQUIRED_SERVER_NAME`"
            },
            {
              "textRaw": "`ERR_TLS_SESSION_ATTACK`",
              "name": "`err_tls_session_attack`",
              "type": "module",
              "desc": "<p>An excessive amount of TLS renegotiations is detected, which is a potential\nvector for denial-of-service attacks.</p>\n<p><a id=\"ERR_TLS_SNI_FROM_SERVER\"></a></p>",
              "displayName": "`ERR_TLS_SESSION_ATTACK`"
            },
            {
              "textRaw": "`ERR_TLS_SNI_FROM_SERVER`",
              "name": "`err_tls_sni_from_server`",
              "type": "module",
              "desc": "<p>An attempt was made to issue Server Name Indication from a TLS server-side\nsocket, which is only valid from a client.</p>\n<p><a id=\"ERR_TRACE_EVENTS_CATEGORY_REQUIRED\"></a></p>",
              "displayName": "`ERR_TLS_SNI_FROM_SERVER`"
            },
            {
              "textRaw": "`ERR_TRACE_EVENTS_CATEGORY_REQUIRED`",
              "name": "`err_trace_events_category_required`",
              "type": "module",
              "desc": "<p>The <code>trace_events.createTracing()</code> method requires at least one trace event\ncategory.</p>\n<p><a id=\"ERR_TRACE_EVENTS_UNAVAILABLE\"></a></p>",
              "displayName": "`ERR_TRACE_EVENTS_CATEGORY_REQUIRED`"
            },
            {
              "textRaw": "`ERR_TRACE_EVENTS_UNAVAILABLE`",
              "name": "`err_trace_events_unavailable`",
              "type": "module",
              "desc": "<p>The <code>node:trace_events</code> module could not be loaded because Node.js was compiled\nwith the <code>--without-v8-platform</code> flag.</p>\n<p><a id=\"ERR_TRAILING_JUNK_AFTER_STREAM_END\"></a></p>",
              "displayName": "`ERR_TRACE_EVENTS_UNAVAILABLE`"
            },
            {
              "textRaw": "`ERR_TRAILING_JUNK_AFTER_STREAM_END`",
              "name": "`err_trailing_junk_after_stream_end`",
              "type": "module",
              "desc": "<p>Trailing junk found after the end of the compressed stream.\nThis error is thrown when extra, unexpected data is detected\nafter the end of a compressed stream (for example, in zlib\nor gzip decompression).</p>\n<p><a id=\"ERR_TRANSFORM_ALREADY_TRANSFORMING\"></a></p>",
              "displayName": "`ERR_TRAILING_JUNK_AFTER_STREAM_END`"
            },
            {
              "textRaw": "`ERR_TRANSFORM_ALREADY_TRANSFORMING`",
              "name": "`err_transform_already_transforming`",
              "type": "module",
              "desc": "<p>A <code>Transform</code> stream finished while it was still transforming.</p>\n<p><a id=\"ERR_TRANSFORM_WITH_LENGTH_0\"></a></p>",
              "displayName": "`ERR_TRANSFORM_ALREADY_TRANSFORMING`"
            },
            {
              "textRaw": "`ERR_TRANSFORM_WITH_LENGTH_0`",
              "name": "`err_transform_with_length_0`",
              "type": "module",
              "desc": "<p>A <code>Transform</code> stream finished with data still in the write buffer.</p>\n<p><a id=\"ERR_TTY_INIT_FAILED\"></a></p>",
              "displayName": "`ERR_TRANSFORM_WITH_LENGTH_0`"
            },
            {
              "textRaw": "`ERR_TTY_INIT_FAILED`",
              "name": "`err_tty_init_failed`",
              "type": "module",
              "desc": "<p>The initialization of a TTY failed due to a system error.</p>\n<p><a id=\"ERR_UNAVAILABLE_DURING_EXIT\"></a></p>",
              "displayName": "`ERR_TTY_INIT_FAILED`"
            },
            {
              "textRaw": "`ERR_UNAVAILABLE_DURING_EXIT`",
              "name": "`err_unavailable_during_exit`",
              "type": "module",
              "desc": "<p>Function was called within a <a href=\"process.html#event-exit\"><code>process.on('exit')</code></a> handler that shouldn't be\ncalled within <a href=\"process.html#event-exit\"><code>process.on('exit')</code></a> handler.</p>\n<p><a id=\"ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET\"></a></p>",
              "displayName": "`ERR_UNAVAILABLE_DURING_EXIT`"
            },
            {
              "textRaw": "`ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET`",
              "name": "`err_uncaught_exception_capture_already_set`",
              "type": "module",
              "desc": "<p><a href=\"process.html#processsetuncaughtexceptioncapturecallbackfn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> was called twice,\nwithout first resetting the callback to <code>null</code>.</p>\n<p>This error is designed to prevent accidentally overwriting a callback registered\nfrom another module.</p>\n<p><a id=\"ERR_UNESCAPED_CHARACTERS\"></a></p>",
              "displayName": "`ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET`"
            },
            {
              "textRaw": "`ERR_UNESCAPED_CHARACTERS`",
              "name": "`err_unescaped_characters`",
              "type": "module",
              "desc": "<p>A string that contained unescaped characters was received.</p>\n<p><a id=\"ERR_UNHANDLED_ERROR\"></a></p>",
              "displayName": "`ERR_UNESCAPED_CHARACTERS`"
            },
            {
              "textRaw": "`ERR_UNHANDLED_ERROR`",
              "name": "`err_unhandled_error`",
              "type": "module",
              "desc": "<p>An unhandled error occurred (for instance, when an <code>'error'</code> event is emitted\nby an <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a> but an <code>'error'</code> handler is not registered).</p>\n<p><a id=\"ERR_UNKNOWN_BUILTIN_MODULE\"></a></p>",
              "displayName": "`ERR_UNHANDLED_ERROR`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_BUILTIN_MODULE`",
              "name": "`err_unknown_builtin_module`",
              "type": "module",
              "desc": "<p>Used to identify a specific kind of internal Node.js error that should not\ntypically be triggered by user code. Instances of this error point to an\ninternal bug within the Node.js binary itself.</p>\n<p><a id=\"ERR_UNKNOWN_CREDENTIAL\"></a></p>",
              "displayName": "`ERR_UNKNOWN_BUILTIN_MODULE`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_CREDENTIAL`",
              "name": "`err_unknown_credential`",
              "type": "module",
              "desc": "<p>A Unix group or user identifier that does not exist was passed.</p>\n<p><a id=\"ERR_UNKNOWN_ENCODING\"></a></p>",
              "displayName": "`ERR_UNKNOWN_CREDENTIAL`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_ENCODING`",
              "name": "`err_unknown_encoding`",
              "type": "module",
              "desc": "<p>An invalid or unknown encoding option was passed to an API.</p>\n<p><a id=\"ERR_UNKNOWN_FILE_EXTENSION\"></a></p>",
              "displayName": "`ERR_UNKNOWN_ENCODING`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_FILE_EXTENSION`",
              "name": "`err_unknown_file_extension`",
              "type": "module",
              "desc": "<p>An attempt was made to load a module with an unknown or unsupported file\nextension.</p>\n<p><a id=\"ERR_UNKNOWN_MODULE_FORMAT\"></a></p>",
              "displayName": "`ERR_UNKNOWN_FILE_EXTENSION`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_MODULE_FORMAT`",
              "name": "`err_unknown_module_format`",
              "type": "module",
              "desc": "<p>An attempt was made to load a module with an unknown or unsupported format.</p>\n<p><a id=\"ERR_UNKNOWN_SIGNAL\"></a></p>",
              "displayName": "`ERR_UNKNOWN_MODULE_FORMAT`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_SIGNAL`",
              "name": "`err_unknown_signal`",
              "type": "module",
              "desc": "<p>An invalid or unknown process signal was passed to an API expecting a valid\nsignal (such as <a href=\"child_process.html#subprocesskillsignal\"><code>subprocess.kill()</code></a>).</p>\n<p><a id=\"ERR_UNSUPPORTED_DIR_IMPORT\"></a></p>",
              "displayName": "`ERR_UNKNOWN_SIGNAL`"
            },
            {
              "textRaw": "`ERR_UNSUPPORTED_DIR_IMPORT`",
              "name": "`err_unsupported_dir_import`",
              "type": "module",
              "desc": "<p><code>import</code> a directory URL is unsupported. Instead,\n<a href=\"packages.html#self-referencing-a-package-using-its-name\">self-reference a package using its name</a> and <a href=\"packages.html#subpath-exports\">define a custom subpath</a> in\nthe <a href=\"packages.html#exports\"><code>\"exports\"</code></a> field of the <a href=\"packages.html#nodejs-packagejson-field-definitions\"><code>package.json</code></a> file.</p>\n<pre><code class=\"language-mjs\">import './'; // unsupported\nimport './index.js'; // supported\nimport 'package-name'; // supported\n</code></pre>\n<p><a id=\"ERR_UNSUPPORTED_ESM_URL_SCHEME\"></a></p>",
              "displayName": "`ERR_UNSUPPORTED_DIR_IMPORT`"
            },
            {
              "textRaw": "`ERR_UNSUPPORTED_ESM_URL_SCHEME`",
              "name": "`err_unsupported_esm_url_scheme`",
              "type": "module",
              "desc": "<p><code>import</code> with URL schemes other than <code>file</code> and <code>data</code> is unsupported.</p>\n<p><a id=\"ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING\"></a></p>",
              "displayName": "`ERR_UNSUPPORTED_ESM_URL_SCHEME`"
            },
            {
              "textRaw": "`ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING`",
              "name": "`err_unsupported_node_modules_type_stripping`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Type stripping is not supported for files descendent of a <code>node_modules</code> directory.</p>\n<p><a id=\"ERR_UNSUPPORTED_RESOLVE_REQUEST\"></a></p>",
              "displayName": "`ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING`"
            },
            {
              "textRaw": "`ERR_UNSUPPORTED_RESOLVE_REQUEST`",
              "name": "`err_unsupported_resolve_request`",
              "type": "module",
              "desc": "<p>An attempt was made to resolve an invalid module referrer. This can happen when\nimporting or calling <code>import.meta.resolve()</code> with either:</p>\n<ul>\n<li>a bare specifier that is not a builtin module from a module whose URL scheme\nis not <code>file</code>.</li>\n<li>a <a href=\"https://url.spec.whatwg.org/#relative-url-string\">relative URL</a> from a module whose URL scheme is not a <a href=\"https://url.spec.whatwg.org/#special-scheme\">special scheme</a>.</li>\n</ul>\n<pre><code class=\"language-mjs\">try {\n  // Trying to import the package 'bare-specifier' from a `data:` URL module:\n  await import('data:text/javascript,import \"bare-specifier\"');\n} catch (e) {\n  console.log(e.code); // ERR_UNSUPPORTED_RESOLVE_REQUEST\n}\n</code></pre>\n<p><a id=\"ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX\"></a></p>",
              "displayName": "`ERR_UNSUPPORTED_RESOLVE_REQUEST`"
            },
            {
              "textRaw": "`ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`",
              "name": "`err_unsupported_typescript_syntax`",
              "type": "module",
              "meta": {
                "added": [
                  "v23.7.0",
                  "v22.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The provided TypeScript syntax is unsupported.\nThis could happen when using TypeScript syntax that requires\ntransformation with <a href=\"typescript.html#type-stripping\">type-stripping</a>.</p>\n<p><a id=\"ERR_USE_AFTER_CLOSE\"></a></p>",
              "displayName": "`ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX`"
            },
            {
              "textRaw": "`ERR_USE_AFTER_CLOSE`",
              "name": "`err_use_after_close`",
              "type": "module",
              "desc": "<p>An attempt was made to use something that was already closed.</p>\n<p><a id=\"ERR_VALID_PERFORMANCE_ENTRY_TYPE\"></a></p>",
              "displayName": "`ERR_USE_AFTER_CLOSE`"
            },
            {
              "textRaw": "`ERR_VALID_PERFORMANCE_ENTRY_TYPE`",
              "name": "`err_valid_performance_entry_type`",
              "type": "module",
              "desc": "<p>While using the Performance Timing API (<code>perf_hooks</code>), no valid performance\nentry types are found.</p>\n<p><a id=\"ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING\"></a></p>",
              "displayName": "`ERR_VALID_PERFORMANCE_ENTRY_TYPE`"
            },
            {
              "textRaw": "`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`",
              "name": "`err_vm_dynamic_import_callback_missing`",
              "type": "module",
              "desc": "<p>A dynamic import callback was not specified.</p>\n<p><a id=\"ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG\"></a></p>",
              "displayName": "`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING`"
            },
            {
              "textRaw": "`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`",
              "name": "`err_vm_dynamic_import_callback_missing_flag`",
              "type": "module",
              "desc": "<p>A dynamic import callback was invoked without <code>--experimental-vm-modules</code>.</p>\n<p><a id=\"ERR_VM_MODULE_ALREADY_LINKED\"></a></p>",
              "displayName": "`ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_ALREADY_LINKED`",
              "name": "`err_vm_module_already_linked`",
              "type": "module",
              "desc": "<p>The module attempted to be linked is not eligible for linking, because of one of\nthe following reasons:</p>\n<ul>\n<li>It has already been linked (<code>linkingStatus</code> is <code>'linked'</code>)</li>\n<li>It is being linked (<code>linkingStatus</code> is <code>'linking'</code>)</li>\n<li>Linking has failed for this module (<code>linkingStatus</code> is <code>'errored'</code>)</li>\n</ul>\n<p><a id=\"ERR_VM_MODULE_CACHED_DATA_REJECTED\"></a></p>",
              "displayName": "`ERR_VM_MODULE_ALREADY_LINKED`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_CACHED_DATA_REJECTED`",
              "name": "`err_vm_module_cached_data_rejected`",
              "type": "module",
              "desc": "<p>The <code>cachedData</code> option passed to a module constructor is invalid.</p>\n<p><a id=\"ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA\"></a></p>",
              "displayName": "`ERR_VM_MODULE_CACHED_DATA_REJECTED`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA`",
              "name": "`err_vm_module_cannot_create_cached_data`",
              "type": "module",
              "desc": "<p>Cached data cannot be created for modules which have already been evaluated.</p>\n<p><a id=\"ERR_VM_MODULE_DIFFERENT_CONTEXT\"></a></p>",
              "displayName": "`ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_DIFFERENT_CONTEXT`",
              "name": "`err_vm_module_different_context`",
              "type": "module",
              "desc": "<p>The module being returned from the linker function is from a different context\nthan the parent module. Linked modules must share the same context.</p>\n<p><a id=\"ERR_VM_MODULE_LINK_FAILURE\"></a></p>",
              "displayName": "`ERR_VM_MODULE_DIFFERENT_CONTEXT`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_LINK_FAILURE`",
              "name": "`err_vm_module_link_failure`",
              "type": "module",
              "desc": "<p>The module was unable to be linked due to a failure.</p>\n<p><a id=\"ERR_VM_MODULE_NOT_MODULE\"></a></p>",
              "displayName": "`ERR_VM_MODULE_LINK_FAILURE`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_NOT_MODULE`",
              "name": "`err_vm_module_not_module`",
              "type": "module",
              "desc": "<p>The fulfilled value of a linking promise is not a <code>vm.Module</code> object.</p>\n<p><a id=\"ERR_VM_MODULE_STATUS\"></a></p>",
              "displayName": "`ERR_VM_MODULE_NOT_MODULE`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_STATUS`",
              "name": "`err_vm_module_status`",
              "type": "module",
              "desc": "<p>The current module's status does not allow for this operation. The specific\nmeaning of the error depends on the specific function.</p>\n<p><a id=\"ERR_WASI_ALREADY_STARTED\"></a></p>",
              "displayName": "`ERR_VM_MODULE_STATUS`"
            },
            {
              "textRaw": "`ERR_WASI_ALREADY_STARTED`",
              "name": "`err_wasi_already_started`",
              "type": "module",
              "desc": "<p>The WASI instance has already started.</p>\n<p><a id=\"ERR_WASI_NOT_STARTED\"></a></p>",
              "displayName": "`ERR_WASI_ALREADY_STARTED`"
            },
            {
              "textRaw": "`ERR_WASI_NOT_STARTED`",
              "name": "`err_wasi_not_started`",
              "type": "module",
              "desc": "<p>The WASI instance has not been started.</p>\n<p><a id=\"ERR_WEBASSEMBLY_NOT_SUPPORTED\"></a></p>",
              "displayName": "`ERR_WASI_NOT_STARTED`"
            },
            {
              "textRaw": "`ERR_WEBASSEMBLY_NOT_SUPPORTED`",
              "name": "`err_webassembly_not_supported`",
              "type": "module",
              "desc": "<p>A feature requiring WebAssembly was used, but WebAssembly is not supported or\nhas been disabled in the current environment (for example, when running with\n<code>--jitless</code>).</p>\n<p><a id=\"ERR_WEBASSEMBLY_RESPONSE\"></a></p>",
              "displayName": "`ERR_WEBASSEMBLY_NOT_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_WEBASSEMBLY_RESPONSE`",
              "name": "`err_webassembly_response`",
              "type": "module",
              "meta": {
                "added": [
                  "v18.1.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>Response</code> that has been passed to <code>WebAssembly.compileStreaming</code> or to\n<code>WebAssembly.instantiateStreaming</code> is not a valid WebAssembly response.</p>\n<p><a id=\"ERR_WORKER_INIT_FAILED\"></a></p>",
              "displayName": "`ERR_WEBASSEMBLY_RESPONSE`"
            },
            {
              "textRaw": "`ERR_WORKER_INIT_FAILED`",
              "name": "`err_worker_init_failed`",
              "type": "module",
              "desc": "<p>The <code>Worker</code> initialization failed.</p>\n<p><a id=\"ERR_WORKER_INVALID_EXEC_ARGV\"></a></p>",
              "displayName": "`ERR_WORKER_INIT_FAILED`"
            },
            {
              "textRaw": "`ERR_WORKER_INVALID_EXEC_ARGV`",
              "name": "`err_worker_invalid_exec_argv`",
              "type": "module",
              "desc": "<p>The <code>execArgv</code> option passed to the <code>Worker</code> constructor contains\ninvalid flags.</p>\n<p><a id=\"ERR_WORKER_MESSAGING_ERRORED\"></a></p>",
              "displayName": "`ERR_WORKER_INVALID_EXEC_ARGV`"
            },
            {
              "textRaw": "`ERR_WORKER_MESSAGING_ERRORED`",
              "name": "`err_worker_messaging_errored`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>The destination thread threw an error while processing a message sent via <a href=\"worker_threads.html#worker_threadspostmessagetothreadthreadid-value-transferlist-timeout\"><code>postMessageToThread()</code></a>.</p>\n<p><a id=\"ERR_WORKER_MESSAGING_FAILED\"></a></p>",
              "displayName": "`ERR_WORKER_MESSAGING_ERRORED`"
            },
            {
              "textRaw": "`ERR_WORKER_MESSAGING_FAILED`",
              "name": "`err_worker_messaging_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>The thread requested in <a href=\"worker_threads.html#worker_threadspostmessagetothreadthreadid-value-transferlist-timeout\"><code>postMessageToThread()</code></a> is invalid or has no <code>workerMessage</code> listener.</p>\n<p><a id=\"ERR_WORKER_MESSAGING_SAME_THREAD\"></a></p>",
              "displayName": "`ERR_WORKER_MESSAGING_FAILED`"
            },
            {
              "textRaw": "`ERR_WORKER_MESSAGING_SAME_THREAD`",
              "name": "`err_worker_messaging_same_thread`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>The thread id requested in <a href=\"worker_threads.html#worker_threadspostmessagetothreadthreadid-value-transferlist-timeout\"><code>postMessageToThread()</code></a> is the current thread id.</p>\n<p><a id=\"ERR_WORKER_MESSAGING_TIMEOUT\"></a></p>",
              "displayName": "`ERR_WORKER_MESSAGING_SAME_THREAD`"
            },
            {
              "textRaw": "`ERR_WORKER_MESSAGING_TIMEOUT`",
              "name": "`err_worker_messaging_timeout`",
              "type": "module",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>Sending a message via <a href=\"worker_threads.html#worker_threadspostmessagetothreadthreadid-value-transferlist-timeout\"><code>postMessageToThread()</code></a> timed out.</p>\n<p><a id=\"ERR_WORKER_NOT_RUNNING\"></a></p>",
              "displayName": "`ERR_WORKER_MESSAGING_TIMEOUT`"
            },
            {
              "textRaw": "`ERR_WORKER_NOT_RUNNING`",
              "name": "`err_worker_not_running`",
              "type": "module",
              "desc": "<p>An operation failed because the <code>Worker</code> instance is not currently running.</p>\n<p><a id=\"ERR_WORKER_OUT_OF_MEMORY\"></a></p>",
              "displayName": "`ERR_WORKER_NOT_RUNNING`"
            },
            {
              "textRaw": "`ERR_WORKER_OUT_OF_MEMORY`",
              "name": "`err_worker_out_of_memory`",
              "type": "module",
              "desc": "<p>The <code>Worker</code> instance terminated because it reached its memory limit.</p>\n<p><a id=\"ERR_WORKER_PATH\"></a></p>",
              "displayName": "`ERR_WORKER_OUT_OF_MEMORY`"
            },
            {
              "textRaw": "`ERR_WORKER_PATH`",
              "name": "`err_worker_path`",
              "type": "module",
              "desc": "<p>The path for the main script of a worker is neither an absolute path\nnor a relative path starting with <code>./</code> or <code>../</code>.</p>\n<p><a id=\"ERR_WORKER_UNSERIALIZABLE_ERROR\"></a></p>",
              "displayName": "`ERR_WORKER_PATH`"
            },
            {
              "textRaw": "`ERR_WORKER_UNSERIALIZABLE_ERROR`",
              "name": "`err_worker_unserializable_error`",
              "type": "module",
              "desc": "<p>All attempts at serializing an uncaught exception from a worker thread failed.</p>\n<p><a id=\"ERR_WORKER_UNSUPPORTED_OPERATION\"></a></p>",
              "displayName": "`ERR_WORKER_UNSERIALIZABLE_ERROR`"
            },
            {
              "textRaw": "`ERR_WORKER_UNSUPPORTED_OPERATION`",
              "name": "`err_worker_unsupported_operation`",
              "type": "module",
              "desc": "<p>The requested functionality is not supported in worker threads.</p>\n<p><a id=\"ERR_ZLIB_INITIALIZATION_FAILED\"></a></p>",
              "displayName": "`ERR_WORKER_UNSUPPORTED_OPERATION`"
            },
            {
              "textRaw": "`ERR_ZLIB_INITIALIZATION_FAILED`",
              "name": "`err_zlib_initialization_failed`",
              "type": "module",
              "desc": "<p>Creation of a <a href=\"zlib.html\"><code>zlib</code></a> object failed due to incorrect configuration.</p>\n<p><a id=\"ERR_ZSTD_INVALID_PARAM\"></a></p>",
              "displayName": "`ERR_ZLIB_INITIALIZATION_FAILED`"
            },
            {
              "textRaw": "`ERR_ZSTD_INVALID_PARAM`",
              "name": "`err_zstd_invalid_param`",
              "type": "module",
              "desc": "<p>An invalid parameter key was passed during construction of a Zstd stream.</p>\n<p><a id=\"HPE_CHUNK_EXTENSIONS_OVERFLOW\"></a></p>",
              "displayName": "`ERR_ZSTD_INVALID_PARAM`"
            },
            {
              "textRaw": "`HPE_CHUNK_EXTENSIONS_OVERFLOW`",
              "name": "`hpe_chunk_extensions_overflow`",
              "type": "module",
              "meta": {
                "added": [
                  "v21.6.2",
                  "v20.11.1",
                  "v18.19.1"
                ],
                "changes": []
              },
              "desc": "<p>Too much data was received for a chunk extensions. In order to protect against\nmalicious or malconfigured clients, if more than 16 KiB of data is received\nthen an <code>Error</code> with this code will be emitted.</p>\n<p><a id=\"HPE_HEADER_OVERFLOW\"></a></p>",
              "displayName": "`HPE_CHUNK_EXTENSIONS_OVERFLOW`"
            },
            {
              "textRaw": "`HPE_HEADER_OVERFLOW`",
              "name": "`hpe_header_overflow`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v11.4.0",
                      "v10.15.0"
                    ],
                    "commit": "186035243fad247e3955f",
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/143",
                    "description": "Max header size in `http_parser` was set to 8 KiB."
                  }
                ]
              },
              "desc": "<p>Too much HTTP header data was received. In order to protect against malicious or\nmalconfigured clients, if more than <code>maxHeaderSize</code> of HTTP header data is received then\nHTTP parsing will abort without a request or response object being created, and\nan <code>Error</code> with this code will be emitted.</p>\n<p><a id=\"HPE_UNEXPECTED_CONTENT_LENGTH\"></a></p>",
              "displayName": "`HPE_HEADER_OVERFLOW`"
            },
            {
              "textRaw": "`HPE_UNEXPECTED_CONTENT_LENGTH`",
              "name": "`hpe_unexpected_content_length`",
              "type": "module",
              "desc": "<p>Server is sending both a <code>Content-Length</code> header and <code>Transfer-Encoding: chunked</code>.</p>\n<p><code>Transfer-Encoding: chunked</code> allows the server to maintain an HTTP persistent\nconnection for dynamically generated content.\nIn this case, the <code>Content-Length</code> HTTP header cannot be used.</p>\n<p>Use <code>Content-Length</code> or <code>Transfer-Encoding: chunked</code>.</p>\n<p><a id=\"MODULE_NOT_FOUND\"></a></p>",
              "displayName": "`HPE_UNEXPECTED_CONTENT_LENGTH`"
            },
            {
              "textRaw": "`MODULE_NOT_FOUND`",
              "name": "`module_not_found`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25690",
                    "description": "Added `requireStack` property."
                  }
                ]
              },
              "desc": "<p>A module file could not be resolved by the CommonJS modules loader while\nattempting a <a href=\"modules.html#requireid\"><code>require()</code></a> operation or when loading the program entry point.</p>",
              "displayName": "`MODULE_NOT_FOUND`"
            }
          ],
          "displayName": "Node.js error codes"
        },
        {
          "textRaw": "Legacy Node.js error codes",
          "name": "legacy_node.js_error_codes",
          "type": "misc",
          "stability": 0,
          "stabilityText": "Deprecated. These error codes are either inconsistent, or have been removed.",
          "desc": "<p><a id=\"ERR_CANNOT_TRANSFER_OBJECT\"></a></p>",
          "modules": [
            {
              "textRaw": "`ERR_CANNOT_TRANSFER_OBJECT`",
              "name": "`err_cannot_transfer_object`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [],
                "removed": [
                  "v12.5.0"
                ]
              },
              "desc": "<p>The value passed to <code>postMessage()</code> contained an object that is not supported\nfor transferring.</p>\n<p><a id=\"ERR_CPU_USAGE\"></a></p>",
              "displayName": "`ERR_CANNOT_TRANSFER_OBJECT`"
            },
            {
              "textRaw": "`ERR_CPU_USAGE`",
              "name": "`err_cpu_usage`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v15.0.0"
                ]
              },
              "desc": "<p>The native call from <code>process.cpuUsage</code> could not be processed.</p>\n<p><a id=\"ERR_CRYPTO_HASH_DIGEST_NO_UTF16\"></a></p>",
              "displayName": "`ERR_CPU_USAGE`"
            },
            {
              "textRaw": "`ERR_CRYPTO_HASH_DIGEST_NO_UTF16`",
              "name": "`err_crypto_hash_digest_no_utf16`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v12.12.0"
                ]
              },
              "desc": "<p>The UTF-16 encoding was used with <a href=\"crypto.html#hashdigestencoding\"><code>hash.digest()</code></a>. While the\n<code>hash.digest()</code> method does allow an <code>encoding</code> argument to be passed in,\ncausing the method to return a string rather than a <code>Buffer</code>, the UTF-16\nencoding (e.g. <code>ucs</code> or <code>utf16le</code>) is not supported.</p>\n<p><a id=\"ERR_CRYPTO_SCRYPT_INVALID_PARAMETER\"></a></p>",
              "displayName": "`ERR_CRYPTO_HASH_DIGEST_NO_UTF16`"
            },
            {
              "textRaw": "`ERR_CRYPTO_SCRYPT_INVALID_PARAMETER`",
              "name": "`err_crypto_scrypt_invalid_parameter`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v23.0.0"
                ]
              },
              "desc": "<p>An incompatible combination of options was passed to <a href=\"crypto.html#cryptoscryptpassword-salt-keylen-options-callback\"><code>crypto.scrypt()</code></a> or\n<a href=\"crypto.html#cryptoscryptsyncpassword-salt-keylen-options\"><code>crypto.scryptSync()</code></a>. New versions of Node.js use the error code\n<a href=\"#err_incompatible_option_pair\"><code>ERR_INCOMPATIBLE_OPTION_PAIR</code></a> instead, which is consistent with other APIs.</p>\n<p><a id=\"ERR_FS_INVALID_SYMLINK_TYPE\"></a></p>",
              "displayName": "`ERR_CRYPTO_SCRYPT_INVALID_PARAMETER`"
            },
            {
              "textRaw": "`ERR_FS_INVALID_SYMLINK_TYPE`",
              "name": "`err_fs_invalid_symlink_type`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v23.0.0"
                ]
              },
              "desc": "<p>An invalid symlink type was passed to the <a href=\"fs.html#fssymlinktarget-path-type-callback\"><code>fs.symlink()</code></a> or\n<a href=\"fs.html#fssymlinksynctarget-path-type\"><code>fs.symlinkSync()</code></a> methods.</p>\n<p><a id=\"ERR_HTTP2_FRAME_ERROR\"></a></p>",
              "displayName": "`ERR_FS_INVALID_SYMLINK_TYPE`"
            },
            {
              "textRaw": "`ERR_HTTP2_FRAME_ERROR`",
              "name": "`err_http2_frame_error`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when a failure occurs sending an individual frame on the HTTP/2\nsession.</p>\n<p><a id=\"ERR_HTTP2_HEADERS_OBJECT\"></a></p>",
              "displayName": "`ERR_HTTP2_FRAME_ERROR`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADERS_OBJECT`",
              "name": "`err_http2_headers_object`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when an HTTP/2 Headers Object is expected.</p>\n<p><a id=\"ERR_HTTP2_HEADER_REQUIRED\"></a></p>",
              "displayName": "`ERR_HTTP2_HEADERS_OBJECT`"
            },
            {
              "textRaw": "`ERR_HTTP2_HEADER_REQUIRED`",
              "name": "`err_http2_header_required`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when a required header is missing in an HTTP/2 message.</p>\n<p><a id=\"ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND\"></a></p>",
              "displayName": "`ERR_HTTP2_HEADER_REQUIRED`"
            },
            {
              "textRaw": "`ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND`",
              "name": "`err_http2_info_headers_after_respond`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>HTTP/2 informational headers must only be sent <em>prior</em> to calling the\n<code>Http2Stream.prototype.respond()</code> method.</p>\n<p><a id=\"ERR_HTTP2_STREAM_CLOSED\"></a></p>",
              "displayName": "`ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND`"
            },
            {
              "textRaw": "`ERR_HTTP2_STREAM_CLOSED`",
              "name": "`err_http2_stream_closed`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when an action has been performed on an HTTP/2 Stream that has already\nbeen closed.</p>\n<p><a id=\"ERR_HTTP_INVALID_CHAR\"></a></p>",
              "displayName": "`ERR_HTTP2_STREAM_CLOSED`"
            },
            {
              "textRaw": "`ERR_HTTP_INVALID_CHAR`",
              "name": "`err_http_invalid_char`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when an invalid character is found in an HTTP response status message\n(reason phrase).</p>\n<p><a id=\"ERR_IMPORT_ASSERTION_TYPE_FAILED\"></a></p>",
              "displayName": "`ERR_HTTP_INVALID_CHAR`"
            },
            {
              "textRaw": "`ERR_IMPORT_ASSERTION_TYPE_FAILED`",
              "name": "`err_import_assertion_type_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v17.1.0",
                  "v16.14.0"
                ],
                "changes": [],
                "removed": [
                  "v21.1.0"
                ]
              },
              "desc": "<p>An import assertion has failed, preventing the specified module to be imported.</p>\n<p><a id=\"ERR_IMPORT_ASSERTION_TYPE_MISSING\"></a></p>",
              "displayName": "`ERR_IMPORT_ASSERTION_TYPE_FAILED`"
            },
            {
              "textRaw": "`ERR_IMPORT_ASSERTION_TYPE_MISSING`",
              "name": "`err_import_assertion_type_missing`",
              "type": "module",
              "meta": {
                "added": [
                  "v17.1.0",
                  "v16.14.0"
                ],
                "changes": [],
                "removed": [
                  "v21.1.0"
                ]
              },
              "desc": "<p>An import assertion is missing, preventing the specified module to be imported.</p>\n<p><a id=\"ERR_IMPORT_ASSERTION_TYPE_UNSUPPORTED\"></a></p>",
              "displayName": "`ERR_IMPORT_ASSERTION_TYPE_MISSING`"
            },
            {
              "textRaw": "`ERR_IMPORT_ASSERTION_TYPE_UNSUPPORTED`",
              "name": "`err_import_assertion_type_unsupported`",
              "type": "module",
              "meta": {
                "added": [
                  "v17.1.0",
                  "v16.14.0"
                ],
                "changes": [],
                "removed": [
                  "v21.1.0"
                ]
              },
              "desc": "<p>An import attribute is not supported by this version of Node.js.</p>\n<p><a id=\"ERR_INDEX_OUT_OF_RANGE\"></a></p>",
              "displayName": "`ERR_IMPORT_ASSERTION_TYPE_UNSUPPORTED`"
            },
            {
              "textRaw": "`ERR_INDEX_OUT_OF_RANGE`",
              "name": "`err_index_out_of_range`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [],
                "removed": [
                  "v11.0.0"
                ]
              },
              "desc": "<p>A given index was out of the accepted range (e.g. negative offsets).</p>\n<p><a id=\"ERR_INVALID_OPT_VALUE\"></a></p>",
              "displayName": "`ERR_INDEX_OUT_OF_RANGE`"
            },
            {
              "textRaw": "`ERR_INVALID_OPT_VALUE`",
              "name": "`err_invalid_opt_value`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "removed": [
                  "v15.0.0"
                ]
              },
              "desc": "<p>An invalid or unexpected value was passed in an options object.</p>\n<p><a id=\"ERR_INVALID_OPT_VALUE_ENCODING\"></a></p>",
              "displayName": "`ERR_INVALID_OPT_VALUE`"
            },
            {
              "textRaw": "`ERR_INVALID_OPT_VALUE_ENCODING`",
              "name": "`err_invalid_opt_value_encoding`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v15.0.0"
                ]
              },
              "desc": "<p>An invalid or unknown file encoding was passed.</p>\n<p><a id=\"ERR_INVALID_PERFORMANCE_MARK\"></a></p>",
              "displayName": "`ERR_INVALID_OPT_VALUE_ENCODING`"
            },
            {
              "textRaw": "`ERR_INVALID_PERFORMANCE_MARK`",
              "name": "`err_invalid_performance_mark`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [],
                "removed": [
                  "v16.7.0"
                ]
              },
              "desc": "<p>While using the Performance Timing API (<code>perf_hooks</code>), a performance mark is\ninvalid.</p>\n<p><a id=\"ERR_INVALID_TRANSFER_OBJECT\"></a></p>",
              "displayName": "`ERR_INVALID_PERFORMANCE_MARK`"
            },
            {
              "textRaw": "`ERR_INVALID_TRANSFER_OBJECT`",
              "name": "`err_invalid_transfer_object`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v21.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/47839",
                    "description": "A `DOMException` is thrown instead."
                  }
                ],
                "removed": [
                  "v21.0.0"
                ]
              },
              "desc": "<p>An invalid transfer object was passed to <code>postMessage()</code>.</p>\n<p><a id=\"ERR_MANIFEST_ASSERT_INTEGRITY\"></a></p>",
              "displayName": "`ERR_INVALID_TRANSFER_OBJECT`"
            },
            {
              "textRaw": "`ERR_MANIFEST_ASSERT_INTEGRITY`",
              "name": "`err_manifest_assert_integrity`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v22.2.0"
                ]
              },
              "desc": "<p>An attempt was made to load a resource, but the resource did not match the\nintegrity defined by the policy manifest. See the documentation for policy\nmanifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_DEPENDENCY_MISSING\"></a></p>",
              "displayName": "`ERR_MANIFEST_ASSERT_INTEGRITY`"
            },
            {
              "textRaw": "`ERR_MANIFEST_DEPENDENCY_MISSING`",
              "name": "`err_manifest_dependency_missing`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v22.2.0"
                ]
              },
              "desc": "<p>An attempt was made to load a resource, but the resource was not listed as a\ndependency from the location that attempted to load it. See the documentation\nfor policy manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_INTEGRITY_MISMATCH\"></a></p>",
              "displayName": "`ERR_MANIFEST_DEPENDENCY_MISSING`"
            },
            {
              "textRaw": "`ERR_MANIFEST_INTEGRITY_MISMATCH`",
              "name": "`err_manifest_integrity_mismatch`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v22.2.0"
                ]
              },
              "desc": "<p>An attempt was made to load a policy manifest, but the manifest had multiple\nentries for a resource which did not match each other. Update the manifest\nentries to match in order to resolve this error. See the documentation for\npolicy manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_INVALID_RESOURCE_FIELD\"></a></p>",
              "displayName": "`ERR_MANIFEST_INTEGRITY_MISMATCH`"
            },
            {
              "textRaw": "`ERR_MANIFEST_INVALID_RESOURCE_FIELD`",
              "name": "`err_manifest_invalid_resource_field`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v22.2.0"
                ]
              },
              "desc": "<p>A policy manifest resource had an invalid value for one of its fields. Update\nthe manifest entry to match in order to resolve this error. See the\ndocumentation for policy manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_INVALID_SPECIFIER\"></a></p>",
              "displayName": "`ERR_MANIFEST_INVALID_RESOURCE_FIELD`"
            },
            {
              "textRaw": "`ERR_MANIFEST_INVALID_SPECIFIER`",
              "name": "`err_manifest_invalid_specifier`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v22.2.0"
                ]
              },
              "desc": "<p>A policy manifest resource had an invalid value for one of its dependency\nmappings. Update the manifest entry to match to resolve this error. See the\ndocumentation for policy manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_PARSE_POLICY\"></a></p>",
              "displayName": "`ERR_MANIFEST_INVALID_SPECIFIER`"
            },
            {
              "textRaw": "`ERR_MANIFEST_PARSE_POLICY`",
              "name": "`err_manifest_parse_policy`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v22.2.0"
                ]
              },
              "desc": "<p>An attempt was made to load a policy manifest, but the manifest was unable to\nbe parsed. See the documentation for policy manifests for more information.</p>\n<p><a id=\"ERR_MANIFEST_TDZ\"></a></p>",
              "displayName": "`ERR_MANIFEST_PARSE_POLICY`"
            },
            {
              "textRaw": "`ERR_MANIFEST_TDZ`",
              "name": "`err_manifest_tdz`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v22.2.0"
                ]
              },
              "desc": "<p>An attempt was made to read from a policy manifest, but the manifest\ninitialization has not yet taken place. This is likely a bug in Node.js.</p>\n<p><a id=\"ERR_MANIFEST_UNKNOWN_ONERROR\"></a></p>",
              "displayName": "`ERR_MANIFEST_TDZ`"
            },
            {
              "textRaw": "`ERR_MANIFEST_UNKNOWN_ONERROR`",
              "name": "`err_manifest_unknown_onerror`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v22.2.0"
                ]
              },
              "desc": "<p>A policy manifest was loaded, but had an unknown value for its \"onerror\"\nbehavior. See the documentation for policy manifests for more information.</p>\n<p><a id=\"ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST\"></a></p>",
              "displayName": "`ERR_MANIFEST_UNKNOWN_ONERROR`"
            },
            {
              "textRaw": "`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`",
              "name": "`err_missing_message_port_in_transfer_list`",
              "type": "module",
              "meta": {
                "changes": [],
                "removed": [
                  "v15.0.0"
                ]
              },
              "desc": "<p>This error code was replaced by <a href=\"#err_missing_transferable_in_transfer_list\"><code>ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST</code></a>\nin Node.js 15.0.0, because it is no longer accurate as other types of\ntransferable objects also exist now.</p>\n<p><a id=\"ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST\"></a></p>",
              "displayName": "`ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST`"
            },
            {
              "textRaw": "`ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST`",
              "name": "`err_missing_transferable_in_transfer_list`",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v21.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/47839",
                    "description": "A `DOMException` is thrown instead."
                  }
                ],
                "removed": [
                  "v21.0.0"
                ]
              },
              "desc": "<p>An object that needs to be explicitly listed in the <code>transferList</code> argument\nis in the object passed to a <a href=\"worker_threads.html#portpostmessagevalue-transferlist\"><code>postMessage()</code></a> call, but is not provided\nin the <code>transferList</code> for that call. Usually, this is a <code>MessagePort</code>.</p>\n<p>In Node.js versions prior to v15.0.0, the error code being used here was\n<a href=\"#err_missing_message_port_in_transfer_list\"><code>ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST</code></a>. However, the set of\ntransferable object types has been expanded to cover more types than\n<code>MessagePort</code>.</p>\n<p><a id=\"ERR_NAPI_CONS_PROTOTYPE_OBJECT\"></a></p>",
              "displayName": "`ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST`"
            },
            {
              "textRaw": "`ERR_NAPI_CONS_PROTOTYPE_OBJECT`",
              "name": "`err_napi_cons_prototype_object`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used by the <code>Node-API</code> when <code>Constructor.prototype</code> is not an object.</p>\n<p><a id=\"ERR_NAPI_TSFN_START_IDLE_LOOP\"></a></p>",
              "displayName": "`ERR_NAPI_CONS_PROTOTYPE_OBJECT`"
            },
            {
              "textRaw": "`ERR_NAPI_TSFN_START_IDLE_LOOP`",
              "name": "`err_napi_tsfn_start_idle_loop`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0",
                  "v8.16.0"
                ],
                "changes": [],
                "removed": [
                  "v14.2.0",
                  "v12.17.0"
                ]
              },
              "desc": "<p>On the main thread, values are removed from the queue associated with the\nthread-safe function in an idle loop. This error indicates that an error\nhas occurred when attempting to start the loop.</p>\n<p><a id=\"ERR_NAPI_TSFN_STOP_IDLE_LOOP\"></a></p>",
              "displayName": "`ERR_NAPI_TSFN_START_IDLE_LOOP`"
            },
            {
              "textRaw": "`ERR_NAPI_TSFN_STOP_IDLE_LOOP`",
              "name": "`err_napi_tsfn_stop_idle_loop`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.6.0",
                  "v8.16.0"
                ],
                "changes": [],
                "removed": [
                  "v14.2.0",
                  "v12.17.0"
                ]
              },
              "desc": "<p>Once no more items are left in the queue, the idle loop must be suspended. This\nerror indicates that the idle loop has failed to stop.</p>\n<p><a id=\"ERR_NO_LONGER_SUPPORTED\"></a></p>",
              "displayName": "`ERR_NAPI_TSFN_STOP_IDLE_LOOP`"
            },
            {
              "textRaw": "`ERR_NO_LONGER_SUPPORTED`",
              "name": "`err_no_longer_supported`",
              "type": "module",
              "desc": "<p>A Node.js API was called in an unsupported manner, such as\n<code>Buffer.write(string, encoding, offset[, length])</code>.</p>\n<p><a id=\"ERR_OUTOFMEMORY\"></a></p>",
              "displayName": "`ERR_NO_LONGER_SUPPORTED`"
            },
            {
              "textRaw": "`ERR_OUTOFMEMORY`",
              "name": "`err_outofmemory`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used generically to identify that an operation caused an out of memory\ncondition.</p>\n<p><a id=\"ERR_PARSE_HISTORY_DATA\"></a></p>",
              "displayName": "`ERR_OUTOFMEMORY`"
            },
            {
              "textRaw": "`ERR_PARSE_HISTORY_DATA`",
              "name": "`err_parse_history_data`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>The <code>node:repl</code> module was unable to parse data from the REPL history file.</p>\n<p><a id=\"ERR_SOCKET_CANNOT_SEND\"></a></p>",
              "displayName": "`ERR_PARSE_HISTORY_DATA`"
            },
            {
              "textRaw": "`ERR_SOCKET_CANNOT_SEND`",
              "name": "`err_socket_cannot_send`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v14.0.0"
                ]
              },
              "desc": "<p>Data could not be sent on a socket.</p>\n<p><a id=\"ERR_STDERR_CLOSE\"></a></p>",
              "displayName": "`ERR_SOCKET_CANNOT_SEND`"
            },
            {
              "textRaw": "`ERR_STDERR_CLOSE`",
              "name": "`err_stderr_close`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23053",
                    "description": "Rather than emitting an error, `process.stderr.end()` now only closes the stream side but not the underlying resource, making this error obsolete."
                  }
                ],
                "removed": [
                  "v10.12.0"
                ]
              },
              "desc": "<p>An attempt was made to close the <code>process.stderr</code> stream. By design, Node.js\ndoes not allow <code>stdout</code> or <code>stderr</code> streams to be closed by user code.</p>\n<p><a id=\"ERR_STDOUT_CLOSE\"></a></p>",
              "displayName": "`ERR_STDERR_CLOSE`"
            },
            {
              "textRaw": "`ERR_STDOUT_CLOSE`",
              "name": "`err_stdout_close`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v10.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23053",
                    "description": "Rather than emitting an error, `process.stderr.end()` now only closes the stream side but not the underlying resource, making this error obsolete."
                  }
                ],
                "removed": [
                  "v10.12.0"
                ]
              },
              "desc": "<p>An attempt was made to close the <code>process.stdout</code> stream. By design, Node.js\ndoes not allow <code>stdout</code> or <code>stderr</code> streams to be closed by user code.</p>\n<p><a id=\"ERR_STREAM_READ_NOT_IMPLEMENTED\"></a></p>",
              "displayName": "`ERR_STDOUT_CLOSE`"
            },
            {
              "textRaw": "`ERR_STREAM_READ_NOT_IMPLEMENTED`",
              "name": "`err_stream_read_not_implemented`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when an attempt is made to use a readable stream that has not implemented\n<a href=\"stream.html#readable_readsize\"><code>readable._read()</code></a>.</p>\n<p><a id=\"ERR_TAP_LEXER_ERROR\"></a></p>",
              "displayName": "`ERR_STREAM_READ_NOT_IMPLEMENTED`"
            },
            {
              "textRaw": "`ERR_TAP_LEXER_ERROR`",
              "name": "`err_tap_lexer_error`",
              "type": "module",
              "desc": "<p>An error representing a failing lexer state.</p>\n<p><a id=\"ERR_TAP_PARSER_ERROR\"></a></p>",
              "displayName": "`ERR_TAP_LEXER_ERROR`"
            },
            {
              "textRaw": "`ERR_TAP_PARSER_ERROR`",
              "name": "`err_tap_parser_error`",
              "type": "module",
              "desc": "<p>An error representing a failing parser state. Additional information about\nthe token causing the error is available via the <code>cause</code> property.</p>\n<p><a id=\"ERR_TAP_VALIDATION_ERROR\"></a></p>",
              "displayName": "`ERR_TAP_PARSER_ERROR`"
            },
            {
              "textRaw": "`ERR_TAP_VALIDATION_ERROR`",
              "name": "`err_tap_validation_error`",
              "type": "module",
              "desc": "<p>This error represents a failed TAP validation.</p>\n<p><a id=\"ERR_TLS_RENEGOTIATION_FAILED\"></a></p>",
              "displayName": "`ERR_TAP_VALIDATION_ERROR`"
            },
            {
              "textRaw": "`ERR_TLS_RENEGOTIATION_FAILED`",
              "name": "`err_tls_renegotiation_failed`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when a TLS renegotiation request has failed in a non-specific way.</p>\n<p><a id=\"ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER\"></a></p>",
              "displayName": "`ERR_TLS_RENEGOTIATION_FAILED`"
            },
            {
              "textRaw": "`ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER`",
              "name": "`err_transferring_externalized_sharedarraybuffer`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [],
                "removed": [
                  "v14.0.0"
                ]
              },
              "desc": "<p>A <code>SharedArrayBuffer</code> whose memory is not managed by the JavaScript engine\nor by Node.js was encountered during serialization. Such a <code>SharedArrayBuffer</code>\ncannot be serialized.</p>\n<p>This can only happen when native addons create <code>SharedArrayBuffer</code>s in\n\"externalized\" mode, or put existing <code>SharedArrayBuffer</code> into externalized mode.</p>\n<p><a id=\"ERR_UNKNOWN_STDIN_TYPE\"></a></p>",
              "displayName": "`ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_STDIN_TYPE`",
              "name": "`err_unknown_stdin_type`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "removed": [
                  "v11.7.0"
                ]
              },
              "desc": "<p>An attempt was made to launch a Node.js process with an unknown <code>stdin</code> file\ntype. This error is usually an indication of a bug within Node.js itself,\nalthough it is possible for user code to trigger it.</p>\n<p><a id=\"ERR_UNKNOWN_STREAM_TYPE\"></a></p>",
              "displayName": "`ERR_UNKNOWN_STDIN_TYPE`"
            },
            {
              "textRaw": "`ERR_UNKNOWN_STREAM_TYPE`",
              "name": "`err_unknown_stream_type`",
              "type": "module",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [],
                "removed": [
                  "v11.7.0"
                ]
              },
              "desc": "<p>An attempt was made to launch a Node.js process with an unknown <code>stdout</code> or\n<code>stderr</code> file type. This error is usually an indication of a bug within Node.js\nitself, although it is possible for user code to trigger it.</p>\n<p><a id=\"ERR_V8BREAKITERATOR\"></a></p>",
              "displayName": "`ERR_UNKNOWN_STREAM_TYPE`"
            },
            {
              "textRaw": "`ERR_V8BREAKITERATOR`",
              "name": "`err_v8breakiterator`",
              "type": "module",
              "desc": "<p>The V8 <code>BreakIterator</code> API was used but the full ICU data set is not installed.</p>\n<p><a id=\"ERR_VALUE_OUT_OF_RANGE\"></a></p>",
              "displayName": "`ERR_V8BREAKITERATOR`"
            },
            {
              "textRaw": "`ERR_VALUE_OUT_OF_RANGE`",
              "name": "`err_value_out_of_range`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when a given value is out of the accepted range.</p>\n<p><a id=\"ERR_VM_MODULE_LINKING_ERRORED\"></a></p>",
              "displayName": "`ERR_VALUE_OUT_OF_RANGE`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_LINKING_ERRORED`",
              "name": "`err_vm_module_linking_errored`",
              "type": "module",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [],
                "removed": [
                  "v18.1.0",
                  "v16.17.0"
                ]
              },
              "desc": "<p>The linker function returned a module for which linking has failed.</p>\n<p><a id=\"ERR_VM_MODULE_NOT_LINKED\"></a></p>",
              "displayName": "`ERR_VM_MODULE_LINKING_ERRORED`"
            },
            {
              "textRaw": "`ERR_VM_MODULE_NOT_LINKED`",
              "name": "`err_vm_module_not_linked`",
              "type": "module",
              "desc": "<p>The module must be successfully linked before instantiation.</p>\n<p><a id=\"ERR_WORKER_UNSUPPORTED_EXTENSION\"></a></p>",
              "displayName": "`ERR_VM_MODULE_NOT_LINKED`"
            },
            {
              "textRaw": "`ERR_WORKER_UNSUPPORTED_EXTENSION`",
              "name": "`err_worker_unsupported_extension`",
              "type": "module",
              "meta": {
                "added": [
                  "v11.0.0"
                ],
                "changes": [],
                "removed": [
                  "v16.9.0"
                ]
              },
              "desc": "<p>The pathname used for the main script of a worker has an\nunknown file extension.</p>\n<p><a id=\"ERR_ZLIB_BINDING_CLOSED\"></a></p>",
              "displayName": "`ERR_WORKER_UNSUPPORTED_EXTENSION`"
            },
            {
              "textRaw": "`ERR_ZLIB_BINDING_CLOSED`",
              "name": "`err_zlib_binding_closed`",
              "type": "module",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [],
                "removed": [
                  "v10.0.0"
                ]
              },
              "desc": "<p>Used when an attempt is made to use a <code>zlib</code> object after it has already been\nclosed.</p>\n<p><a id=\"openssl-error-codes\"></a></p>",
              "displayName": "`ERR_ZLIB_BINDING_CLOSED`"
            }
          ],
          "displayName": "Legacy Node.js error codes"
        },
        {
          "textRaw": "OpenSSL Error Codes",
          "name": "openssl_error_codes",
          "type": "misc",
          "desc": "<p><a id=\"Time Validity Errors\"></a></p>",
          "modules": [
            {
              "textRaw": "Time Validity Errors",
              "name": "time_validity_errors",
              "type": "module",
              "desc": "<p><a id=\"CERT_NOT_YET_VALID\"></a></p>",
              "modules": [
                {
                  "textRaw": "`CERT_NOT_YET_VALID`",
                  "name": "`cert_not_yet_valid`",
                  "type": "module",
                  "desc": "<p>The certificate is not yet valid: the notBefore date is after the current time.</p>\n<p><a id=\"CERT_HAS_EXPIRED\"></a></p>",
                  "displayName": "`CERT_NOT_YET_VALID`"
                },
                {
                  "textRaw": "`CERT_HAS_EXPIRED`",
                  "name": "`cert_has_expired`",
                  "type": "module",
                  "desc": "<p>The certificate has expired: the notAfter date is before the current time.</p>\n<p><a id=\"CRL_NOT_YET_VALID\"></a></p>",
                  "displayName": "`CERT_HAS_EXPIRED`"
                },
                {
                  "textRaw": "`CRL_NOT_YET_VALID`",
                  "name": "`crl_not_yet_valid`",
                  "type": "module",
                  "desc": "<p>The certificate revocation list (CRL) has a future issue date.</p>\n<p><a id=\"CRL_HAS_EXPIRED\"></a></p>",
                  "displayName": "`CRL_NOT_YET_VALID`"
                },
                {
                  "textRaw": "`CRL_HAS_EXPIRED`",
                  "name": "`crl_has_expired`",
                  "type": "module",
                  "desc": "<p>The certificate revocation list (CRL) has expired.</p>\n<p><a id=\"CERT_REVOKED\"></a></p>",
                  "displayName": "`CRL_HAS_EXPIRED`"
                },
                {
                  "textRaw": "`CERT_REVOKED`",
                  "name": "`cert_revoked`",
                  "type": "module",
                  "desc": "<p>The certificate has been revoked; it is on a certificate revocation list (CRL).</p>\n<p><a id=\"Trust or Chain Related Errors\"></a></p>",
                  "displayName": "`CERT_REVOKED`"
                }
              ],
              "displayName": "Time Validity Errors"
            },
            {
              "textRaw": "Trust or Chain Related Errors",
              "name": "trust_or_chain_related_errors",
              "type": "module",
              "desc": "<p><a id=\"UNABLE_TO_GET_ISSUER_CERT\"></a></p>",
              "modules": [
                {
                  "textRaw": "`UNABLE_TO_GET_ISSUER_CERT`",
                  "name": "`unable_to_get_issuer_cert`",
                  "type": "module",
                  "desc": "<p>The issuer certificate of a looked up certificate could not be found. This\nnormally means the list of trusted certificates is not complete.</p>\n<p><a id=\"UNABLE_TO_GET_ISSUER_CERT_LOCALLY\"></a></p>",
                  "displayName": "`UNABLE_TO_GET_ISSUER_CERT`"
                },
                {
                  "textRaw": "`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`",
                  "name": "`unable_to_get_issuer_cert_locally`",
                  "type": "module",
                  "desc": "<p>The certificate’s issuer is not known. This is the case if the issuer is not\nincluded in the trusted certificate list.</p>\n<p><a id=\"DEPTH_ZERO_SELF_SIGNED_CERT\"></a></p>",
                  "displayName": "`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`"
                },
                {
                  "textRaw": "`DEPTH_ZERO_SELF_SIGNED_CERT`",
                  "name": "`depth_zero_self_signed_cert`",
                  "type": "module",
                  "desc": "<p>The passed certificate is self-signed and the same certificate cannot be found\nin the list of trusted certificates.</p>\n<p><a id=\"SELF_SIGNED_CERT_IN_CHAIN\"></a></p>",
                  "displayName": "`DEPTH_ZERO_SELF_SIGNED_CERT`"
                },
                {
                  "textRaw": "`SELF_SIGNED_CERT_IN_CHAIN`",
                  "name": "`self_signed_cert_in_chain`",
                  "type": "module",
                  "desc": "<p>The certificate’s issuer is not known. This is the case if the issuer is not\nincluded in the trusted certificate list.</p>\n<p><a id=\"CERT_CHAIN_TOO_LONG\"></a></p>",
                  "displayName": "`SELF_SIGNED_CERT_IN_CHAIN`"
                },
                {
                  "textRaw": "`CERT_CHAIN_TOO_LONG`",
                  "name": "`cert_chain_too_long`",
                  "type": "module",
                  "desc": "<p>The certificate chain length is greater than the maximum depth.</p>\n<p><a id=\"UNABLE_TO_GET_CRL\"></a></p>",
                  "displayName": "`CERT_CHAIN_TOO_LONG`"
                },
                {
                  "textRaw": "`UNABLE_TO_GET_CRL`",
                  "name": "`unable_to_get_crl`",
                  "type": "module",
                  "desc": "<p>The CRL reference by the certificate could not be found.</p>\n<p><a id=\"UNABLE_TO_VERIFY_LEAF_SIGNATURE\"></a></p>",
                  "displayName": "`UNABLE_TO_GET_CRL`"
                },
                {
                  "textRaw": "`UNABLE_TO_VERIFY_LEAF_SIGNATURE`",
                  "name": "`unable_to_verify_leaf_signature`",
                  "type": "module",
                  "desc": "<p>No signatures could be verified because the chain contains only one certificate\nand it is not self signed.</p>\n<p><a id=\"CERT_UNTRUSTED\"></a></p>",
                  "displayName": "`UNABLE_TO_VERIFY_LEAF_SIGNATURE`"
                },
                {
                  "textRaw": "`CERT_UNTRUSTED`",
                  "name": "`cert_untrusted`",
                  "type": "module",
                  "desc": "<p>The root certificate authority (CA) is not marked as trusted for the specified\npurpose.</p>\n<p><a id=\"Basic Extension Errors\"></a></p>",
                  "displayName": "`CERT_UNTRUSTED`"
                }
              ],
              "displayName": "Trust or Chain Related Errors"
            },
            {
              "textRaw": "Basic Extension Errors",
              "name": "basic_extension_errors",
              "type": "module",
              "desc": "<p><a id=\"INVALID_CA\"></a></p>",
              "modules": [
                {
                  "textRaw": "`INVALID_CA`",
                  "name": "`invalid_ca`",
                  "type": "module",
                  "desc": "<p>A CA certificate is invalid. Either it is not a CA or its extensions are not\nconsistent with the supplied purpose.</p>\n<p><a id=\"PATH_LENGTH_EXCEEDED\"></a></p>",
                  "displayName": "`INVALID_CA`"
                },
                {
                  "textRaw": "`PATH_LENGTH_EXCEEDED`",
                  "name": "`path_length_exceeded`",
                  "type": "module",
                  "desc": "<p>The basicConstraints pathlength parameter has been exceeded.</p>\n<p><a id=\"Name Related Errors\"></a></p>",
                  "displayName": "`PATH_LENGTH_EXCEEDED`"
                }
              ],
              "displayName": "Basic Extension Errors"
            },
            {
              "textRaw": "Name Related Errors",
              "name": "name_related_errors",
              "type": "module",
              "desc": "<p><a id=\"HOSTNAME_MISMATCH\"></a></p>",
              "modules": [
                {
                  "textRaw": "`HOSTNAME_MISMATCH`",
                  "name": "`hostname_mismatch`",
                  "type": "module",
                  "desc": "<p>Certificate does not match provided name.</p>\n<p><a id=\"Usage and Policy Errors\"></a></p>",
                  "displayName": "`HOSTNAME_MISMATCH`"
                }
              ],
              "displayName": "Name Related Errors"
            },
            {
              "textRaw": "Usage and Policy Errors",
              "name": "usage_and_policy_errors",
              "type": "module",
              "desc": "<p><a id=\"INVALID_PURPOSE\"></a></p>",
              "modules": [
                {
                  "textRaw": "`INVALID_PURPOSE`",
                  "name": "`invalid_purpose`",
                  "type": "module",
                  "desc": "<p>The supplied certificate cannot be used for the specified purpose.</p>\n<p><a id=\"CERT_REJECTED\"></a></p>",
                  "displayName": "`INVALID_PURPOSE`"
                },
                {
                  "textRaw": "`CERT_REJECTED`",
                  "name": "`cert_rejected`",
                  "type": "module",
                  "desc": "<p>The root CA is marked to reject the specified purpose.</p>\n<p><a id=\"Formatting Errors\"></a></p>",
                  "displayName": "`CERT_REJECTED`"
                }
              ],
              "displayName": "Usage and Policy Errors"
            },
            {
              "textRaw": "Formatting Errors",
              "name": "formatting_errors",
              "type": "module",
              "desc": "<p><a id=\"CERT_SIGNATURE_FAILURE\"></a></p>",
              "modules": [
                {
                  "textRaw": "`CERT_SIGNATURE_FAILURE`",
                  "name": "`cert_signature_failure`",
                  "type": "module",
                  "desc": "<p>The signature of the certificate is invalid.</p>\n<p><a id=\"CRL_SIGNATURE_FAILURE\"></a></p>",
                  "displayName": "`CERT_SIGNATURE_FAILURE`"
                },
                {
                  "textRaw": "`CRL_SIGNATURE_FAILURE`",
                  "name": "`crl_signature_failure`",
                  "type": "module",
                  "desc": "<p>The signature of the certificate revocation list (CRL) is invalid.</p>\n<p><a id=\"ERROR_IN_CERT_NOT_BEFORE_FIELD\"></a></p>",
                  "displayName": "`CRL_SIGNATURE_FAILURE`"
                },
                {
                  "textRaw": "`ERROR_IN_CERT_NOT_BEFORE_FIELD`",
                  "name": "`error_in_cert_not_before_field`",
                  "type": "module",
                  "desc": "<p>The certificate notBefore field contains an invalid time.</p>\n<p><a id=\"ERROR_IN_CERT_NOT_AFTER_FIELD\"></a></p>",
                  "displayName": "`ERROR_IN_CERT_NOT_BEFORE_FIELD`"
                },
                {
                  "textRaw": "`ERROR_IN_CERT_NOT_AFTER_FIELD`",
                  "name": "`error_in_cert_not_after_field`",
                  "type": "module",
                  "desc": "<p>The certificate notAfter field contains an invalid time.</p>\n<p><a id=\"ERROR_IN_CRL_LAST_UPDATE_FIELD\"></a></p>",
                  "displayName": "`ERROR_IN_CERT_NOT_AFTER_FIELD`"
                },
                {
                  "textRaw": "`ERROR_IN_CRL_LAST_UPDATE_FIELD`",
                  "name": "`error_in_crl_last_update_field`",
                  "type": "module",
                  "desc": "<p>The CRL lastUpdate field contains an invalid time.</p>\n<p><a id=\"ERROR_IN_CRL_NEXT_UPDATE_FIELD\"></a></p>",
                  "displayName": "`ERROR_IN_CRL_LAST_UPDATE_FIELD`"
                },
                {
                  "textRaw": "`ERROR_IN_CRL_NEXT_UPDATE_FIELD`",
                  "name": "`error_in_crl_next_update_field`",
                  "type": "module",
                  "desc": "<p>The CRL nextUpdate field contains an invalid time.</p>\n<p><a id=\"UNABLE_TO_DECRYPT_CERT_SIGNATURE\"></a></p>",
                  "displayName": "`ERROR_IN_CRL_NEXT_UPDATE_FIELD`"
                },
                {
                  "textRaw": "`UNABLE_TO_DECRYPT_CERT_SIGNATURE`",
                  "name": "`unable_to_decrypt_cert_signature`",
                  "type": "module",
                  "desc": "<p>The certificate signature could not be decrypted. This means that the actual\nsignature value could not be determined rather than it not matching the expected\nvalue, this is only meaningful for RSA keys.</p>\n<p><a id=\"UNABLE_TO_DECRYPT_CRL_SIGNATURE\"></a></p>",
                  "displayName": "`UNABLE_TO_DECRYPT_CERT_SIGNATURE`"
                },
                {
                  "textRaw": "`UNABLE_TO_DECRYPT_CRL_SIGNATURE`",
                  "name": "`unable_to_decrypt_crl_signature`",
                  "type": "module",
                  "desc": "<p>The certificate revocation list (CRL) signature could not be decrypted: this\nmeans that the actual signature value could not be determined rather than it not\nmatching the expected value.</p>\n<p><a id=\"UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY\"></a></p>",
                  "displayName": "`UNABLE_TO_DECRYPT_CRL_SIGNATURE`"
                },
                {
                  "textRaw": "`UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY`",
                  "name": "`unable_to_decode_issuer_public_key`",
                  "type": "module",
                  "desc": "<p>The public key in the certificate SubjectPublicKeyInfo could not be read.</p>\n<p><a id=\"Other OpenSSL Errors\"></a></p>",
                  "displayName": "`UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY`"
                }
              ],
              "displayName": "Formatting Errors"
            },
            {
              "textRaw": "Other OpenSSL Errors",
              "name": "other_openssl_errors",
              "type": "module",
              "desc": "<p><a id=\"OUT_OF_MEM\"></a></p>",
              "modules": [
                {
                  "textRaw": "`OUT_OF_MEM`",
                  "name": "`out_of_mem`",
                  "type": "module",
                  "desc": "<p>An error occurred trying to allocate memory. This should never happen.</p>",
                  "displayName": "`OUT_OF_MEM`"
                }
              ],
              "displayName": "Other OpenSSL Errors"
            }
          ],
          "displayName": "OpenSSL Error Codes"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Error`",
          "name": "Error",
          "type": "class",
          "desc": "<p>A generic JavaScript <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> object that does not denote any specific\ncircumstance of why the error occurred. <code>Error</code> objects capture a \"stack trace\"\ndetailing the point in the code at which the <code>Error</code> was instantiated, and may\nprovide a text description of the error.</p>\n<p>All errors generated by Node.js, including all system and JavaScript errors,\nwill either be instances of, or inherit from, the <code>Error</code> class.</p>",
          "signatures": [
            {
              "textRaw": "`new Error(message[, options])`",
              "name": "Error",
              "type": "ctor",
              "params": [
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`cause` {any} The error that caused the newly created error.",
                      "name": "cause",
                      "type": "any",
                      "desc": "The error that caused the newly created error."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new <code>Error</code> object and sets the <code>error.message</code> property to the\nprovided text message. If an object is passed as <code>message</code>, the text message\nis generated by calling <code>String(message)</code>. If the <code>cause</code> option is provided,\nit is assigned to the <code>error.cause</code> property. The <code>error.stack</code> property will\nrepresent the point in the code at which <code>new Error()</code> was called. Stack traces\nare dependent on <a href=\"https://v8.dev/docs/stack-trace-api\">V8's stack trace API</a>. Stack traces extend only to either\n(a) the beginning of <em>synchronous code execution</em>, or (b) the number of frames\ngiven by the property <code>Error.stackTraceLimit</code>, whichever is smaller.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`Error.captureStackTrace(targetObject[, constructorOpt])`",
              "name": "captureStackTrace",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`targetObject` {Object}",
                      "name": "targetObject",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`constructorOpt` {Function}",
                      "name": "constructorOpt",
                      "type": "Function",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a <code>.stack</code> property on <code>targetObject</code>, which when accessed returns\na string representing the location in the code at which\n<code>Error.captureStackTrace()</code> was called.</p>\n<pre><code class=\"language-js\">const myObject = {};\nError.captureStackTrace(myObject);\nmyObject.stack;  // Similar to `new Error().stack`\n</code></pre>\n<p>The first line of the trace will be prefixed with\n<code>${myObject.name}: ${myObject.message}</code>.</p>\n<p>The optional <code>constructorOpt</code> argument accepts a function. If given, all frames\nabove <code>constructorOpt</code>, including <code>constructorOpt</code>, will be omitted from the\ngenerated stack trace.</p>\n<p>The <code>constructorOpt</code> argument is useful for hiding implementation\ndetails of error generation from the user. For instance:</p>\n<pre><code class=\"language-js\">function a() {\n  b();\n}\n\nfunction b() {\n  c();\n}\n\nfunction c() {\n  // Create an error without stack trace to avoid calculating the stack trace twice.\n  const { stackTraceLimit } = Error;\n  Error.stackTraceLimit = 0;\n  const error = new Error();\n  Error.stackTraceLimit = stackTraceLimit;\n\n  // Capture the stack trace above function b\n  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace\n  throw error;\n}\n\na();\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "stackTraceLimit",
              "type": "number",
              "desc": "<p>The <code>Error.stackTraceLimit</code> property specifies the number of stack frames\ncollected by a stack trace (whether generated by <code>new Error().stack</code> or\n<code>Error.captureStackTrace(obj)</code>).</p>\n<p>The default value is <code>10</code> but may be set to any valid JavaScript number. Changes\nwill affect any stack trace captured <em>after</em> the value has been changed.</p>\n<p>If set to a non-number value, or set to a negative number, stack traces will\nnot capture any frames.</p>"
            },
            {
              "textRaw": "Type: {any}",
              "name": "cause",
              "type": "any",
              "meta": {
                "added": [
                  "v16.9.0"
                ],
                "changes": []
              },
              "desc": "<p>If present, the <code>error.cause</code> property is the underlying cause of the <code>Error</code>.\nIt is used when catching an error and throwing a new one with a different\nmessage or code in order to still have access to the original error.</p>\n<p>The <code>error.cause</code> property is typically set by calling\n<code>new Error(message, { cause })</code>. It is not set by the constructor if the\n<code>cause</code> option is not provided.</p>\n<p>This property allows errors to be chained. When serializing <code>Error</code> objects,\n<a href=\"util.html#utilinspectobject-options\"><code>util.inspect()</code></a> recursively serializes <code>error.cause</code> if it is set.</p>\n<pre><code class=\"language-js\">const cause = new Error('The remote HTTP server responded with a 500 status');\nconst symptom = new Error('The message failed to send', { cause });\n\nconsole.log(symptom);\n// Prints:\n//   Error: The message failed to send\n//       at REPL2:1:17\n//       at Script.runInThisContext (node:vm:130:12)\n//       ... 7 lines matching cause stack trace ...\n//       at [_line] [as _line] (node:internal/readline/interface:886:18) {\n//     [cause]: Error: The remote HTTP server responded with a 500 status\n//         at REPL1:1:15\n//         at Script.runInThisContext (node:vm:130:12)\n//         at REPLServer.defaultEval (node:repl:574:29)\n//         at bound (node:domain:426:15)\n//         at REPLServer.runBound [as eval] (node:domain:437:12)\n//         at REPLServer.onLine (node:repl:902:10)\n//         at REPLServer.emit (node:events:549:35)\n//         at REPLServer.emit (node:domain:482:12)\n//         at [_onLine] [as _onLine] (node:internal/readline/interface:425:12)\n//         at [_line] [as _line] (node:internal/readline/interface:886:18)\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "code",
              "type": "string",
              "desc": "<p>The <code>error.code</code> property is a string label that identifies the kind of error.\n<code>error.code</code> is the most stable way to identify an error. It will only change\nbetween major versions of Node.js. In contrast, <code>error.message</code> strings may\nchange between any versions of Node.js. See <a href=\"#nodejs-error-codes\">Node.js error codes</a> for details\nabout specific codes.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "message",
              "type": "string",
              "desc": "<p>The <code>error.message</code> property is the string description of the error as set by\ncalling <code>new Error(message)</code>. The <code>message</code> passed to the constructor will also\nappear in the first line of the stack trace of the <code>Error</code>, however changing\nthis property after the <code>Error</code> object is created <em>may not</em> change the first\nline of the stack trace (for example, when <code>error.stack</code> is read before this\nproperty is changed).</p>\n<pre><code class=\"language-js\">const err = new Error('The message');\nconsole.error(err.message);\n// Prints: The message\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "stack",
              "type": "string",
              "desc": "<p>The <code>error.stack</code> property is a string describing the point in the code at which\nthe <code>Error</code> was instantiated.</p>\n<pre><code class=\"language-console\">Error: Things keep happening!\n   at /home/gbusey/file.js:525:2\n   at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21)\n   at Actor.&#x3C;anonymous> (/home/gbusey/actors.js:400:8)\n   at increaseSynergy (/home/gbusey/actors.js:701:6)\n</code></pre>\n<p>The first line is formatted as <code>&#x3C;error class name>: &#x3C;error message></code>, and\nis followed by a series of stack frames (each line beginning with \"at \").\nEach frame describes a call site within the code that lead to the error being\ngenerated. V8 attempts to display a name for each function (by variable name,\nfunction name, or object method name), but occasionally it will not be able to\nfind a suitable name. If V8 cannot determine a name for the function, only\nlocation information will be displayed for that frame. Otherwise, the\ndetermined function name will be displayed with location information appended\nin parentheses.</p>\n<p>Frames are only generated for JavaScript functions. If, for example, execution\nsynchronously passes through a C++ addon function called <code>cheetahify</code> which\nitself calls a JavaScript function, the frame representing the <code>cheetahify</code> call\nwill not be present in the stack traces:</p>\n<pre><code class=\"language-js\">const cheetahify = require('./native-binding.node');\n\nfunction makeFaster() {\n  // `cheetahify()` *synchronously* calls speedy.\n  cheetahify(function speedy() {\n    throw new Error('oh no!');\n  });\n}\n\nmakeFaster();\n// will throw:\n//   /home/gbusey/file.js:6\n//       throw new Error('oh no!');\n//           ^\n//   Error: oh no!\n//       at speedy (/home/gbusey/file.js:6:11)\n//       at makeFaster (/home/gbusey/file.js:5:3)\n//       at Object.&#x3C;anonymous> (/home/gbusey/file.js:10:1)\n//       at Module._compile (module.js:456:26)\n//       at Object.Module._extensions..js (module.js:474:10)\n//       at Module.load (module.js:356:32)\n//       at Function.Module._load (module.js:312:12)\n//       at Function.Module.runMain (module.js:497:10)\n//       at startup (node.js:119:16)\n//       at node.js:906:3\n</code></pre>\n<p>The location information will be one of:</p>\n<ul>\n<li><code>native</code>, if the frame represents a call internal to V8 (as in <code>[].forEach</code>).</li>\n<li><code>plain-filename.js:line:column</code>, if the frame represents a call internal\nto Node.js.</li>\n<li><code>/absolute/path/to/file.js:line:column</code>, if the frame represents a call in\na user program (using CommonJS module system), or its dependencies.</li>\n<li><code>&#x3C;transport-protocol>:///url/to/module/file.mjs:line:column</code>, if the frame\nrepresents a call in a user program (using ES module system), or\nits dependencies.</li>\n</ul>\n<p>The number of frames captured by the stack trace is bounded by the smaller of\n<code>Error.stackTraceLimit</code> or the number of available frames on the current event\nloop tick.</p>\n<p><code>error.stack</code> is a getter/setter for a hidden internal property which is only\npresent on builtin <code>Error</code> objects (those for which <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError\"><code>Error.isError</code></a> returns\ntrue). If <code>error</code> is not a builtin error object, then the <code>error.stack</code> getter\nwill always return <code>undefined</code>, and the setter will do nothing. This can occur\nif the accessor is manually invoked with a <code>this</code> value that is not a builtin\nerror object, such as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy\"><code>&#x3C;Proxy></code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `AssertionError`",
          "name": "AssertionError",
          "type": "class",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates the failure of an assertion. For details, see\n<a href=\"assert.html#class-assertassertionerror\"><code>Class: assert.AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "Class: `RangeError`",
          "name": "RangeError",
          "type": "class",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates that a provided argument was not within the set or range of\nacceptable values for a function; whether that is a numeric range, or\noutside the set of options for a given function parameter.</p>\n<pre><code class=\"language-js\">require('node:net').connect(-1);\n// Throws \"RangeError: \"port\" option should be >= 0 and &#x3C; 65536: -1\"\n</code></pre>\n<p>Node.js will generate and throw <code>RangeError</code> instances <em>immediately</em> as a form\nof argument validation.</p>"
        },
        {
          "textRaw": "Class: `ReferenceError`",
          "name": "ReferenceError",
          "type": "class",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates that an attempt is being made to access a variable that is not\ndefined. Such errors commonly indicate typos in code, or an otherwise broken\nprogram.</p>\n<p>While client code may generate and propagate these errors, in practice, only V8\nwill do so.</p>\n<pre><code class=\"language-js\">doesNotExist;\n// Throws ReferenceError, doesNotExist is not a variable in this program.\n</code></pre>\n<p>Unless an application is dynamically generating and running code,\n<code>ReferenceError</code> instances indicate a bug in the code or its dependencies.</p>"
        },
        {
          "textRaw": "Class: `SyntaxError`",
          "name": "SyntaxError",
          "type": "class",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates that a program is not valid JavaScript. These errors may only be\ngenerated and propagated as a result of code evaluation. Code evaluation may\nhappen as a result of <code>eval</code>, <code>Function</code>, <code>require</code>, or <a href=\"vm.html\">vm</a>. These errors\nare almost always indicative of a broken program.</p>\n<pre><code class=\"language-js\">try {\n  require('node:vm').runInThisContext('binary ! isNotOk');\n} catch (err) {\n  // 'err' will be a SyntaxError.\n}\n</code></pre>\n<p><code>SyntaxError</code> instances are unrecoverable in the context that created them –\nthey may only be caught by other contexts.</p>"
        },
        {
          "textRaw": "Class: `SystemError`",
          "name": "SystemError",
          "type": "class",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Node.js generates system errors when exceptions occur within its runtime\nenvironment. These usually occur when an application violates an operating\nsystem constraint. For example, a system error will occur if an application\nattempts to read a file that does not exist.</p>\n<ul>\n<li><code>address</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If present, the address to which a network connection\nfailed</li>\n<li><code>code</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The string error code</li>\n<li><code>dest</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If present, the file path destination when reporting a file\nsystem error</li>\n<li><code>errno</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The system-provided error number</li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> If present, extra details about the error condition</li>\n<li><code>message</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> A system-provided human-readable description of the error</li>\n<li><code>path</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If present, the file path when reporting a file system error</li>\n<li><code>port</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> If present, the network connection port that is not available</li>\n<li><code>syscall</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The name of the system call that triggered the error</li>\n</ul>",
          "properties": [
            {
              "textRaw": "Type: {string}",
              "name": "address",
              "type": "string",
              "desc": "<p>If present, <code>error.address</code> is a string describing the address to which a\nnetwork connection failed.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "code",
              "type": "string",
              "desc": "<p>The <code>error.code</code> property is a string representing the error code.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "dest",
              "type": "string",
              "desc": "<p>If present, <code>error.dest</code> is the file path destination when reporting a file\nsystem error.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "errno",
              "type": "number",
              "desc": "<p>The <code>error.errno</code> property is a negative number which corresponds\nto the error code defined in <a href=\"https://docs.libuv.org/en/v1.x/errors.html\"><code>libuv Error handling</code></a>.</p>\n<p>On Windows the error number provided by the system will be normalized by libuv.</p>\n<p>To get the string representation of the error code, use\n<a href=\"util.html#utilgetsystemerrornameerr\"><code>util.getSystemErrorName(error.errno)</code></a>.</p>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "info",
              "type": "Object",
              "desc": "<p>If present, <code>error.info</code> is an object with details about the error condition.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "message",
              "type": "string",
              "desc": "<p><code>error.message</code> is a system-provided human-readable description of the error.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "path",
              "type": "string",
              "desc": "<p>If present, <code>error.path</code> is a string containing a relevant invalid pathname.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "port",
              "type": "number",
              "desc": "<p>If present, <code>error.port</code> is the network connection port that is not available.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "syscall",
              "type": "string",
              "desc": "<p>The <code>error.syscall</code> property is a string describing the <a href=\"https://man7.org/linux/man-pages/man2/syscalls.2.html\">syscall</a> that failed.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "Common system errors",
              "name": "common_system_errors",
              "type": "module",
              "desc": "<p>This is a list of system errors commonly-encountered when writing a Node.js\nprogram. For a comprehensive list, see the <a href=\"https://man7.org/linux/man-pages/man3/errno.3.html\"><code>errno</code>(3) man page</a>.</p>\n<ul>\n<li>\n<p><code>EACCES</code> (Permission denied): An attempt was made to access a file in a way\nforbidden by its file access permissions.</p>\n</li>\n<li>\n<p><code>EADDRINUSE</code> (Address already in use): An attempt to bind a server\n(<a href=\"net.html\"><code>net</code></a>, <a href=\"http.html\"><code>http</code></a>, or <a href=\"https.html\"><code>https</code></a>) to a local address failed due to\nanother server on the local system already occupying that address.</p>\n</li>\n<li>\n<p><code>ECONNREFUSED</code> (Connection refused): No connection could be made because the\ntarget machine actively refused it. This usually results from trying to\nconnect to a service that is inactive on the foreign host.</p>\n</li>\n<li>\n<p><code>ECONNRESET</code> (Connection reset by peer): A connection was forcibly closed by\na peer. This normally results from a loss of the connection on the remote\nsocket due to a timeout or reboot. Commonly encountered via the <a href=\"http.html\"><code>http</code></a>\nand <a href=\"net.html\"><code>net</code></a> modules.</p>\n</li>\n<li>\n<p><code>EEXIST</code> (File exists): An existing file was the target of an operation that\nrequired that the target not exist.</p>\n</li>\n<li>\n<p><code>EISDIR</code> (Is a directory): An operation expected a file, but the given\npathname was a directory.</p>\n</li>\n<li>\n<p><code>EMFILE</code> (Too many open files in system): Maximum number of\n<a href=\"https://en.wikipedia.org/wiki/File_descriptor\">file descriptors</a> allowable on the system has been reached, and\nrequests for another descriptor cannot be fulfilled until at least one\nhas been closed. This is encountered when opening many files at once in\nparallel, especially on systems (in particular, macOS) where there is a low\nfile descriptor limit for processes. To remedy a low limit, run\n<code>ulimit -n 2048</code> in the same shell that will run the Node.js process.</p>\n</li>\n<li>\n<p><code>ENOENT</code> (No such file or directory): Commonly raised by <a href=\"fs.html\"><code>fs</code></a> operations\nto indicate that a component of the specified pathname does not exist. No\nentity (file or directory) could be found by the given path.</p>\n</li>\n<li>\n<p><code>ENOTDIR</code> (Not a directory): A component of the given pathname existed, but\nwas not a directory as expected. Commonly raised by <a href=\"fs.html#fsreaddirpath-options-callback\"><code>fs.readdir</code></a>.</p>\n</li>\n<li>\n<p><code>ENOTEMPTY</code> (Directory not empty): A directory with entries was the target\nof an operation that requires an empty directory, usually <a href=\"fs.html#fsunlinkpath-callback\"><code>fs.unlink</code></a>.</p>\n</li>\n<li>\n<p><code>ENOTFOUND</code> (DNS lookup failed): Indicates a DNS failure of either\n<code>EAI_NODATA</code> or <code>EAI_NONAME</code>. This is not a standard POSIX error.</p>\n</li>\n<li>\n<p><code>EPERM</code> (Operation not permitted): An attempt was made to perform an\noperation that requires elevated privileges.</p>\n</li>\n<li>\n<p><code>EPIPE</code> (Broken pipe): A write on a pipe, socket, or FIFO for which there is\nno process to read the data. Commonly encountered at the <a href=\"net.html\"><code>net</code></a> and\n<a href=\"http.html\"><code>http</code></a> layers, indicative that the remote side of the stream being\nwritten to has been closed.</p>\n</li>\n<li>\n<p><code>ETIMEDOUT</code> (Operation timed out): A connect or send request failed because\nthe connected party did not properly respond after a period of time. Usually\nencountered by <a href=\"http.html\"><code>http</code></a> or <a href=\"net.html\"><code>net</code></a>. Often a sign that a <code>socket.end()</code>\nwas not properly called.</p>\n</li>\n</ul>",
              "displayName": "Common system errors"
            }
          ]
        },
        {
          "textRaw": "Class: `TypeError`",
          "name": "TypeError",
          "type": "class",
          "desc": "<ul>\n<li>Extends <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates that a provided argument is not an allowable type. For example,\npassing a function to a parameter which expects a string would be a <code>TypeError</code>.</p>\n<pre><code class=\"language-js\">require('node:url').parse(() => { });\n// Throws TypeError, since it expected a string.\n</code></pre>\n<p>Node.js will generate and throw <code>TypeError</code> instances <em>immediately</em> as a form\nof argument validation.</p>"
        }
      ],
      "source": "doc/api/errors.md"
    },
    {
      "textRaw": "Global objects",
      "name": "Global objects",
      "introduced_in": "v0.10.0",
      "type": "misc",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>These objects are available in all modules.</p>\n<p>The following variables may appear to be global but are not. They exist only in\nthe scope of <a href=\"modules.html\">CommonJS modules</a>:</p>\n<ul>\n<li><a href=\"modules.html#__dirname\"><code>__dirname</code></a></li>\n<li><a href=\"modules.html#__filename\"><code>__filename</code></a></li>\n<li><a href=\"modules.html#exports\"><code>exports</code></a></li>\n<li><a href=\"modules.html#module\"><code>module</code></a></li>\n<li><a href=\"modules.html#requireid\"><code>require()</code></a></li>\n</ul>\n<p>The objects listed here are specific to Node.js. There are <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects\">built-in objects</a>\nthat are part of the JavaScript language itself, which are also globally\naccessible.</p>",
      "miscs": [
        {
          "textRaw": "`__dirname`",
          "name": "`__dirname`",
          "type": "misc",
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#__dirname\"><code>__dirname</code></a>.</p>",
          "displayName": "`__dirname`"
        },
        {
          "textRaw": "`__filename`",
          "name": "`__filename`",
          "type": "misc",
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#__filename\"><code>__filename</code></a>.</p>",
          "displayName": "`__filename`"
        },
        {
          "textRaw": "`console`",
          "name": "`console`",
          "type": "misc",
          "meta": {
            "added": [
              "v0.1.100"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>Used to print to stdout and stderr. See the <a href=\"console.html\"><code>console</code></a> section.</p>",
          "displayName": "`console`"
        },
        {
          "textRaw": "`crypto`",
          "name": "`crypto`",
          "type": "misc",
          "meta": {
            "added": [
              "v17.6.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": "v23.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/52564",
                "description": "No longer experimental."
              },
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/42083",
                "description": "No longer behind `--experimental-global-webcrypto` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of the <a href=\"webcrypto.html\">Web Crypto API</a>.</p>",
          "displayName": "`crypto`"
        },
        {
          "textRaw": "`ErrorEvent`",
          "name": "`errorevent`",
          "type": "misc",
          "meta": {
            "added": [
              "v25.0.0"
            ],
            "changes": []
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/ErrorEvent\"><code>&#x3C;ErrorEvent></code></a>.</p>",
          "displayName": "`ErrorEvent`"
        },
        {
          "textRaw": "`exports`",
          "name": "`exports`",
          "type": "misc",
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#exports\"><code>exports</code></a>.</p>",
          "displayName": "`exports`"
        },
        {
          "textRaw": "`fetch`",
          "name": "`fetch`",
          "type": "misc",
          "meta": {
            "added": [
              "v17.5.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": [
                  "v21.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/45684",
                "description": "No longer experimental."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41811",
                "description": "No longer behind `--experimental-fetch` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch\"><code>fetch()</code></a> function.</p>\n<pre><code class=\"language-mjs\">const res = await fetch('https://nodejs.org/api/documentation.json');\nif (res.ok) {\n  const data = await res.json();\n  console.log(data);\n}\n</code></pre>\n<p>The implementation is based upon <a href=\"https://undici.nodejs.org\">undici</a>, an HTTP/1.1 client\nwritten from scratch for Node.js. You can figure out which version of <code>undici</code> is bundled\nin your Node.js process reading the <code>process.versions.undici</code> property.</p>",
          "modules": [
            {
              "textRaw": "Custom dispatcher",
              "name": "custom_dispatcher",
              "type": "module",
              "desc": "<p>You can use a custom dispatcher to dispatch requests passing it in fetch's options object.\nThe dispatcher must be compatible with <code>undici</code>'s\n<a href=\"https://undici.nodejs.org/#/docs/api/Dispatcher.md\"><code>Dispatcher</code> class</a>.</p>\n<pre><code class=\"language-js\">fetch(url, { dispatcher: new MyAgent() });\n</code></pre>\n<p>It is possible to change the global dispatcher in Node.js by installing <code>undici</code> and using\nthe <code>setGlobalDispatcher()</code> method. Calling this method will affect both <code>undici</code> and\nNode.js.</p>\n<pre><code class=\"language-mjs\">import { setGlobalDispatcher } from 'undici';\nsetGlobalDispatcher(new MyAgent());\n</code></pre>",
              "displayName": "Custom dispatcher"
            },
            {
              "textRaw": "Related classes",
              "name": "related_classes",
              "type": "module",
              "desc": "<p>The following globals are available to use with <code>fetch</code>:</p>\n<ul>\n<li><a href=\"#class-formdata\"><code>FormData</code></a></li>\n<li><a href=\"#class-headers\"><code>Headers</code></a></li>\n<li><a href=\"#class-request\"><code>Request</code></a></li>\n<li><a href=\"#class-response\"><code>Response</code></a></li>\n</ul>",
              "displayName": "Related classes"
            }
          ],
          "displayName": "`fetch`"
        },
        {
          "textRaw": "`global`",
          "name": "`global`",
          "type": "misc",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": []
          },
          "stability": 3,
          "stabilityText": "Legacy. Use `globalThis` instead.",
          "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The global namespace object.</li>\n</ul>\n<p>In browsers, the top-level scope has traditionally been the global scope. This\nmeans that <code>var something</code> will define a new global variable, except within\nECMAScript modules. In Node.js, this is different. The top-level scope is not\nthe global scope; <code>var something</code> inside a Node.js module will be local to that\nmodule, regardless of whether it is a <a href=\"modules.html\">CommonJS module</a> or an\n<a href=\"esm.html\">ECMAScript module</a>.</p>",
          "displayName": "`global`"
        },
        {
          "textRaw": "`localStorage`",
          "name": "`localstorage`",
          "type": "misc",
          "meta": {
            "added": [
              "v22.4.0"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/60351",
                "description": "Accessing the `localStorage` global without providing `--localstorage-file` now throws a `DOMException`, for compliance with the Web Storage specification."
              },
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57666",
                "description": "When webstorage is enabled and `--localstorage-file` is not provided, accessing the `localStorage` global now returns an empty object."
              },
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57666",
                "description": "This API is no longer behind `--experimental-webstorage` runtime flag."
              }
            ]
          },
          "stability": 1.2,
          "stabilityText": "Release candidate. Disable this API with `--no-experimental-webstorage`.",
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage\"><code>localStorage</code></a>. Data is stored\nunencrypted in the file specified by the <a href=\"cli.html#--localstorage-filefile\"><code>--localstorage-file</code></a> CLI flag.\nThe maximum amount of data that can be stored is 10 MB.\nAny modification of this data outside of the Web Storage API is not supported.\n<code>localStorage</code> data is not stored per user or per request when used in the context\nof a server, it is shared across all users and requests.</p>",
          "displayName": "`localStorage`"
        },
        {
          "textRaw": "`module`",
          "name": "`module`",
          "type": "misc",
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#module\"><code>module</code></a>.</p>",
          "displayName": "`module`"
        },
        {
          "textRaw": "`navigator`",
          "name": "`navigator`",
          "type": "misc",
          "meta": {
            "added": [
              "v21.0.0"
            ],
            "changes": []
          },
          "stability": 1.1,
          "stabilityText": "Active development. Disable this API with the `--no-experimental-global-navigator` CLI flag.",
          "desc": "<p>A partial implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator\"><code>window.navigator</code></a>.</p>",
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "hardwareConcurrency",
              "type": "number",
              "meta": {
                "added": [
                  "v21.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>navigator.hardwareConcurrency</code> read-only property returns the number of\nlogical processors available to the current Node.js instance.</p>\n<pre><code class=\"language-js\">console.log(`This process is running on ${navigator.hardwareConcurrency} logical processors`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "language",
              "type": "string",
              "meta": {
                "added": [
                  "v21.2.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>navigator.language</code> read-only property returns a string representing the\npreferred language of the Node.js instance. The language will be determined by\nthe ICU library used by Node.js at runtime based on the\ndefault language of the operating system.</p>\n<p>The value is representing the language version as defined in <a href=\"https://www.rfc-editor.org/rfc/rfc5646.txt\">RFC 5646</a>.</p>\n<p>The fallback value on builds without ICU is <code>'en-US'</code>.</p>\n<pre><code class=\"language-js\">console.log(`The preferred language of the Node.js instance has the tag '${navigator.language}'`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {string[]}",
              "name": "languages",
              "type": "string[]",
              "meta": {
                "added": [
                  "v21.2.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>navigator.languages</code> read-only property returns an array of strings\nrepresenting the preferred languages of the Node.js instance.\nBy default <code>navigator.languages</code> contains only the value of\n<code>navigator.language</code>, which will be determined by the ICU library used by\nNode.js at runtime based on the default language of the operating system.</p>\n<p>The fallback value on builds without ICU is <code>['en-US']</code>.</p>\n<pre><code class=\"language-js\">console.log(`The preferred languages are '${navigator.languages}'`);\n</code></pre>"
            },
            {
              "textRaw": "`navigator.locks`",
              "name": "locks",
              "type": "property",
              "meta": {
                "added": [
                  "v24.5.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>The <code>navigator.locks</code> read-only property returns a <a href=\"worker_threads.html#class-lockmanager\"><code>LockManager</code></a> instance that\ncan be used to coordinate access to resources that may be shared across multiple\nthreads within the same process. This global implementation matches the semantics\nof the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/LockManager\">browser <code>LockManager</code></a> API.</p>\n<pre><code class=\"language-mjs\">// Request an exclusive lock\nawait navigator.locks.request('my_resource', async (lock) => {\n  // The lock has been acquired.\n  console.log(`Lock acquired: ${lock.name}`);\n  // Lock is automatically released when the function returns\n});\n\n// Request a shared lock\nawait navigator.locks.request('shared_resource', { mode: 'shared' }, async (lock) => {\n  // Multiple shared locks can be held simultaneously\n  console.log(`Shared lock acquired: ${lock.name}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Request an exclusive lock\nnavigator.locks.request('my_resource', async (lock) => {\n  // The lock has been acquired.\n  console.log(`Lock acquired: ${lock.name}`);\n  // Lock is automatically released when the function returns\n}).then(() => {\n  console.log('Lock released');\n});\n\n// Request a shared lock\nnavigator.locks.request('shared_resource', { mode: 'shared' }, async (lock) => {\n  // Multiple shared locks can be held simultaneously\n  console.log(`Shared lock acquired: ${lock.name}`);\n}).then(() => {\n  console.log('Shared lock released');\n});\n</code></pre>\n<p>See <a href=\"worker_threads.html#worker_threadslocks\"><code>worker_threads.locks</code></a> for detailed API documentation.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "platform",
              "type": "string",
              "meta": {
                "added": [
                  "v21.2.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>navigator.platform</code> read-only property returns a string identifying the\nplatform on which the Node.js instance is running.</p>\n<pre><code class=\"language-js\">console.log(`This process is running on ${navigator.platform}`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "userAgent",
              "type": "string",
              "meta": {
                "added": [
                  "v21.1.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>navigator.userAgent</code> read-only property returns user agent\nconsisting of the runtime name and major version number.</p>\n<pre><code class=\"language-js\">console.log(`The user-agent is ${navigator.userAgent}`); // Prints \"Node.js/21\"\n</code></pre>"
            }
          ],
          "displayName": "`navigator`"
        },
        {
          "textRaw": "`performance`",
          "name": "`performance`",
          "type": "misc",
          "meta": {
            "added": [
              "v16.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <a href=\"perf_hooks.html#perf_hooksperformance\"><code>perf_hooks.performance</code></a> object.</p>",
          "displayName": "`performance`"
        },
        {
          "textRaw": "`process`",
          "name": "`process`",
          "type": "misc",
          "meta": {
            "added": [
              "v0.1.7"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>The process object. See the <a href=\"process.html#process\"><code>process</code> object</a> section.</p>",
          "displayName": "`process`"
        },
        {
          "textRaw": "`sessionStorage`",
          "name": "`sessionstorage`",
          "type": "misc",
          "meta": {
            "added": [
              "v22.4.0"
            ],
            "changes": [
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57666",
                "description": "This API is no longer behind `--experimental-webstorage` runtime flag."
              }
            ]
          },
          "stability": 1.2,
          "stabilityText": "Release candidate. Disable this API with `--no-experimental-webstorage`.",
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage\"><code>sessionStorage</code></a>. Data is stored in\nmemory, with a storage quota of 10 MB. <code>sessionStorage</code> data persists only within\nthe currently running process, and is not shared between workers.</p>",
          "displayName": "`sessionStorage`"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `AbortController`",
          "name": "AbortController",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": [
              {
                "version": "v15.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/35949",
                "description": "No longer experimental."
              }
            ]
          },
          "desc": "<p>A utility class used to signal cancelation in selected <code>Promise</code>-based APIs.\nThe API is based on the Web API <a href=\"globals.html#class-abortcontroller\"><code>&#x3C;AbortController></code></a>.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\n\nac.signal.addEventListener('abort', () => console.log('Aborted!'),\n                           { once: true });\n\nac.abort();\n\nconsole.log(ac.signal.aborted);  // Prints true\n</code></pre>",
          "methods": [
            {
              "textRaw": "`abortController.abort([reason])`",
              "name": "abort",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.2.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/40807",
                    "description": "Added the new optional reason argument."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`reason` {any} An optional reason, retrievable on the `AbortSignal`'s `reason` property.",
                      "name": "reason",
                      "type": "any",
                      "desc": "An optional reason, retrievable on the `AbortSignal`'s `reason` property.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Triggers the abort signal, causing the <code>abortController.signal</code> to emit\nthe <code>'abort'</code> event.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {AbortSignal}",
              "name": "signal",
              "type": "AbortSignal",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.17.0"
                ],
                "changes": []
              }
            }
          ]
        },
        {
          "textRaw": "Class: `AbortSignal`",
          "name": "AbortSignal",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventtarget\"><code>&#x3C;EventTarget></code></a></li>\n</ul>\n<p>The <code>AbortSignal</code> is used to notify observers when the\n<code>abortController.abort()</code> method is called.</p>",
          "classMethods": [
            {
              "textRaw": "Static method: `AbortSignal.abort([reason])`",
              "name": "abort",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v15.12.0",
                  "v14.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.2.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/40807",
                    "description": "Added the new optional reason argument."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`reason` {any}",
                      "name": "reason",
                      "type": "any",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {AbortSignal}",
                    "name": "return",
                    "type": "AbortSignal"
                  }
                }
              ],
              "desc": "<p>Returns a new already aborted <code>AbortSignal</code>.</p>"
            },
            {
              "textRaw": "Static method: `AbortSignal.timeout(delay)`",
              "name": "timeout",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v17.3.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`delay` {number} The number of milliseconds to wait before triggering the AbortSignal.",
                      "name": "delay",
                      "type": "number",
                      "desc": "The number of milliseconds to wait before triggering the AbortSignal."
                    }
                  ]
                }
              ],
              "desc": "<p>Returns a new <code>AbortSignal</code> which will be aborted in <code>delay</code> milliseconds.</p>"
            },
            {
              "textRaw": "Static method: `AbortSignal.any(signals)`",
              "name": "any",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v20.3.0",
                  "v18.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`signals` {AbortSignal[]} The `AbortSignal`s of which to compose a new `AbortSignal`.",
                      "name": "signals",
                      "type": "AbortSignal[]",
                      "desc": "The `AbortSignal`s of which to compose a new `AbortSignal`."
                    }
                  ]
                }
              ],
              "desc": "<p>Returns a new <code>AbortSignal</code> which will be aborted if any of the provided\nsignals are aborted. Its <a href=\"#abortsignalreason\"><code>abortSignal.reason</code></a> will be set to whichever\none of the <code>signals</code> caused it to be aborted.</p>"
            }
          ],
          "events": [
            {
              "textRaw": "Event: `'abort'`",
              "name": "abort",
              "type": "event",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'abort'</code> event is emitted when the <code>abortController.abort()</code> method\nis called. The callback is invoked with a single object argument with a\nsingle <code>type</code> property set to <code>'abort'</code>:</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\n\n// Use either the onabort property...\nac.signal.onabort = () => console.log('aborted!');\n\n// Or the EventTarget API...\nac.signal.addEventListener('abort', (event) => {\n  console.log(event.type);  // Prints 'abort'\n}, { once: true });\n\nac.abort();\n</code></pre>\n<p>The <code>AbortController</code> with which the <code>AbortSignal</code> is associated will only\never trigger the <code>'abort'</code> event once. We recommended that code check\nthat the <code>abortSignal.aborted</code> attribute is <code>false</code> before adding an <code>'abort'</code>\nevent listener.</p>\n<p>Any event listeners attached to the <code>AbortSignal</code> should use the\n<code>{ once: true }</code> option (or, if using the <code>EventEmitter</code> APIs to attach a\nlistener, use the <code>once()</code> method) to ensure that the event listener is\nremoved as soon as the <code>'abort'</code> event is handled. Failure to do so may\nresult in memory leaks.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean}",
              "name": "aborted",
              "type": "boolean",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "desc": "<p>True after the <code>AbortController</code> has been aborted.</p>"
            },
            {
              "textRaw": "Type: {Function}",
              "name": "onabort",
              "type": "Function",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "desc": "<p>An optional callback function that may be set by user code to be notified\nwhen the <code>abortController.abort()</code> function has been called.</p>"
            },
            {
              "textRaw": "Type: {any}",
              "name": "reason",
              "type": "any",
              "meta": {
                "added": [
                  "v17.2.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>An optional reason specified when the <code>AbortSignal</code> was triggered.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\nac.abort(new Error('boom!'));\nconsole.log(ac.signal.reason);  // Error: boom!\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`abortSignal.throwIfAborted()`",
              "name": "throwIfAborted",
              "type": "method",
              "meta": {
                "added": [
                  "v17.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>If <code>abortSignal.aborted</code> is <code>true</code>, throws <code>abortSignal.reason</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Blob`",
          "name": "Blob",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": []
          },
          "desc": "<p>See <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a>.</p>"
        },
        {
          "textRaw": "Class: `BroadcastChannel`",
          "name": "BroadcastChannel",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": []
          },
          "desc": "<p>See <a href=\"worker_threads.html#class-broadcastchannel-extends-eventtarget\"><code>&#x3C;BroadcastChannel></code></a>.</p>"
        },
        {
          "textRaw": "Class: `Buffer`",
          "name": "Buffer",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.103"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a></li>\n</ul>\n<p>Used to handle binary data. See the <a href=\"buffer.html\">buffer section</a>.</p>"
        },
        {
          "textRaw": "Class: `ByteLengthQueuingStrategy`",
          "name": "ByteLengthQueuingStrategy",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-bytelengthqueuingstrategy\"><code>ByteLengthQueuingStrategy</code></a>.</p>"
        },
        {
          "textRaw": "Class: `CloseEvent`",
          "name": "CloseEvent",
          "type": "class",
          "meta": {
            "added": [
              "v23.0.0"
            ],
            "changes": []
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/CloseEvent\"><code>&#x3C;CloseEvent></code></a>. Disable this API\nwith the <a href=\"cli.html#--no-experimental-websocket\"><code>--no-experimental-websocket</code></a> CLI flag.</p>"
        },
        {
          "textRaw": "Class: `CompressionStream`",
          "name": "CompressionStream",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.7.0",
                  "v22.20.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59464",
                "description": "format now accepts `brotli` value."
              },
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-compressionstream\"><code>CompressionStream</code></a>.</p>"
        },
        {
          "textRaw": "Class: `CountQueuingStrategy`",
          "name": "CountQueuingStrategy",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-countqueuingstrategy\"><code>CountQueuingStrategy</code></a>.</p>"
        },
        {
          "textRaw": "Class: `Crypto`",
          "name": "Crypto",
          "type": "class",
          "meta": {
            "added": [
              "v17.6.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": "v23.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/52564",
                "description": "No longer experimental."
              },
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/42083",
                "description": "No longer behind `--experimental-global-webcrypto` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-crypto\"><code>&#x3C;Crypto></code></a>. This global is available\nonly if the Node.js binary was compiled with including support for the <code>node:crypto</code> module.</p>"
        },
        {
          "textRaw": "Class: `CryptoKey`",
          "name": "CryptoKey",
          "type": "class",
          "meta": {
            "added": [
              "v17.6.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": "v23.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/52564",
                "description": "No longer experimental."
              },
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/42083",
                "description": "No longer behind `--experimental-global-webcrypto` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>. This global is available\nonly if the Node.js binary was compiled with including support for the <code>node:crypto</code> module.</p>"
        },
        {
          "textRaw": "Class: `CustomEvent`",
          "name": "CustomEvent",
          "type": "class",
          "meta": {
            "added": [
              "v18.7.0",
              "v16.17.0"
            ],
            "changes": [
              {
                "version": "v23.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/52723",
                "description": "No longer experimental."
              },
              {
                "version": [
                  "v22.1.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52618",
                "description": "CustomEvent is now stable."
              },
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/44860",
                "description": "No longer behind `--experimental-global-customevent` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"events.html#class-customevent\"><code>&#x3C;CustomEvent></code></a>.</p>"
        },
        {
          "textRaw": "Class: `DecompressionStream`",
          "name": "DecompressionStream",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.7.0",
                  "v22.20.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59464",
                "description": "format now accepts `brotli` value."
              },
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-decompressionstream\"><code>DecompressionStream</code></a>.</p>"
        },
        {
          "textRaw": "Class: `DOMException`",
          "name": "DOMException",
          "type": "class",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/docs/Web/API/DOMException\"><code>&#x3C;DOMException></code></a> class.</p>"
        },
        {
          "textRaw": "Class: `Event`",
          "name": "Event",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": [
              {
                "version": "v15.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/35949",
                "description": "No longer experimental."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of the <code>Event</code> class. See\n<a href=\"events.html#eventtarget-and-event-api\"><code>EventTarget</code> and <code>Event</code> API</a> for more details.</p>"
        },
        {
          "textRaw": "Class: `EventSource`",
          "name": "EventSource",
          "type": "class",
          "meta": {
            "added": [
              "v22.3.0",
              "v20.18.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental. Enable this API with the `--experimental-eventsource` CLI flag.",
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/EventSource\"><code>&#x3C;EventSource></code></a>.</p>"
        },
        {
          "textRaw": "Class: `EventTarget`",
          "name": "EventTarget",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": [
              {
                "version": "v15.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/35949",
                "description": "No longer experimental."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of the <code>EventTarget</code> class. See\n<a href=\"events.html#eventtarget-and-event-api\"><code>EventTarget</code> and <code>Event</code> API</a> for more details.</p>"
        },
        {
          "textRaw": "Class: `File`",
          "name": "File",
          "type": "class",
          "meta": {
            "added": [
              "v20.0.0"
            ],
            "changes": []
          },
          "desc": "<p>See <a href=\"buffer.html#class-file\"><code>&#x3C;File></code></a>.</p>"
        },
        {
          "textRaw": "Class: `FormData`",
          "name": "FormData",
          "type": "class",
          "meta": {
            "added": [
              "v17.6.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": [
                  "v21.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/45684",
                "description": "No longer experimental."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41811",
                "description": "No longer behind `--experimental-fetch` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/FormData\"><code>&#x3C;FormData></code></a>.</p>"
        },
        {
          "textRaw": "Class: `Headers`",
          "name": "Headers",
          "type": "class",
          "meta": {
            "added": [
              "v17.5.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": [
                  "v21.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/45684",
                "description": "No longer experimental."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41811",
                "description": "No longer behind `--experimental-fetch` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/Headers\"><code>&#x3C;Headers></code></a>.</p>"
        },
        {
          "textRaw": "Class: `MessageChannel`",
          "name": "MessageChannel",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>MessageChannel</code> class. See <a href=\"worker_threads.html#class-messagechannel\"><code>MessageChannel</code></a> for more details.</p>"
        },
        {
          "textRaw": "Class: `MessageEvent`",
          "name": "MessageEvent",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": []
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/MessageEvent\"><code>&#x3C;MessageEvent></code></a>.</p>"
        },
        {
          "textRaw": "Class: `MessagePort`",
          "name": "MessagePort",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>MessagePort</code> class. See <a href=\"worker_threads.html#class-messageport\"><code>MessagePort</code></a> for more details.</p>"
        },
        {
          "textRaw": "Class: `Navigator`",
          "name": "Navigator",
          "type": "class",
          "meta": {
            "added": [
              "v21.0.0"
            ],
            "changes": []
          },
          "stability": 1.1,
          "stabilityText": "Active development. Disable this API with the `--no-experimental-global-navigator` CLI flag.",
          "desc": "<p>A partial implementation of the <a href=\"https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object\">Navigator API</a>.</p>"
        },
        {
          "textRaw": "Class: `PerformanceEntry`",
          "name": "PerformanceEntry",
          "type": "class",
          "meta": {
            "added": [
              "v19.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>PerformanceEntry</code> class. See <a href=\"perf_hooks.html#class-performanceentry\"><code>PerformanceEntry</code></a> for more details.</p>"
        },
        {
          "textRaw": "Class: `PerformanceMark`",
          "name": "PerformanceMark",
          "type": "class",
          "meta": {
            "added": [
              "v19.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>PerformanceMark</code> class. See <a href=\"perf_hooks.html#class-performancemark\"><code>PerformanceMark</code></a> for more details.</p>"
        },
        {
          "textRaw": "Class: `PerformanceMeasure`",
          "name": "PerformanceMeasure",
          "type": "class",
          "meta": {
            "added": [
              "v19.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>PerformanceMeasure</code> class. See <a href=\"perf_hooks.html#class-performancemeasure\"><code>PerformanceMeasure</code></a> for more details.</p>"
        },
        {
          "textRaw": "Class: `PerformanceObserver`",
          "name": "PerformanceObserver",
          "type": "class",
          "meta": {
            "added": [
              "v19.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>PerformanceObserver</code> class. See <a href=\"perf_hooks.html#class-performanceobserver\"><code>PerformanceObserver</code></a> for more details.</p>"
        },
        {
          "textRaw": "Class: `PerformanceObserverEntryList`",
          "name": "PerformanceObserverEntryList",
          "type": "class",
          "meta": {
            "added": [
              "v19.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>PerformanceObserverEntryList</code> class. See\n<a href=\"perf_hooks.html#class-performanceobserverentrylist\"><code>PerformanceObserverEntryList</code></a> for more details.</p>"
        },
        {
          "textRaw": "Class: `PerformanceResourceTiming`",
          "name": "PerformanceResourceTiming",
          "type": "class",
          "meta": {
            "added": [
              "v19.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>PerformanceResourceTiming</code> class. See <a href=\"perf_hooks.html#class-performanceresourcetiming\"><code>PerformanceResourceTiming</code></a> for\nmore details.</p>"
        },
        {
          "textRaw": "Class: `QuotaExceededError`",
          "name": "QuotaExceededError",
          "type": "class",
          "meta": {
            "added": [
              "v26.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/docs/Web/API/QuotaExceededError\"><code>&#x3C;QuotaExceededError></code></a> class. Extends <a href=\"https://developer.mozilla.org/docs/Web/API/DOMException\"><code>&#x3C;DOMException></code></a>.</p>"
        },
        {
          "textRaw": "Class: `ReadableByteStreamController`",
          "name": "ReadableByteStreamController",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablebytestreamcontroller\"><code>ReadableByteStreamController</code></a>.</p>"
        },
        {
          "textRaw": "Class: `ReadableStream`",
          "name": "ReadableStream",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestream\"><code>ReadableStream</code></a>.</p>"
        },
        {
          "textRaw": "Class: `ReadableStreamBYOBReader`",
          "name": "ReadableStreamBYOBReader",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreambyobreader\"><code>ReadableStreamBYOBReader</code></a>.</p>"
        },
        {
          "textRaw": "Class: `ReadableStreamBYOBRequest`",
          "name": "ReadableStreamBYOBRequest",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreambyobrequest\"><code>ReadableStreamBYOBRequest</code></a>.</p>"
        },
        {
          "textRaw": "Class: `ReadableStreamDefaultController`",
          "name": "ReadableStreamDefaultController",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreamdefaultcontroller\"><code>ReadableStreamDefaultController</code></a>.</p>"
        },
        {
          "textRaw": "Class: `ReadableStreamDefaultReader`",
          "name": "ReadableStreamDefaultReader",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreamdefaultreader\"><code>ReadableStreamDefaultReader</code></a>.</p>"
        },
        {
          "textRaw": "Class: `Request`",
          "name": "Request",
          "type": "class",
          "meta": {
            "added": [
              "v17.5.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": [
                  "v21.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/45684",
                "description": "No longer experimental."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41811",
                "description": "No longer behind `--experimental-fetch` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/Request\"><code>&#x3C;Request></code></a>.</p>"
        },
        {
          "textRaw": "Class: `Response`",
          "name": "Response",
          "type": "class",
          "meta": {
            "added": [
              "v17.5.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": [
                  "v21.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/45684",
                "description": "No longer experimental."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41811",
                "description": "No longer behind `--experimental-fetch` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/Response\"><code>&#x3C;Response></code></a>.</p>"
        },
        {
          "textRaw": "Class: `Storage`",
          "name": "Storage",
          "type": "class",
          "meta": {
            "added": [
              "v22.4.0"
            ],
            "changes": []
          },
          "stability": 1.2,
          "stabilityText": "Release candidate. Disable this API with `--no-experimental-webstorage`.",
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/Storage\"><code>&#x3C;Storage></code></a>.</p>"
        },
        {
          "textRaw": "Class: `SubtleCrypto`",
          "name": "SubtleCrypto",
          "type": "class",
          "meta": {
            "added": [
              "v17.6.0",
              "v16.15.0"
            ],
            "changes": [
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/42083",
                "description": "No longer behind `--experimental-global-webcrypto` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-subtlecrypto\"><code>&#x3C;SubtleCrypto></code></a>. This global is available\nonly if the Node.js binary was compiled with including support for the <code>node:crypto</code> module.</p>"
        },
        {
          "textRaw": "Class: `TextDecoder`",
          "name": "TextDecoder",
          "type": "class",
          "meta": {
            "added": [
              "v11.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The WHATWG <code>TextDecoder</code> class. See the <a href=\"util.html#class-utiltextdecoder\"><code>TextDecoder</code></a> section.</p>"
        },
        {
          "textRaw": "Class: `TextDecoderStream`",
          "name": "TextDecoderStream",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-textdecoderstream\"><code>TextDecoderStream</code></a>.</p>"
        },
        {
          "textRaw": "Class: `TextEncoder`",
          "name": "TextEncoder",
          "type": "class",
          "meta": {
            "added": [
              "v11.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The WHATWG <code>TextEncoder</code> class. See the <a href=\"util.html#class-utiltextencoder\"><code>TextEncoder</code></a> section.</p>"
        },
        {
          "textRaw": "Class: `TextEncoderStream`",
          "name": "TextEncoderStream",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-textencoderstream\"><code>TextEncoderStream</code></a>.</p>"
        },
        {
          "textRaw": "Class: `TransformStream`",
          "name": "TransformStream",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-transformstream\"><code>TransformStream</code></a>.</p>"
        },
        {
          "textRaw": "Class: `TransformStreamDefaultController`",
          "name": "TransformStreamDefaultController",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-transformstreamdefaultcontroller\"><code>TransformStreamDefaultController</code></a>.</p>"
        },
        {
          "textRaw": "Class: `URL`",
          "name": "URL",
          "type": "class",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The WHATWG <code>URL</code> class. See the <a href=\"url.html#class-url\"><code>URL</code></a> section.</p>"
        },
        {
          "textRaw": "Class: `URLPattern`",
          "name": "URLPattern",
          "type": "class",
          "meta": {
            "added": [
              "v24.0.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>The WHATWG <code>URLPattern</code> class. See the <a href=\"url.html#class-urlpattern\"><code>URLPattern</code></a> section.</p>"
        },
        {
          "textRaw": "Class: `URLSearchParams`",
          "name": "URLSearchParams",
          "type": "class",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The WHATWG <code>URLSearchParams</code> class. See the <a href=\"url.html#class-urlsearchparams\"><code>URLSearchParams</code></a> section.</p>"
        },
        {
          "textRaw": "Class: `WebAssembly`",
          "name": "WebAssembly",
          "type": "class",
          "meta": {
            "added": [
              "v8.0.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>The object that acts as the namespace for all W3C\n<a href=\"https://webassembly.org\">WebAssembly</a> related functionality. See the\n<a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly\">Mozilla Developer Network</a> for usage and compatibility.</p>"
        },
        {
          "textRaw": "Class: `WebSocket`",
          "name": "WebSocket",
          "type": "class",
          "meta": {
            "added": [
              "v21.0.0",
              "v20.10.0"
            ],
            "changes": [
              {
                "version": "v22.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/53352",
                "description": "No longer experimental."
              },
              {
                "version": "v22.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/51594",
                "description": "No longer behind `--experimental-websocket` CLI flag."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/WebSocket\"><code>&#x3C;WebSocket></code></a>. Disable this API\nwith the <a href=\"cli.html#--no-experimental-websocket\"><code>--no-experimental-websocket</code></a> CLI flag.</p>"
        },
        {
          "textRaw": "Class: `WritableStream`",
          "name": "WritableStream",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestream\"><code>WritableStream</code></a>.</p>"
        },
        {
          "textRaw": "Class: `WritableStreamDefaultController`",
          "name": "WritableStreamDefaultController",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestreamdefaultcontroller\"><code>WritableStreamDefaultController</code></a>.</p>"
        },
        {
          "textRaw": "Class: `WritableStreamDefaultWriter`",
          "name": "WritableStreamDefaultWriter",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestreamdefaultwriter\"><code>WritableStreamDefaultWriter</code></a>.</p>"
        }
      ],
      "methods": [
        {
          "textRaw": "`atob(data)`",
          "name": "atob",
          "type": "method",
          "meta": {
            "added": [
              "v16.0.0"
            ],
            "changes": []
          },
          "stability": 3,
          "stabilityText": "Legacy. Use `Buffer.from(data, 'base64')` instead.",
          "signatures": [
            {
              "params": [
                {
                  "name": "data"
                }
              ]
            }
          ],
          "desc": "<p>Global alias for <a href=\"buffer.html#bufferatobdata\"><code>buffer.atob()</code></a>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>"
        },
        {
          "textRaw": "`btoa(data)`",
          "name": "btoa",
          "type": "method",
          "meta": {
            "added": [
              "v16.0.0"
            ],
            "changes": []
          },
          "stability": 3,
          "stabilityText": "Legacy. Use `buf.toString('base64')` instead.",
          "signatures": [
            {
              "params": [
                {
                  "name": "data"
                }
              ]
            }
          ],
          "desc": "<p>Global alias for <a href=\"buffer.html#bufferbtoadata\"><code>buffer.btoa()</code></a>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>"
        },
        {
          "textRaw": "`clearImmediate(immediateObject)`",
          "name": "clearImmediate",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "immediateObject"
                }
              ]
            }
          ],
          "desc": "<p><a href=\"timers.html#clearimmediateimmediate\"><code>clearImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`clearInterval(intervalObject)`",
          "name": "clearInterval",
          "type": "method",
          "meta": {
            "added": [
              "v0.0.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "intervalObject"
                }
              ]
            }
          ],
          "desc": "<p><a href=\"timers.html#clearintervaltimeout\"><code>clearInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`clearTimeout(timeoutObject)`",
          "name": "clearTimeout",
          "type": "method",
          "meta": {
            "added": [
              "v0.0.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "timeoutObject"
                }
              ]
            }
          ],
          "desc": "<p><a href=\"timers.html#cleartimeouttimeout\"><code>clearTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`queueMicrotask(callback)`",
          "name": "queueMicrotask",
          "type": "method",
          "meta": {
            "added": [
              "v11.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`callback` {Function} Function to be queued.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "Function to be queued."
                }
              ]
            }
          ],
          "desc": "<p>The <code>queueMicrotask()</code> method queues a microtask to invoke <code>callback</code>. If\n<code>callback</code> throws an exception, the <a href=\"process.html#process\"><code>process</code> object</a> <code>'uncaughtException'</code>\nevent will be emitted.</p>\n<p>The microtask queue is managed by V8 and may be used in a similar manner to\nthe <a href=\"process.html#processnexttickcallback-args\"><code>process.nextTick()</code></a> queue, which is managed by Node.js. The\n<code>process.nextTick()</code> queue is always processed before the microtask queue\nwithin each turn of the Node.js event loop.</p>\n<pre><code class=\"language-js\">// Here, `queueMicrotask()` is used to ensure the 'load' event is always\n// emitted asynchronously, and therefore consistently. Using\n// `process.nextTick()` here would result in the 'load' event always emitting\n// before any other promise jobs.\n\nDataHandler.prototype.load = async function load(key) {\n  const hit = this._cache.get(key);\n  if (hit !== undefined) {\n    queueMicrotask(() => {\n      this.emit('load', hit);\n    });\n    return;\n  }\n\n  const data = await fetchData(key);\n  this._cache.set(key, data);\n  this.emit('load', data);\n};\n</code></pre>"
        },
        {
          "textRaw": "`require()`",
          "name": "require",
          "type": "method",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#requireid\"><code>require()</code></a>.</p>"
        },
        {
          "textRaw": "`setImmediate(callback[, ...args])`",
          "name": "setImmediate",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "callback"
                },
                {
                  "name": "...args",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><a href=\"timers.html#setimmediatecallback-args\"><code>setImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`setInterval(callback, delay[, ...args])`",
          "name": "setInterval",
          "type": "method",
          "meta": {
            "added": [
              "v0.0.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "callback"
                },
                {
                  "name": "delay"
                },
                {
                  "name": "...args",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><a href=\"timers.html#setintervalcallback-delay-args\"><code>setInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`setTimeout(callback, delay[, ...args])`",
          "name": "setTimeout",
          "type": "method",
          "meta": {
            "added": [
              "v0.0.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "callback"
                },
                {
                  "name": "delay"
                },
                {
                  "name": "...args",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><a href=\"timers.html#settimeoutcallback-delay-args\"><code>setTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
        },
        {
          "textRaw": "`structuredClone(value[, options])`",
          "name": "structuredClone",
          "type": "method",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "value"
                },
                {
                  "name": "options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone\"><code>structuredClone</code></a> method.</p>"
        }
      ],
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Internationalization support",
      "name": "Internationalization support",
      "introduced_in": "v8.2.0",
      "type": "misc",
      "desc": "<p>Node.js has many features that make it easier to write internationalized\nprograms. Some of them are:</p>\n<ul>\n<li>Locale-sensitive or Unicode-aware functions in the <a href=\"https://tc39.github.io/ecma262/\">ECMAScript Language\nSpecification</a>:\n<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize\"><code>String.prototype.normalize()</code></a></li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase\"><code>String.prototype.toLowerCase()</code></a></li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase\"><code>String.prototype.toUpperCase()</code></a></li>\n</ul>\n</li>\n<li>All functionality described in the <a href=\"https://tc39.github.io/ecma402/\">ECMAScript Internationalization API\nSpecification</a> (aka ECMA-402):\n<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl\"><code>Intl</code></a> object</li>\n<li>Locale-sensitive methods like <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare\"><code>String.prototype.localeCompare()</code></a> and\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString\"><code>Date.prototype.toLocaleString()</code></a></li>\n</ul>\n</li>\n<li>The <a href=\"url.html#the-whatwg-url-api\">WHATWG URL parser</a>'s <a href=\"https://en.wikipedia.org/wiki/Internationalized_domain_name\">internationalized domain names</a> (IDNs) support</li>\n<li><a href=\"buffer.html#buffertranscodesource-fromenc-toenc\"><code>require('node:buffer').transcode()</code></a></li>\n<li>More accurate <a href=\"repl.html#repl\">REPL</a> line editing</li>\n<li><a href=\"util.html#class-utiltextdecoder\"><code>require('node:util').TextDecoder</code></a></li>\n<li><a href=\"https://github.com/tc39/proposal-regexp-unicode-property-escapes\"><code>RegExp</code> Unicode Property Escapes</a></li>\n</ul>\n<p>Node.js and the underlying V8 engine use\n<a href=\"http://site.icu-project.org/\">International Components for Unicode (ICU)</a> to implement these features\nin native C/C++ code. The full ICU data set is provided by Node.js by default.\nHowever, due to the size of the ICU data file, several\noptions are provided for customizing the ICU data set either when\nbuilding or running Node.js.</p>",
      "miscs": [
        {
          "textRaw": "Options for building Node.js",
          "name": "options_for_building_node.js",
          "type": "misc",
          "desc": "<p>To control how ICU is used in Node.js, four <code>configure</code> options are available\nduring compilation. Additional details on how to compile Node.js are documented\nin <a href=\"https://github.com/nodejs/node/blob/HEAD/BUILDING.md\">BUILDING.md</a>.</p>\n<ul>\n<li><code>--with-intl=none</code>/<code>--without-intl</code></li>\n<li><code>--with-intl=system-icu</code></li>\n<li><code>--with-intl=small-icu</code></li>\n<li><code>--with-intl=full-icu</code> (default)</li>\n</ul>\n<p>An overview of available Node.js and JavaScript features for each <code>configure</code>\noption:</p>\n<table>\n<thead>\n<tr>\n<th>Feature</th>\n<th><code>none</code></th>\n<th><code>system-icu</code></th>\n<th><code>small-icu</code></th>\n<th><code>full-icu</code></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize\"><code>String.prototype.normalize()</code></a></td>\n<td>none (function is no-op)</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n<tr>\n<td><code>String.prototype.to*Case()</code></td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl\"><code>Intl</code></a></td>\n<td>none (object does not exist)</td>\n<td>partial/full (depends on OS)</td>\n<td>partial (English-only)</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare\"><code>String.prototype.localeCompare()</code></a></td>\n<td>partial (not locale-aware)</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n<tr>\n<td><code>String.prototype.toLocale*Case()</code></td>\n<td>partial (not locale-aware)</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString\"><code>Number.prototype.toLocaleString()</code></a></td>\n<td>partial (not locale-aware)</td>\n<td>partial/full (depends on OS)</td>\n<td>partial (English-only)</td>\n<td>full</td>\n</tr>\n<tr>\n<td><code>Date.prototype.toLocale*String()</code></td>\n<td>partial (not locale-aware)</td>\n<td>partial/full (depends on OS)</td>\n<td>partial (English-only)</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"url.html#legacy-url-api\">Legacy URL Parser</a></td>\n<td>partial (no IDN support)</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"url.html#the-whatwg-url-api\">WHATWG URL Parser</a></td>\n<td>partial (no IDN support)</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"buffer.html#buffertranscodesource-fromenc-toenc\"><code>require('node:buffer').transcode()</code></a></td>\n<td>none (function does not exist)</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"repl.html#repl\">REPL</a></td>\n<td>partial (inaccurate line editing)</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"util.html#class-utiltextdecoder\"><code>require('node:util').TextDecoder</code></a></td>\n<td>partial (basic encodings support)</td>\n<td>partial/full (depends on OS)</td>\n<td>partial (Unicode-only)</td>\n<td>full</td>\n</tr>\n<tr>\n<td><a href=\"https://github.com/tc39/proposal-regexp-unicode-property-escapes\"><code>RegExp</code> Unicode Property Escapes</a></td>\n<td>none (invalid <code>RegExp</code> error)</td>\n<td>full</td>\n<td>full</td>\n<td>full</td>\n</tr>\n</tbody>\n</table>\n<p>The \"(not locale-aware)\" designation denotes that the function carries out its\noperation just like the non-<code>Locale</code> version of the function, if one\nexists. For example, under <code>none</code> mode, <code>Date.prototype.toLocaleString()</code>'s\noperation is identical to that of <code>Date.prototype.toString()</code>.</p>",
          "modules": [
            {
              "textRaw": "Disable all internationalization features (`none`)",
              "name": "disable_all_internationalization_features_(`none`)",
              "type": "module",
              "desc": "<p>If this option is chosen, ICU is disabled and most internationalization\nfeatures mentioned above will be <strong>unavailable</strong> in the resulting <code>node</code> binary.</p>",
              "displayName": "Disable all internationalization features (`none`)"
            },
            {
              "textRaw": "Build with a pre-installed ICU (`system-icu`)",
              "name": "build_with_a_pre-installed_icu_(`system-icu`)",
              "type": "module",
              "desc": "<p>Node.js can link against an ICU build already installed on the system. In fact,\nmost Linux distributions already come with ICU installed, and this option would\nmake it possible to reuse the same set of data used by other components in the\nOS.</p>\n<p>Functionalities that only require the ICU library itself, such as\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize\"><code>String.prototype.normalize()</code></a> and the <a href=\"url.html#the-whatwg-url-api\">WHATWG URL parser</a>, are fully\nsupported under <code>system-icu</code>. Features that require ICU locale data in\naddition, such as <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\"><code>Intl.DateTimeFormat</code></a> <em>may</em> be fully or partially\nsupported, depending on the completeness of the ICU data installed on the\nsystem.</p>",
              "displayName": "Build with a pre-installed ICU (`system-icu`)"
            },
            {
              "textRaw": "Embed a limited set of ICU data (`small-icu`)",
              "name": "embed_a_limited_set_of_icu_data_(`small-icu`)",
              "type": "module",
              "desc": "<p>This option makes the resulting binary link against the ICU library statically,\nand includes a subset of ICU data (typically only the English locale) within\nthe <code>node</code> executable.</p>\n<p>Functionalities that only require the ICU library itself, such as\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize\"><code>String.prototype.normalize()</code></a> and the <a href=\"url.html#the-whatwg-url-api\">WHATWG URL parser</a>, are fully\nsupported under <code>small-icu</code>. Features that require ICU locale data in addition,\nsuch as <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\"><code>Intl.DateTimeFormat</code></a>, generally only work with the English locale:</p>\n<pre><code class=\"language-js\">const january = new Date(9e8);\nconst english = new Intl.DateTimeFormat('en', { month: 'long' });\nconst spanish = new Intl.DateTimeFormat('es', { month: 'long' });\n\nconsole.log(english.format(january));\n// Prints \"January\"\nconsole.log(spanish.format(january));\n// Prints either \"M01\" or \"January\" on small-icu, depending on the user’s default locale\n// Should print \"enero\"\n</code></pre>\n<p>This mode provides a balance between features and binary size.</p>",
              "modules": [
                {
                  "textRaw": "Providing ICU data at runtime",
                  "name": "providing_icu_data_at_runtime",
                  "type": "module",
                  "desc": "<p>If the <code>small-icu</code> option is used, one can still provide additional locale data\nat runtime so that the JS methods would work for all ICU locales. Assuming the\ndata file is stored at <code>/runtime/directory/with/dat/file</code>, it can be made\navailable to ICU through either:</p>\n<ul>\n<li>\n<p>The <code>--with-icu-default-data-dir</code> configure option:</p>\n<pre><code class=\"language-bash\">./configure --with-icu-default-data-dir=/runtime/directory/with/dat/file --with-intl=small-icu\n</code></pre>\n<p>This only embeds the default data directory path into the binary.\nThe actual data file is going to be loaded at runtime from this directory\npath.</p>\n</li>\n<li>\n<p>The <a href=\"cli.html#node_icu_datafile\"><code>NODE_ICU_DATA</code></a> environment variable:</p>\n<pre><code class=\"language-bash\">env NODE_ICU_DATA=/runtime/directory/with/dat/file node\n</code></pre>\n</li>\n<li>\n<p>The <a href=\"cli.html#--icu-data-dirfile\"><code>--icu-data-dir</code></a> CLI parameter:</p>\n<pre><code class=\"language-bash\">node --icu-data-dir=/runtime/directory/with/dat/file\n</code></pre>\n</li>\n</ul>\n<p>When more than one of them is specified, the <code>--icu-data-dir</code> CLI parameter has\nthe highest precedence, then the <code>NODE_ICU_DATA</code>  environment variable, then\nthe <code>--with-icu-default-data-dir</code> configure option.</p>\n<p>ICU is able to automatically find and load a variety of data formats, but the\ndata must be appropriate for the ICU version, and the file correctly named.\nThe most common name for the data file is <code>icudtX[bl].dat</code>, where <code>X</code> denotes\nthe intended ICU version, and <code>b</code> or <code>l</code> indicates the system's endianness.\nNode.js would fail to load if the expected data file cannot be read from the\nspecified directory. The name of the data file corresponding to the current\nNode.js version can be computed with:</p>\n<pre><code class=\"language-js\">`icudt${process.versions.icu.split('.')[0]}${os.endianness()[0].toLowerCase()}.dat`;\n</code></pre>\n<p>Check <a href=\"http://userguide.icu-project.org/icudata\">\"ICU Data\"</a> article in the ICU User Guide for other supported formats\nand more details on ICU data in general.</p>\n<p>The <a href=\"https://www.npmjs.com/package/full-icu\">full-icu</a> npm module can greatly simplify ICU data installation by\ndetecting the ICU version of the running <code>node</code> executable and downloading the\nappropriate data file. After installing the module through <code>npm i full-icu</code>,\nthe data file will be available at <code>./node_modules/full-icu</code>. This path can be\nthen passed either to <code>NODE_ICU_DATA</code> or <code>--icu-data-dir</code> as shown above to\nenable full <code>Intl</code> support.</p>",
                  "displayName": "Providing ICU data at runtime"
                }
              ],
              "displayName": "Embed a limited set of ICU data (`small-icu`)"
            },
            {
              "textRaw": "Embed the entire ICU (`full-icu`)",
              "name": "embed_the_entire_icu_(`full-icu`)",
              "type": "module",
              "desc": "<p>This option makes the resulting binary link against ICU statically and include\na full set of ICU data. A binary created this way has no further external\ndependencies and supports all locales, but might be rather large. This is\nthe default behavior if no <code>--with-intl</code> flag is passed. The official binaries\nare also built in this mode.</p>",
              "displayName": "Embed the entire ICU (`full-icu`)"
            }
          ],
          "displayName": "Options for building Node.js"
        },
        {
          "textRaw": "Detecting internationalization support",
          "name": "detecting_internationalization_support",
          "type": "misc",
          "desc": "<p>To verify that ICU is enabled at all (<code>system-icu</code>, <code>small-icu</code>, or\n<code>full-icu</code>), simply checking the existence of <code>Intl</code> should suffice:</p>\n<pre><code class=\"language-js\">const hasICU = typeof Intl === 'object';\n</code></pre>\n<p>Alternatively, checking for <code>process.versions.icu</code>, a property defined only\nwhen ICU is enabled, works too:</p>\n<pre><code class=\"language-js\">const hasICU = typeof process.versions.icu === 'string';\n</code></pre>\n<p>To check for support for a non-English locale (i.e. <code>full-icu</code> or\n<code>system-icu</code>), <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat\"><code>Intl.DateTimeFormat</code></a> can be a good distinguishing factor:</p>\n<pre><code class=\"language-js\">const hasFullICU = (() => {\n  try {\n    const january = new Date(9e8);\n    const spanish = new Intl.DateTimeFormat('es', { month: 'long' });\n    return spanish.format(january) === 'enero';\n  } catch (err) {\n    return false;\n  }\n})();\n</code></pre>\n<p>For more verbose tests for <code>Intl</code> support, the following resources may be found\nto be helpful:</p>\n<ul>\n<li><a href=\"https://github.com/srl295/btest402\">btest402</a>: Generally used to check whether Node.js with <code>Intl</code> support is\nbuilt correctly.</li>\n<li><a href=\"https://github.com/tc39/test262/tree/HEAD/test/intl402\">Test262</a>: ECMAScript's official conformance test suite includes a section\ndedicated to ECMA-402.</li>\n</ul>",
          "displayName": "Detecting internationalization support"
        }
      ],
      "source": "doc/api/intl.md"
    },
    {
      "textRaw": "Modules: ECMAScript modules",
      "name": "Modules: ECMAScript modules",
      "introduced_in": "v8.5.0",
      "type": "misc",
      "meta": {
        "added": [
          "v8.5.0"
        ],
        "changes": [
          {
            "version": [
              "v23.1.0",
              "v22.12.0",
              "v20.18.3",
              "v18.20.5"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/55333",
            "description": "Import attributes are no longer experimental."
          },
          {
            "version": "v22.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/52104",
            "description": "Drop support for import assertions."
          },
          {
            "version": [
              "v21.0.0",
              "v20.10.0",
              "v18.20.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/50140",
            "description": "Add experimental support for import attributes."
          },
          {
            "version": [
              "v20.0.0",
              "v18.19.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/44710",
            "description": "Module customization hooks are executed off the main thread."
          },
          {
            "version": [
              "v18.6.0",
              "v16.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/42623",
            "description": "Add support for chaining module customization hooks."
          },
          {
            "version": [
              "v17.1.0",
              "v16.14.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/40250",
            "description": "Add experimental support for import assertions."
          },
          {
            "version": [
              "v17.0.0",
              "v16.12.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/37468",
            "description": "Consolidate customization hooks, removed `getFormat`, `getSource`, `transformSource`, and `getGlobalPreloadCode` hooks added `load` and `globalPreload` hooks allowed returning `format` from either `resolve` or `load` hooks."
          },
          {
            "version": [
              "v15.3.0",
              "v14.17.0",
              "v12.22.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/35781",
            "description": "Stabilize modules implementation."
          },
          {
            "version": [
              "v14.13.0",
              "v12.20.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/35249",
            "description": "Support for detection of CommonJS named exports."
          },
          {
            "version": "v14.8.0",
            "pr-url": "https://github.com/nodejs/node/pull/34558",
            "description": "Unflag Top-Level Await."
          },
          {
            "version": [
              "v14.0.0",
              "v13.14.0",
              "v12.20.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/31974",
            "description": "Remove experimental modules warning."
          },
          {
            "version": [
              "v13.2.0",
              "v12.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/29866",
            "description": "Loading ECMAScript modules no longer requires a command-line flag."
          },
          {
            "version": "v12.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/26745",
            "description": "Add support for ES modules using `.js` file extension via `package.json` `\"type\"` field."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "miscs": [
        {
          "textRaw": "Introduction",
          "name": "introduction",
          "type": "misc",
          "desc": "<p>ECMAScript modules are <a href=\"https://tc39.github.io/ecma262/#sec-modules\">the official standard format</a> to package JavaScript\ncode for reuse. Modules are defined using a variety of <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import\"><code>import</code></a> and\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export\"><code>export</code></a> statements.</p>\n<p>The following example of an ES module exports a function:</p>\n<pre><code class=\"language-js\">// addTwo.mjs\nfunction addTwo(num) {\n  return num + 2;\n}\n\nexport { addTwo };\n</code></pre>\n<p>The following example of an ES module imports the function from <code>addTwo.mjs</code>:</p>\n<pre><code class=\"language-js\">// app.mjs\nimport { addTwo } from './addTwo.mjs';\n\n// Prints: 6\nconsole.log(addTwo(4));\n</code></pre>\n<p>Node.js fully supports ECMAScript modules as they are currently specified and\nprovides interoperability between them and its original module format,\n<a href=\"modules.html\">CommonJS</a>.</p>\n<p><i id=\"esm_package_json_type_field\"></i><i id=\"esm_package_scope_and_file_extensions\"></i><i id=\"esm_input_type_flag\"></i></p>",
          "displayName": "Introduction"
        },
        {
          "textRaw": "Enabling",
          "name": "Enabling",
          "type": "misc",
          "desc": "<p>Node.js has two module systems: <a href=\"modules.html\">CommonJS</a> modules and ECMAScript modules.</p>\n<p>Authors can tell Node.js to interpret JavaScript as an ES module via the <code>.mjs</code>\nfile extension, the <code>package.json</code> <a href=\"packages.html#type\"><code>\"type\"</code></a> field with a value <code>\"module\"</code>,\nor the <a href=\"cli.html#--input-typetype\"><code>--input-type</code></a> flag with a value of <code>\"module\"</code>. These are explicit\nmarkers of code being intended to run as an ES module.</p>\n<p>Inversely, authors can explicitly tell Node.js to interpret JavaScript as\nCommonJS via the <code>.cjs</code> file extension, the <code>package.json</code> <a href=\"packages.html#type\"><code>\"type\"</code></a> field\nwith a value <code>\"commonjs\"</code>, or the <a href=\"cli.html#--input-typetype\"><code>--input-type</code></a> flag with a value of\n<code>\"commonjs\"</code>.</p>\n<p>When code lacks explicit markers for either module system, Node.js will inspect\nthe source code of a module to look for ES module syntax. If such syntax is\nfound, Node.js will run the code as an ES module; otherwise it will run the\nmodule as CommonJS. See <a href=\"packages.html#determining-module-system\">Determining module system</a> for more details.</p>\n<p><i id=\"esm_package_entry_points\"></i><i id=\"esm_main_entry_point_export\"></i><i id=\"esm_subpath_exports\"></i><i id=\"esm_package_exports_fallbacks\"></i><i id=\"esm_exports_sugar\"></i><i id=\"esm_conditional_exports\"></i><i id=\"esm_nested_conditions\"></i><i id=\"esm_self_referencing_a_package_using_its_name\"></i><i id=\"esm_internal_package_imports\"></i><i id=\"esm_dual_commonjs_es_module_packages\"></i><i id=\"esm_dual_package_hazard\"></i><i id=\"esm_writing_dual_packages_while_avoiding_or_minimizing_hazards\"></i><i id=\"esm_approach_1_use_an_es_module_wrapper\"></i><i id=\"esm_approach_2_isolate_state\"></i></p>"
        },
        {
          "textRaw": "Packages",
          "name": "packages",
          "type": "misc",
          "desc": "<p>This section was moved to <a href=\"packages.html\">Modules: Packages</a>.</p>",
          "displayName": "Packages"
        },
        {
          "textRaw": "`import` Specifiers",
          "name": "`import`_specifiers",
          "type": "misc",
          "modules": [
            {
              "textRaw": "Terminology",
              "name": "terminology",
              "type": "module",
              "desc": "<p>The <em>specifier</em> of an <code>import</code> statement is the string after the <code>from</code> keyword,\ne.g. <code>'node:path'</code> in <code>import { sep } from 'node:path'</code>. Specifiers are also\nused in <code>export from</code> statements, and as the argument to an <code>import()</code>\nexpression.</p>\n<p>There are three types of specifiers:</p>\n<ul>\n<li>\n<p><em>Relative specifiers</em> like <code>'./startup.js'</code> or <code>'../config.mjs'</code>. They refer\nto a path relative to the location of the importing file. <em>The file extension\nis always necessary for these.</em></p>\n</li>\n<li>\n<p><em>Bare specifiers</em> like <code>'some-package'</code> or <code>'some-package/shuffle'</code>. They can\nrefer to the main entry point of a package by the package name, or a\nspecific feature module within a package prefixed by the package name as per\nthe examples respectively. <em>Including the file extension is only necessary\nfor packages without an <a href=\"packages.html#exports\"><code>\"exports\"</code></a> field.</em></p>\n</li>\n<li>\n<p><em>Absolute specifiers</em> like <code>'file:///opt/nodejs/config.js'</code>. They refer\ndirectly and explicitly to a full path.</p>\n</li>\n</ul>\n<p>Bare specifier resolutions are handled by the <a href=\"#resolution-algorithm-specification\">Node.js module\nresolution and loading algorithm</a>.\nAll other specifier resolutions are always only resolved with\nthe standard relative <a href=\"https://url.spec.whatwg.org/\">URL</a> resolution semantics.</p>\n<p>Like in CommonJS, module files within packages can be accessed by appending a\npath to the package name unless the package's <a href=\"packages.html#nodejs-packagejson-field-definitions\"><code>package.json</code></a> contains an\n<a href=\"packages.html#exports\"><code>\"exports\"</code></a> field, in which case files within packages can only be accessed\nvia the paths defined in <a href=\"packages.html#exports\"><code>\"exports\"</code></a>.</p>\n<p>For details on these package resolution rules that apply to bare specifiers in\nthe Node.js module resolution, see the <a href=\"packages.html\">packages documentation</a>.</p>",
              "displayName": "Terminology"
            },
            {
              "textRaw": "Mandatory file extensions",
              "name": "mandatory_file_extensions",
              "type": "module",
              "desc": "<p>A file extension must be provided when using the <code>import</code> keyword to resolve\nrelative or absolute specifiers. Directory indexes (e.g. <code>'./startup/index.js'</code>)\nmust also be fully specified.</p>\n<p>This behavior matches how <code>import</code> behaves in browser environments, assuming a\ntypically configured server.</p>",
              "displayName": "Mandatory file extensions"
            },
            {
              "textRaw": "URLs",
              "name": "urls",
              "type": "module",
              "desc": "<p>ES modules are resolved and cached as URLs. This means that special characters\nmust be <a href=\"url.html#percent-encoding-in-urls\">percent-encoded</a>, such as <code>#</code> with <code>%23</code> and <code>?</code> with <code>%3F</code>.</p>\n<p><code>file:</code>, <code>node:</code>, and <code>data:</code> URL schemes are supported. A specifier like\n<code>'https://example.com/app.js'</code> is not supported natively in Node.js unless using\na <a href=\"module.html#import-from-https\">custom HTTPS loader</a>.</p>",
              "modules": [
                {
                  "textRaw": "`file:` URLs",
                  "name": "`file:`_urls",
                  "type": "module",
                  "desc": "<p>Modules are loaded multiple times if the <code>import</code> specifier used to resolve\nthem has a different query or fragment.</p>\n<pre><code class=\"language-js\">import './foo.mjs?query=1'; // loads ./foo.mjs with query of \"?query=1\"\nimport './foo.mjs?query=2'; // loads ./foo.mjs with query of \"?query=2\"\n</code></pre>\n<p>The volume root may be referenced via <code>/</code>, <code>//</code>, or <code>file:///</code>. Given the\ndifferences between <a href=\"https://url.spec.whatwg.org/\">URL</a> and path resolution (such as percent encoding\ndetails), it is recommended to use <a href=\"url.html#urlpathtofileurlpath-options\">url.pathToFileURL</a> when importing a path.</p>",
                  "displayName": "`file:` URLs"
                },
                {
                  "textRaw": "`data:` imports",
                  "name": "`data:`_imports",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/URI/Reference/Schemes/data\"><code>data:</code> URLs</a> are supported for importing with the following MIME types:</p>\n<ul>\n<li><code>text/javascript</code> for ES modules</li>\n<li><code>application/json</code> for JSON</li>\n<li><code>application/wasm</code> for Wasm</li>\n</ul>\n<pre><code class=\"language-js\">import 'data:text/javascript,console.log(\"hello!\");';\nimport _ from 'data:application/json,\"world!\"' with { type: 'json' };\n</code></pre>\n<p><code>data:</code> URLs only resolve <a href=\"#terminology\">bare specifiers</a> for builtin modules\nand <a href=\"#terminology\">absolute specifiers</a>. Resolving\n<a href=\"#terminology\">relative specifiers</a> does not work because <code>data:</code> is not a\n<a href=\"https://url.spec.whatwg.org/#special-scheme\">special scheme</a>. For example, attempting to load <code>./foo</code>\nfrom <code>data:text/javascript,import \"./foo\";</code> fails to resolve because there\nis no concept of relative resolution for <code>data:</code> URLs.</p>",
                  "displayName": "`data:` imports"
                },
                {
                  "textRaw": "`node:` imports",
                  "name": "`node:`_imports",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v14.13.1",
                      "v12.20.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v16.0.0",
                          "v14.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/37246",
                        "description": "Added `node:` import support to `require(...)`."
                      }
                    ]
                  },
                  "desc": "<p><code>node:</code> URLs are supported as an alternative means to load Node.js builtin\nmodules. This URL scheme allows for builtin modules to be referenced by valid\nabsolute URL strings.</p>\n<pre><code class=\"language-js\">import fs from 'node:fs/promises';\n</code></pre>\n<p><a id=\"import-assertions\"></a></p>",
                  "displayName": "`node:` imports"
                }
              ],
              "displayName": "URLs"
            }
          ],
          "displayName": "`import` Specifiers"
        },
        {
          "textRaw": "Import attributes",
          "name": "import_attributes",
          "type": "misc",
          "meta": {
            "added": [
              "v17.1.0",
              "v16.14.0"
            ],
            "changes": [
              {
                "version": [
                  "v21.0.0",
                  "v20.10.0",
                  "v18.20.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/50140",
                "description": "Switch from Import Assertions to Import Attributes."
              }
            ]
          },
          "desc": "<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with\">Import attributes</a> are an inline syntax for module import\nstatements to pass on more information alongside the module specifier.</p>\n<pre><code class=\"language-js\">import fooData from './foo.json' with { type: 'json' };\n\nconst { default: barData } =\n  await import('./bar.json', { with: { type: 'json' } });\n</code></pre>\n<p>Node.js only supports the <code>type</code> attribute, for which it supports the following values:</p>\n<table>\n<thead>\n<tr>\n<th>Attribute <code>type</code></th>\n<th>Needed for</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'json'</code></td>\n<td><a href=\"#json-modules\">JSON modules</a></td>\n</tr>\n</tbody>\n</table>\n<p>The <code>type: 'json'</code> attribute is mandatory when importing JSON modules.</p>",
          "displayName": "Import attributes"
        },
        {
          "textRaw": "Built-in modules",
          "name": "built-in_modules",
          "type": "misc",
          "desc": "<p><a href=\"modules.html#built-in-modules\">Built-in modules</a> provide named exports of their public API. A\ndefault export is also provided which is the value of the CommonJS exports.\nThe default export can be used for, among other things, modifying the named\nexports. Named exports of built-in modules are updated only by calling\n<a href=\"module.html#modulesyncbuiltinesmexports\"><code>module.syncBuiltinESMExports()</code></a>.</p>\n<pre><code class=\"language-js\">import EventEmitter from 'node:events';\nconst e = new EventEmitter();\n</code></pre>\n<pre><code class=\"language-js\">import { readFile } from 'node:fs';\nreadFile('./foo.txt', (err, source) => {\n  if (err) {\n    console.error(err);\n  } else {\n    console.log(source);\n  }\n});\n</code></pre>\n<pre><code class=\"language-js\">import fs, { readFileSync } from 'node:fs';\nimport { syncBuiltinESMExports } from 'node:module';\nimport { Buffer } from 'node:buffer';\n\nfs.readFileSync = () => Buffer.from('Hello, ESM');\nsyncBuiltinESMExports();\n\nfs.readFileSync === readFileSync;\n</code></pre>\n<blockquote>\n<p>When importing built-in modules, all the named exports (i.e. properties of the module exports object)\nare populated even if they are not individually accessed.\nThis can make initial imports of built-in modules slightly slower compared to loading them with\n<code>require()</code> or <code>process.getBuiltinModule()</code>, where the module exports object is evaluated immediately,\nbut some of its properties may only be initialized when first accessed individually.</p>\n</blockquote>",
          "displayName": "Built-in modules"
        },
        {
          "textRaw": "`import()` expressions",
          "name": "`import()`_expressions",
          "type": "misc",
          "desc": "<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import\">Dynamic <code>import()</code></a> provides an asynchronous way to import modules. It is\nsupported in both CommonJS and ES modules, and can be used to load both CommonJS\nand ES modules.</p>",
          "displayName": "`import()` expressions"
        },
        {
          "textRaw": "Interoperability with CommonJS",
          "name": "interoperability_with_commonjs",
          "type": "misc",
          "modules": [
            {
              "textRaw": "`import` statements",
              "name": "`import`_statements",
              "type": "module",
              "desc": "<p>An <code>import</code> statement can reference an ES module or a CommonJS module.\n<code>import</code> statements are permitted only in ES modules, but dynamic <a href=\"#import-expressions\"><code>import()</code></a>\nexpressions are supported in CommonJS for loading ES modules.</p>\n<p>When importing <a href=\"#commonjs-namespaces\">CommonJS modules</a>, the\n<code>module.exports</code> object is provided as the default export. Named exports may be\navailable, provided by static analysis as a convenience for better ecosystem\ncompatibility.</p>",
              "displayName": "`import` statements"
            },
            {
              "textRaw": "`require`",
              "name": "`require`",
              "type": "module",
              "desc": "<p>The CommonJS module <code>require</code> currently only supports loading synchronous ES\nmodules (that is, ES modules that do not use top-level <code>await</code>).</p>\n<p>See <a href=\"modules.html#loading-ecmascript-modules-using-require\">Loading ECMAScript modules using <code>require()</code></a> for details.</p>",
              "displayName": "`require`"
            },
            {
              "textRaw": "CommonJS Namespaces",
              "name": "commonjs_namespaces",
              "type": "module",
              "meta": {
                "added": [
                  "v14.13.0"
                ],
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53848",
                    "description": "Added `'module.exports'` export marker to CJS namespaces."
                  }
                ]
              },
              "desc": "<p>CommonJS modules consist of a <code>module.exports</code> object which can be of any type.</p>\n<p>To support this, when importing CommonJS from an ECMAScript module, a namespace\nwrapper for the CommonJS module is constructed, which always provides a\n<code>default</code> export key pointing to the CommonJS <code>module.exports</code> value.</p>\n<p>In addition, a heuristic static analysis is performed against the source text of\nthe CommonJS module to get a best-effort static list of exports to provide on\nthe namespace from values on <code>module.exports</code>. This is necessary since these\nnamespaces must be constructed prior to the evaluation of the CJS module.</p>\n<p>These CommonJS namespace objects also provide the <code>default</code> export as a\n<code>'module.exports'</code> named export, in order to unambiguously indicate that their\nrepresentation in CommonJS uses this value, and not the namespace value. This\nmirrors the semantics of the handling of the <code>'module.exports'</code> export name in\n<a href=\"modules.html#loading-ecmascript-modules-using-require\"><code>require(esm)</code></a> interop support.</p>\n<p>When importing a CommonJS module, it can be reliably imported using the ES\nmodule default import or its corresponding sugar syntax:</p>\n<pre><code class=\"language-js\">import { default as cjs } from 'cjs';\n// Identical to the above\nimport cjsSugar from 'cjs';\n\nconsole.log(cjs);\nconsole.log(cjs === cjsSugar);\n// Prints:\n//   &#x3C;module.exports>\n//   true\n</code></pre>\n<p>This Module Namespace Exotic Object can be directly observed either when using\n<code>import * as m from 'cjs'</code> or a dynamic import:</p>\n<pre><code class=\"language-js\">import * as m from 'cjs';\nconsole.log(m);\nconsole.log(m === await import('cjs'));\n// Prints:\n//   [Module] { default: &#x3C;module.exports>, 'module.exports': &#x3C;module.exports> }\n//   true\n</code></pre>\n<p>For better compatibility with existing usage in the JS ecosystem, Node.js\nin addition attempts to determine the CommonJS named exports of every imported\nCommonJS module to provide them as separate ES module exports using a static\nanalysis process.</p>\n<p>For example, consider a CommonJS module written:</p>\n<pre><code class=\"language-cjs\">// cjs.cjs\nexports.name = 'exported';\n</code></pre>\n<p>The preceding module supports named imports in ES modules:</p>\n<pre><code class=\"language-js\">import { name } from './cjs.cjs';\nconsole.log(name);\n// Prints: 'exported'\n\nimport cjs from './cjs.cjs';\nconsole.log(cjs);\n// Prints: { name: 'exported' }\n\nimport * as m from './cjs.cjs';\nconsole.log(m);\n// Prints:\n//   [Module] {\n//     default: { name: 'exported' },\n//     'module.exports': { name: 'exported' },\n//     name: 'exported'\n//   }\n</code></pre>\n<p>As can be seen from the last example of the Module Namespace Exotic Object being\nlogged, the <code>name</code> export is copied off of the <code>module.exports</code> object and set\ndirectly on the ES module namespace when the module is imported.</p>\n<p>Live binding updates or new exports added to <code>module.exports</code> are not detected\nfor these named exports.</p>\n<p>The detection of named exports is based on common syntax patterns but does not\nalways correctly detect named exports. In these cases, using the default\nimport form described above can be a better option.</p>\n<p>Named exports detection covers many common export patterns, reexport patterns\nand build tool and transpiler outputs. See <a href=\"https://github.com/anonrig/merve/tree/v1.0.0\">merve</a> for the exact\nsemantics implemented.</p>",
              "displayName": "CommonJS Namespaces"
            },
            {
              "textRaw": "Differences between ES modules and CommonJS",
              "name": "differences_between_es_modules_and_commonjs",
              "type": "module",
              "modules": [
                {
                  "textRaw": "No `require`, `exports`, or `module.exports`",
                  "name": "no_`require`,_`exports`,_or_`module.exports`",
                  "type": "module",
                  "desc": "<p>In most cases, the ES module <code>import</code> can be used to load CommonJS modules.</p>\n<p>If needed, a <code>require</code> function can be constructed within an ES module using\n<a href=\"module.html#modulecreaterequirefilename\"><code>module.createRequire()</code></a>.</p>",
                  "displayName": "No `require`, `exports`, or `module.exports`"
                },
                {
                  "textRaw": "No `__filename` or `__dirname`",
                  "name": "no_`__filename`_or_`__dirname`",
                  "type": "module",
                  "desc": "<p>These CommonJS variables are not available in ES modules.</p>\n<p><code>__filename</code> and <code>__dirname</code> use cases can be replicated via\n<a href=\"#importmetafilename\"><code>import.meta.filename</code></a> and <a href=\"#importmetadirname\"><code>import.meta.dirname</code></a>.</p>",
                  "displayName": "No `__filename` or `__dirname`"
                },
                {
                  "textRaw": "No Addon Loading",
                  "name": "no_addon_loading",
                  "type": "module",
                  "desc": "<p><a href=\"addons.html\">Addons</a> are not currently supported with ES module imports.</p>\n<p>They can instead be loaded with <a href=\"module.html#modulecreaterequirefilename\"><code>module.createRequire()</code></a> or\n<a href=\"process.html#processdlopenmodule-filename-flags\"><code>process.dlopen</code></a>.</p>",
                  "displayName": "No Addon Loading"
                },
                {
                  "textRaw": "No `require.main`",
                  "name": "no_`require.main`",
                  "type": "module",
                  "desc": "<p>To replace <code>require.main === module</code>, there is the <a href=\"#importmetamain\"><code>import.meta.main</code></a> API.</p>",
                  "displayName": "No `require.main`"
                },
                {
                  "textRaw": "No `require.resolve`",
                  "name": "no_`require.resolve`",
                  "type": "module",
                  "desc": "<p>Relative resolution can be handled via <code>new URL('./local', import.meta.url)</code>.</p>\n<p>For a complete <code>require.resolve</code> replacement, there is the\n<a href=\"#importmetaresolvespecifier\">import.meta.resolve</a> API.</p>\n<p>Alternatively <code>module.createRequire()</code> can be used.</p>",
                  "displayName": "No `require.resolve`"
                },
                {
                  "textRaw": "No `NODE_PATH`",
                  "name": "no_`node_path`",
                  "type": "module",
                  "desc": "<p><code>NODE_PATH</code> is not part of resolving <code>import</code> specifiers. Please use symlinks\nif this behavior is desired.</p>",
                  "displayName": "No `NODE_PATH`"
                },
                {
                  "textRaw": "No `require.extensions`",
                  "name": "no_`require.extensions`",
                  "type": "module",
                  "desc": "<p><code>require.extensions</code> is not used by <code>import</code>. Module customization hooks can\nprovide a replacement.</p>",
                  "displayName": "No `require.extensions`"
                },
                {
                  "textRaw": "No `require.cache`",
                  "name": "no_`require.cache`",
                  "type": "module",
                  "desc": "<p><code>require.cache</code> is not used by <code>import</code> as the ES module loader has its own\nseparate cache.</p>\n<p><i id=\"esm_experimental_json_modules\"></i></p>",
                  "displayName": "No `require.cache`"
                }
              ],
              "displayName": "Differences between ES modules and CommonJS"
            }
          ],
          "displayName": "Interoperability with CommonJS"
        },
        {
          "textRaw": "JSON modules",
          "name": "json_modules",
          "type": "misc",
          "meta": {
            "changes": [
              {
                "version": [
                  "v23.1.0",
                  "v22.12.0",
                  "v20.18.3",
                  "v18.20.5"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/55333",
                "description": "JSON modules are no longer experimental."
              }
            ]
          },
          "desc": "<p>JSON files can be referenced by <code>import</code>:</p>\n<pre><code class=\"language-js\">import packageConfig from './package.json' with { type: 'json' };\n</code></pre>\n<p>The <code>with { type: 'json' }</code> syntax is mandatory; see <a href=\"#import-attributes\">Import Attributes</a>.</p>\n<p>The imported JSON only exposes a <code>default</code> export. There is no support for named\nexports. A cache entry is created in the CommonJS cache to avoid duplication.\nThe same object is returned in CommonJS if the JSON module has already been\nimported from the same path.</p>\n<p><i id=\"esm_experimental_wasm_modules\"></i></p>",
          "displayName": "JSON modules"
        },
        {
          "textRaw": "Wasm modules",
          "name": "wasm_modules",
          "type": "misc",
          "meta": {
            "changes": [
              {
                "version": [
                  "v24.5.0",
                  "v22.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57038",
                "description": "Wasm modules no longer require the `--experimental-wasm-modules` flag."
              }
            ]
          },
          "desc": "<p>Importing both WebAssembly module instances and WebAssembly source phase\nimports is supported.</p>\n<p>Both of these integrations are in line with the\n<a href=\"https://github.com/webassembly/esm-integration\">ES Module Integration Proposal for WebAssembly</a>.</p>",
          "modules": [
            {
              "textRaw": "Wasm Source Phase Imports",
              "name": "wasm_source_phase_imports",
              "type": "module",
              "meta": {
                "added": [
                  "v24.0.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "desc": "<p>The <a href=\"https://github.com/tc39/proposal-source-phase-imports\">Source Phase Imports</a> proposal allows the <code>import source</code> keyword\ncombination to import a <code>WebAssembly.Module</code> object directly, instead of getting\na module instance already instantiated with its dependencies.</p>\n<p>This is useful when needing custom instantiations for Wasm, while still\nresolving and loading it through the ES module integration.</p>\n<p>For example, to create multiple instances of a module, or to pass custom imports\ninto a new instance of <code>library.wasm</code>:</p>\n<pre><code class=\"language-js\">import source libraryModule from './library.wasm';\n\nconst instance1 = await WebAssembly.instantiate(libraryModule, importObject1);\n\nconst instance2 = await WebAssembly.instantiate(libraryModule, importObject2);\n</code></pre>\n<p>In addition to the static source phase, there is also a dynamic variant of the\nsource phase via the <code>import.source</code> dynamic phase import syntax:</p>\n<pre><code class=\"language-js\">const dynamicLibrary = await import.source('./library.wasm');\n\nconst instance = await WebAssembly.instantiate(dynamicLibrary, importObject);\n</code></pre>",
              "displayName": "Wasm Source Phase Imports"
            },
            {
              "textRaw": "JavaScript String Builtins",
              "name": "javascript_string_builtins",
              "type": "module",
              "meta": {
                "added": [
                  "v24.5.0",
                  "v22.19.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "desc": "<p>When importing WebAssembly modules, the\n<a href=\"https://github.com/WebAssembly/js-string-builtins\">WebAssembly JS String Builtins Proposal</a> is automatically enabled through the\nESM Integration. This allows WebAssembly modules to directly use efficient\ncompile-time string builtins from the <code>wasm:js-string</code> namespace.</p>\n<p>For example, the following Wasm module exports a string <code>getLength</code> function using\nthe <code>wasm:js-string</code> <code>length</code> builtin:</p>\n<pre><code class=\"language-text\">(module\n  ;; Compile-time import of the string length builtin.\n  (import \"wasm:js-string\" \"length\" (func $string_length (param externref) (result i32)))\n\n  ;; Define getLength, taking a JS value parameter assumed to be a string,\n  ;; calling string length on it and returning the result.\n  (func $getLength (param $str externref) (result i32)\n    local.get $str\n    call $string_length\n  )\n\n  ;; Export the getLength function.\n  (export \"getLength\" (func $get_length))\n)\n</code></pre>\n<pre><code class=\"language-js\">import { getLength } from './string-len.wasm';\ngetLength('foo'); // Returns 3.\n</code></pre>\n<p>Wasm builtins are compile-time imports that are linked during module compilation\nrather than during instantiation. They do not behave like normal module graph\nimports and they cannot be inspected via <code>WebAssembly.Module.imports(mod)</code>\nor virtualized unless recompiling the module using the direct\n<code>WebAssembly.compile</code> API with string builtins disabled.</p>\n<p>String constants may also be imported from the <code>wasm:js/string-constants</code> builtin\nimport URL, allowing static JS string globals to be defined:</p>\n<pre><code class=\"language-text\">(module\n  (import \"wasm:js/string-constants\" \"hello\" (global $hello externref))\n)\n</code></pre>\n<p>Importing a module in the source phase before it has been instantiated will also\nuse the compile-time builtins automatically:</p>\n<pre><code class=\"language-js\">import source mod from './string-len.wasm';\nconst { exports: { getLength } } = await WebAssembly.instantiate(mod, {});\ngetLength('foo'); // Also returns 3.\n</code></pre>",
              "displayName": "JavaScript String Builtins"
            },
            {
              "textRaw": "Wasm Instance Phase Imports",
              "name": "wasm_instance_phase_imports",
              "type": "module",
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>Instance imports allow any <code>.wasm</code> files to be imported as normal modules,\nsupporting their module imports in turn.</p>\n<p>For example, an <code>index.js</code> containing:</p>\n<pre><code class=\"language-js\">import * as M from './library.wasm';\nconsole.log(M);\n</code></pre>\n<p>executed under:</p>\n<pre><code class=\"language-bash\">node index.mjs\n</code></pre>\n<p>would provide the exports interface for the instantiation of <code>library.wasm</code>.</p>",
              "displayName": "Wasm Instance Phase Imports"
            },
            {
              "textRaw": "Reserved Wasm Namespaces",
              "name": "reserved_wasm_namespaces",
              "type": "module",
              "meta": {
                "added": [
                  "v24.5.0",
                  "v22.19.0"
                ],
                "changes": []
              },
              "desc": "<p>When importing WebAssembly module instances, they cannot use import module\nnames or import/export names that start with reserved prefixes:</p>\n<ul>\n<li><code>wasm-js:</code> - reserved in all module import names, module names and export\nnames.</li>\n<li><code>wasm:</code> - reserved in module import names and export names (imported module\nnames are allowed in order to support future builtin polyfills).</li>\n</ul>\n<p>Importing a module using the above reserved names will throw a\n<code>WebAssembly.LinkError</code>.</p>\n<p><i id=\"esm_experimental_top_level_await\"></i></p>",
              "displayName": "Reserved Wasm Namespaces"
            }
          ],
          "displayName": "Wasm modules"
        },
        {
          "textRaw": "Top-level `await`",
          "name": "top-level_`await`",
          "type": "misc",
          "meta": {
            "added": [
              "v14.8.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>await</code> keyword may be used in the top level body of an ECMAScript module.</p>\n<p>Assuming an <code>a.mjs</code> with</p>\n<pre><code class=\"language-js\">export const five = await Promise.resolve(5);\n</code></pre>\n<p>And a <code>b.mjs</code> with</p>\n<pre><code class=\"language-js\">import { five } from './a.mjs';\n\nconsole.log(five); // Logs `5`\n</code></pre>\n<pre><code class=\"language-bash\">node b.mjs # works\n</code></pre>\n<p>If a top level <code>await</code> expression never resolves, the <code>node</code> process will exit\nwith a <code>13</code> <a href=\"process.html#exit-codes\">status code</a>.</p>\n<pre><code class=\"language-js\">import { spawn } from 'node:child_process';\nimport { execPath } from 'node:process';\n\nspawn(execPath, [\n  '--input-type=module',\n  '--eval',\n  // Never-resolving Promise:\n  'await new Promise(() => {})',\n]).once('exit', (code) => {\n  console.log(code); // Logs `13`\n});\n</code></pre>\n<p><i id=\"esm_experimental_loaders\"></i></p>",
          "displayName": "Top-level `await`"
        },
        {
          "textRaw": "Loaders",
          "name": "loaders",
          "type": "misc",
          "desc": "<p>The former Loaders documentation is now at\n<a href=\"module.html#customization-hooks\">Modules: Customization hooks</a>.</p>",
          "displayName": "Loaders"
        },
        {
          "textRaw": "Resolution and loading algorithm",
          "name": "resolution_and_loading_algorithm",
          "type": "misc",
          "modules": [
            {
              "textRaw": "Features",
              "name": "features",
              "type": "module",
              "desc": "<p>The default resolver has the following properties:</p>\n<ul>\n<li>FileURL-based resolution as is used by ES modules</li>\n<li>Relative and absolute URL resolution</li>\n<li>No default extensions</li>\n<li>No folder mains</li>\n<li>Bare specifier package resolution lookup through node_modules</li>\n<li>Does not fail on unknown extensions or protocols</li>\n<li>Can optionally provide a hint of the format to the loading phase</li>\n</ul>\n<p>The default loader has the following properties</p>\n<ul>\n<li>Support for builtin module loading via <code>node:</code> URLs</li>\n<li>Support for \"inline\" module loading via <code>data:</code> URLs</li>\n<li>Support for <code>file:</code> module loading</li>\n<li>Fails on any other URL protocol</li>\n<li>Fails on unknown extensions for <code>file:</code> loading\n(supports only <code>.cjs</code>, <code>.js</code>, and <code>.mjs</code>)</li>\n</ul>",
              "displayName": "Features"
            },
            {
              "textRaw": "Resolution algorithm",
              "name": "resolution_algorithm",
              "type": "module",
              "desc": "<p>The algorithm to load an ES module specifier is given through the\n<strong>ESM_RESOLVE</strong> method below. It returns the resolved URL for a\nmodule specifier relative to a parentURL.</p>\n<p>The resolution algorithm determines the full resolved URL for a module\nload, along with its suggested module format. The resolution algorithm\ndoes not determine whether the resolved URL protocol can be loaded,\nor whether the file extensions are permitted, instead these validations\nare applied by Node.js during the load phase\n(for example, if it was asked to load a URL that has a protocol that is\nnot <code>file:</code>, <code>data:</code> or <code>node:</code>.</p>\n<p>The algorithm also tries to determine the format of the file based\non the extension (see <code>ESM_FILE_FORMAT</code> algorithm below). If it does\nnot recognize the file extension (eg if it is not <code>.mjs</code>, <code>.cjs</code>, or\n<code>.json</code>), then a format of <code>undefined</code> is returned,\nwhich will throw during the load phase.</p>\n<p>The algorithm to determine the module format of a resolved URL is\nprovided by <strong>ESM_FILE_FORMAT</strong>, which returns the unique module\nformat for any file. The <em>\"module\"</em> format is returned for an ECMAScript\nModule, while the <em>\"commonjs\"</em> format is used to indicate loading through the\nlegacy CommonJS loader. Additional formats such as <em>\"addon\"</em> can be extended in\nfuture updates.</p>\n<p>In the following algorithms, all subroutine errors are propagated as errors\nof these top-level routines unless stated otherwise.</p>\n<p><em>defaultConditions</em> is the conditional environment name array,\n<code>[\"node\", \"import\"]</code>.</p>\n<p>The resolver can throw the following errors:</p>\n<ul>\n<li><em>Invalid Module Specifier</em>: Module specifier is an invalid URL, package name\nor package subpath specifier.</li>\n<li><em>Invalid Package Configuration</em>: package.json configuration is invalid or\ncontains an invalid configuration.</li>\n<li><em>Invalid Package Target</em>: Package exports or imports define a target module\nfor the package that is an invalid type or string target.</li>\n<li><em>Package Path Not Exported</em>: Package exports do not define or permit a target\nsubpath in the package for the given module.</li>\n<li><em>Package Import Not Defined</em>: Package imports do not define the specifier.</li>\n<li><em>Module Not Found</em>: The package or module requested does not exist.</li>\n<li><em>Unsupported Directory Import</em>: The resolved path corresponds to a directory,\nwhich is not a supported target for module imports.</li>\n</ul>",
              "displayName": "Resolution algorithm"
            },
            {
              "textRaw": "Resolution Algorithm Specification",
              "name": "resolution_algorithm_specification",
              "type": "module",
              "desc": "<p><strong>ESM_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>resolved</em> be <strong>undefined</strong>.</li>\n<li>If <em>specifier</em> is a valid URL, then\n<ol>\n<li>Set <em>resolved</em> to the result of parsing and reserializing\n<em>specifier</em> as a URL.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>specifier</em> starts with <em>\"/\"</em>, <em>\"./\"</em>, or <em>\"../\"</em>, then\n<ol>\n<li>Set <em>resolved</em> to the URL resolution of <em>specifier</em> relative to\n<em>parentURL</em>.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>specifier</em> starts with <em>\"#\"</em>, then\n<ol>\n<li>Set <em>resolved</em> to the result of\n<strong>PACKAGE_IMPORTS_RESOLVE</strong>(<em>specifier</em>,\n<em>parentURL</em>, <em>defaultConditions</em>).</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>Note: <em>specifier</em> is now a bare specifier.</li>\n<li>Set <em>resolved</em> the result of\n<strong>PACKAGE_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>).</li>\n</ol>\n</li>\n<li>Let <em>format</em> be <strong>undefined</strong>.</li>\n<li>If <em>resolved</em> is a <em>\"file:\"</em> URL, then\n<ol>\n<li>If <em>resolved</em> contains any percent encodings of <em>\"/\"</em> or <em>\"\\\"</em> (<em>\"%2F\"</em>\nand <em>\"%5C\"</em> respectively), then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>If the file at <em>resolved</em> is a directory, then\n<ol>\n<li>Throw an <em>Unsupported Directory Import</em> error.</li>\n</ol>\n</li>\n<li>If the file at <em>resolved</em> does not exist, then\n<ol>\n<li>Throw a <em>Module Not Found</em> error.</li>\n</ol>\n</li>\n<li>Set <em>resolved</em> to the real path of <em>resolved</em>, maintaining the\nsame URL querystring and fragment components.</li>\n<li>Set <em>format</em> to the result of <strong>ESM_FILE_FORMAT</strong>(<em>resolved</em>).</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>Set <em>format</em> the module format of the content type associated with the\nURL <em>resolved</em>.</li>\n</ol>\n</li>\n<li>Return <em>format</em> and <em>resolved</em> to the loading phase</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_RESOLVE</strong>(<em>packageSpecifier</em>, <em>parentURL</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>packageName</em> be <strong>undefined</strong>.</li>\n<li>If <em>packageSpecifier</em> is an empty string, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>If <em>packageSpecifier</em> is a Node.js builtin module name, then\n<ol>\n<li>Return the string <em>\"node:\"</em> concatenated with <em>packageSpecifier</em>.</li>\n</ol>\n</li>\n<li>If <em>packageSpecifier</em> does not start with <em>\"@\"</em>, then\n<ol>\n<li>Set <em>packageName</em> to the substring of <em>packageSpecifier</em> until the first\n<em>\"/\"</em> separator or the end of the string.</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>If <em>packageSpecifier</em> does not contain a <em>\"/\"</em> separator, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>Set <em>packageName</em> to the substring of <em>packageSpecifier</em>\nuntil the second <em>\"/\"</em> separator or the end of the string.</li>\n</ol>\n</li>\n<li>If <em>packageName</em> starts with <em>\".\"</em> or contains <em>\"\\\"</em> or <em>\"%\"</em>, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>Let <em>packageSubpath</em> be <em>\".\"</em> concatenated with the substring of\n<em>packageSpecifier</em> from the position at the length of <em>packageName</em>.</li>\n<li>Let <em>selfUrl</em> be the result of\n<strong>PACKAGE_SELF_RESOLVE</strong>(<em>packageName</em>, <em>packageSubpath</em>, <em>parentURL</em>).</li>\n<li>If <em>selfUrl</em> is not <strong>undefined</strong>, return <em>selfUrl</em>.</li>\n<li>While <em>parentURL</em> is not the file system root,\n<ol>\n<li>Let <em>packageURL</em> be the URL resolution of <em>\"node_modules/\"</em>\nconcatenated with <em>packageName</em>, relative to <em>parentURL</em>.</li>\n<li>Set <em>parentURL</em> to the parent folder URL of <em>parentURL</em>.</li>\n<li>If the folder at <em>packageURL</em> does not exist, then\n<ol>\n<li>Continue the next loop iteration.</li>\n</ol>\n</li>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>).</li>\n<li>If <em>pjson</em> is not <strong>null</strong> and <em>pjson</em>.<em>exports</em> is not <strong>null</strong> or\n<strong>undefined</strong>, then\n<ol>\n<li>Return the result of <strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>,\n<em>packageSubpath</em>, <em>pjson.exports</em>, <em>defaultConditions</em>).</li>\n</ol>\n</li>\n<li>Otherwise, if <em>packageSubpath</em> is equal to <em>\".\"</em>, then\n<ol>\n<li>If <em>pjson.main</em> is a string, then\n<ol>\n<li>Return the URL resolution of <em>main</em> in <em>packageURL</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Otherwise,\n<ol>\n<li>Return the URL resolution of <em>packageSubpath</em> in <em>packageURL</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Throw a <em>Module Not Found</em> error.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_SELF_RESOLVE</strong>(<em>packageName</em>, <em>packageSubpath</em>, <em>parentURL</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>packageURL</em> be the result of <strong>LOOKUP_PACKAGE_SCOPE</strong>(<em>parentURL</em>).</li>\n<li>If <em>packageURL</em> is <strong>null</strong>, then\n<ol>\n<li>Return <strong>undefined</strong>.</li>\n</ol>\n</li>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>).</li>\n<li>If <em>pjson</em> is <strong>null</strong> or if <em>pjson</em>.<em>exports</em> is <strong>null</strong> or\n<strong>undefined</strong>, then\n<ol>\n<li>Return <strong>undefined</strong>.</li>\n</ol>\n</li>\n<li>If <em>pjson.name</em> is equal to <em>packageName</em>, then\n<ol>\n<li>Return the result of <strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>,\n<em>packageSubpath</em>, <em>pjson.exports</em>, <em>defaultConditions</em>).</li>\n</ol>\n</li>\n<li>Otherwise, return <strong>undefined</strong>.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_EXPORTS_RESOLVE</strong>(<em>packageURL</em>, <em>subpath</em>, <em>exports</em>, <em>conditions</em>)</p>\n<p>Note: This function is directly invoked by the CommonJS resolution algorithm.</p>\n<blockquote>\n<ol>\n<li>If <em>exports</em> is an Object with both a key starting with <em>\".\"</em> and a key not\nstarting with <em>\".\"</em>, throw an <em>Invalid Package Configuration</em> error.</li>\n<li>If <em>subpath</em> is equal to <em>\".\"</em>, then\n<ol>\n<li>Let <em>mainExport</em> be <strong>undefined</strong>.</li>\n<li>If <em>exports</em> is a String or Array, or an Object containing no keys\nstarting with <em>\".\"</em>, then\n<ol>\n<li>Set <em>mainExport</em> to <em>exports</em>.</li>\n</ol>\n</li>\n<li>Otherwise if <em>exports</em> is an Object containing a <em>\".\"</em> property, then\n<ol>\n<li>Set <em>mainExport</em> to <em>exports</em>[<em>\".\"</em>].</li>\n</ol>\n</li>\n<li>If <em>mainExport</em> is not <strong>undefined</strong>, then\n<ol>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>mainExport</em>, <strong>null</strong>, <strong>false</strong>, <em>conditions</em>).</li>\n<li>If <em>resolved</em> is not <strong>null</strong> or <strong>undefined</strong>, return <em>resolved</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Otherwise, if <em>exports</em> is an Object and all keys of <em>exports</em> start with\n<em>\".\"</em>, then\n<ol>\n<li>Assert: <em>subpath</em> begins with <em>\"./\"</em>.</li>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_IMPORTS_EXPORTS_RESOLVE</strong>(\n<em>subpath</em>, <em>exports</em>, <em>packageURL</em>, <strong>false</strong>, <em>conditions</em>).</li>\n<li>If <em>resolved</em> is not <strong>null</strong> or <strong>undefined</strong>, return <em>resolved</em>.</li>\n</ol>\n</li>\n<li>Throw a <em>Package Path Not Exported</em> error.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_IMPORTS_RESOLVE</strong>(<em>specifier</em>, <em>parentURL</em>, <em>conditions</em>)</p>\n<p>Note: This function is directly invoked by the CommonJS resolution algorithm.</p>\n<blockquote>\n<ol>\n<li>Assert: <em>specifier</em> begins with <em>\"#\"</em>.</li>\n<li>If <em>specifier</em> is exactly equal to <em>\"#\"</em>, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>Let <em>packageURL</em> be the result of <strong>LOOKUP_PACKAGE_SCOPE</strong>(<em>parentURL</em>).</li>\n<li>If <em>packageURL</em> is not <strong>null</strong>, then\n<ol>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>).</li>\n<li>If <em>pjson.imports</em> is a non-null Object, then\n<ol>\n<li>Let <em>resolved</em> be the result of\n<strong>PACKAGE_IMPORTS_EXPORTS_RESOLVE</strong>(\n<em>specifier</em>, <em>pjson.imports</em>, <em>packageURL</em>, <strong>true</strong>, <em>conditions</em>).</li>\n<li>If <em>resolved</em> is not <strong>null</strong> or <strong>undefined</strong>, return <em>resolved</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Throw a <em>Package Import Not Defined</em> error.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_IMPORTS_EXPORTS_RESOLVE</strong>(<em>matchKey</em>, <em>matchObj</em>, <em>packageURL</em>,\n<em>isImports</em>, <em>conditions</em>)</p>\n<blockquote>\n<ol>\n<li>If <em>matchKey</em> ends in <em>\"/\"</em>, then\n<ol>\n<li>Throw an <em>Invalid Module Specifier</em> error.</li>\n</ol>\n</li>\n<li>If <em>matchKey</em> is a key of <em>matchObj</em> and does not contain <em>\"*\"</em>, then\n<ol>\n<li>Let <em>target</em> be the value of <em>matchObj</em>[<em>matchKey</em>].</li>\n<li>Return the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(<em>packageURL</em>,\n<em>target</em>, <strong>null</strong>, <em>isImports</em>, <em>conditions</em>).</li>\n</ol>\n</li>\n<li>Let <em>expansionKeys</em> be the list of keys of <em>matchObj</em> containing only a\nsingle <em>\"*\"</em>, sorted by the sorting function <strong>PATTERN_KEY_COMPARE</strong>\nwhich orders in descending order of specificity.</li>\n<li>For each key <em>expansionKey</em> in <em>expansionKeys</em>, do\n<ol>\n<li>Let <em>patternBase</em> be the substring of <em>expansionKey</em> up to but excluding\nthe first <em>\"*\"</em> character.</li>\n<li>If <em>matchKey</em> starts with but is not equal to <em>patternBase</em>, then\n<ol>\n<li>Let <em>patternTrailer</em> be the substring of <em>expansionKey</em> from the\nindex after the first <em>\"*\"</em> character.</li>\n<li>If <em>patternTrailer</em> has zero length, or if <em>matchKey</em> ends with\n<em>patternTrailer</em> and the length of <em>matchKey</em> is greater than or\nequal to the length of <em>expansionKey</em>, then\n<ol>\n<li>Let <em>target</em> be the value of <em>matchObj</em>[<em>expansionKey</em>].</li>\n<li>Let <em>patternMatch</em> be the substring of <em>matchKey</em> starting at the\nindex of the length of <em>patternBase</em> up to the length of\n<em>matchKey</em> minus the length of <em>patternTrailer</em>.</li>\n<li>Return the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(<em>packageURL</em>,\n<em>target</em>, <em>patternMatch</em>, <em>isImports</em>, <em>conditions</em>).</li>\n</ol>\n</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Return <strong>null</strong>.</li>\n</ol>\n</blockquote>\n<p><strong>PATTERN_KEY_COMPARE</strong>(<em>keyA</em>, <em>keyB</em>)</p>\n<blockquote>\n<ol>\n<li>Assert: <em>keyA</em> contains only a single <em>\"*\"</em>.</li>\n<li>Assert: <em>keyB</em> contains only a single <em>\"*\"</em>.</li>\n<li>Let <em>baseLengthA</em> be the index of <em>\"*\"</em> in <em>keyA</em>.</li>\n<li>Let <em>baseLengthB</em> be the index of <em>\"*\"</em> in <em>keyB</em>.</li>\n<li>If <em>baseLengthA</em> is greater than <em>baseLengthB</em>, return -1.</li>\n<li>If <em>baseLengthB</em> is greater than <em>baseLengthA</em>, return 1.</li>\n<li>If the length of <em>keyA</em> is greater than the length of <em>keyB</em>, return -1.</li>\n<li>If the length of <em>keyB</em> is greater than the length of <em>keyA</em>, return 1.</li>\n<li>Return 0.</li>\n</ol>\n</blockquote>\n<p><strong>PACKAGE_TARGET_RESOLVE</strong>(<em>packageURL</em>, <em>target</em>, <em>patternMatch</em>,\n<em>isImports</em>, <em>conditions</em>)</p>\n<blockquote>\n<ol>\n<li>If <em>target</em> is a String, then\n<ol>\n<li>If <em>target</em> does not start with <em>\"./\"</em>, then\n<ol>\n<li>If <em>isImports</em> is <strong>false</strong>, or if <em>target</em> starts with <em>\"../\"</em> or\n<em>\"/\"</em>, or if <em>target</em> is a valid URL, then\n<ol>\n<li>Throw an <em>Invalid Package Target</em> error.</li>\n</ol>\n</li>\n<li>If <em>patternMatch</em> is a String, then\n<ol>\n<li>Return <strong>PACKAGE_RESOLVE</strong>(<em>target</em> with every instance of <em>\"*\"</em>\nreplaced by <em>patternMatch</em>, <em>packageURL</em> + <em>\"/\"</em>).</li>\n</ol>\n</li>\n<li>Return <strong>PACKAGE_RESOLVE</strong>(<em>target</em>, <em>packageURL</em> + <em>\"/\"</em>).</li>\n</ol>\n</li>\n<li>If <em>target</em> split on <em>\"/\"</em> or <em>\"\\\"</em> contains any <em>\"\"</em>, <em>\".\"</em>, <em>\"..\"</em>,\nor <em>\"node_modules\"</em> segments after the first <em>\".\"</em> segment, case\ninsensitive and including percent encoded variants, throw an <em>Invalid\nPackage Target</em> error.</li>\n<li>Let <em>resolvedTarget</em> be the URL resolution of the concatenation of\n<em>packageURL</em> and <em>target</em>.</li>\n<li>Assert: <em>packageURL</em> is contained in <em>resolvedTarget</em>.</li>\n<li>If <em>patternMatch</em> is <strong>null</strong>, then\n<ol>\n<li>Return <em>resolvedTarget</em>.</li>\n</ol>\n</li>\n<li>If <em>patternMatch</em> split on <em>\"/\"</em> or <em>\"\\\"</em> contains any <em>\"\"</em>, <em>\".\"</em>,\n<em>\"..\"</em>, or <em>\"node_modules\"</em> segments, case insensitive and including\npercent encoded variants, throw an <em>Invalid Module Specifier</em> error.</li>\n<li>Return the URL resolution of <em>resolvedTarget</em> with every instance of\n<em>\"*\"</em> replaced with <em>patternMatch</em>.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>target</em> is a non-null Object, then\n<ol>\n<li>If <em>target</em> contains any index property keys, as defined in ECMA-262\n<a href=\"https://tc39.es/ecma262/#integer-index\">6.1.7 Array Index</a>, throw an <em>Invalid Package Configuration</em> error.</li>\n<li>For each property <em>p</em> of <em>target</em>, in object insertion order as,\n<ol>\n<li>If <em>p</em> equals <em>\"default\"</em> or <em>conditions</em> contains an entry for <em>p</em>,\nthen\n<ol>\n<li>Let <em>targetValue</em> be the value of the <em>p</em> property in <em>target</em>.</li>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>targetValue</em>, <em>patternMatch</em>, <em>isImports</em>,\n<em>conditions</em>).</li>\n<li>If <em>resolved</em> is equal to <strong>undefined</strong>, continue the loop.</li>\n<li>Return <em>resolved</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Return <strong>undefined</strong>.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>target</em> is an Array, then\n<ol>\n<li>If _target.length is zero, return <strong>null</strong>.</li>\n<li>For each item <em>targetValue</em> in <em>target</em>, do\n<ol>\n<li>Let <em>resolved</em> be the result of <strong>PACKAGE_TARGET_RESOLVE</strong>(\n<em>packageURL</em>, <em>targetValue</em>, <em>patternMatch</em>, <em>isImports</em>,\n<em>conditions</em>), continuing the loop on any <em>Invalid Package Target</em>\nerror.</li>\n<li>If <em>resolved</em> is <strong>undefined</strong>, continue the loop.</li>\n<li>Return <em>resolved</em>.</li>\n</ol>\n</li>\n<li>Return or throw the last fallback resolution <strong>null</strong> return or error.</li>\n</ol>\n</li>\n<li>Otherwise, if <em>target</em> is <em>null</em>, return <strong>null</strong>.</li>\n<li>Otherwise throw an <em>Invalid Package Target</em> error.</li>\n</ol>\n</blockquote>\n<p><strong>ESM_FILE_FORMAT</strong>(<em>url</em>)</p>\n<blockquote>\n<ol>\n<li>Assert: <em>url</em> corresponds to an existing file.</li>\n<li>If <em>url</em> ends in <em>\".mjs\"</em>, then\n<ol>\n<li>Return <em>\"module\"</em>.</li>\n</ol>\n</li>\n<li>If <em>url</em> ends in <em>\".cjs\"</em>, then\n<ol>\n<li>Return <em>\"commonjs\"</em>.</li>\n</ol>\n</li>\n<li>If <em>url</em> ends in <em>\".json\"</em>, then\n<ol>\n<li>Return <em>\"json\"</em>.</li>\n</ol>\n</li>\n<li>If <em>url</em> ends in\n<em>\".wasm\"</em>, then\n<ol>\n<li>Return <em>\"wasm\"</em>.</li>\n</ol>\n</li>\n<li>If <code>--experimental-addon-modules</code> is enabled and <em>url</em> ends in\n<em>\".node\"</em>, then\n<ol>\n<li>Return <em>\"addon\"</em>.</li>\n</ol>\n</li>\n<li>Let <em>packageURL</em> be the result of <strong>LOOKUP_PACKAGE_SCOPE</strong>(<em>url</em>).</li>\n<li>Let <em>pjson</em> be the result of <strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>).</li>\n<li>Let <em>packageType</em> be <strong>null</strong>.</li>\n<li>If <em>pjson?.type</em> is <em>\"module\"</em> or <em>\"commonjs\"</em>, then\n<ol>\n<li>Set <em>packageType</em> to <em>pjson.type</em>.</li>\n</ol>\n</li>\n<li>If <em>url</em> ends in <em>\".js\"</em>, then\n<ol>\n<li>If <em>packageType</em> is not <strong>null</strong>, then\n<ol>\n<li>Return <em>packageType</em>.</li>\n</ol>\n</li>\n<li>If the result of <strong>DETECT_MODULE_SYNTAX</strong>(<em>source</em>) is true, then\n<ol>\n<li>Return <em>\"module\"</em>.</li>\n</ol>\n</li>\n<li>Return <em>\"commonjs\"</em>.</li>\n</ol>\n</li>\n<li>If <em>url</em> does not have any extension, then\n<ol>\n<li>If <em>packageType</em> is <em>\"module\"</em> and the file at <em>url</em> contains the\n\"application/wasm\" content type header for a WebAssembly module, then\n<ol>\n<li>Return <em>\"wasm\"</em>.</li>\n</ol>\n</li>\n<li>If <em>packageType</em> is not <strong>null</strong>, then\n<ol>\n<li>Return <em>packageType</em>.</li>\n</ol>\n</li>\n<li>If the result of <strong>DETECT_MODULE_SYNTAX</strong>(<em>source</em>) is true, then\n<ol>\n<li>Return <em>\"module\"</em>.</li>\n</ol>\n</li>\n<li>Return <em>\"commonjs\"</em>.</li>\n</ol>\n</li>\n<li>Return <strong>undefined</strong> (will throw during load phase).</li>\n</ol>\n</blockquote>\n<p><strong>LOOKUP_PACKAGE_SCOPE</strong>(<em>url</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>scopeURL</em> be <em>url</em>.</li>\n<li>While <em>scopeURL</em> is not the file system root,\n<ol>\n<li>Set <em>scopeURL</em> to the parent URL of <em>scopeURL</em>.</li>\n<li>If <em>scopeURL</em> ends in a <em>\"node_modules\"</em> path segment, return <strong>null</strong>.</li>\n<li>Let <em>pjsonURL</em> be the resolution of <em>\"package.json\"</em> within\n<em>scopeURL</em>.</li>\n<li>if the file at <em>pjsonURL</em> exists, then\n<ol>\n<li>Return <em>scopeURL</em>.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li>Return <strong>null</strong>.</li>\n</ol>\n</blockquote>\n<p><strong>READ_PACKAGE_JSON</strong>(<em>packageURL</em>)</p>\n<blockquote>\n<ol>\n<li>Let <em>pjsonURL</em> be the resolution of <em>\"package.json\"</em> within <em>packageURL</em>.</li>\n<li>If the file at <em>pjsonURL</em> does not exist, then\n<ol>\n<li>Return <strong>null</strong>.</li>\n</ol>\n</li>\n<li>If the file at <em>packageURL</em> does not parse as valid JSON, then\n<ol>\n<li>Throw an <em>Invalid Package Configuration</em> error.</li>\n</ol>\n</li>\n<li>Return the parsed JSON source of the file at <em>pjsonURL</em>.</li>\n</ol>\n</blockquote>\n<p><strong>DETECT_MODULE_SYNTAX</strong>(<em>source</em>)</p>\n<blockquote>\n<ol>\n<li>Parse <em>source</em> as an ECMAScript module.</li>\n<li>If the parse is successful, then\n<ol>\n<li>If <em>source</em> contains top-level <code>await</code>, static <code>import</code> or <code>export</code>\nstatements, or <code>import.meta</code>, return <strong>true</strong>.</li>\n<li>If <em>source</em> contains a top-level lexical declaration (<code>const</code>, <code>let</code>,\nor <code>class</code>) of any of the CommonJS wrapper variables (<code>require</code>,\n<code>exports</code>, <code>module</code>, <code>__filename</code>, or <code>__dirname</code>) then return <strong>true</strong>.</li>\n</ol>\n</li>\n<li>Return <strong>false</strong>.</li>\n</ol>\n</blockquote>",
              "displayName": "Resolution Algorithm Specification"
            },
            {
              "textRaw": "Customizing ESM specifier resolution algorithm",
              "name": "customizing_esm_specifier_resolution_algorithm",
              "type": "module",
              "desc": "<p><a href=\"module.html#customization-hooks\">Module customization hooks</a> provide a mechanism for customizing the ESM\nspecifier resolution algorithm. An example that provides CommonJS-style\nresolution for ESM specifiers is <a href=\"https://github.com/nodejs/loaders-test/tree/main/commonjs-extension-resolution-loader\">commonjs-extension-resolution-loader</a>.</p>",
              "displayName": "Customizing ESM specifier resolution algorithm"
            }
          ],
          "displayName": "Resolution and loading algorithm"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {Object}",
          "name": "meta",
          "type": "Object",
          "desc": "<p>The <code>import.meta</code> meta property is an <code>Object</code> that contains the following\nproperties. It is only supported in ES modules.</p>",
          "properties": [
            {
              "textRaw": "Type: {string} The directory name of the current module.",
              "name": "dirname",
              "type": "string",
              "meta": {
                "added": [
                  "v21.2.0",
                  "v20.11.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58011",
                    "description": "This property is no longer experimental."
                  }
                ]
              },
              "desc": "<p>This is the same as the <a href=\"path.html#pathdirnamepath\"><code>path.dirname()</code></a> of the <a href=\"#importmetafilename\"><code>import.meta.filename</code></a>.</p>\n<blockquote>\n<p><strong>Caveat</strong>: only present on <code>file:</code> modules.</p>\n</blockquote>",
              "shortDesc": "The directory name of the current module."
            },
            {
              "textRaw": "Type: {string} The full absolute path and filename of the current module, with symlinks resolved.",
              "name": "filename",
              "type": "string",
              "meta": {
                "added": [
                  "v21.2.0",
                  "v20.11.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58011",
                    "description": "This property is no longer experimental."
                  }
                ]
              },
              "desc": "<p>This is the same as the <a href=\"url.html#urlfileurltopathurl-options\"><code>url.fileURLToPath()</code></a> of the <a href=\"#importmetaurl\"><code>import.meta.url</code></a>.</p>\n<blockquote>\n<p><strong>Caveat</strong> only local modules support this property. Modules not using the\n<code>file:</code> protocol will not provide it.</p>\n</blockquote>",
              "shortDesc": "The full absolute path and filename of the current module, with symlinks resolved."
            },
            {
              "textRaw": "Type: {string} The absolute `file:` URL of the module.",
              "name": "url",
              "type": "string",
              "desc": "<p>This is defined exactly the same as it is in browsers providing the URL of the\ncurrent module file.</p>\n<p>This enables useful patterns such as relative file loading:</p>\n<pre><code class=\"language-js\">import { readFileSync } from 'node:fs';\nconst buffer = readFileSync(new URL('./data.proto', import.meta.url));\n</code></pre>",
              "shortDesc": "The absolute `file:` URL of the module."
            },
            {
              "textRaw": "Type: {boolean} `true` when the current module is the entry point of the current process; `false` otherwise.",
              "name": "main",
              "type": "boolean",
              "meta": {
                "added": [
                  "v24.2.0",
                  "v22.18.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>Equivalent to <code>require.main === module</code> in CommonJS.</p>\n<p>Analogous to Python's <code>__name__ == \"__main__\"</code>.</p>\n<pre><code class=\"language-js\">export function foo() {\n  return 'Hello, world';\n}\n\nfunction main() {\n  const message = foo();\n  console.log(message);\n}\n\nif (import.meta.main) main();\n// `foo` can be imported from another module without possible side-effects from `main`\n</code></pre>",
              "shortDesc": "`true` when the current module is the entry point of the current process; `false` otherwise."
            }
          ],
          "methods": [
            {
              "textRaw": "`import.meta.resolve(specifier)`",
              "name": "resolve",
              "type": "method",
              "meta": {
                "added": [
                  "v13.9.0",
                  "v12.16.2"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/49028",
                    "description": "No longer behind `--experimental-import-meta-resolve` CLI flag, except for the non-standard `parentURL` parameter."
                  },
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/49038",
                    "description": "This API no longer throws when targeting `file:` URLs that do not map to an existing file on the local FS."
                  },
                  {
                    "version": [
                      "v20.0.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44710",
                    "description": "This API now returns a string synchronously instead of a Promise."
                  },
                  {
                    "version": [
                      "v16.2.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38587",
                    "description": "Add support for WHATWG `URL` object to `parentURL` parameter."
                  }
                ]
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`specifier` {string} The module specifier to resolve relative to the current module.",
                      "name": "specifier",
                      "type": "string",
                      "desc": "The module specifier to resolve relative to the current module."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string} The absolute URL string that the specifier would resolve to.",
                    "name": "return",
                    "type": "string",
                    "desc": "The absolute URL string that the specifier would resolve to."
                  }
                }
              ],
              "desc": "<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve\"><code>import.meta.resolve</code></a> is a module-relative resolution function scoped to\neach module, returning the URL string.</p>\n<pre><code class=\"language-js\">const dependencyAsset = import.meta.resolve('component-lib/asset.css');\n// file:///app/node_modules/component-lib/asset.css\nimport.meta.resolve('./dep.js');\n// file:///app/dep.js\n</code></pre>\n<p>All features of the Node.js module resolution are supported. Dependency\nresolutions are subject to the permitted exports resolutions within the package.</p>\n<p><strong>Caveats</strong>:</p>\n<ul>\n<li>This can result in synchronous file-system operations, which\ncan impact performance similarly to <code>require.resolve</code>.</li>\n<li>This feature is not available within custom loaders (it would\ncreate a deadlock).</li>\n</ul>\n<p><strong>Non-standard API</strong>:</p>\n<p>When using the <code>--experimental-import-meta-resolve</code> flag, that function accepts\na second argument:</p>\n<ul>\n<li><code>parent</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> An optional absolute parent module URL to resolve from. <strong>Default:</strong> <code>import.meta.url</code></li>\n</ul>"
            }
          ]
        }
      ],
      "source": "doc/api/esm.md"
    },
    {
      "textRaw": "Modules: Packages",
      "name": "Modules: Packages",
      "introduced_in": "v12.20.0",
      "type": "misc",
      "meta": {
        "changes": [
          {
            "version": [
              "v14.13.0",
              "v12.20.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/34718",
            "description": "Add support for `\"exports\"` patterns."
          },
          {
            "version": [
              "v14.6.0",
              "v12.19.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/34117",
            "description": "Add package `\"imports\"` field."
          },
          {
            "version": [
              "v13.7.0",
              "v12.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/29866",
            "description": "Unflag conditional exports."
          },
          {
            "version": [
              "v13.7.0",
              "v12.16.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/31001",
            "description": "Remove the `--experimental-conditional-exports` option. In 12.16.0, conditional exports are still behind `--experimental-modules`."
          },
          {
            "version": [
              "v13.6.0",
              "v12.16.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/31002",
            "description": "Unflag self-referencing a package using its name."
          },
          {
            "version": "v12.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/28568",
            "description": "Introduce `\"exports\"` `package.json` field as a more powerful alternative to the classic `\"main\"` field."
          },
          {
            "version": "v12.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/26745",
            "description": "Add support for ES modules using `.js` file extension via `package.json` `\"type\"` field."
          }
        ]
      },
      "miscs": [
        {
          "textRaw": "Introduction",
          "name": "introduction",
          "type": "misc",
          "desc": "<p>A package is a folder tree described by a <code>package.json</code> file. The package\nconsists of the folder containing the <code>package.json</code> file and all subfolders\nuntil the next folder containing another <code>package.json</code> file, or a folder\nnamed <code>node_modules</code>.</p>\n<p>This page provides guidance for package authors writing <code>package.json</code> files\nalong with a reference for the <a href=\"#nodejs-packagejson-field-definitions\"><code>package.json</code></a> fields defined by Node.js.</p>",
          "displayName": "Introduction"
        },
        {
          "textRaw": "Determining module system",
          "name": "determining_module_system",
          "type": "misc",
          "modules": [
            {
              "textRaw": "Introduction",
              "name": "introduction",
              "type": "module",
              "desc": "<p>Node.js will treat the following as <a href=\"esm.html\">ES modules</a> when passed to <code>node</code> as the\ninitial input, or when referenced by <code>import</code> statements or <code>import()</code>\nexpressions:</p>\n<ul>\n<li>\n<p>Files with an <code>.mjs</code> extension.</p>\n</li>\n<li>\n<p>Files with a <code>.js</code> extension when the nearest parent <code>package.json</code> file\ncontains a top-level <a href=\"#type\"><code>\"type\"</code></a> field with a value of <code>\"module\"</code>.</p>\n</li>\n<li>\n<p>Strings passed in as an argument to <code>--eval</code>, or piped to <code>node</code> via <code>STDIN</code>,\nwith the flag <code>--input-type=module</code>.</p>\n</li>\n<li>\n<p>Code containing syntax only successfully parsed as <a href=\"esm.html\">ES modules</a>, such as\n<code>import</code> or <code>export</code> statements or <code>import.meta</code>, with no explicit marker of\nhow it should be interpreted. Explicit markers are <code>.mjs</code> or <code>.cjs</code>\nextensions, <code>package.json</code> <code>\"type\"</code> fields with either <code>\"module\"</code> or\n<code>\"commonjs\"</code> values, or the <code>--input-type</code> flag. Dynamic <code>import()</code>\nexpressions are supported in either CommonJS or ES modules and would not force\na file to be treated as an ES module. See <a href=\"#syntax-detection\">Syntax detection</a>.</p>\n</li>\n</ul>\n<p>Node.js will treat the following as <a href=\"modules.html\">CommonJS</a> when passed to <code>node</code> as the\ninitial input, or when referenced by <code>import</code> statements or <code>import()</code>\nexpressions:</p>\n<ul>\n<li>\n<p>Files with a <code>.cjs</code> extension.</p>\n</li>\n<li>\n<p>Files with a <code>.js</code> extension when the nearest parent <code>package.json</code> file\ncontains a top-level field <a href=\"#type\"><code>\"type\"</code></a> with a value of <code>\"commonjs\"</code>.</p>\n</li>\n<li>\n<p>Strings passed in as an argument to <code>--eval</code> or <code>--print</code>, or piped to <code>node</code>\nvia <code>STDIN</code>, with the flag <code>--input-type=commonjs</code>.</p>\n</li>\n<li>\n<p>Files with a <code>.js</code> extension with no parent <code>package.json</code> file or where the\nnearest parent <code>package.json</code> file lacks a <code>type</code> field, and where the code\ncan evaluate successfully as CommonJS. In other words, Node.js tries to run\nsuch \"ambiguous\" files as CommonJS first, and will retry evaluating them as ES\nmodules if the evaluation as CommonJS fails because the parser found ES module\nsyntax.</p>\n</li>\n</ul>\n<p>Writing ES module syntax in \"ambiguous\" files incurs a performance cost, and\ntherefore it is encouraged that authors be explicit wherever possible. In\nparticular, package authors should always include the <a href=\"#type\"><code>\"type\"</code></a> field in\ntheir <code>package.json</code> files, even in packages where all sources are CommonJS.\nBeing explicit about the <code>type</code> of the package will future-proof the package in\ncase the default type of Node.js ever changes, and it will also make things\neasier for build tools and loaders to determine how the files in the package\nshould be interpreted.</p>",
              "displayName": "Introduction"
            },
            {
              "textRaw": "Syntax detection",
              "name": "syntax_detection",
              "type": "module",
              "meta": {
                "added": [
                  "v21.1.0",
                  "v20.10.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.7.0",
                      "v20.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53619",
                    "description": "Syntax detection is enabled by default."
                  }
                ]
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "desc": "<p>Node.js will inspect the source code of ambiguous input to determine whether it\ncontains ES module syntax; if such syntax is detected, the input will be treated\nas an ES module.</p>\n<p>Ambiguous input is defined as:</p>\n<ul>\n<li>Files with a <code>.js</code> extension or no extension; and either no controlling\n<code>package.json</code> file or one that lacks a <code>type</code> field.</li>\n<li>String input (<code>--eval</code> or <code>STDIN</code>) when <code>--input-type</code>is not specified.</li>\n</ul>\n<p>ES module syntax is defined as syntax that would throw when evaluated as\nCommonJS. This includes the following:</p>\n<ul>\n<li><code>import</code> statements (but <em>not</em> <code>import()</code> expressions, which are valid in\nCommonJS).</li>\n<li><code>export</code> statements.</li>\n<li><code>import.meta</code> references.</li>\n<li><code>await</code> at the top level of a module.</li>\n<li>Lexical redeclarations of the CommonJS wrapper variables (<code>require</code>, <code>module</code>,\n<code>exports</code>, <code>__dirname</code>, <code>__filename</code>).</li>\n</ul>",
              "displayName": "Syntax detection"
            },
            {
              "textRaw": "Module resolution and loading",
              "name": "module_resolution_and_loading",
              "type": "module",
              "desc": "<p>Node.js has two types of module resolution and loading, chosen based on how the module is requested.</p>\n<p>When a module is requested via <code>require()</code> (available by default in CommonJS modules,\nand can be dynamically generated using <code>createRequire()</code> in both CommonJS and ES Modules):</p>\n<ul>\n<li>Resolution:\n<ul>\n<li>The resolution initiated by <code>require()</code> supports <a href=\"modules.html#folders-as-modules\">folders as modules</a>.</li>\n<li>When resolving a specifier, if no exact match is found, <code>require()</code> will try to add\nextensions (<code>.js</code>, <code>.json</code>, and finally <code>.node</code>) and then attempt to resolve\n<a href=\"modules.html#folders-as-modules\">folders as modules</a>.</li>\n<li>It does not support URLs as specifiers by default.</li>\n</ul>\n</li>\n<li>Loading:\n<ul>\n<li><code>.json</code> files are treated as JSON text files.</li>\n<li><code>.node</code> files are interpreted as compiled addon modules loaded with <code>process.dlopen()</code>.</li>\n<li><code>.ts</code>, <code>.mts</code> and <code>.cts</code> files are treated as <a href=\"typescript.html\">TypeScript</a> text files.</li>\n<li>Files with any other extension, or without extensions, are treated as JavaScript\ntext files.</li>\n<li><code>require()</code> can only be used to <a href=\"modules.html#loading-ecmascript-modules-using-require\">load ECMAScript modules from CommonJS modules</a> if\nthe <a href=\"esm.html\">ECMAScript module</a> <em>and its dependencies</em> are synchronous\n(i.e. they do not contain top-level <code>await</code>).</li>\n</ul>\n</li>\n</ul>\n<p>When a module is requested via static <code>import</code> statements (only available in ES Modules)\nor <code>import()</code> expressions (available in both CommonJS and ES Modules):</p>\n<ul>\n<li>Resolution:\n<ul>\n<li>The resolution of <code>import</code>/<code>import()</code> does not support folders as modules,\ndirectory indexes (e.g. <code>'./startup/index.js'</code>) must be fully specified.</li>\n<li>It does not perform extension searching. A file extension must be provided\nwhen the specifier is a relative or absolute file URL.</li>\n<li>It supports <code>file://</code> and <code>data:</code> URLs as specifiers by default.</li>\n</ul>\n</li>\n<li>Loading:\n<ul>\n<li><code>.json</code> files are treated as JSON text files. When importing JSON modules,\nan import type attribute is required (e.g.\n<code>import json from './data.json' with { type: 'json' }</code>).</li>\n<li><code>.node</code> files are interpreted as compiled addon modules loaded with\n<code>process.dlopen()</code>, if <a href=\"cli.html#--experimental-addon-modules\"><code>--experimental-addon-modules</code></a> is enabled.</li>\n<li><code>.ts</code>, <code>.mts</code> and <code>.cts</code> files are treated as <a href=\"typescript.html\">TypeScript</a> text files.</li>\n<li>It accepts only <code>.js</code>, <code>.mjs</code>, and <code>.cjs</code> extensions for JavaScript text\nfiles.</li>\n<li><code>.wasm</code> files are treated as <a href=\"esm.html#wasm-modules\">WebAssembly modules</a>.</li>\n<li>Any other file extensions will result in a  <a href=\"errors.html#err_unknown_file_extension\"><code>ERR_UNKNOWN_FILE_EXTENSION</code></a> error.\nAdditional file extensions can be facilitated via <a href=\"module.html#customization-hooks\">customization hooks</a>.</li>\n<li><code>import</code>/<code>import()</code> can be used to load JavaScript <a href=\"modules.html\">CommonJS modules</a>.\nSuch modules are passed through <a href=\"https://github.com/anonrig/merve\">merve</a> to try to identify named\nexports, which are available if they can be determined through static analysis.</li>\n</ul>\n</li>\n</ul>\n<p>Regardless of how a module is requested, the resolution and loading process can be customized\nusing <a href=\"module.html#customization-hooks\">customization hooks</a>.</p>",
              "displayName": "Module resolution and loading"
            },
            {
              "textRaw": "`package.json` and file extensions",
              "name": "`package.json`_and_file_extensions",
              "type": "module",
              "desc": "<p>Within a package, the <a href=\"#nodejs-packagejson-field-definitions\"><code>package.json</code></a> <a href=\"#type\"><code>\"type\"</code></a> field defines how\nNode.js should interpret <code>.js</code> files. If a <code>package.json</code> file does not have a\n<code>\"type\"</code> field, <code>.js</code> files are treated as <a href=\"modules.html\">CommonJS</a>.</p>\n<p>A <code>package.json</code> <code>\"type\"</code> value of <code>\"module\"</code> tells Node.js to interpret <code>.js</code>\nfiles within that package as using <a href=\"esm.html\">ES module</a> syntax.</p>\n<p>The <code>\"type\"</code> field applies not only to initial entry points (<code>node my-app.js</code>)\nbut also to files referenced by <code>import</code> statements and <code>import()</code> expressions.</p>\n<pre><code class=\"language-js\">// my-app.js, treated as an ES module because there is a package.json\n// file in the same folder with \"type\": \"module\".\n\nimport './startup/init.js';\n// Loaded as ES module since ./startup contains no package.json file,\n// and therefore inherits the \"type\" value from one level up.\n\nimport 'commonjs-package';\n// Loaded as CommonJS since ./node_modules/commonjs-package/package.json\n// lacks a \"type\" field or contains \"type\": \"commonjs\".\n\nimport './node_modules/commonjs-package/index.js';\n// Loaded as CommonJS since ./node_modules/commonjs-package/package.json\n// lacks a \"type\" field or contains \"type\": \"commonjs\".\n</code></pre>\n<p>Files ending with <code>.mjs</code> are always loaded as <a href=\"esm.html\">ES modules</a> regardless of\nthe nearest parent <code>package.json</code>.</p>\n<p>Files ending with <code>.cjs</code> are always loaded as <a href=\"modules.html\">CommonJS</a> regardless of the\nnearest parent <code>package.json</code>.</p>\n<pre><code class=\"language-js\">import './legacy-file.cjs';\n// Loaded as CommonJS since .cjs is always loaded as CommonJS.\n\nimport 'commonjs-package/src/index.mjs';\n// Loaded as ES module since .mjs is always loaded as ES module.\n</code></pre>\n<p>The <code>.mjs</code> and <code>.cjs</code> extensions can be used to mix types within the same\npackage:</p>\n<ul>\n<li>\n<p>Within a <code>\"type\": \"module\"</code> package, Node.js can be instructed to\ninterpret a particular file as <a href=\"modules.html\">CommonJS</a> by naming it with a <code>.cjs</code>\nextension (since both <code>.js</code> and <code>.mjs</code> files are treated as ES modules within\na <code>\"module\"</code> package).</p>\n</li>\n<li>\n<p>Within a <code>\"type\": \"commonjs\"</code> package, Node.js can be instructed to\ninterpret a particular file as an <a href=\"esm.html\">ES module</a> by naming it with an <code>.mjs</code>\nextension (since both <code>.js</code> and <code>.cjs</code> files are treated as CommonJS within a\n<code>\"commonjs\"</code> package).</p>\n</li>\n</ul>",
              "displayName": "`package.json` and file extensions"
            },
            {
              "textRaw": "`--input-type` flag",
              "name": "`--input-type`_flag",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Strings passed in as an argument to <code>--eval</code> (or <code>-e</code>), or piped to <code>node</code> via\n<code>STDIN</code>, are treated as <a href=\"esm.html\">ES modules</a> when the <code>--input-type=module</code> flag\nis set.</p>\n<pre><code class=\"language-bash\">node --input-type=module --eval \"import { sep } from 'node:path'; console.log(sep);\"\n\necho \"import { sep } from 'node:path'; console.log(sep);\" | node --input-type=module\n</code></pre>\n<p>For completeness there is also <code>--input-type=commonjs</code>, for explicitly running\nstring input as CommonJS. This is the default behavior if <code>--input-type</code> is\nunspecified.</p>",
              "displayName": "`--input-type` flag"
            }
          ],
          "displayName": "Determining module system"
        },
        {
          "textRaw": "Package entry points",
          "name": "package_entry_points",
          "type": "misc",
          "desc": "<p>In a package's <code>package.json</code> file, two fields can define entry points for a\npackage: <a href=\"#main\"><code>\"main\"</code></a> and <a href=\"#exports\"><code>\"exports\"</code></a>. Both fields apply to both ES module\nand CommonJS module entry points.</p>\n<p>The <a href=\"#main\"><code>\"main\"</code></a> field is supported in all versions of Node.js, but its\ncapabilities are limited: it only defines the main entry point of the package.</p>\n<p>The <a href=\"#exports\"><code>\"exports\"</code></a> provides a modern alternative to <a href=\"#main\"><code>\"main\"</code></a> allowing\nmultiple entry points to be defined, conditional entry resolution support\nbetween environments, and <strong>preventing any other entry points besides those\ndefined in <a href=\"#exports\"><code>\"exports\"</code></a></strong>. This encapsulation allows module authors to\nclearly define the public interface for their package.</p>\n<p>For new packages targeting the currently supported versions of Node.js, the\n<a href=\"#exports\"><code>\"exports\"</code></a> field is recommended. For packages supporting Node.js 10 and\nbelow, the <a href=\"#main\"><code>\"main\"</code></a> field is required. If both <a href=\"#exports\"><code>\"exports\"</code></a> and\n<a href=\"#main\"><code>\"main\"</code></a> are defined, the <a href=\"#exports\"><code>\"exports\"</code></a> field takes precedence over\n<a href=\"#main\"><code>\"main\"</code></a> in supported versions of Node.js.</p>\n<p><a href=\"#conditional-exports\">Conditional exports</a> can be used within <a href=\"#exports\"><code>\"exports\"</code></a> to define different\npackage entry points per environment, including whether the package is\nreferenced via <code>require</code> or via <code>import</code>. For more information about supporting\nboth CommonJS and ES modules in a single package please consult\n<a href=\"#dual-commonjses-module-packages\">the dual CommonJS/ES module packages section</a>.</p>\n<p>Existing packages introducing the <a href=\"#exports\"><code>\"exports\"</code></a> field will prevent consumers\nof the package from using any entry points that are not defined, including the\n<a href=\"#nodejs-packagejson-field-definitions\"><code>package.json</code></a> (e.g. <code>require('your-package/package.json')</code>). <strong>This will\nlikely be a breaking change.</strong></p>\n<p>To make the introduction of <a href=\"#exports\"><code>\"exports\"</code></a> non-breaking, ensure that every\npreviously supported entry point is exported. It is best to explicitly specify\nentry points so that the package's public API is well-defined. For example,\na project that previously exported <code>main</code>, <code>lib</code>,\n<code>feature</code>, and the <code>package.json</code> could use the following <code>package.exports</code>:</p>\n<pre><code class=\"language-json\">{\n  \"name\": \"my-package\",\n  \"exports\": {\n    \".\": \"./lib/index.js\",\n    \"./lib\": \"./lib/index.js\",\n    \"./lib/index\": \"./lib/index.js\",\n    \"./lib/index.js\": \"./lib/index.js\",\n    \"./feature\": \"./feature/index.js\",\n    \"./feature/index\": \"./feature/index.js\",\n    \"./feature/index.js\": \"./feature/index.js\",\n    \"./package.json\": \"./package.json\"\n  }\n}\n</code></pre>\n<p>Alternatively a project could choose to export entire folders both with and\nwithout extensioned subpaths using export patterns:</p>\n<pre><code class=\"language-json\">{\n  \"name\": \"my-package\",\n  \"exports\": {\n    \".\": \"./lib/index.js\",\n    \"./lib\": \"./lib/index.js\",\n    \"./lib/*\": \"./lib/*.js\",\n    \"./lib/*.js\": \"./lib/*.js\",\n    \"./feature\": \"./feature/index.js\",\n    \"./feature/*\": \"./feature/*.js\",\n    \"./feature/*.js\": \"./feature/*.js\",\n    \"./package.json\": \"./package.json\"\n  }\n}\n</code></pre>\n<p>With the above providing backwards-compatibility for any minor package versions,\na future major change for the package can then properly restrict the exports\nto only the specific feature exports exposed:</p>\n<pre><code class=\"language-json\">{\n  \"name\": \"my-package\",\n  \"exports\": {\n    \".\": \"./lib/index.js\",\n    \"./feature/*.js\": \"./feature/*.js\",\n    \"./feature/internal/*\": null\n  }\n}\n</code></pre>",
          "modules": [
            {
              "textRaw": "Main entry point export",
              "name": "main_entry_point_export",
              "type": "module",
              "desc": "<p>When writing a new package, it is recommended to use the <a href=\"#exports\"><code>\"exports\"</code></a> field:</p>\n<pre><code class=\"language-json\">{\n  \"exports\": \"./index.js\"\n}\n</code></pre>\n<p>When the <a href=\"#exports\"><code>\"exports\"</code></a> field is defined, all subpaths of the package are\nencapsulated and no longer available to importers. For example,\n<code>require('pkg/subpath.js')</code> throws an <a href=\"errors.html#err_package_path_not_exported\"><code>ERR_PACKAGE_PATH_NOT_EXPORTED</code></a>\nerror.</p>\n<p>This encapsulation of exports provides more reliable guarantees\nabout package interfaces for tools and when handling semver upgrades for a\npackage. It is not a strong encapsulation since a direct require of any\nabsolute subpath of the package such as\n<code>require('/path/to/node_modules/pkg/subpath.js')</code> will still load <code>subpath.js</code>.</p>\n<p>All currently supported versions of Node.js and modern build tools support the\n<code>\"exports\"</code> field. For projects using an older version of Node.js or a related\nbuild tool, compatibility can be achieved by including the <code>\"main\"</code> field\nalongside <code>\"exports\"</code> pointing to the same module:</p>\n<pre><code class=\"language-json\">{\n  \"main\": \"./index.js\",\n  \"exports\": \"./index.js\"\n}\n</code></pre>",
              "displayName": "Main entry point export"
            },
            {
              "textRaw": "Subpath exports",
              "name": "subpath_exports",
              "type": "module",
              "meta": {
                "added": [
                  "v12.7.0"
                ],
                "changes": []
              },
              "desc": "<p>When using the <a href=\"#exports\"><code>\"exports\"</code></a> field, custom subpaths can be defined along\nwith the main entry point by treating the main entry point as the\n<code>\".\"</code> subpath:</p>\n<pre><code class=\"language-json\">{\n  \"exports\": {\n    \".\": \"./index.js\",\n    \"./submodule.js\": \"./src/submodule.js\"\n  }\n}\n</code></pre>\n<p>Now only the defined subpath in <a href=\"#exports\"><code>\"exports\"</code></a> can be imported by a consumer:</p>\n<pre><code class=\"language-js\">import submodule from 'es-module-package/submodule.js';\n// Loads ./node_modules/es-module-package/src/submodule.js\n</code></pre>\n<p>While other subpaths will error:</p>\n<pre><code class=\"language-js\">import submodule from 'es-module-package/private-module.js';\n// Throws ERR_PACKAGE_PATH_NOT_EXPORTED\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Extensions in subpaths",
                  "name": "extensions_in_subpaths",
                  "type": "module",
                  "desc": "<p>Package authors should provide either extensioned (<code>import 'pkg/subpath.js'</code>) or\nextensionless (<code>import 'pkg/subpath'</code>) subpaths in their exports. This ensures\nthat there is only one subpath for each exported module so that all dependents\nimport the same consistent specifier, keeping the package contract clear for\nconsumers and simplifying package subpath completions.</p>\n<p>Traditionally, packages tended to use the extensionless style, which has the\nbenefits of readability and of masking the true path of the file within the\npackage.</p>\n<p>With <a href=\"https://github.com/WICG/import-maps\">import maps</a> now providing a standard for package resolution in browsers\nand other JavaScript runtimes, using the extensionless style can result in\nbloated import map definitions. Explicit file extensions can avoid this issue by\nenabling the import map to utilize a <a href=\"https://github.com/WICG/import-maps#packages-via-trailing-slashes\">packages folder mapping</a> to map multiple\nsubpaths where possible instead of a separate map entry per package subpath\nexport. This also mirrors the requirement of using <a href=\"esm.html#mandatory-file-extensions\">the full specifier path</a>\nin relative and absolute import specifiers.</p>",
                  "displayName": "Extensions in subpaths"
                },
                {
                  "textRaw": "Path Rules and Validation for Export Targets",
                  "name": "path_rules_and_validation_for_export_targets",
                  "type": "module",
                  "desc": "<p>When defining paths as targets in the <a href=\"#exports\"><code>\"exports\"</code></a> field, Node.js enforces\nseveral rules to ensure security, predictability, and proper encapsulation.\nUnderstanding these rules is crucial for authors publishing packages.</p>",
                  "modules": [
                    {
                      "textRaw": "Targets must be relative URLs",
                      "name": "targets_must_be_relative_urls",
                      "type": "module",
                      "desc": "<p>All target paths in the <a href=\"#exports\"><code>\"exports\"</code></a> map (the values associated with export\nkeys) must be relative URL strings starting with <code>./</code>.</p>\n<pre><code class=\"language-json\">// package.json\n{\n  \"name\": \"my-package\",\n  \"exports\": {\n    \".\": \"./dist/main.js\",          // Correct\n    \"./feature\": \"./lib/feature.js\", // Correct\n    // \"./origin-relative\": \"/dist/main.js\", // Incorrect: Must start with ./\n    // \"./absolute\": \"file:///dev/null\", // Incorrect: Must start with ./\n    // \"./outside\": \"../common/util.js\" // Incorrect: Must start with ./\n  }\n}\n</code></pre>\n<p>Reasons for this behavior include:</p>\n<ul>\n<li><strong>Security:</strong> Prevents exporting arbitrary files from outside the\npackage's own directory.</li>\n<li><strong>Encapsulation:</strong> Ensures all exported paths are resolved relative to\nthe package root, making the package self-contained.</li>\n</ul>",
                      "displayName": "Targets must be relative URLs"
                    },
                    {
                      "textRaw": "No path traversal or invalid segments",
                      "name": "no_path_traversal_or_invalid_segments",
                      "type": "module",
                      "desc": "<p>Export targets must not resolve to a location outside the package's root\ndirectory. Additionally, path segments like <code>.</code> (single dot), <code>..</code> (double dot),\nor <code>node_modules</code> (and their URL-encoded equivalents) are generally disallowed\nwithin the <code>target</code> string after the initial <code>./</code> and in any <code>subpath</code> part\nsubstituted into a target pattern.</p>\n<pre><code class=\"language-json\">// package.json\n{\n  \"name\": \"my-package\",\n  \"exports\": {\n    // \".\": \"./dist/../../elsewhere/file.js\", // Invalid: path traversal\n    // \".\": \"././dist/main.js\",             // Invalid: contains \".\" segment\n    // \".\": \"./dist/../dist/main.js\",       // Invalid: contains \"..\" segment\n    // \"./utils/./helper.js\": \"./utils/helper.js\" // Key has invalid segment\n  }\n}\n</code></pre>",
                      "displayName": "No path traversal or invalid segments"
                    }
                  ],
                  "displayName": "Path Rules and Validation for Export Targets"
                }
              ],
              "displayName": "Subpath exports"
            },
            {
              "textRaw": "Exports sugar",
              "name": "exports_sugar",
              "type": "module",
              "meta": {
                "added": [
                  "v12.11.0"
                ],
                "changes": []
              },
              "desc": "<p>If the <code>\".\"</code> export is the only export, the <a href=\"#exports\"><code>\"exports\"</code></a> field provides sugar\nfor this case being the direct <a href=\"#exports\"><code>\"exports\"</code></a> field value.</p>\n<pre><code class=\"language-json\">{\n  \"exports\": {\n    \".\": \"./index.js\"\n  }\n}\n</code></pre>\n<p>can be written:</p>\n<pre><code class=\"language-json\">{\n  \"exports\": \"./index.js\"\n}\n</code></pre>",
              "displayName": "Exports sugar"
            },
            {
              "textRaw": "Subpath imports",
              "name": "subpath_imports",
              "type": "module",
              "meta": {
                "added": [
                  "v14.6.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.4.0",
                      "v24.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60864",
                    "description": "Allow subpath imports that start with `#/`."
                  }
                ]
              },
              "desc": "<p>In addition to the <a href=\"#exports\"><code>\"exports\"</code></a> field, there is a package <code>\"imports\"</code> field\nto create private mappings that only apply to import specifiers from within the\npackage itself.</p>\n<p>Entries in the <code>\"imports\"</code> field must always start with <code>#</code> to ensure they are\ndisambiguated from external package specifiers.</p>\n<p>For example, the imports field can be used to gain the benefits of conditional\nexports for internal modules:</p>\n<pre><code class=\"language-json\">// package.json\n{\n  \"imports\": {\n    \"#dep\": {\n      \"node\": \"dep-node-native\",\n      \"default\": \"./dep-polyfill.js\"\n    }\n  },\n  \"dependencies\": {\n    \"dep-node-native\": \"^1.0.0\"\n  }\n}\n</code></pre>\n<p>where <code>import '#dep'</code> does not get the resolution of the external package\n<code>dep-node-native</code> (including its exports in turn), and instead gets the local\nfile <code>./dep-polyfill.js</code> relative to the package in other environments.</p>\n<p>Unlike the <code>\"exports\"</code> field, the <code>\"imports\"</code> field permits mapping to external\npackages.</p>\n<p>The resolution rules for the imports field are otherwise analogous to the\nexports field.</p>",
              "displayName": "Subpath imports"
            },
            {
              "textRaw": "Subpath patterns",
              "name": "subpath_patterns",
              "type": "module",
              "meta": {
                "added": [
                  "v14.13.0",
                  "v12.20.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.10.0",
                      "v14.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/40041",
                    "description": "Support pattern trailers in \"imports\" field."
                  },
                  {
                    "version": [
                      "v16.9.0",
                      "v14.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39635",
                    "description": "Support pattern trailers."
                  }
                ]
              },
              "desc": "<p>For packages with a small number of exports or imports, we recommend\nexplicitly listing each exports subpath entry. But for packages that have\nlarge numbers of subpaths, this might cause <code>package.json</code> bloat and\nmaintenance issues.</p>\n<p>For these use cases, subpath export patterns can be used instead:</p>\n<pre><code class=\"language-json\">// ./node_modules/es-module-package/package.json\n{\n  \"exports\": {\n    \"./features/*.js\": \"./src/features/*.js\"\n  },\n  \"imports\": {\n    \"#internal/*.js\": \"./src/internal/*.js\"\n  }\n}\n</code></pre>\n<p><strong><code>*</code> maps expose nested subpaths as it is a string replacement syntax\nonly.</strong></p>\n<p>All instances of <code>*</code> on the right hand side will then be replaced with this\nvalue, including if it contains any <code>/</code> separators.</p>\n<pre><code class=\"language-js\">import featureX from 'es-module-package/features/x.js';\n// Loads ./node_modules/es-module-package/src/features/x.js\n\nimport featureY from 'es-module-package/features/y/y.js';\n// Loads ./node_modules/es-module-package/src/features/y/y.js\n\nimport internalZ from '#internal/z.js';\n// Loads ./src/internal/z.js\n</code></pre>\n<p>This is a direct static matching and replacement without any special handling\nfor file extensions. Including the <code>\"*.js\"</code> on both sides of the mapping\nrestricts the exposed package exports to only JS files.</p>\n<p>The property of exports being statically enumerable is maintained with exports\npatterns since the individual exports for a package can be determined by\ntreating the right hand side target pattern as a <code>**</code> glob against the list of\nfiles within the package. Because <code>node_modules</code> paths are forbidden in exports\ntargets, this expansion is dependent on only the files of the package itself.</p>\n<p>To exclude private subfolders from patterns, <code>null</code> targets can be used:</p>\n<pre><code class=\"language-json\">// ./node_modules/es-module-package/package.json\n{\n  \"exports\": {\n    \"./features/*.js\": \"./src/features/*.js\",\n    \"./features/private-internal/*\": null\n  }\n}\n</code></pre>\n<pre><code class=\"language-js\">import featureInternal from 'es-module-package/features/private-internal/m.js';\n// Throws: ERR_PACKAGE_PATH_NOT_EXPORTED\n\nimport featureX from 'es-module-package/features/x.js';\n// Loads ./node_modules/es-module-package/src/features/x.js\n</code></pre>",
              "displayName": "Subpath patterns"
            },
            {
              "textRaw": "Conditional exports",
              "name": "conditional_exports",
              "type": "module",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.7.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31001",
                    "description": "Unflag conditional exports."
                  }
                ]
              },
              "desc": "<p>Conditional exports provide a way to map to different paths depending on\ncertain conditions. They are supported for both CommonJS and ES module imports.</p>\n<p>For example, a package that wants to provide different ES module exports for\n<code>require()</code> and <code>import</code> can be written:</p>\n<pre><code class=\"language-json\">// package.json\n{\n  \"exports\": {\n    \"import\": \"./index-module.js\",\n    \"require\": \"./index-require.cjs\"\n  },\n  \"type\": \"module\"\n}\n</code></pre>\n<p>Node.js implements the following conditions, listed in order from most\nspecific to least specific as conditions should be defined:</p>\n<ul>\n<li><code>\"node-addons\"</code> - similar to <code>\"node\"</code> and matches for any Node.js environment.\nThis condition can be used to provide an entry point which uses native C++\naddons as opposed to an entry point which is more universal and doesn't rely\non native addons. This condition can be disabled via the\n<a href=\"cli.html#--no-addons\"><code>--no-addons</code> flag</a>.</li>\n<li><code>\"node\"</code> - matches for any Node.js environment. Can be a CommonJS or ES\nmodule file. <em>In most cases explicitly calling out the Node.js platform is\nnot necessary.</em></li>\n<li><code>\"import\"</code> - matches when the package is loaded via <code>import</code> or\n<code>import()</code>, or via any top-level import or resolve operation by the\nECMAScript module loader. Applies regardless of the module format of the\ntarget file. <em>Always mutually exclusive with <code>\"require\"</code>.</em></li>\n<li><code>\"require\"</code> - matches when the package is loaded via <code>require()</code>. The\nreferenced file should be loadable with <code>require()</code> although the condition\nmatches regardless of the module format of the target file. Expected\nformats include CommonJS, JSON, native addons, and ES modules. <em>Always mutually\nexclusive with <code>\"import\"</code>.</em></li>\n<li><code>\"module-sync\"</code> - matches no matter the package is loaded via <code>import</code>,\n<code>import()</code> or <code>require()</code>. The format is expected to be ES modules that does\nnot contain top-level await in its module graph - if it does,\n<code>ERR_REQUIRE_ASYNC_MODULE</code> will be thrown when the module is <code>require()</code>-ed.</li>\n<li><code>\"default\"</code> - the generic fallback that always matches. Can be a CommonJS\nor ES module file. <em>This condition should always come last.</em></li>\n</ul>\n<p>Within the <a href=\"#exports\"><code>\"exports\"</code></a> object, key order is significant. During condition\nmatching, earlier entries have higher priority and take precedence over later\nentries. <em>The general rule is that conditions should be from most specific to\nleast specific in object order</em>.</p>\n<p>Using the <code>\"import\"</code> and <code>\"require\"</code> conditions can lead to some hazards,\nwhich are further explained in <a href=\"#dual-commonjses-module-packages\">the dual CommonJS/ES module packages section</a>.</p>\n<p>The <code>\"node-addons\"</code> condition can be used to provide an entry point which\nuses native C++ addons. However, this condition can be disabled via the\n<a href=\"cli.html#--no-addons\"><code>--no-addons</code> flag</a>. When using <code>\"node-addons\"</code>, it's recommended to treat\n<code>\"default\"</code> as an enhancement that provides a more universal entry point, e.g.\nusing WebAssembly instead of a native addon.</p>\n<p>Conditional exports can also be extended to exports subpaths, for example:</p>\n<pre><code class=\"language-json\">{\n  \"exports\": {\n    \".\": \"./index.js\",\n    \"./feature.js\": {\n      \"node\": \"./feature-node.js\",\n      \"default\": \"./feature.js\"\n    }\n  }\n}\n</code></pre>\n<p>Defines a package where <code>require('pkg/feature.js')</code> and\n<code>import 'pkg/feature.js'</code> could provide different implementations between\nNode.js and other JS environments.</p>\n<p>When using environment branches, always include a <code>\"default\"</code> condition where\npossible. Providing a <code>\"default\"</code> condition ensures that any unknown JS\nenvironments are able to use this universal implementation, which helps avoid\nthese JS environments from having to pretend to be existing environments in\norder to support packages with conditional exports. For this reason, using\n<code>\"node\"</code> and <code>\"default\"</code> condition branches is usually preferable to using\n<code>\"node\"</code> and <code>\"browser\"</code> condition branches.</p>",
              "displayName": "Conditional exports"
            },
            {
              "textRaw": "Nested conditions",
              "name": "nested_conditions",
              "type": "module",
              "desc": "<p>In addition to direct mappings, Node.js also supports nested condition objects.</p>\n<p>For example, to define a package that only has dual mode entry points for\nuse in Node.js but not the browser:</p>\n<pre><code class=\"language-json\">{\n  \"exports\": {\n    \"node\": {\n      \"import\": \"./feature-node.mjs\",\n      \"require\": \"./feature-node.cjs\"\n    },\n    \"default\": \"./feature.mjs\"\n  }\n}\n</code></pre>\n<p>Conditions continue to be matched in order as with flat conditions. If\na nested condition does not have any mapping it will continue checking\nthe remaining conditions of the parent condition. In this way nested\nconditions behave analogously to nested JavaScript <code>if</code> statements.</p>",
              "displayName": "Nested conditions"
            },
            {
              "textRaw": "Resolving user conditions",
              "name": "resolving_user_conditions",
              "type": "module",
              "meta": {
                "added": [
                  "v14.9.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "desc": "<p>When running Node.js, custom user conditions can be added with the\n<code>--conditions</code> flag:</p>\n<pre><code class=\"language-bash\">node --conditions=development index.js\n</code></pre>\n<p>which would then resolve the <code>\"development\"</code> condition in package imports and\nexports, while resolving the existing <code>\"node\"</code>, <code>\"node-addons\"</code>, <code>\"default\"</code>,\n<code>\"import\"</code>, and <code>\"require\"</code> conditions as appropriate.</p>\n<p>Any number of custom conditions can be set with repeat flags.</p>\n<p>Typical conditions should only contain alphanumerical characters,\nusing \":\", \"-\", or \"=\" as separators if necessary. Anything else may run\ninto compability issues outside of node.</p>\n<p>In node, conditions have very few restrictions, but specifically these include:</p>\n<ol>\n<li>They must contain at least one character.</li>\n<li>They cannot start with \".\" since they may appear in places that also\nallow relative paths.</li>\n<li>They cannot contain \",\" since they may be parsed as a comma-separated\nlist by some CLI tools.</li>\n<li>They cannot be integer property keys like \"10\" since that can have\nunexpected effects on property key ordering for JS objects.</li>\n</ol>",
              "displayName": "Resolving user conditions"
            },
            {
              "textRaw": "Community Conditions Definitions",
              "name": "community_conditions_definitions",
              "type": "module",
              "desc": "<p>Condition strings other than the <code>\"import\"</code>, <code>\"require\"</code>, <code>\"node\"</code>, <code>\"module-sync\"</code>,\n<code>\"node-addons\"</code> and <code>\"default\"</code> conditions\n<a href=\"#conditional-exports\">implemented in Node.js core</a> are ignored by default.</p>\n<p>Other platforms may implement other conditions and user conditions can be\nenabled in Node.js via the <a href=\"#resolving-user-conditions\"><code>--conditions</code> / <code>-C</code> flag</a>.</p>\n<p>Since custom package conditions require clear definitions to ensure correct\nusage, a list of common known package conditions and their strict definitions\nis provided below to assist with ecosystem coordination.</p>\n<ul>\n<li><code>\"types\"</code> - can be used by typing systems to resolve the typing file for\nthe given export. <em>This condition should always be included first.</em></li>\n<li><code>\"browser\"</code> - any web browser environment.</li>\n<li><code>\"development\"</code> - can be used to define a development-only environment\nentry point, for example to provide additional debugging context such as\nbetter error messages when running in a development mode. <em>Must always be\nmutually exclusive with <code>\"production\"</code>.</em></li>\n<li><code>\"production\"</code> - can be used to define a production environment entry\npoint. <em>Must always be mutually exclusive with <code>\"development\"</code>.</em></li>\n</ul>\n<p>For other runtimes, platform-specific condition key definitions are maintained\nby the <a href=\"https://wintercg.org/\">WinterCG</a> in the <a href=\"https://runtime-keys.proposal.wintercg.org/\">Runtime Keys</a> proposal specification.</p>\n<p>New conditions definitions may be added to this list by creating a pull request\nto the <a href=\"https://github.com/nodejs/node/blob/HEAD/doc/api/packages.md#conditions-definitions\">Node.js documentation for this section</a>. The requirements for listing\na new condition definition here are that:</p>\n<ul>\n<li>The definition should be clear and unambiguous for all implementers.</li>\n<li>The use case for why the condition is needed should be clearly justified.</li>\n<li>There should exist sufficient existing implementation usage.</li>\n<li>The condition name should not conflict with another condition definition or\ncondition in wide usage.</li>\n<li>The listing of the condition definition should provide a coordination\nbenefit to the ecosystem that wouldn't otherwise be possible. For example,\nthis would not necessarily be the case for company-specific or\napplication-specific conditions.</li>\n<li>The condition should be such that a Node.js user would expect it to be in\nNode.js core documentation. The <code>\"types\"</code> condition is a good example: It\ndoesn't really belong in the <a href=\"https://runtime-keys.proposal.wintercg.org/\">Runtime Keys</a> proposal but is a good fit\nhere in the Node.js docs.</li>\n</ul>\n<p>The above definitions may be moved to a dedicated conditions registry in due\ncourse.</p>",
              "displayName": "Community Conditions Definitions"
            },
            {
              "textRaw": "Self-referencing a package using its name",
              "name": "self-referencing_a_package_using_its_name",
              "type": "module",
              "meta": {
                "added": [
                  "v13.1.0",
                  "v12.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.6.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31002",
                    "description": "Unflag self-referencing a package using its name."
                  }
                ]
              },
              "desc": "<p>Within a package, the values defined in the package's\n<code>package.json</code> <a href=\"#exports\"><code>\"exports\"</code></a> field can be referenced via the package's name.\nFor example, assuming the <code>package.json</code> is:</p>\n<pre><code class=\"language-json\">// package.json\n{\n  \"name\": \"a-package\",\n  \"exports\": {\n    \".\": \"./index.mjs\",\n    \"./foo.js\": \"./foo.js\"\n  }\n}\n</code></pre>\n<p>Then any module <em>in that package</em> can reference an export in the package itself:</p>\n<pre><code class=\"language-js\">// ./a-module.mjs\nimport { something } from 'a-package'; // Imports \"something\" from ./index.mjs.\n</code></pre>\n<p>Self-referencing is available only if <code>package.json</code> has <a href=\"#exports\"><code>\"exports\"</code></a>, and\nwill allow importing only what that <a href=\"#exports\"><code>\"exports\"</code></a> (in the <code>package.json</code>)\nallows. So the code below, given the previous package, will generate a runtime\nerror:</p>\n<pre><code class=\"language-js\">// ./another-module.mjs\n\n// Imports \"another\" from ./m.mjs. Fails because\n// the \"package.json\" \"exports\" field\n// does not provide an export named \"./m.mjs\".\nimport { another } from 'a-package/m.mjs';\n</code></pre>\n<p>Self-referencing is also available when using <code>require</code>, both in an ES module,\nand in a CommonJS one. For example, this code will also work:</p>\n<pre><code class=\"language-cjs\">// ./a-module.js\nconst { something } = require('a-package/foo.js'); // Loads from ./foo.js.\n</code></pre>\n<p>Finally, self-referencing also works with scoped packages. For example, this\ncode will also work:</p>\n<pre><code class=\"language-json\">// package.json\n{\n  \"name\": \"@my/package\",\n  \"exports\": \"./index.js\"\n}\n</code></pre>\n<pre><code class=\"language-cjs\">// ./index.js\nmodule.exports = 42;\n</code></pre>\n<pre><code class=\"language-cjs\">// ./other.js\nconsole.log(require('@my/package'));\n</code></pre>\n<pre><code class=\"language-console\">$ node other.js\n42\n</code></pre>",
              "displayName": "Self-referencing a package using its name"
            }
          ],
          "displayName": "Package entry points"
        },
        {
          "textRaw": "Dual CommonJS/ES module packages",
          "name": "dual_commonjs/es_module_packages",
          "type": "misc",
          "desc": "<p>See <a href=\"https://github.com/nodejs/package-examples\">the package examples repository</a> for details.</p>",
          "displayName": "Dual CommonJS/ES module packages"
        },
        {
          "textRaw": "Node.js `package.json` field definitions",
          "name": "node.js_`package.json`_field_definitions",
          "type": "misc",
          "desc": "<p>This section describes the fields used by the Node.js runtime. Other tools (such\nas <a href=\"https://docs.npmjs.com/cli/v8/configuring-npm/package-json\">npm</a>) use\nadditional fields which are ignored by Node.js and not documented here.</p>\n<p>The following fields in <code>package.json</code> files are used in Node.js:</p>\n<ul>\n<li><a href=\"#name\"><code>\"name\"</code></a> - Relevant when using named imports within a package. Also used\nby package managers as the name of the package.</li>\n<li><a href=\"#main\"><code>\"main\"</code></a> - The default module when loading the package, if exports is not\nspecified, and in versions of Node.js prior to the introduction of exports.</li>\n<li><a href=\"#type\"><code>\"type\"</code></a> - The package type determining whether to load <code>.js</code> files as\nCommonJS or ES modules.</li>\n<li><a href=\"#exports\"><code>\"exports\"</code></a> - Package exports and conditional exports. When present,\nlimits which submodules can be loaded from within the package.</li>\n<li><a href=\"#imports\"><code>\"imports\"</code></a> - Package imports, for use by modules within the package\nitself.</li>\n</ul>",
          "modules": [
            {
              "textRaw": "`\"name\"`",
              "name": "`\"name\"`",
              "type": "module",
              "meta": {
                "added": [
                  "v13.1.0",
                  "v12.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.6.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31002",
                    "description": "Remove the `--experimental-resolve-self` option."
                  }
                ]
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<pre><code class=\"language-json\">{\n  \"name\": \"package-name\"\n}\n</code></pre>\n<p>The <code>\"name\"</code> field defines your package's name. Publishing to the\n<em>npm</em> registry requires a name that satisfies\n<a href=\"https://docs.npmjs.com/files/package.json#name\">certain requirements</a>.</p>\n<p>The <code>\"name\"</code> field can be used in addition to the <a href=\"#exports\"><code>\"exports\"</code></a> field to\n<a href=\"#self-referencing-a-package-using-its-name\">self-reference</a> a package using its name.</p>",
              "displayName": "`\"name\"`"
            },
            {
              "textRaw": "`\"main\"`",
              "name": "`\"main\"`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<pre><code class=\"language-json\">{\n  \"main\": \"./index.js\"\n}\n</code></pre>\n<p>The <code>\"main\"</code> field defines the entry point of a package when imported by name\nvia a <code>node_modules</code> lookup.  Its value is a path.</p>\n<p>The <a href=\"#exports\"><code>\"exports\"</code></a> field, if it exists, takes precedence over the\n<code>\"main\"</code> field when importing the package by name.</p>\n<p>It also defines the script that is used when the <a href=\"modules.html#folders-as-modules\">package directory is loaded\nvia <code>require()</code></a>.</p>\n<pre><code class=\"language-cjs\">// This resolves to ./path/to/directory/index.js.\nrequire('./path/to/directory');\n</code></pre>",
              "displayName": "`\"main\"`"
            },
            {
              "textRaw": "`\"type\"`",
              "name": "`\"type\"`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.2.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29866",
                    "description": "Unflag `--experimental-modules`."
                  }
                ]
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p>The <code>\"type\"</code> field defines the module format that Node.js uses for all\n<code>.js</code> files that have that <code>package.json</code> file as their nearest parent.</p>\n<p>Files ending with <code>.js</code> are loaded as ES modules when the nearest parent\n<code>package.json</code> file contains a top-level field <code>\"type\"</code> with a value of\n<code>\"module\"</code>.</p>\n<p>The nearest parent <code>package.json</code> is defined as the first <code>package.json</code> found\nwhen searching in the current folder, that folder's parent, and so on up\nuntil a node_modules folder or the volume root is reached.</p>\n<pre><code class=\"language-json\">// package.json\n{\n  \"type\": \"module\"\n}\n</code></pre>\n<pre><code class=\"language-bash\"># In same folder as preceding package.json\nnode my-app.js # Runs as ES module\n</code></pre>\n<p>If the nearest parent <code>package.json</code> lacks a <code>\"type\"</code> field, or contains\n<code>\"type\": \"commonjs\"</code>, <code>.js</code> files are treated as <a href=\"modules.html\">CommonJS</a>. If the volume\nroot is reached and no <code>package.json</code> is found, <code>.js</code> files are treated as\n<a href=\"modules.html\">CommonJS</a>.</p>\n<p><code>import</code> statements of <code>.js</code> files are treated as ES modules if the nearest\nparent <code>package.json</code> contains <code>\"type\": \"module\"</code>.</p>\n<pre><code class=\"language-js\">// my-app.js, part of the same example as above\nimport './startup.js'; // Loaded as ES module because of package.json\n</code></pre>\n<p>Regardless of the value of the <code>\"type\"</code> field, <code>.mjs</code> files are always treated\nas ES modules and <code>.cjs</code> files are always treated as CommonJS.</p>",
              "displayName": "`\"type\"`"
            },
            {
              "textRaw": "`\"exports\"`",
              "name": "`\"exports\"`",
              "type": "module",
              "meta": {
                "added": [
                  "v12.7.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.13.0",
                      "v12.20.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34718",
                    "description": "Add support for `\"exports\"` patterns."
                  },
                  {
                    "version": [
                      "v13.7.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29866",
                    "description": "Unflag conditional exports."
                  },
                  {
                    "version": [
                      "v13.7.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31008",
                    "description": "Implement logical conditional exports ordering."
                  },
                  {
                    "version": [
                      "v13.7.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31001",
                    "description": "Remove the `--experimental-conditional-exports` option. In 12.16.0, conditional exports are still behind `--experimental-modules`."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29978",
                    "description": "Implement conditional exports."
                  }
                ]
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a></li>\n</ul>\n<pre><code class=\"language-json\">{\n  \"exports\": \"./index.js\"\n}\n</code></pre>\n<p>The <code>\"exports\"</code> field allows defining the <a href=\"#package-entry-points\">entry points</a> of a package when\nimported by name loaded either via a <code>node_modules</code> lookup or a\n<a href=\"#self-referencing-a-package-using-its-name\">self-reference</a> to its own name. It is supported in Node.js 12+ as an\nalternative to the <a href=\"#main\"><code>\"main\"</code></a> that can support defining <a href=\"#subpath-exports\">subpath exports</a>\nand <a href=\"#conditional-exports\">conditional exports</a> while encapsulating internal unexported modules.</p>\n<p><a href=\"#conditional-exports\">Conditional Exports</a> can also be used within <code>\"exports\"</code> to define different\npackage entry points per environment, including whether the package is\nreferenced via <code>require</code> or via <code>import</code>.</p>\n<p>All paths defined in the <code>\"exports\"</code> must be relative file URLs starting with\n<code>./</code>.</p>",
              "displayName": "`\"exports\"`"
            },
            {
              "textRaw": "`\"imports\"`",
              "name": "`\"imports\"`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.6.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<pre><code class=\"language-json\">// package.json\n{\n  \"imports\": {\n    \"#dep\": {\n      \"node\": \"dep-node-native\",\n      \"default\": \"./dep-polyfill.js\"\n    }\n  },\n  \"dependencies\": {\n    \"dep-node-native\": \"^1.0.0\"\n  }\n}\n</code></pre>\n<p>Entries in the imports field must be strings starting with <code>#</code>.</p>\n<p>Package imports permit mapping to external packages.</p>\n<p>This field defines <a href=\"#subpath-imports\">subpath imports</a> for the current package.</p>",
              "displayName": "`\"imports\"`"
            }
          ],
          "displayName": "Node.js `package.json` field definitions"
        }
      ],
      "source": "doc/api/packages.md"
    },
    {
      "textRaw": "Diagnostic report",
      "name": "Diagnostic report",
      "introduced_in": "v11.8.0",
      "type": "misc",
      "meta": {
        "changes": [
          {
            "version": [
              "v23.3.0",
              "v22.13.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/55697",
            "description": "Added `--report-exclude-env` option for excluding environment variables from report generation."
          },
          {
            "version": [
              "v22.0.0",
              "v20.13.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/51645",
            "description": "Added `--report-exclude-network` option for excluding networking operations that can slow down report generation in some cases."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>Delivers a JSON-formatted diagnostic summary, written to a file.</p>\n<p>The report is intended for development, test, and production use, to capture\nand preserve information for problem determination. It includes JavaScript\nand native stack traces, heap statistics, platform information, resource\nusage etc. With the report option enabled, diagnostic reports can be triggered\non unhandled exceptions, fatal errors and user signals, in addition to\ntriggering programmatically through API calls.</p>\n<p>A complete example report that was generated on an uncaught exception\nis provided below for reference.</p>\n<pre><code class=\"language-json\">{\n  \"header\": {\n    \"reportVersion\": 5,\n    \"event\": \"exception\",\n    \"trigger\": \"Exception\",\n    \"filename\": \"report.20181221.005011.8974.0.001.json\",\n    \"dumpEventTime\": \"2018-12-21T00:50:11Z\",\n    \"dumpEventTimeStamp\": \"1545371411331\",\n    \"processId\": 8974,\n    \"cwd\": \"/home/nodeuser/project/node\",\n    \"commandLine\": [\n      \"/home/nodeuser/project/node/out/Release/node\",\n      \"--report-uncaught-exception\",\n      \"/home/nodeuser/project/node/test/report/test-exception.js\",\n      \"child\"\n    ],\n    \"nodejsVersion\": \"v12.0.0-pre\",\n    \"glibcVersionRuntime\": \"2.17\",\n    \"glibcVersionCompiler\": \"2.17\",\n    \"wordSize\": \"64 bit\",\n    \"arch\": \"x64\",\n    \"platform\": \"linux\",\n    \"componentVersions\": {\n      \"node\": \"12.0.0-pre\",\n      \"v8\": \"7.1.302.28-node.5\",\n      \"uv\": \"1.24.1\",\n      \"zlib\": \"1.2.11\",\n      \"ares\": \"1.15.0\",\n      \"modules\": \"68\",\n      \"nghttp2\": \"1.34.0\",\n      \"napi\": \"3\",\n      \"llhttp\": \"1.0.1\",\n      \"openssl\": \"1.1.0j\"\n    },\n    \"release\": {\n      \"name\": \"node\"\n    },\n    \"osName\": \"Linux\",\n    \"osRelease\": \"3.10.0-862.el7.x86_64\",\n    \"osVersion\": \"#1 SMP Wed Mar 21 18:14:51 EDT 2018\",\n    \"osMachine\": \"x86_64\",\n    \"cpus\": [\n      {\n        \"model\": \"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz\",\n        \"speed\": 2700,\n        \"user\": 88902660,\n        \"nice\": 0,\n        \"sys\": 50902570,\n        \"idle\": 241732220,\n        \"irq\": 0\n      },\n      {\n        \"model\": \"Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz\",\n        \"speed\": 2700,\n        \"user\": 88902660,\n        \"nice\": 0,\n        \"sys\": 50902570,\n        \"idle\": 241732220,\n        \"irq\": 0\n      }\n    ],\n    \"networkInterfaces\": [\n      {\n        \"name\": \"en0\",\n        \"internal\": false,\n        \"mac\": \"13:10:de:ad:be:ef\",\n        \"address\": \"10.0.0.37\",\n        \"netmask\": \"255.255.255.0\",\n        \"family\": \"IPv4\"\n      }\n    ],\n    \"host\": \"test_machine\"\n  },\n  \"javascriptStack\": {\n    \"message\": \"Error: *** test-exception.js: throwing uncaught Error\",\n    \"stack\": [\n      \"at myException (/home/nodeuser/project/node/test/report/test-exception.js:9:11)\",\n      \"at Object.&#x3C;anonymous> (/home/nodeuser/project/node/test/report/test-exception.js:12:3)\",\n      \"at Module._compile (internal/modules/cjs/loader.js:718:30)\",\n      \"at Object.Module._extensions..js (internal/modules/cjs/loader.js:729:10)\",\n      \"at Module.load (internal/modules/cjs/loader.js:617:32)\",\n      \"at tryModuleLoad (internal/modules/cjs/loader.js:560:12)\",\n      \"at Function.Module._load (internal/modules/cjs/loader.js:552:3)\",\n      \"at Function.Module.runMain (internal/modules/cjs/loader.js:771:12)\",\n      \"at executeUserCode (internal/bootstrap/node.js:332:15)\"\n    ]\n  },\n  \"nativeStack\": [\n    {\n      \"pc\": \"0x000055b57f07a9ef\",\n      \"symbol\": \"report::GetNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, v8::Local&#x3C;v8::String>, std::ostream&#x26;) [./node]\"\n    },\n    {\n      \"pc\": \"0x000055b57f07cf03\",\n      \"symbol\": \"report::GetReport(v8::FunctionCallbackInfo&#x3C;v8::Value> const&#x26;) [./node]\"\n    },\n    {\n      \"pc\": \"0x000055b57f1bccfd\",\n      \"symbol\": \" [./node]\"\n    },\n    {\n      \"pc\": \"0x000055b57f1be048\",\n      \"symbol\": \"v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [./node]\"\n    },\n    {\n      \"pc\": \"0x000055b57feeda0e\",\n      \"symbol\": \" [./node]\"\n    }\n  ],\n  \"javascriptHeap\": {\n    \"totalMemory\": 5660672,\n    \"executableMemory\": 524288,\n    \"totalCommittedMemory\": 5488640,\n    \"availableMemory\": 4341379928,\n    \"totalGlobalHandlesMemory\": 8192,\n    \"usedGlobalHandlesMemory\": 3136,\n    \"usedMemory\": 4816432,\n    \"memoryLimit\": 4345298944,\n    \"mallocedMemory\": 254128,\n    \"externalMemory\": 315644,\n    \"peakMallocedMemory\": 98752,\n    \"nativeContextCount\": 1,\n    \"detachedContextCount\": 0,\n    \"doesZapGarbage\": 0,\n    \"heapSpaces\": {\n      \"read_only_space\": {\n        \"memorySize\": 524288,\n        \"committedMemory\": 39208,\n        \"capacity\": 515584,\n        \"used\": 30504,\n        \"available\": 485080\n      },\n      \"new_space\": {\n        \"memorySize\": 2097152,\n        \"committedMemory\": 2019312,\n        \"capacity\": 1031168,\n        \"used\": 985496,\n        \"available\": 45672\n      },\n      \"old_space\": {\n        \"memorySize\": 2273280,\n        \"committedMemory\": 1769008,\n        \"capacity\": 1974640,\n        \"used\": 1725488,\n        \"available\": 249152\n      },\n      \"code_space\": {\n        \"memorySize\": 696320,\n        \"committedMemory\": 184896,\n        \"capacity\": 152128,\n        \"used\": 152128,\n        \"available\": 0\n      },\n      \"map_space\": {\n        \"memorySize\": 536576,\n        \"committedMemory\": 344928,\n        \"capacity\": 327520,\n        \"used\": 327520,\n        \"available\": 0\n      },\n      \"large_object_space\": {\n        \"memorySize\": 0,\n        \"committedMemory\": 0,\n        \"capacity\": 1520590336,\n        \"used\": 0,\n        \"available\": 1520590336\n      },\n      \"new_large_object_space\": {\n        \"memorySize\": 0,\n        \"committedMemory\": 0,\n        \"capacity\": 0,\n        \"used\": 0,\n        \"available\": 0\n      }\n    }\n  },\n  \"resourceUsage\": {\n    \"rss\": \"35766272\",\n    \"free_memory\": \"1598337024\",\n    \"total_memory\": \"17179869184\",\n    \"available_memory\": \"1598337024\",\n    \"maxRss\": \"36624662528\",\n    \"constrained_memory\": \"36624662528\",\n    \"userCpuSeconds\": 0.040072,\n    \"kernelCpuSeconds\": 0.016029,\n    \"cpuConsumptionPercent\": 5.6101,\n    \"userCpuConsumptionPercent\": 4.0072,\n    \"kernelCpuConsumptionPercent\": 1.6029,\n    \"pageFaults\": {\n      \"IORequired\": 0,\n      \"IONotRequired\": 4610\n    },\n    \"fsActivity\": {\n      \"reads\": 0,\n      \"writes\": 0\n    }\n  },\n  \"uvthreadResourceUsage\": {\n    \"userCpuSeconds\": 0.039843,\n    \"kernelCpuSeconds\": 0.015937,\n    \"cpuConsumptionPercent\": 5.578,\n    \"userCpuConsumptionPercent\": 3.9843,\n    \"kernelCpuConsumptionPercent\": 1.5937,\n    \"fsActivity\": {\n      \"reads\": 0,\n      \"writes\": 0\n    }\n  },\n  \"libuv\": [\n    {\n      \"type\": \"async\",\n      \"is_active\": true,\n      \"is_referenced\": false,\n      \"address\": \"0x0000000102910900\",\n      \"details\": \"\"\n    },\n    {\n      \"type\": \"timer\",\n      \"is_active\": false,\n      \"is_referenced\": false,\n      \"address\": \"0x00007fff5fbfeab0\",\n      \"repeat\": 0,\n      \"firesInMsFromNow\": 94403548320796,\n      \"expired\": true\n    },\n    {\n      \"type\": \"check\",\n      \"is_active\": true,\n      \"is_referenced\": false,\n      \"address\": \"0x00007fff5fbfeb48\"\n    },\n    {\n      \"type\": \"idle\",\n      \"is_active\": false,\n      \"is_referenced\": true,\n      \"address\": \"0x00007fff5fbfebc0\"\n    },\n    {\n      \"type\": \"prepare\",\n      \"is_active\": false,\n      \"is_referenced\": false,\n      \"address\": \"0x00007fff5fbfec38\"\n    },\n    {\n      \"type\": \"check\",\n      \"is_active\": false,\n      \"is_referenced\": false,\n      \"address\": \"0x00007fff5fbfecb0\"\n    },\n    {\n      \"type\": \"async\",\n      \"is_active\": true,\n      \"is_referenced\": false,\n      \"address\": \"0x000000010188f2e0\"\n    },\n    {\n      \"type\": \"tty\",\n      \"is_active\": false,\n      \"is_referenced\": true,\n      \"address\": \"0x000055b581db0e18\",\n      \"width\": 204,\n      \"height\": 55,\n      \"fd\": 17,\n      \"writeQueueSize\": 0,\n      \"readable\": true,\n      \"writable\": true\n    },\n    {\n      \"type\": \"signal\",\n      \"is_active\": true,\n      \"is_referenced\": false,\n      \"address\": \"0x000055b581d80010\",\n      \"signum\": 28,\n      \"signal\": \"SIGWINCH\"\n    },\n    {\n      \"type\": \"tty\",\n      \"is_active\": true,\n      \"is_referenced\": true,\n      \"address\": \"0x000055b581df59f8\",\n      \"width\": 204,\n      \"height\": 55,\n      \"fd\": 19,\n      \"writeQueueSize\": 0,\n      \"readable\": true,\n      \"writable\": true\n    },\n    {\n      \"type\": \"loop\",\n      \"is_active\": true,\n      \"address\": \"0x000055fc7b2cb180\",\n      \"loopIdleTimeSeconds\": 22644.8\n    },\n    {\n      \"type\": \"tcp\",\n      \"is_active\": true,\n      \"is_referenced\": true,\n      \"address\": \"0x000055e70fcb85d8\",\n      \"localEndpoint\": {\n        \"host\": \"localhost\",\n        \"ip4\": \"127.0.0.1\",\n        \"port\": 48986\n      },\n      \"remoteEndpoint\": {\n        \"host\": \"localhost\",\n        \"ip4\": \"127.0.0.1\",\n        \"port\": 38573\n      },\n      \"sendBufferSize\": 2626560,\n      \"recvBufferSize\": 131072,\n      \"fd\": 24,\n      \"writeQueueSize\": 0,\n      \"readable\": true,\n      \"writable\": true\n    }\n  ],\n  \"workers\": [],\n  \"environmentVariables\": {\n    \"REMOTEHOST\": \"REMOVED\",\n    \"MANPATH\": \"/opt/rh/devtoolset-3/root/usr/share/man:\",\n    \"XDG_SESSION_ID\": \"66126\",\n    \"HOSTNAME\": \"test_machine\",\n    \"HOST\": \"test_machine\",\n    \"TERM\": \"xterm-256color\",\n    \"SHELL\": \"/bin/csh\",\n    \"SSH_CLIENT\": \"REMOVED\",\n    \"PERL5LIB\": \"/opt/rh/devtoolset-3/root//usr/lib64/perl5/vendor_perl:/opt/rh/devtoolset-3/root/usr/lib/perl5:/opt/rh/devtoolset-3/root//usr/share/perl5/vendor_perl\",\n    \"OLDPWD\": \"/home/nodeuser/project/node/src\",\n    \"JAVACONFDIRS\": \"/opt/rh/devtoolset-3/root/etc/java:/etc/java\",\n    \"SSH_TTY\": \"/dev/pts/0\",\n    \"PCP_DIR\": \"/opt/rh/devtoolset-3/root\",\n    \"GROUP\": \"normaluser\",\n    \"USER\": \"nodeuser\",\n    \"LD_LIBRARY_PATH\": \"/opt/rh/devtoolset-3/root/usr/lib64:/opt/rh/devtoolset-3/root/usr/lib\",\n    \"HOSTTYPE\": \"x86_64-linux\",\n    \"XDG_CONFIG_DIRS\": \"/opt/rh/devtoolset-3/root/etc/xdg:/etc/xdg\",\n    \"MAIL\": \"/var/spool/mail/nodeuser\",\n    \"PATH\": \"/home/nodeuser/project/node:/opt/rh/devtoolset-3/root/usr/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin\",\n    \"PWD\": \"/home/nodeuser/project/node\",\n    \"LANG\": \"en_US.UTF-8\",\n    \"PS1\": \"\\\\u@\\\\h : \\\\[\\\\e[31m\\\\]\\\\w\\\\[\\\\e[m\\\\] >  \",\n    \"SHLVL\": \"2\",\n    \"HOME\": \"/home/nodeuser\",\n    \"OSTYPE\": \"linux\",\n    \"VENDOR\": \"unknown\",\n    \"PYTHONPATH\": \"/opt/rh/devtoolset-3/root/usr/lib64/python2.7/site-packages:/opt/rh/devtoolset-3/root/usr/lib/python2.7/site-packages\",\n    \"MACHTYPE\": \"x86_64\",\n    \"LOGNAME\": \"nodeuser\",\n    \"XDG_DATA_DIRS\": \"/opt/rh/devtoolset-3/root/usr/share:/usr/local/share:/usr/share\",\n    \"LESSOPEN\": \"||/usr/bin/lesspipe.sh %s\",\n    \"INFOPATH\": \"/opt/rh/devtoolset-3/root/usr/share/info\",\n    \"XDG_RUNTIME_DIR\": \"/run/user/50141\",\n    \"_\": \"./node\"\n  },\n  \"userLimits\": {\n    \"core_file_size_blocks\": {\n      \"soft\": \"\",\n      \"hard\": \"unlimited\"\n    },\n    \"data_seg_size_bytes\": {\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    },\n    \"file_size_blocks\": {\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    },\n    \"max_locked_memory_bytes\": {\n      \"soft\": \"unlimited\",\n      \"hard\": 65536\n    },\n    \"max_memory_size_bytes\": {\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    },\n    \"open_files\": {\n      \"soft\": \"unlimited\",\n      \"hard\": 4096\n    },\n    \"stack_size_bytes\": {\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    },\n    \"cpu_time_seconds\": {\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    },\n    \"max_user_processes\": {\n      \"soft\": \"unlimited\",\n      \"hard\": 4127290\n    },\n    \"virtual_memory_bytes\": {\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    }\n  },\n  \"sharedObjects\": [\n    \"/lib64/libdl.so.2\",\n    \"/lib64/librt.so.1\",\n    \"/lib64/libstdc++.so.6\",\n    \"/lib64/libm.so.6\",\n    \"/lib64/libgcc_s.so.1\",\n    \"/lib64/libpthread.so.0\",\n    \"/lib64/libc.so.6\",\n    \"/lib64/ld-linux-x86-64.so.2\"\n  ]\n}\n</code></pre>",
      "miscs": [
        {
          "textRaw": "Usage",
          "name": "usage",
          "type": "misc",
          "desc": "<pre><code class=\"language-bash\">node --report-uncaught-exception --report-on-signal \\\n--report-on-fatalerror app.js\n</code></pre>\n<ul>\n<li>\n<p><code>--report-uncaught-exception</code> Enables report to be generated on\nun-caught exceptions. Useful when inspecting JavaScript stack in conjunction\nwith native stack and other runtime environment data.</p>\n</li>\n<li>\n<p><code>--report-on-signal</code> Enables report to be generated upon receiving\nthe specified (or predefined) signal to the running Node.js process. (See\nbelow on how to modify the signal that triggers the report.) Default signal is\n<code>SIGUSR2</code>. Useful when a report needs to be triggered from another program.\nApplication monitors may leverage this feature to collect report at regular\nintervals and plot rich set of internal runtime data to their views.</p>\n</li>\n</ul>\n<p>Signal based report generation is not supported in Windows.</p>\n<p>Under normal circumstances, there is no need to modify the report triggering\nsignal. However, if <code>SIGUSR2</code> is already used for other purposes, then this\nflag helps to change the signal for report generation and preserve the original\nmeaning of <code>SIGUSR2</code> for the said purposes.</p>\n<ul>\n<li>\n<p><code>--report-on-fatalerror</code> Enables the report to be triggered on fatal errors\n(internal errors within the Node.js runtime, such as out of memory)\nthat leads to termination of the application. Useful to inspect various\ndiagnostic data elements such as heap, stack, event loop state, resource\nconsumption etc. to reason about the fatal error.</p>\n</li>\n<li>\n<p><code>--report-compact</code> Write reports in a compact format, single-line JSON, more\neasily consumable by log processing systems than the default multi-line format\ndesigned for human consumption.</p>\n</li>\n<li>\n<p><code>--report-directory</code> Location at which the report will be\ngenerated.</p>\n</li>\n<li>\n<p><code>--report-filename</code> Name of the file to which the report will be\nwritten.</p>\n</li>\n<li>\n<p><code>--report-signal</code> Sets or resets the signal for report generation\n(not supported on Windows). Default signal is <code>SIGUSR2</code>.</p>\n</li>\n<li>\n<p><code>--report-exclude-network</code> Exclude <code>header.networkInterfaces</code> and disable the reverse DNS queries\nin <code>libuv.*.(remote|local)Endpoint.host</code> from the diagnostic report.\nBy default this is not set and the network interfaces are included.</p>\n</li>\n<li>\n<p><code>--report-exclude-env</code> Exclude <code>environmentVariables</code> from the\ndiagnostic report. By default this is not set and the environment\nvariables are included.</p>\n</li>\n</ul>\n<p>A report can also be triggered via an API call from a JavaScript application:</p>\n<pre><code class=\"language-js\">process.report.writeReport();\n</code></pre>\n<p>This function takes an optional additional argument <code>filename</code>, which is\nthe name of a file into which the report is written.</p>\n<pre><code class=\"language-js\">process.report.writeReport('./foo.json');\n</code></pre>\n<p>This function takes an optional additional argument <code>err</code> which is an <code>Error</code>\nobject that will be used as the context for the JavaScript stack printed in the\nreport. When using report to handle errors in a callback or an exception\nhandler, this allows the report to include the location of the original error as\nwell as where it was handled.</p>\n<pre><code class=\"language-js\">try {\n  process.chdir('/non-existent-path');\n} catch (err) {\n  process.report.writeReport(err);\n}\n// Any other code\n</code></pre>\n<p>If both filename and error object are passed to <code>writeReport()</code> the\nerror object must be the second parameter.</p>\n<pre><code class=\"language-js\">try {\n  process.chdir('/non-existent-path');\n} catch (err) {\n  process.report.writeReport(filename, err);\n}\n// Any other code\n</code></pre>\n<p>The content of the diagnostic report can be returned as a JavaScript Object\nvia an API call from a JavaScript application:</p>\n<pre><code class=\"language-js\">const report = process.report.getReport();\nconsole.log(typeof report === 'object'); // true\n\n// Similar to process.report.writeReport() output\nconsole.log(JSON.stringify(report, null, 2));\n</code></pre>\n<p>This function takes an optional additional argument <code>err</code>, which is an <code>Error</code>\nobject that will be used as the context for the JavaScript stack printed in the\nreport.</p>\n<pre><code class=\"language-js\">const report = process.report.getReport(new Error('custom error'));\nconsole.log(typeof report === 'object'); // true\n</code></pre>\n<p>The API versions are useful when inspecting the runtime state from within\nthe application, in expectation of self-adjusting the resource consumption,\nload balancing, monitoring etc.</p>\n<p>The content of the report consists of a header section containing the event\ntype, date, time, PID, and Node.js version, sections containing JavaScript and\nnative stack traces, a section containing V8 heap information, a section\ncontaining <code>libuv</code> handle information, and an OS platform information section\nshowing CPU and memory usage and system limits. An example report can be\ntriggered using the Node.js REPL:</p>\n<pre><code class=\"language-console\">$ node\n> process.report.writeReport();\nWriting Node.js report to file: report.20181126.091102.8480.0.001.json\nNode.js report completed\n>\n</code></pre>\n<p>When a report is written, start and end messages are issued to stderr\nand the filename of the report is returned to the caller. The default filename\nincludes the date, time, PID, and a sequence number. The sequence number helps\nin associating the report dump with the runtime state if generated multiple\ntimes for the same Node.js process.</p>",
          "displayName": "Usage"
        },
        {
          "textRaw": "Report Version",
          "name": "report_version",
          "type": "misc",
          "desc": "<p>Diagnostic report has an associated single-digit version number (<code>report.header.reportVersion</code>),\nuniquely representing the report format. The version number is bumped\nwhen new key is added or removed, or the data type of a value is changed.\nReport version definitions are consistent across LTS releases.</p>",
          "modules": [
            {
              "textRaw": "Version history",
              "name": "version_history",
              "type": "module",
              "modules": [
                {
                  "textRaw": "Version 5",
                  "name": "version_5",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v23.5.0",
                          "v22.13.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/56068",
                        "description": "Fix typos in the memory limit units."
                      }
                    ]
                  },
                  "desc": "<p>Replace the keys <code>data_seg_size_kbytes</code>, <code>max_memory_size_kbytes</code>, and <code>virtual_memory_kbytes</code>\nwith <code>data_seg_size_bytes</code>, <code>max_memory_size_bytes</code>, and <code>virtual_memory_bytes</code>\nrespectively in the <code>userLimits</code> section, as these values are given in bytes.</p>\n<pre><code class=\"language-json\">{\n  \"userLimits\": {\n    // Skip some keys ...\n    \"data_seg_size_bytes\": { // replacing data_seg_size_kbytes\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    },\n    // ...\n    \"max_memory_size_bytes\": { // replacing max_memory_size_kbytes\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    },\n    // ...\n    \"virtual_memory_bytes\": { // replacing virtual_memory_kbytes\n      \"soft\": \"unlimited\",\n      \"hard\": \"unlimited\"\n    }\n  }\n}\n</code></pre>",
                  "displayName": "Version 5"
                },
                {
                  "textRaw": "Version 4",
                  "name": "version_4",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v23.3.0",
                          "v22.13.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/55697",
                        "description": "Added `--report-exclude-env` option for excluding environment variables from report generation."
                      }
                    ]
                  },
                  "desc": "<p>New fields <code>ipv4</code> and <code>ipv6</code> are added to <code>tcp</code> and <code>udp</code> libuv handles endpoints. Examples:</p>\n<pre><code class=\"language-json\">{\n  \"libuv\": [\n    {\n      \"type\": \"tcp\",\n      \"is_active\": true,\n      \"is_referenced\": true,\n      \"address\": \"0x000055e70fcb85d8\",\n      \"localEndpoint\": {\n        \"host\": \"localhost\",\n        \"ip4\": \"127.0.0.1\", // new key\n        \"port\": 48986\n      },\n      \"remoteEndpoint\": {\n        \"host\": \"localhost\",\n        \"ip4\": \"127.0.0.1\", // new key\n        \"port\": 38573\n      },\n      \"sendBufferSize\": 2626560,\n      \"recvBufferSize\": 131072,\n      \"fd\": 24,\n      \"writeQueueSize\": 0,\n      \"readable\": true,\n      \"writable\": true\n    },\n    {\n      \"type\": \"tcp\",\n      \"is_active\": true,\n      \"is_referenced\": true,\n      \"address\": \"0x000055e70fcd68c8\",\n      \"localEndpoint\": {\n        \"host\": \"ip6-localhost\",\n        \"ip6\": \"::1\", // new key\n        \"port\": 52266\n      },\n      \"remoteEndpoint\": {\n        \"host\": \"ip6-localhost\",\n        \"ip6\": \"::1\", // new key\n        \"port\": 38573\n      },\n      \"sendBufferSize\": 2626560,\n      \"recvBufferSize\": 131072,\n      \"fd\": 25,\n      \"writeQueueSize\": 0,\n      \"readable\": false,\n      \"writable\": false\n    }\n  ]\n}\n</code></pre>",
                  "displayName": "Version 4"
                },
                {
                  "textRaw": "Version 3",
                  "name": "version_3",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v19.1.0",
                          "v18.13.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/45254",
                        "description": "Add more memory info."
                      }
                    ]
                  },
                  "desc": "<p>The following memory usage keys are added to the <code>resourceUsage</code> section.</p>\n<pre><code class=\"language-json\">{\n  \"resourceUsage\": {\n    \"rss\": \"35766272\",\n    \"free_memory\": \"1598337024\",\n    \"total_memory\": \"17179869184\",\n    \"available_memory\": \"1598337024\",\n    \"constrained_memory\": \"36624662528\"\n  }\n}\n</code></pre>",
                  "displayName": "Version 3"
                },
                {
                  "textRaw": "Version 2",
                  "name": "version_2",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v13.9.0",
                          "v12.16.2"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/31386",
                        "description": "Workers are now included in the report."
                      }
                    ]
                  },
                  "desc": "<p>Added <a href=\"worker_threads.html\"><code>Worker</code></a> support. Refer to <a href=\"#interaction-with-workers\">Interaction with workers</a> section for more details.</p>",
                  "displayName": "Version 2"
                },
                {
                  "textRaw": "Version 1",
                  "name": "version_1",
                  "type": "module",
                  "desc": "<p>This is the first version of the diagnostic report.</p>",
                  "displayName": "Version 1"
                }
              ],
              "displayName": "Version history"
            }
          ],
          "displayName": "Report Version"
        },
        {
          "textRaw": "Configuration",
          "name": "configuration",
          "type": "misc",
          "desc": "<p>Additional runtime configuration of report generation is available via\nthe following properties of <code>process.report</code>:</p>\n<p><code>reportOnFatalError</code> triggers diagnostic reporting on fatal errors when <code>true</code>.\nDefaults to <code>false</code>.</p>\n<p><code>reportOnSignal</code> triggers diagnostic reporting on signal when <code>true</code>. This is\nnot supported on Windows. Defaults to <code>false</code>.</p>\n<p><code>reportOnUncaughtException</code> triggers diagnostic reporting on uncaught exception\nwhen <code>true</code>. Defaults to <code>false</code>.</p>\n<p><code>signal</code> specifies the POSIX signal identifier that will be used\nto intercept external triggers for report generation. Defaults to\n<code>'SIGUSR2'</code>.</p>\n<p><code>filename</code> specifies the name of the output file in the file system.\nSpecial meaning is attached to <code>stdout</code> and <code>stderr</code>. Usage of these\nwill result in report being written to the associated standard streams.\nIn cases where standard streams are used, the value in <code>directory</code> is ignored.\nURLs are not supported. Defaults to a composite filename that contains\ntimestamp, PID, and sequence number.</p>\n<p><code>directory</code> specifies the file system directory where the report will be\nwritten. URLs are not supported. Defaults to the current working directory of\nthe Node.js process.</p>\n<p><code>excludeNetwork</code> excludes <code>header.networkInterfaces</code> from the diagnostic report.</p>\n<pre><code class=\"language-js\">// Trigger report only on uncaught exceptions.\nprocess.report.reportOnFatalError = false;\nprocess.report.reportOnSignal = false;\nprocess.report.reportOnUncaughtException = true;\n\n// Trigger report for both internal errors as well as external signal.\nprocess.report.reportOnFatalError = true;\nprocess.report.reportOnSignal = true;\nprocess.report.reportOnUncaughtException = false;\n\n// Change the default signal to 'SIGQUIT' and enable it.\nprocess.report.reportOnFatalError = false;\nprocess.report.reportOnUncaughtException = false;\nprocess.report.reportOnSignal = true;\nprocess.report.signal = 'SIGQUIT';\n\n// Disable network interfaces reporting\nprocess.report.excludeNetwork = true;\n</code></pre>\n<p>Configuration on module initialization is also available via\nenvironment variables:</p>\n<pre><code class=\"language-bash\">NODE_OPTIONS=\"--report-uncaught-exception \\\n  --report-on-fatalerror --report-on-signal \\\n  --report-signal=SIGUSR2  --report-filename=./report.json \\\n  --report-directory=/home/nodeuser\"\n</code></pre>\n<p>Specific API documentation can be found under\n<a href=\"process.html\"><code>process API documentation</code></a> section.</p>",
          "displayName": "Configuration"
        },
        {
          "textRaw": "Interaction with workers",
          "name": "interaction_with_workers",
          "type": "misc",
          "meta": {
            "changes": [
              {
                "version": [
                  "v13.9.0",
                  "v12.16.2"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/31386",
                "description": "Workers are now included in the report."
              }
            ]
          },
          "desc": "<p><a href=\"worker_threads.html\"><code>Worker</code></a> threads can create reports in the same way that the main thread\ndoes.</p>\n<p>Reports will include information on any Workers that are children of the current\nthread as part of the <code>workers</code> section, with each Worker generating a report\nin the standard report format.</p>\n<p>The thread which is generating the report will wait for the reports from Worker\nthreads to finish. However, the latency for this will usually be low, as both\nrunning JavaScript and the event loop are interrupted to generate the report.</p>",
          "displayName": "Interaction with workers"
        }
      ],
      "source": "doc/api/report.md"
    }
  ],
  "modules": [
    {
      "textRaw": "Assert",
      "name": "assert",
      "introduced_in": "v0.1.21",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:assert</code> module provides a set of assertion functions for verifying\ninvariants.</p>",
      "modules": [
        {
          "textRaw": "Strict assertion mode",
          "name": "strict_assertion_mode",
          "type": "module",
          "meta": {
            "added": [
              "v9.9.0"
            ],
            "changes": [
              {
                "version": "v15.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/34001",
                "description": "Exposed as `require('node:assert/strict')`."
              },
              {
                "version": [
                  "v13.9.0",
                  "v12.16.2"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/31635",
                "description": "Changed \"strict mode\" to \"strict assertion mode\" and \"legacy mode\" to \"legacy assertion mode\" to avoid confusion with the more usual meaning of \"strict mode\"."
              },
              {
                "version": "v9.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/17615",
                "description": "Added error diffs to the strict assertion mode."
              },
              {
                "version": "v9.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/17002",
                "description": "Added strict assertion mode to the assert module."
              }
            ]
          },
          "desc": "<p>In strict assertion mode, non-strict methods behave like their corresponding\nstrict methods. For example, <a href=\"#assertdeepequalactual-expected-message\"><code>assert.deepEqual()</code></a> will behave like\n<a href=\"#assertdeepstrictequalactual-expected-message\"><code>assert.deepStrictEqual()</code></a>.</p>\n<p>In strict assertion mode, error messages for objects display a diff. In legacy\nassertion mode, error messages for objects display the objects, often truncated.</p>",
          "modules": [
            {
              "textRaw": "Message parameter semantics",
              "name": "message_parameter_semantics",
              "type": "module",
              "desc": "<p>For assertion methods that accept an optional <code>message</code> parameter, the message\nmay be provided in one of the following forms:</p>\n<ul>\n<li><strong>string</strong>: Used as-is. If additional arguments are supplied after the\n<code>message</code> string, they are treated as printf-like substitutions (see\n<a href=\"util.html#utilformatformat-args\"><code>util.format()</code></a>).</li>\n<li><strong>Error</strong>: If an <code>Error</code> instance is provided as <code>message</code>, that error is\nthrown directly instead of an <code>AssertionError</code>.</li>\n<li><strong>function</strong>: A function of the form <code>(actual, expected) => string</code>. It is\ncalled only when the assertion fails and should return a string to be used as\nthe error message. Non-string return values are ignored and the default\nmessage is used instead.</li>\n</ul>\n<p>If additional arguments are passed along with an <code>Error</code> or a function as\n<code>message</code>, the call is rejected with <code>ERR_AMBIGUOUS_ARGUMENT</code>.</p>\n<p>If the first item is neither a string, <code>Error</code>, nor function, <code>ERR_INVALID_ARG_TYPE</code>\nis thrown.</p>\n<p>To use strict assertion mode:</p>\n<pre><code class=\"language-mjs\">import { strict as assert } from 'node:assert';\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert').strict;\n</code></pre>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n</code></pre>\n<p>Example error diff:</p>\n<pre><code class=\"language-mjs\">import { strict as assert } from 'node:assert';\n\nassert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected ... Lines skipped\n//\n//   [\n//     [\n// ...\n//       2,\n// +     3\n// -     '3'\n//     ],\n// ...\n//     5\n//   ]\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.deepEqual([[[1, 2, 3]], 4, 5], [[[1, 2, '3']], 4, 5]);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected ... Lines skipped\n//\n//   [\n//     [\n// ...\n//       2,\n// +     3\n// -     '3'\n//     ],\n// ...\n//     5\n//   ]\n</code></pre>\n<p>To deactivate the colors, use the <code>NO_COLOR</code> or <code>NODE_DISABLE_COLORS</code>\nenvironment variables. This will also deactivate the colors in the REPL. For\nmore on color support in terminal environments, read the tty\n<a href=\"tty.html#writestreamgetcolordepthenv\"><code>getColorDepth()</code></a> documentation.</p>",
              "displayName": "Message parameter semantics"
            }
          ],
          "displayName": "Strict assertion mode"
        },
        {
          "textRaw": "Legacy assertion mode",
          "name": "legacy_assertion_mode",
          "type": "module",
          "desc": "<p>Legacy assertion mode uses the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality\"><code>==</code> operator</a> in:</p>\n<ul>\n<li><a href=\"#assertdeepequalactual-expected-message\"><code>assert.deepEqual()</code></a></li>\n<li><a href=\"#assertequalactual-expected-message\"><code>assert.equal()</code></a></li>\n<li><a href=\"#assertnotdeepequalactual-expected-message\"><code>assert.notDeepEqual()</code></a></li>\n<li><a href=\"#assertnotequalactual-expected-message\"><code>assert.notEqual()</code></a></li>\n</ul>\n<p>To use legacy assertion mode:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n</code></pre>\n<p>Legacy assertion mode may have surprising results, especially when using\n<a href=\"#assertdeepequalactual-expected-message\"><code>assert.deepEqual()</code></a>:</p>\n<pre><code class=\"language-cjs\">// WARNING: This does not throw an AssertionError in legacy assertion mode!\nassert.deepEqual(/a/gi, new Date());\n</code></pre>",
          "displayName": "Legacy assertion mode"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `assert.AssertionError`",
          "name": "assert.AssertionError",
          "type": "class",
          "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates the failure of an assertion. All errors thrown by the <code>node:assert</code>\nmodule will be instances of the <code>AssertionError</code> class.</p>",
          "signatures": [
            {
              "textRaw": "`new assert.AssertionError(options)`",
              "name": "assert.AssertionError",
              "type": "ctor",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`message` {string} If provided, the error message is set to this value.",
                      "name": "message",
                      "type": "string",
                      "desc": "If provided, the error message is set to this value."
                    },
                    {
                      "textRaw": "`actual` {any} The `actual` property on the error instance.",
                      "name": "actual",
                      "type": "any",
                      "desc": "The `actual` property on the error instance."
                    },
                    {
                      "textRaw": "`expected` {any} The `expected` property on the error instance.",
                      "name": "expected",
                      "type": "any",
                      "desc": "The `expected` property on the error instance."
                    },
                    {
                      "textRaw": "`operator` {string} The `operator` property on the error instance.",
                      "name": "operator",
                      "type": "string",
                      "desc": "The `operator` property on the error instance."
                    },
                    {
                      "textRaw": "`stackStartFn` {Function} If provided, the generated stack trace omits frames before this function.",
                      "name": "stackStartFn",
                      "type": "Function",
                      "desc": "If provided, the generated stack trace omits frames before this function."
                    },
                    {
                      "textRaw": "`diff` {string} If set to `'full'`, shows the full diff in assertion errors. Defaults to `'simple'`. Accepted values: `'simple'`, `'full'`.",
                      "name": "diff",
                      "type": "string",
                      "desc": "If set to `'full'`, shows the full diff in assertion errors. Defaults to `'simple'`. Accepted values: `'simple'`, `'full'`."
                    }
                  ]
                }
              ],
              "desc": "<p>A subclass of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> that indicates the failure of an assertion.</p>\n<p>All instances contain the built-in <code>Error</code> properties (<code>message</code> and <code>name</code>)\nand:</p>\n<ul>\n<li><code>actual</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> Set to the <code>actual</code> argument for methods such as\n<a href=\"#assertstrictequalactual-expected-message\"><code>assert.strictEqual()</code></a>.</li>\n<li><code>expected</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> Set to the <code>expected</code> value for methods such as\n<a href=\"#assertstrictequalactual-expected-message\"><code>assert.strictEqual()</code></a>.</li>\n<li><code>generatedMessage</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Indicates if the message was auto-generated\n(<code>true</code>) or not.</li>\n<li><code>code</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Value is always <code>ERR_ASSERTION</code> to show that the error is an\nassertion error.</li>\n<li><code>operator</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Set to the passed in operator value.</li>\n</ul>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\n// Generate an AssertionError to compare the error message later:\nconst { message } = new assert.AssertionError({\n  actual: 1,\n  expected: 2,\n  operator: 'strictEqual',\n});\n\n// Verify error output:\ntry {\n  assert.strictEqual(1, 2);\n} catch (err) {\n  assert(err instanceof assert.AssertionError);\n  assert.strictEqual(err.message, message);\n  assert.strictEqual(err.name, 'AssertionError');\n  assert.strictEqual(err.actual, 1);\n  assert.strictEqual(err.expected, 2);\n  assert.strictEqual(err.code, 'ERR_ASSERTION');\n  assert.strictEqual(err.operator, 'strictEqual');\n  assert.strictEqual(err.generatedMessage, true);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\n// Generate an AssertionError to compare the error message later:\nconst { message } = new assert.AssertionError({\n  actual: 1,\n  expected: 2,\n  operator: 'strictEqual',\n});\n\n// Verify error output:\ntry {\n  assert.strictEqual(1, 2);\n} catch (err) {\n  assert(err instanceof assert.AssertionError);\n  assert.strictEqual(err.message, message);\n  assert.strictEqual(err.name, 'AssertionError');\n  assert.strictEqual(err.actual, 1);\n  assert.strictEqual(err.expected, 2);\n  assert.strictEqual(err.code, 'ERR_ASSERTION');\n  assert.strictEqual(err.operator, 'strictEqual');\n  assert.strictEqual(err.generatedMessage, true);\n}\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `assert.Assert`",
          "name": "assert.Assert",
          "type": "class",
          "meta": {
            "added": [
              "v24.6.0",
              "v22.19.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>Assert</code> class allows creating independent assertion instances with custom options.</p>",
          "signatures": [
            {
              "textRaw": "`new assert.Assert([options])`",
              "name": "assert.Assert",
              "type": "ctor",
              "meta": {
                "changes": [
                  {
                    "version": "v24.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59762",
                    "description": "Added `skipPrototype` option."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`diff` {string} If set to `'full'`, shows the full diff in assertion errors. Defaults to `'simple'`. Accepted values: `'simple'`, `'full'`.",
                      "name": "diff",
                      "type": "string",
                      "desc": "If set to `'full'`, shows the full diff in assertion errors. Defaults to `'simple'`. Accepted values: `'simple'`, `'full'`."
                    },
                    {
                      "textRaw": "`strict` {boolean} If set to `true`, non-strict methods behave like their corresponding strict methods. Defaults to `true`.",
                      "name": "strict",
                      "type": "boolean",
                      "desc": "If set to `true`, non-strict methods behave like their corresponding strict methods. Defaults to `true`."
                    },
                    {
                      "textRaw": "`skipPrototype` {boolean} If set to `true`, skips prototype and constructor comparison in deep equality checks. Defaults to `false`.",
                      "name": "skipPrototype",
                      "type": "boolean",
                      "desc": "If set to `true`, skips prototype and constructor comparison in deep equality checks. Defaults to `false`."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new assertion instance. The <code>diff</code> option controls the verbosity of diffs in assertion error messages.</p>\n<pre><code class=\"language-js\">const { Assert } = require('node:assert');\nconst assertInstance = new Assert({ diff: 'full' });\nassertInstance.deepStrictEqual({ a: 1 }, { a: 2 });\n// Shows a full diff in the error message.\n</code></pre>\n<p><strong>Important</strong>: When destructuring assertion methods from an <code>Assert</code> instance,\nthe methods lose their connection to the instance's configuration options (such\nas <code>diff</code>, <code>strict</code>, and <code>skipPrototype</code> settings).\nThe destructured methods will fall back to default behavior instead.</p>\n<pre><code class=\"language-js\">const myAssert = new Assert({ diff: 'full' });\n\n// This works as expected - uses 'full' diff\nmyAssert.strictEqual({ a: 1 }, { b: { c: 1 } });\n\n// This loses the 'full' diff setting - falls back to default 'simple' diff\nconst { strictEqual } = myAssert;\nstrictEqual({ a: 1 }, { b: { c: 1 } });\n</code></pre>\n<p>The <code>skipPrototype</code> option affects all deep equality methods:</p>\n<pre><code class=\"language-js\">class Foo {\n  constructor(a) {\n    this.a = a;\n  }\n}\n\nclass Bar {\n  constructor(a) {\n    this.a = a;\n  }\n}\n\nconst foo = new Foo(1);\nconst bar = new Bar(1);\n\n// Default behavior - fails due to different constructors\nconst assert1 = new Assert();\nassert1.deepStrictEqual(foo, bar); // AssertionError\n\n// Skip prototype comparison - passes if properties are equal\nconst assert2 = new Assert({ skipPrototype: true });\nassert2.deepStrictEqual(foo, bar); // OK\n</code></pre>\n<p>When destructured, methods lose access to the instance's <code>this</code> context and revert to default assertion behavior\n(diff: 'simple', non-strict mode).\nTo maintain custom options when using destructured methods, avoid\ndestructuring and call methods directly on the instance.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`assert(value[, message])`",
          "name": "assert",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.9"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`value` {any} The input that is checked for being truthy.",
                  "name": "value",
                  "type": "any",
                  "desc": "The input that is checked for being truthy."
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>An alias of <a href=\"#assertokvalue-message\"><code>assert.ok()</code></a>.</p>"
        },
        {
          "textRaw": "`assert.deepEqual(actual, expected[, message])`",
          "name": "deepEqual",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/59448",
                "description": "Promises are not considered equal anymore if they are not of the same instance."
              },
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57627",
                "description": "Invalid dates are now considered equal."
              },
              {
                "version": "v24.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57622",
                "description": "Recursion now stops when either side encounters a circular reference."
              },
              {
                "version": [
                  "v22.2.0",
                  "v20.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/51805",
                "description": "Error cause and errors properties are now compared as well."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41020",
                "description": "Regular expressions lastIndex property is now compared as well."
              },
              {
                "version": [
                  "v16.0.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/38113",
                "description": "In Legacy assertion mode, changed status from Deprecated to Legacy."
              },
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/30766",
                "description": "NaN is now treated as being identical if both sides are NaN."
              },
              {
                "version": "v12.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/25008",
                "description": "The type tags are now properly compared and there are a couple minor comparison adjustments to make the check less surprising."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15001",
                "description": "The `Error` names and messages are now properly compared."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12142",
                "description": "The `Set` and `Map` content is also compared."
              },
              {
                "version": [
                  "v6.4.0",
                  "v4.7.1"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/8002",
                "description": "Typed array slices are handled correctly now."
              },
              {
                "version": [
                  "v6.1.0",
                  "v4.5.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/6432",
                "description": "Objects with circular references can be used as inputs now."
              },
              {
                "version": [
                  "v5.10.1",
                  "v4.4.3"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/5910",
                "description": "Handle non-`Uint8Array` typed arrays correctly."
              }
            ]
          },
          "stability": 3,
          "stabilityText": "Legacy: Use `assert.deepStrictEqual()` instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><strong>Strict assertion mode</strong></p>\n<p>An alias of <a href=\"#assertdeepstrictequalactual-expected-message\"><code>assert.deepStrictEqual()</code></a>.</p>\n<p><strong>Legacy assertion mode</strong></p>\n<p>Tests for deep equality between the <code>actual</code> and <code>expected</code> parameters. Consider\nusing <a href=\"#assertdeepstrictequalactual-expected-message\"><code>assert.deepStrictEqual()</code></a> instead. <a href=\"#assertdeepequalactual-expected-message\"><code>assert.deepEqual()</code></a> can have\nsurprising results.</p>\n<p><em>Deep equality</em> means that the enumerable \"own\" properties of child objects\nare also recursively evaluated by the following rules.</p>",
          "modules": [
            {
              "textRaw": "Comparison details",
              "name": "comparison_details",
              "type": "module",
              "desc": "<ul>\n<li>Primitive values are compared with the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality\"><code>==</code> operator</a>,\nwith the exception of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/NaN\"><code>&#x3C;NaN></code></a>. It is treated as being identical in case\nboth sides are <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/NaN\"><code>&#x3C;NaN></code></a>.</li>\n<li><a href=\"https://tc39.github.io/ecma262/#sec-object.prototype.tostring\">Type tags</a> of objects should be the same.</li>\n<li>Only <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Enumerability_and_ownership_of_properties\">enumerable \"own\" properties</a> are considered.</li>\n<li>Object constructors are compared when available.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> names, messages, causes, and errors are always compared,\neven if these are not enumerable properties.</li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Data_structures#primitive_values\">Object wrappers</a> are compared both as objects and unwrapped values.</li>\n<li><code>Object</code> properties are compared unordered.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>&#x3C;Map></code></a> keys and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>&#x3C;Set></code></a> items are compared unordered.</li>\n<li>Recursion stops when both sides differ or either side encounters a circular\nreference.</li>\n<li>Implementation does not test the <a href=\"https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\"><code>[[Prototype]]</code></a> of\nobjects.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#symbol_type\"><code>&#x3C;Symbol></code></a> properties are not compared.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>&#x3C;WeakMap></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>&#x3C;WeakSet></code></a> and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> instances are <strong>not</strong> compared\nstructurally. They are only equal if they reference the same object. Any\ncomparison between different <code>WeakMap</code>, <code>WeakSet</code>, or <code>Promise</code> instances\nwill result in inequality, even if they contain the same content.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a> lastIndex, flags, and source are always compared, even if these\nare not enumerable properties.</li>\n</ul>\n<p>The following example does not throw an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> because the\nprimitives are compared using the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality\"><code>==</code> operator</a>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n// WARNING: This does not throw an AssertionError!\n\nassert.deepEqual('+00000000', false);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n// WARNING: This does not throw an AssertionError!\n\nassert.deepEqual('+00000000', false);\n</code></pre>\n<p>\"Deep\" equality means that the enumerable \"own\" properties of child objects\nare evaluated also:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nconst obj1 = {\n  a: {\n    b: 1,\n  },\n};\nconst obj2 = {\n  a: {\n    b: 2,\n  },\n};\nconst obj3 = {\n  a: {\n    b: 1,\n  },\n};\nconst obj4 = { __proto__: obj1 };\n\nassert.deepEqual(obj1, obj1);\n// OK\n\n// Values of b are different:\nassert.deepEqual(obj1, obj2);\n// AssertionError: { a: { b: 1 } } deepEqual { a: { b: 2 } }\n\nassert.deepEqual(obj1, obj3);\n// OK\n\n// Prototypes are ignored:\nassert.deepEqual(obj1, obj4);\n// AssertionError: { a: { b: 1 } } deepEqual {}\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nconst obj1 = {\n  a: {\n    b: 1,\n  },\n};\nconst obj2 = {\n  a: {\n    b: 2,\n  },\n};\nconst obj3 = {\n  a: {\n    b: 1,\n  },\n};\nconst obj4 = { __proto__: obj1 };\n\nassert.deepEqual(obj1, obj1);\n// OK\n\n// Values of b are different:\nassert.deepEqual(obj1, obj2);\n// AssertionError: { a: { b: 1 } } deepEqual { a: { b: 2 } }\n\nassert.deepEqual(obj1, obj3);\n// OK\n\n// Prototypes are ignored:\nassert.deepEqual(obj1, obj4);\n// AssertionError: { a: { b: 1 } } deepEqual {}\n</code></pre>\n<p>If the values are not equal, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a <code>message</code>\nproperty set equal to the value of the <code>message</code> parameter. If the <code>message</code>\nparameter is undefined, a default error message is assigned. If the <code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown instead of the <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>.</p>",
              "displayName": "Comparison details"
            }
          ]
        },
        {
          "textRaw": "`assert.deepStrictEqual(actual, expected[, message])`",
          "name": "deepStrictEqual",
          "type": "method",
          "meta": {
            "added": [
              "v1.2.0"
            ],
            "changes": [
              {
                "version": "v25.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/59448",
                "description": "Promises are not considered equal anymore if they are not of the same instance."
              },
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57627",
                "description": "Invalid dates are now considered equal."
              },
              {
                "version": "v24.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57622",
                "description": "Recursion now stops when either side encounters a circular reference."
              },
              {
                "version": [
                  "v22.2.0",
                  "v20.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/51805",
                "description": "Error cause and errors properties are now compared as well."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41020",
                "description": "Regular expressions lastIndex property is now compared as well."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15169",
                "description": "Enumerable symbol properties are now compared."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15036",
                "description": "The `NaN` is now compared using the [SameValueZero](https://tc39.github.io/ecma262/#sec-samevaluezero) comparison."
              },
              {
                "version": "v8.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/15001",
                "description": "The `Error` names and messages are now properly compared."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12142",
                "description": "The `Set` and `Map` content is also compared."
              },
              {
                "version": [
                  "v6.4.0",
                  "v4.7.1"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/8002",
                "description": "Typed array slices are handled correctly now."
              },
              {
                "version": "v6.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/6432",
                "description": "Objects with circular references can be used as inputs now."
              },
              {
                "version": [
                  "v5.10.1",
                  "v4.4.3"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/5910",
                "description": "Handle non-`Uint8Array` typed arrays correctly."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Tests for deep equality between the <code>actual</code> and <code>expected</code> parameters.\n\"Deep\" equality means that the enumerable \"own\" properties of child objects\nare recursively evaluated also by the following rules.</p>",
          "modules": [
            {
              "textRaw": "Comparison details",
              "name": "comparison_details",
              "type": "module",
              "desc": "<ul>\n<li>Primitive values are compared using <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\"><code>Object.is()</code></a>.</li>\n<li><a href=\"https://tc39.github.io/ecma262/#sec-object.prototype.tostring\">Type tags</a> of objects should be the same.</li>\n<li><a href=\"https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\"><code>[[Prototype]]</code></a> of objects are compared using\nthe <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality\"><code>===</code> operator</a>.</li>\n<li>Only <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Enumerability_and_ownership_of_properties\">enumerable \"own\" properties</a> are considered.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> names, messages, causes, and errors are always compared,\neven if these are not enumerable properties. <code>errors</code> is also compared.</li>\n<li>Enumerable own <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#symbol_type\"><code>&#x3C;Symbol></code></a> properties are compared as well.</li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Data_structures#primitive_values\">Object wrappers</a> are compared both as objects and unwrapped values.</li>\n<li><code>Object</code> properties are compared unordered.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>&#x3C;Map></code></a> keys and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>&#x3C;Set></code></a> items are compared unordered.</li>\n<li>Recursion stops when both sides differ or either side encounters a circular\nreference.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>&#x3C;WeakMap></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>&#x3C;WeakSet></code></a> and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> instances are <strong>not</strong> compared\nstructurally. They are only equal if they reference the same object. Any\ncomparison between different <code>WeakMap</code>, <code>WeakSet</code>, or <code>Promise</code> instances\nwill result in inequality, even if they contain the same content.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a> lastIndex, flags, and source are always compared, even if these\nare not enumerable properties.</li>\n</ul>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\n// This fails because 1 !== '1'.\nassert.deepStrictEqual({ a: 1 }, { a: '1' });\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n//   {\n// +   a: 1\n// -   a: '1'\n//   }\n\n// The following objects don't have own properties\nconst date = new Date();\nconst object = {};\nconst fakeDate = {};\nObject.setPrototypeOf(fakeDate, Date.prototype);\n\n// Different [[Prototype]]:\nassert.deepStrictEqual(object, fakeDate);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n// + {}\n// - Date {}\n\n// Different type tags:\nassert.deepStrictEqual(date, fakeDate);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n// + 2018-04-26T00:49:08.604Z\n// - Date {}\n\nassert.deepStrictEqual(NaN, NaN);\n// OK because Object.is(NaN, NaN) is true.\n\n// Different unwrapped numbers:\nassert.deepStrictEqual(new Number(1), new Number(2));\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n// + [Number: 1]\n// - [Number: 2]\n\nassert.deepStrictEqual(new String('foo'), Object('foo'));\n// OK because the object and the string are identical when unwrapped.\n\nassert.deepStrictEqual(-0, -0);\n// OK\n\n// Different zeros:\nassert.deepStrictEqual(0, -0);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n// + 0\n// - -0\n\nconst symbol1 = Symbol();\nconst symbol2 = Symbol();\nassert.deepStrictEqual({ [symbol1]: 1 }, { [symbol1]: 1 });\n// OK, because it is the same symbol on both objects.\n\nassert.deepStrictEqual({ [symbol1]: 1 }, { [symbol2]: 1 });\n// AssertionError [ERR_ASSERTION]: Inputs identical but not reference equal:\n//\n// {\n//   Symbol(): 1\n// }\n\nconst weakMap1 = new WeakMap();\nconst weakMap2 = new WeakMap();\nconst obj = {};\n\nweakMap1.set(obj, 'value');\nweakMap2.set(obj, 'value');\n\n// Comparing different instances fails, even with same contents\nassert.deepStrictEqual(weakMap1, weakMap2);\n// AssertionError: Values have same structure but are not reference-equal:\n//\n// WeakMap {\n//   &#x3C;items unknown>\n// }\n\n// Comparing the same instance to itself succeeds\nassert.deepStrictEqual(weakMap1, weakMap1);\n// OK\n\nconst weakSet1 = new WeakSet();\nconst weakSet2 = new WeakSet();\nweakSet1.add(obj);\nweakSet2.add(obj);\n\n// Comparing different instances fails, even with same contents\nassert.deepStrictEqual(weakSet1, weakSet2);\n// AssertionError: Values have same structure but are not reference-equal:\n// + actual - expected\n//\n// WeakSet {\n//   &#x3C;items unknown>\n// }\n\n// Comparing the same instance to itself succeeds\nassert.deepStrictEqual(weakSet1, weakSet1);\n// OK\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\n// This fails because 1 !== '1'.\nassert.deepStrictEqual({ a: 1 }, { a: '1' });\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n//   {\n// +   a: 1\n// -   a: '1'\n//   }\n\n// The following objects don't have own properties\nconst date = new Date();\nconst object = {};\nconst fakeDate = {};\nObject.setPrototypeOf(fakeDate, Date.prototype);\n\n// Different [[Prototype]]:\nassert.deepStrictEqual(object, fakeDate);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n// + {}\n// - Date {}\n\n// Different type tags:\nassert.deepStrictEqual(date, fakeDate);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n// + 2018-04-26T00:49:08.604Z\n// - Date {}\n\nassert.deepStrictEqual(NaN, NaN);\n// OK because Object.is(NaN, NaN) is true.\n\n// Different unwrapped numbers:\nassert.deepStrictEqual(new Number(1), new Number(2));\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n// + [Number: 1]\n// - [Number: 2]\n\nassert.deepStrictEqual(new String('foo'), Object('foo'));\n// OK because the object and the string are identical when unwrapped.\n\nassert.deepStrictEqual(-0, -0);\n// OK\n\n// Different zeros:\nassert.deepStrictEqual(0, -0);\n// AssertionError: Expected inputs to be strictly deep-equal:\n// + actual - expected\n//\n// + 0\n// - -0\n\nconst symbol1 = Symbol();\nconst symbol2 = Symbol();\nassert.deepStrictEqual({ [symbol1]: 1 }, { [symbol1]: 1 });\n// OK, because it is the same symbol on both objects.\n\nassert.deepStrictEqual({ [symbol1]: 1 }, { [symbol2]: 1 });\n// AssertionError [ERR_ASSERTION]: Inputs identical but not reference equal:\n//\n// {\n//   Symbol(): 1\n// }\n\nconst weakMap1 = new WeakMap();\nconst weakMap2 = new WeakMap();\nconst obj = {};\n\nweakMap1.set(obj, 'value');\nweakMap2.set(obj, 'value');\n\n// Comparing different instances fails, even with same contents\nassert.deepStrictEqual(weakMap1, weakMap2);\n// AssertionError: Values have same structure but are not reference-equal:\n//\n// WeakMap {\n//   &#x3C;items unknown>\n// }\n\n// Comparing the same instance to itself succeeds\nassert.deepStrictEqual(weakMap1, weakMap1);\n// OK\n\nconst weakSet1 = new WeakSet();\nconst weakSet2 = new WeakSet();\nweakSet1.add(obj);\nweakSet2.add(obj);\n\n// Comparing different instances fails, even with same contents\nassert.deepStrictEqual(weakSet1, weakSet2);\n// AssertionError: Values have same structure but are not reference-equal:\n// + actual - expected\n//\n// WeakSet {\n//   &#x3C;items unknown>\n// }\n\n// Comparing the same instance to itself succeeds\nassert.deepStrictEqual(weakSet1, weakSet1);\n// OK\n</code></pre>\n<p>If the values are not equal, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a <code>message</code>\nproperty set equal to the value of the <code>message</code> parameter. If the <code>message</code>\nparameter is undefined, a default error message is assigned. If the <code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown instead of the <code>AssertionError</code>.</p>",
              "displayName": "Comparison details"
            }
          ]
        },
        {
          "textRaw": "`assert.doesNotMatch(string, regexp[, message])`",
          "name": "doesNotMatch",
          "type": "method",
          "meta": {
            "added": [
              "v13.6.0",
              "v12.16.0"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": "v16.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/38111",
                "description": "This API is no longer experimental."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                },
                {
                  "textRaw": "`regexp` {RegExp}",
                  "name": "regexp",
                  "type": "RegExp"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Expects the <code>string</code> input not to match the regular expression.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.doesNotMatch('I will fail', /fail/);\n// AssertionError [ERR_ASSERTION]: The input was expected to not match the ...\n\nassert.doesNotMatch(123, /pass/);\n// AssertionError [ERR_ASSERTION]: The \"string\" argument must be of type string.\n\nassert.doesNotMatch('I will pass', /different/);\n// OK\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.doesNotMatch('I will fail', /fail/);\n// AssertionError [ERR_ASSERTION]: The input was expected to not match the ...\n\nassert.doesNotMatch(123, /pass/);\n// AssertionError [ERR_ASSERTION]: The \"string\" argument must be of type string.\n\nassert.doesNotMatch('I will pass', /different/);\n// OK\n</code></pre>\n<p>If the values do match, or if the <code>string</code> argument is of another type than\n<code>string</code>, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a <code>message</code> property set equal\nto the value of the <code>message</code> parameter. If the <code>message</code> parameter is\nundefined, a default error message is assigned. If the <code>message</code> parameter is an\ninstance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown instead of the <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "`assert.doesNotReject(asyncFn[, error][, message])`",
          "name": "doesNotReject",
          "type": "method",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`asyncFn` {Function|Promise}",
                  "name": "asyncFn",
                  "type": "Function|Promise"
                },
                {
                  "textRaw": "`error` {RegExp|Function}",
                  "name": "error",
                  "type": "RegExp|Function",
                  "optional": true
                },
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise}",
                "name": "return",
                "type": "Promise"
              }
            }
          ],
          "desc": "<p>Awaits the <code>asyncFn</code> promise or, if <code>asyncFn</code> is a function, immediately\ncalls the function and awaits the returned promise to complete. It will then\ncheck that the promise is not rejected.</p>\n<p>If <code>asyncFn</code> is a function and it throws an error synchronously,\n<code>assert.doesNotReject()</code> will return a rejected <code>Promise</code> with that error. If\nthe function does not return a promise, <code>assert.doesNotReject()</code> will return a\nrejected <code>Promise</code> with an <a href=\"errors.html#err_invalid_return_value\"><code>ERR_INVALID_RETURN_VALUE</code></a> error. In both cases\nthe error handler is skipped.</p>\n<p>Using <code>assert.doesNotReject()</code> is actually not useful because there is little\nbenefit in catching a rejection and then rejecting it again. Instead, consider\nadding a comment next to the specific code path that should not reject and keep\nerror messages as expressive as possible.</p>\n<p>If specified, <code>error</code> can be a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\"><code>Class</code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a> or a validation\nfunction. See <a href=\"#assertthrowsfn-error-message\"><code>assert.throws()</code></a> for more details.</p>\n<p>Besides the async nature to await the completion behaves identically to\n<a href=\"#assertdoesnotthrowfn-error-message\"><code>assert.doesNotThrow()</code></a>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nawait assert.doesNotReject(\n  async () => {\n    throw new TypeError('Wrong value');\n  },\n  SyntaxError,\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\n(async () => {\n  await assert.doesNotReject(\n    async () => {\n      throw new TypeError('Wrong value');\n    },\n    SyntaxError,\n  );\n})();\n</code></pre>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.doesNotReject(Promise.reject(new TypeError('Wrong value')))\n  .then(() => {\n    // ...\n  });\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.doesNotReject(Promise.reject(new TypeError('Wrong value')))\n  .then(() => {\n    // ...\n  });\n</code></pre>"
        },
        {
          "textRaw": "`assert.doesNotThrow(fn[, error][, message])`",
          "name": "doesNotThrow",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": [
                  "v5.11.0",
                  "v4.4.5"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/2407",
                "description": "The `message` parameter is respected now."
              },
              {
                "version": "v4.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/3276",
                "description": "The `error` parameter can now be an arrow function."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function}",
                  "name": "fn",
                  "type": "Function"
                },
                {
                  "textRaw": "`error` {RegExp|Function}",
                  "name": "error",
                  "type": "RegExp|Function",
                  "optional": true
                },
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Asserts that the function <code>fn</code> does not throw an error.</p>\n<p>Using <code>assert.doesNotThrow()</code> is actually not useful because there\nis no benefit in catching an error and then rethrowing it. Instead, consider\nadding a comment next to the specific code path that should not throw and keep\nerror messages as expressive as possible.</p>\n<p>When <code>assert.doesNotThrow()</code> is called, it will immediately call the <code>fn</code>\nfunction.</p>\n<p>If an error is thrown and it is the same type as that specified by the <code>error</code>\nparameter, then an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown. If the error is of a\ndifferent type, or if the <code>error</code> parameter is undefined, the error is\npropagated back to the caller.</p>\n<p>If specified, <code>error</code> can be a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\"><code>Class</code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a>, or a validation\nfunction. See <a href=\"#assertthrowsfn-error-message\"><code>assert.throws()</code></a> for more details.</p>\n<p>The following, for instance, will throw the <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypeError\"><code>&#x3C;TypeError></code></a> because there is no\nmatching error type in the assertion:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.doesNotThrow(\n  () => {\n    throw new TypeError('Wrong value');\n  },\n  SyntaxError,\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.doesNotThrow(\n  () => {\n    throw new TypeError('Wrong value');\n  },\n  SyntaxError,\n);\n</code></pre>\n<p>However, the following will result in an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> with the message\n'Got unwanted exception...':</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.doesNotThrow(\n  () => {\n    throw new TypeError('Wrong value');\n  },\n  TypeError,\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.doesNotThrow(\n  () => {\n    throw new TypeError('Wrong value');\n  },\n  TypeError,\n);\n</code></pre>\n<p>If an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown and a value is provided for the <code>message</code>\nparameter, the value of <code>message</code> will be appended to the <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>\nmessage:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.doesNotThrow(\n  () => {\n    throw new TypeError('Wrong value');\n  },\n  /Wrong value/,\n  'Whoops',\n);\n// Throws: AssertionError: Got unwanted exception: Whoops\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.doesNotThrow(\n  () => {\n    throw new TypeError('Wrong value');\n  },\n  /Wrong value/,\n  'Whoops',\n);\n// Throws: AssertionError: Got unwanted exception: Whoops\n</code></pre>"
        },
        {
          "textRaw": "`assert.equal(actual, expected[, message])`",
          "name": "equal",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": [
                  "v16.0.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/38113",
                "description": "In Legacy assertion mode, changed status from Deprecated to Legacy."
              },
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/30766",
                "description": "NaN is now treated as being identical if both sides are NaN."
              }
            ]
          },
          "stability": 3,
          "stabilityText": "Legacy: Use `assert.strictEqual()` instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><strong>Strict assertion mode</strong></p>\n<p>An alias of <a href=\"#assertstrictequalactual-expected-message\"><code>assert.strictEqual()</code></a>.</p>\n<p><strong>Legacy assertion mode</strong></p>\n<p>Tests shallow, coercive equality between the <code>actual</code> and <code>expected</code> parameters\nusing the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Equality\"><code>==</code> operator</a>. <code>NaN</code> is specially handled\nand treated as being identical if both sides are <code>NaN</code>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nassert.equal(1, 1);\n// OK, 1 == 1\nassert.equal(1, '1');\n// OK, 1 == '1'\nassert.equal(NaN, NaN);\n// OK\n\nassert.equal(1, 2);\n// AssertionError: 1 == 2\nassert.equal({ a: { b: 1 } }, { a: { b: 1 } });\n// AssertionError: { a: { b: 1 } } == { a: { b: 1 } }\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nassert.equal(1, 1);\n// OK, 1 == 1\nassert.equal(1, '1');\n// OK, 1 == '1'\nassert.equal(NaN, NaN);\n// OK\n\nassert.equal(1, 2);\n// AssertionError: 1 == 2\nassert.equal({ a: { b: 1 } }, { a: { b: 1 } });\n// AssertionError: { a: { b: 1 } } == { a: { b: 1 } }\n</code></pre>\n<p>If the values are not equal, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a <code>message</code>\nproperty set equal to the value of the <code>message</code> parameter. If the <code>message</code>\nparameter is undefined, a default error message is assigned. If the <code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown instead of the <code>AssertionError</code>.</p>"
        },
        {
          "textRaw": "`assert.fail([message])`",
          "name": "fail",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`message` {string|Error} **Default:** `'Failed'`",
                  "name": "message",
                  "type": "string|Error",
                  "default": "`'Failed'`",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Throws an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> with the provided error message or a default\nerror message. If the <code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then\nit will be thrown instead of the <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.fail();\n// AssertionError [ERR_ASSERTION]: Failed\n\nassert.fail('boom');\n// AssertionError [ERR_ASSERTION]: boom\n\nassert.fail(new TypeError('need array'));\n// TypeError: need array\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.fail();\n// AssertionError [ERR_ASSERTION]: Failed\n\nassert.fail('boom');\n// AssertionError [ERR_ASSERTION]: boom\n\nassert.fail(new TypeError('need array'));\n// TypeError: need array\n</code></pre>"
        },
        {
          "textRaw": "`assert.ifError(value)`",
          "name": "ifError",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.97"
            ],
            "changes": [
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/18247",
                "description": "Instead of throwing the original error it is now wrapped into an [`AssertionError`][] that contains the full stack trace."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/18247",
                "description": "Value may now only be `undefined` or `null`. Before all falsy values were handled the same as `null` and did not throw."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`value` {any}",
                  "name": "value",
                  "type": "any"
                }
              ]
            }
          ],
          "desc": "<p>Throws <code>value</code> if <code>value</code> is not <code>undefined</code> or <code>null</code>. This is useful when\ntesting the <code>error</code> argument in callbacks. The stack trace contains all frames\nfrom the error passed to <code>ifError()</code> including the potential new frames for\n<code>ifError()</code> itself.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.ifError(null);\n// OK\nassert.ifError(0);\n// AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0\nassert.ifError('error');\n// AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error'\nassert.ifError(new Error());\n// AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error\n\n// Create some random error frames.\nlet err;\n(function errorFrame() {\n  err = new Error('test error');\n})();\n\n(function ifErrorFrame() {\n  assert.ifError(err);\n})();\n// AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error\n//     at ifErrorFrame\n//     at errorFrame\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.ifError(null);\n// OK\nassert.ifError(0);\n// AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 0\nassert.ifError('error');\n// AssertionError [ERR_ASSERTION]: ifError got unwanted exception: 'error'\nassert.ifError(new Error());\n// AssertionError [ERR_ASSERTION]: ifError got unwanted exception: Error\n\n// Create some random error frames.\nlet err;\n(function errorFrame() {\n  err = new Error('test error');\n})();\n\n(function ifErrorFrame() {\n  assert.ifError(err);\n})();\n// AssertionError [ERR_ASSERTION]: ifError got unwanted exception: test error\n//     at ifErrorFrame\n//     at errorFrame\n</code></pre>"
        },
        {
          "textRaw": "`assert.match(string, regexp[, message])`",
          "name": "match",
          "type": "method",
          "meta": {
            "added": [
              "v13.6.0",
              "v12.16.0"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": "v16.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/38111",
                "description": "This API is no longer experimental."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                },
                {
                  "textRaw": "`regexp` {RegExp}",
                  "name": "regexp",
                  "type": "RegExp"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Expects the <code>string</code> input to match the regular expression.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.match('I will fail', /pass/);\n// AssertionError [ERR_ASSERTION]: The input did not match the regular ...\n\nassert.match(123, /pass/);\n// AssertionError [ERR_ASSERTION]: The \"string\" argument must be of type string.\n\nassert.match('I will pass', /pass/);\n// OK\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.match('I will fail', /pass/);\n// AssertionError [ERR_ASSERTION]: The input did not match the regular ...\n\nassert.match(123, /pass/);\n// AssertionError [ERR_ASSERTION]: The \"string\" argument must be of type string.\n\nassert.match('I will pass', /pass/);\n// OK\n</code></pre>\n<p>If the values do not match, or if the <code>string</code> argument is of another type than\n<code>string</code>, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a <code>message</code> property set equal\nto the value of the <code>message</code> parameter. If the <code>message</code> parameter is\nundefined, a default error message is assigned. If the <code>message</code> parameter is an\ninstance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown instead of the <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "`assert.notDeepEqual(actual, expected[, message])`",
          "name": "notDeepEqual",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": [
                  "v16.0.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/38113",
                "description": "In Legacy assertion mode, changed status from Deprecated to Legacy."
              },
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/30766",
                "description": "NaN is now treated as being identical if both sides are NaN."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15001",
                "description": "The `Error` names and messages are now properly compared."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12142",
                "description": "The `Set` and `Map` content is also compared."
              },
              {
                "version": [
                  "v6.4.0",
                  "v4.7.1"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/8002",
                "description": "Typed array slices are handled correctly now."
              },
              {
                "version": [
                  "v6.1.0",
                  "v4.5.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/6432",
                "description": "Objects with circular references can be used as inputs now."
              },
              {
                "version": [
                  "v5.10.1",
                  "v4.4.3"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/5910",
                "description": "Handle non-`Uint8Array` typed arrays correctly."
              }
            ]
          },
          "stability": 3,
          "stabilityText": "Legacy: Use `assert.notDeepStrictEqual()` instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><strong>Strict assertion mode</strong></p>\n<p>An alias of <a href=\"#assertnotdeepstrictequalactual-expected-message\"><code>assert.notDeepStrictEqual()</code></a>.</p>\n<p><strong>Legacy assertion mode</strong></p>\n<p>Tests for any deep inequality. Opposite of <a href=\"#assertdeepequalactual-expected-message\"><code>assert.deepEqual()</code></a>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nconst obj1 = {\n  a: {\n    b: 1,\n  },\n};\nconst obj2 = {\n  a: {\n    b: 2,\n  },\n};\nconst obj3 = {\n  a: {\n    b: 1,\n  },\n};\nconst obj4 = { __proto__: obj1 };\n\nassert.notDeepEqual(obj1, obj1);\n// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }\n\nassert.notDeepEqual(obj1, obj2);\n// OK\n\nassert.notDeepEqual(obj1, obj3);\n// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }\n\nassert.notDeepEqual(obj1, obj4);\n// OK\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nconst obj1 = {\n  a: {\n    b: 1,\n  },\n};\nconst obj2 = {\n  a: {\n    b: 2,\n  },\n};\nconst obj3 = {\n  a: {\n    b: 1,\n  },\n};\nconst obj4 = { __proto__: obj1 };\n\nassert.notDeepEqual(obj1, obj1);\n// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }\n\nassert.notDeepEqual(obj1, obj2);\n// OK\n\nassert.notDeepEqual(obj1, obj3);\n// AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }\n\nassert.notDeepEqual(obj1, obj4);\n// OK\n</code></pre>\n<p>If the values are deeply equal, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a\n<code>message</code> property set equal to the value of the <code>message</code> parameter. If the\n<code>message</code> parameter is undefined, a default error message is assigned. If the\n<code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown\ninstead of the <code>AssertionError</code>.</p>"
        },
        {
          "textRaw": "`assert.notDeepStrictEqual(actual, expected[, message])`",
          "name": "notDeepStrictEqual",
          "type": "method",
          "meta": {
            "added": [
              "v1.2.0"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15398",
                "description": "The `-0` and `+0` are not considered equal anymore."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15036",
                "description": "The `NaN` is now compared using the [SameValueZero](https://tc39.github.io/ecma262/#sec-samevaluezero) comparison."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15001",
                "description": "The `Error` names and messages are now properly compared."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12142",
                "description": "The `Set` and `Map` content is also compared."
              },
              {
                "version": [
                  "v6.4.0",
                  "v4.7.1"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/8002",
                "description": "Typed array slices are handled correctly now."
              },
              {
                "version": "v6.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/6432",
                "description": "Objects with circular references can be used as inputs now."
              },
              {
                "version": [
                  "v5.10.1",
                  "v4.4.3"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/5910",
                "description": "Handle non-`Uint8Array` typed arrays correctly."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Tests for deep strict inequality. Opposite of <a href=\"#assertdeepstrictequalactual-expected-message\"><code>assert.deepStrictEqual()</code></a>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.notDeepStrictEqual({ a: 1 }, { a: '1' });\n// OK\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.notDeepStrictEqual({ a: 1 }, { a: '1' });\n// OK\n</code></pre>\n<p>If the values are deeply and strictly equal, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown\nwith a <code>message</code> property set equal to the value of the <code>message</code> parameter. If\nthe <code>message</code> parameter is undefined, a default error message is assigned. If\nthe <code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown\ninstead of the <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "`assert.notEqual(actual, expected[, message])`",
          "name": "notEqual",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": [
                  "v16.0.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/38113",
                "description": "In Legacy assertion mode, changed status from Deprecated to Legacy."
              },
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/30766",
                "description": "NaN is now treated as being identical if both sides are NaN."
              }
            ]
          },
          "stability": 3,
          "stabilityText": "Legacy: Use `assert.notStrictEqual()` instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><strong>Strict assertion mode</strong></p>\n<p>An alias of <a href=\"#assertnotstrictequalactual-expected-message\"><code>assert.notStrictEqual()</code></a>.</p>\n<p><strong>Legacy assertion mode</strong></p>\n<p>Tests shallow, coercive inequality with the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Inequality\"><code>!=</code> operator</a>. <code>NaN</code> is\nspecially handled and treated as being identical if both sides are <code>NaN</code>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nassert.notEqual(1, 2);\n// OK\n\nassert.notEqual(1, 1);\n// AssertionError: 1 != 1\n\nassert.notEqual(1, '1');\n// AssertionError: 1 != '1'\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nassert.notEqual(1, 2);\n// OK\n\nassert.notEqual(1, 1);\n// AssertionError: 1 != 1\n\nassert.notEqual(1, '1');\n// AssertionError: 1 != '1'\n</code></pre>\n<p>If the values are equal, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a <code>message</code>\nproperty set equal to the value of the <code>message</code> parameter. If the <code>message</code>\nparameter is undefined, a default error message is assigned. If the <code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown instead of the <code>AssertionError</code>.</p>"
        },
        {
          "textRaw": "`assert.notStrictEqual(actual, expected[, message])`",
          "name": "notStrictEqual",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/17003",
                "description": "Used comparison changed from Strict Equality to `Object.is()`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Tests strict inequality between the <code>actual</code> and <code>expected</code> parameters as\ndetermined by <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\"><code>Object.is()</code></a>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.notStrictEqual(1, 2);\n// OK\n\nassert.notStrictEqual(1, 1);\n// AssertionError [ERR_ASSERTION]: Expected \"actual\" to be strictly unequal to:\n//\n// 1\n\nassert.notStrictEqual(1, '1');\n// OK\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.notStrictEqual(1, 2);\n// OK\n\nassert.notStrictEqual(1, 1);\n// AssertionError [ERR_ASSERTION]: Expected \"actual\" to be strictly unequal to:\n//\n// 1\n\nassert.notStrictEqual(1, '1');\n// OK\n</code></pre>\n<p>If the values are strictly equal, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a\n<code>message</code> property set equal to the value of the <code>message</code> parameter. If the\n<code>message</code> parameter is undefined, a default error message is assigned. If the\n<code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown\ninstead of the <code>AssertionError</code>.</p>"
        },
        {
          "textRaw": "`assert.ok(value[, message])`",
          "name": "ok",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/18319",
                "description": "The `assert.ok()` (no arguments) will now use a predefined error message."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`value` {any}",
                  "name": "value",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Tests if <code>value</code> is truthy. It is equivalent to\n<code>assert.equal(!!value, true, message)</code>.</p>\n<p>If <code>value</code> is not truthy, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a <code>message</code>\nproperty set equal to the value of the <code>message</code> parameter. If the <code>message</code>\nparameter is <code>undefined</code>, a default error message is assigned. If the <code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown instead of the <code>AssertionError</code>.\nIf no arguments are passed in at all <code>message</code> will be set to the string:\n<code>'No value argument passed to `assert.ok()`'</code>.</p>\n<p>Be aware that in the <code>repl</code> the error message will be different to the one\nthrown in a file! See below for further details.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.ok(true);\n// OK\nassert.ok(1);\n// OK\n\nassert.ok();\n// AssertionError: No value argument passed to `assert.ok()`\n\nassert.ok(false, 'it\\'s false');\n// AssertionError: it's false\n\n// In the repl:\nassert.ok(typeof 123 === 'string');\n// AssertionError: false == true\n\n// In a file (e.g. test.js):\nassert.ok(typeof 123 === 'string');\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert.ok(typeof 123 === 'string')\n\nassert.ok(false);\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert.ok(false)\n\nassert.ok(0);\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert.ok(0)\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.ok(true);\n// OK\nassert.ok(1);\n// OK\n\nassert.ok();\n// AssertionError: No value argument passed to `assert.ok()`\n\nassert.ok(false, 'it\\'s false');\n// AssertionError: it's false\n\n// In the repl:\nassert.ok(typeof 123 === 'string');\n// AssertionError: false == true\n\n// In a file (e.g. test.js):\nassert.ok(typeof 123 === 'string');\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert.ok(typeof 123 === 'string')\n\nassert.ok(false);\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert.ok(false)\n\nassert.ok(0);\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert.ok(0)\n</code></pre>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\n// Using `assert()` works the same:\nassert(2 + 2 > 5);\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert(2 + 2 > 5)\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\n// Using `assert()` works the same:\nassert(2 + 2 > 5);\n// AssertionError: The expression evaluated to a falsy value:\n//\n//   assert(2 + 2 > 5)\n</code></pre>"
        },
        {
          "textRaw": "`assert.rejects(asyncFn[, error][, message])`",
          "name": "rejects",
          "type": "method",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`asyncFn` {Function|Promise}",
                  "name": "asyncFn",
                  "type": "Function|Promise"
                },
                {
                  "textRaw": "`error` {RegExp|Function|Object|Error}",
                  "name": "error",
                  "type": "RegExp|Function|Object|Error",
                  "optional": true
                },
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise}",
                "name": "return",
                "type": "Promise"
              }
            }
          ],
          "desc": "<p>Awaits the <code>asyncFn</code> promise or, if <code>asyncFn</code> is a function, immediately\ncalls the function and awaits the returned promise to complete. It will then\ncheck that the promise is rejected.</p>\n<p>If <code>asyncFn</code> is a function and it throws an error synchronously,\n<code>assert.rejects()</code> will return a rejected <code>Promise</code> with that error. If the\nfunction does not return a promise, <code>assert.rejects()</code> will return a rejected\n<code>Promise</code> with an <a href=\"errors.html#err_invalid_return_value\"><code>ERR_INVALID_RETURN_VALUE</code></a> error. In both cases the error\nhandler is skipped.</p>\n<p>Besides the async nature to await the completion behaves identically to\n<a href=\"#assertthrowsfn-error-message\"><code>assert.throws()</code></a>.</p>\n<p>If specified, <code>error</code> can be a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\"><code>Class</code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a>, a validation function,\nan object where each property will be tested for, or an instance of error where\neach property will be tested for including the non-enumerable <code>message</code> and\n<code>name</code> properties.</p>\n<p>If specified, <code>message</code> will be the message provided by the <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>\nif the <code>asyncFn</code> fails to reject.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nawait assert.rejects(\n  async () => {\n    throw new TypeError('Wrong value');\n  },\n  {\n    name: 'TypeError',\n    message: 'Wrong value',\n  },\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\n(async () => {\n  await assert.rejects(\n    async () => {\n      throw new TypeError('Wrong value');\n    },\n    {\n      name: 'TypeError',\n      message: 'Wrong value',\n    },\n  );\n})();\n</code></pre>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nawait assert.rejects(\n  async () => {\n    throw new TypeError('Wrong value');\n  },\n  (err) => {\n    assert.strictEqual(err.name, 'TypeError');\n    assert.strictEqual(err.message, 'Wrong value');\n    return true;\n  },\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\n(async () => {\n  await assert.rejects(\n    async () => {\n      throw new TypeError('Wrong value');\n    },\n    (err) => {\n      assert.strictEqual(err.name, 'TypeError');\n      assert.strictEqual(err.message, 'Wrong value');\n      return true;\n    },\n  );\n})();\n</code></pre>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.rejects(\n  Promise.reject(new Error('Wrong value')),\n  Error,\n).then(() => {\n  // ...\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.rejects(\n  Promise.reject(new Error('Wrong value')),\n  Error,\n).then(() => {\n  // ...\n});\n</code></pre>\n<p><code>error</code> cannot be a string. If a string is provided as the second\nargument, then <code>error</code> is assumed to be omitted and the string will be used for\n<code>message</code> instead. This can lead to easy-to-miss mistakes. Please read the\nexample in <a href=\"#assertthrowsfn-error-message\"><code>assert.throws()</code></a> carefully if using a string as the second\nargument gets considered.</p>"
        },
        {
          "textRaw": "`assert.strictEqual(actual, expected[, message])`",
          "name": "strictEqual",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/58849",
                "description": "Message may now be a `printf`-like format string or function."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/17003",
                "description": "Used comparison changed from Strict Equality to `Object.is()`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function} Postfix `printf`-like arguments in case it's used as format string. If message is a function, it is called in case of a comparison failure. The function receives the `actual` and `expected` arguments and has to return a string that is going to be used as error message. `printf`-like format strings and functions are beneficial for performance reasons in case arguments are passed through. In addition, it allows nice formatting with ease.",
                  "name": "message",
                  "type": "string|Error|Function",
                  "desc": "Postfix `printf`-like arguments in case it's used as format string. If message is a function, it is called in case of a comparison failure. The function receives the `actual` and `expected` arguments and has to return a string that is going to be used as error message. `printf`-like format strings and functions are beneficial for performance reasons in case arguments are passed through. In addition, it allows nice formatting with ease.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Tests strict equality between the <code>actual</code> and <code>expected</code> parameters as\ndetermined by <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\"><code>Object.is()</code></a>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.strictEqual(1, 2);\n// AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:\n//\n// 1 !== 2\n\nassert.strictEqual(1, 1);\n// OK\n\nassert.strictEqual('Hello foobar', 'Hello World!');\n// AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:\n// + actual - expected\n//\n// + 'Hello foobar'\n// - 'Hello World!'\n//          ^\n\nconst apples = 1;\nconst oranges = 2;\nassert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`);\n// AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2\n\nassert.strictEqual(apples, oranges, 'apples %s !== oranges %s', apples, oranges);\n// AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2\n\nassert.strictEqual(1, '1', new TypeError('Inputs are not identical'));\n// TypeError: Inputs are not identical\n\nassert.strictEqual(apples, oranges, (actual, expected) => {\n  // Do 'heavy' computations\n  return `I expected ${expected} but I got ${actual}`;\n});\n// AssertionError [ERR_ASSERTION]: I expected oranges but I got apples\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.strictEqual(1, 2);\n// AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:\n//\n// 1 !== 2\n\nassert.strictEqual(1, 1);\n// OK\n\nassert.strictEqual('Hello foobar', 'Hello World!');\n// AssertionError [ERR_ASSERTION]: Expected inputs to be strictly equal:\n// + actual - expected\n//\n// + 'Hello foobar'\n// - 'Hello World!'\n//          ^\n\nconst apples = 1;\nconst oranges = 2;\nassert.strictEqual(apples, oranges, `apples ${apples} !== oranges ${oranges}`);\n// AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2\n\nassert.strictEqual(apples, oranges, 'apples %s !== oranges %s', apples, oranges);\n// AssertionError [ERR_ASSERTION]: apples 1 !== oranges 2\n\nassert.strictEqual(1, '1', new TypeError('Inputs are not identical'));\n// TypeError: Inputs are not identical\n\nassert.strictEqual(apples, oranges, (actual, expected) => {\n  // Do 'heavy' computations\n  return `I expected ${expected} but I got ${actual}`;\n});\n// AssertionError [ERR_ASSERTION]: I expected oranges but I got apples\n</code></pre>\n<p>If the values are not strictly equal, an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a> is thrown with a\n<code>message</code> property set equal to the value of the <code>message</code> parameter. If the\n<code>message</code> parameter is undefined, a default error message is assigned. If the\n<code>message</code> parameter is an instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> then it will be thrown\ninstead of the <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>.</p>"
        },
        {
          "textRaw": "`assert.throws(fn[, error][, message])`",
          "name": "throws",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.21"
            ],
            "changes": [
              {
                "version": "v10.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/20485",
                "description": "The `error` parameter can be an object containing regular expressions now."
              },
              {
                "version": "v9.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/17584",
                "description": "The `error` parameter can now be an object as well."
              },
              {
                "version": "v4.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/3276",
                "description": "The `error` parameter can now be an arrow function."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function}",
                  "name": "fn",
                  "type": "Function"
                },
                {
                  "textRaw": "`error` {RegExp|Function|Object|Error}",
                  "name": "error",
                  "type": "RegExp|Function|Object|Error",
                  "optional": true
                },
                {
                  "textRaw": "`message` {string}",
                  "name": "message",
                  "type": "string",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Expects the function <code>fn</code> to throw an error.</p>\n<p>If specified, <code>error</code> can be a <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes\"><code>Class</code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a>, a validation function,\na validation object where each property will be tested for strict deep equality,\nor an instance of error where each property will be tested for strict deep\nequality including the non-enumerable <code>message</code> and <code>name</code> properties. When\nusing an object, it is also possible to use a regular expression, when\nvalidating against a string property. See below for examples.</p>\n<p>If specified, <code>message</code> will be appended to the message provided by the\n<code>AssertionError</code> if the <code>fn</code> call fails to throw or in case the error validation\nfails.</p>\n<p>Custom validation object/error instance:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nconst err = new TypeError('Wrong value');\nerr.code = 404;\nerr.foo = 'bar';\nerr.info = {\n  nested: true,\n  baz: 'text',\n};\nerr.reg = /abc/i;\n\nassert.throws(\n  () => {\n    throw err;\n  },\n  {\n    name: 'TypeError',\n    message: 'Wrong value',\n    info: {\n      nested: true,\n      baz: 'text',\n    },\n    // Only properties on the validation object will be tested for.\n    // Using nested objects requires all properties to be present. Otherwise\n    // the validation is going to fail.\n  },\n);\n\n// Using regular expressions to validate error properties:\nassert.throws(\n  () => {\n    throw err;\n  },\n  {\n    // The `name` and `message` properties are strings and using regular\n    // expressions on those will match against the string. If they fail, an\n    // error is thrown.\n    name: /^TypeError$/,\n    message: /Wrong/,\n    foo: 'bar',\n    info: {\n      nested: true,\n      // It is not possible to use regular expressions for nested properties!\n      baz: 'text',\n    },\n    // The `reg` property contains a regular expression and only if the\n    // validation object contains an identical regular expression, it is going\n    // to pass.\n    reg: /abc/i,\n  },\n);\n\n// Fails due to the different `message` and `name` properties:\nassert.throws(\n  () => {\n    const otherErr = new Error('Not found');\n    // Copy all enumerable properties from `err` to `otherErr`.\n    for (const [key, value] of Object.entries(err)) {\n      otherErr[key] = value;\n    }\n    throw otherErr;\n  },\n  // The error's `message` and `name` properties will also be checked when using\n  // an error as validation object.\n  err,\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nconst err = new TypeError('Wrong value');\nerr.code = 404;\nerr.foo = 'bar';\nerr.info = {\n  nested: true,\n  baz: 'text',\n};\nerr.reg = /abc/i;\n\nassert.throws(\n  () => {\n    throw err;\n  },\n  {\n    name: 'TypeError',\n    message: 'Wrong value',\n    info: {\n      nested: true,\n      baz: 'text',\n    },\n    // Only properties on the validation object will be tested for.\n    // Using nested objects requires all properties to be present. Otherwise\n    // the validation is going to fail.\n  },\n);\n\n// Using regular expressions to validate error properties:\nassert.throws(\n  () => {\n    throw err;\n  },\n  {\n    // The `name` and `message` properties are strings and using regular\n    // expressions on those will match against the string. If they fail, an\n    // error is thrown.\n    name: /^TypeError$/,\n    message: /Wrong/,\n    foo: 'bar',\n    info: {\n      nested: true,\n      // It is not possible to use regular expressions for nested properties!\n      baz: 'text',\n    },\n    // The `reg` property contains a regular expression and only if the\n    // validation object contains an identical regular expression, it is going\n    // to pass.\n    reg: /abc/i,\n  },\n);\n\n// Fails due to the different `message` and `name` properties:\nassert.throws(\n  () => {\n    const otherErr = new Error('Not found');\n    // Copy all enumerable properties from `err` to `otherErr`.\n    for (const [key, value] of Object.entries(err)) {\n      otherErr[key] = value;\n    }\n    throw otherErr;\n  },\n  // The error's `message` and `name` properties will also be checked when using\n  // an error as validation object.\n  err,\n);\n</code></pre>\n<p>Validate instanceof using constructor:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.throws(\n  () => {\n    throw new Error('Wrong value');\n  },\n  Error,\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.throws(\n  () => {\n    throw new Error('Wrong value');\n  },\n  Error,\n);\n</code></pre>\n<p>Validate error message using <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a>:</p>\n<p>Using a regular expression runs <code>.toString</code> on the error object, and will\ntherefore also include the error name.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.throws(\n  () => {\n    throw new Error('Wrong value');\n  },\n  /^Error: Wrong value$/,\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.throws(\n  () => {\n    throw new Error('Wrong value');\n  },\n  /^Error: Wrong value$/,\n);\n</code></pre>\n<p>Custom error validation:</p>\n<p>The function must return <code>true</code> to indicate all internal validations passed.\nIt will otherwise fail with an <a href=\"#class-assertassertionerror\"><code>AssertionError</code></a>.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nassert.throws(\n  () => {\n    throw new Error('Wrong value');\n  },\n  (err) => {\n    assert(err instanceof Error);\n    assert(/value/.test(err));\n    // Avoid returning anything from validation functions besides `true`.\n    // Otherwise, it's not clear what part of the validation failed. Instead,\n    // throw an error about the specific validation that failed (as done in this\n    // example) and add as much helpful debugging information to that error as\n    // possible.\n    return true;\n  },\n  'unexpected error',\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nassert.throws(\n  () => {\n    throw new Error('Wrong value');\n  },\n  (err) => {\n    assert(err instanceof Error);\n    assert(/value/.test(err));\n    // Avoid returning anything from validation functions besides `true`.\n    // Otherwise, it's not clear what part of the validation failed. Instead,\n    // throw an error about the specific validation that failed (as done in this\n    // example) and add as much helpful debugging information to that error as\n    // possible.\n    return true;\n  },\n  'unexpected error',\n);\n</code></pre>\n<p><code>error</code> cannot be a string. If a string is provided as the second\nargument, then <code>error</code> is assumed to be omitted and the string will be used for\n<code>message</code> instead. This can lead to easy-to-miss mistakes. Using the same\nmessage as the thrown error message is going to result in an\n<code>ERR_AMBIGUOUS_ARGUMENT</code> error. Please read the example below carefully if using\na string as the second argument gets considered:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert/strict';\n\nfunction throwingFirst() {\n  throw new Error('First');\n}\n\nfunction throwingSecond() {\n  throw new Error('Second');\n}\n\nfunction notThrowing() {}\n\n// The second argument is a string and the input function threw an Error.\n// The first case will not throw as it does not match for the error message\n// thrown by the input function!\nassert.throws(throwingFirst, 'Second');\n// In the next example the message has no benefit over the message from the\n// error and since it is not clear if the user intended to actually match\n// against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error.\nassert.throws(throwingSecond, 'Second');\n// TypeError [ERR_AMBIGUOUS_ARGUMENT]\n\n// The string is only used (as message) in case the function does not throw:\nassert.throws(notThrowing, 'Second');\n// AssertionError [ERR_ASSERTION]: Missing expected exception: Second\n\n// If it was intended to match for the error message do this instead:\n// It does not throw because the error messages match.\nassert.throws(throwingSecond, /Second$/);\n\n// If the error message does not match, an AssertionError is thrown.\nassert.throws(throwingFirst, /Second$/);\n// AssertionError [ERR_ASSERTION]\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert/strict');\n\nfunction throwingFirst() {\n  throw new Error('First');\n}\n\nfunction throwingSecond() {\n  throw new Error('Second');\n}\n\nfunction notThrowing() {}\n\n// The second argument is a string and the input function threw an Error.\n// The first case will not throw as it does not match for the error message\n// thrown by the input function!\nassert.throws(throwingFirst, 'Second');\n// In the next example the message has no benefit over the message from the\n// error and since it is not clear if the user intended to actually match\n// against the error message, Node.js throws an `ERR_AMBIGUOUS_ARGUMENT` error.\nassert.throws(throwingSecond, 'Second');\n// TypeError [ERR_AMBIGUOUS_ARGUMENT]\n\n// The string is only used (as message) in case the function does not throw:\nassert.throws(notThrowing, 'Second');\n// AssertionError [ERR_ASSERTION]: Missing expected exception: Second\n\n// If it was intended to match for the error message do this instead:\n// It does not throw because the error messages match.\nassert.throws(throwingSecond, /Second$/);\n\n// If the error message does not match, an AssertionError is thrown.\nassert.throws(throwingFirst, /Second$/);\n// AssertionError [ERR_ASSERTION]\n</code></pre>\n<p>Due to the confusing error-prone notation, avoid a string as the second\nargument.</p>"
        },
        {
          "textRaw": "`assert.partialDeepStrictEqual(actual, expected[, message])`",
          "name": "partialDeepStrictEqual",
          "type": "method",
          "meta": {
            "added": [
              "v23.4.0",
              "v22.13.0"
            ],
            "changes": [
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/59448",
                "description": "Promises are not considered equal anymore if they are not of the same instance."
              },
              {
                "version": "v25.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57627",
                "description": "Invalid dates are now considered equal."
              },
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57370",
                "description": "partialDeepStrictEqual is now Stable. Previously, it had been Experimental."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {any}",
                  "name": "actual",
                  "type": "any"
                },
                {
                  "textRaw": "`expected` {any}",
                  "name": "expected",
                  "type": "any"
                },
                {
                  "textRaw": "`message` {string|Error|Function}",
                  "name": "message",
                  "type": "string|Error|Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Tests for partial deep equality between the <code>actual</code> and <code>expected</code> parameters.\n\"Deep\" equality means that the enumerable \"own\" properties of child objects\nare recursively evaluated also by the following rules. \"Partial\" equality means\nthat only properties that exist on the <code>expected</code> parameter are going to be\ncompared.</p>\n<p>This method always passes the same test cases as <a href=\"#assertdeepstrictequalactual-expected-message\"><code>assert.deepStrictEqual()</code></a>,\nbehaving as a super set of it.</p>",
          "modules": [
            {
              "textRaw": "Comparison details",
              "name": "comparison_details",
              "type": "module",
              "desc": "<ul>\n<li>Primitive values are compared using <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\"><code>Object.is()</code></a>.</li>\n<li><a href=\"https://tc39.github.io/ecma262/#sec-object.prototype.tostring\">Type tags</a> of objects should be the same.</li>\n<li><a href=\"https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\"><code>[[Prototype]]</code></a> of objects are not compared.</li>\n<li>Only <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Enumerability_and_ownership_of_properties\">enumerable \"own\" properties</a> are considered.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> names, messages, causes, and errors are always compared,\neven if these are not enumerable properties. <code>errors</code> is also compared.</li>\n<li>Enumerable own <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#symbol_type\"><code>&#x3C;Symbol></code></a> properties are compared as well.</li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Data_structures#primitive_values\">Object wrappers</a> are compared both as objects and unwrapped values.</li>\n<li><code>Object</code> properties are compared unordered.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>&#x3C;Map></code></a> keys and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>&#x3C;Set></code></a> items are compared unordered.</li>\n<li>Recursion stops when both sides differ or both sides encounter a circular\nreference.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>&#x3C;WeakMap></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>&#x3C;WeakSet></code></a> and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> instances are <strong>not</strong> compared\nstructurally. They are only equal if they reference the same object. Any\ncomparison between different <code>WeakMap</code>, <code>WeakSet</code>, or <code>Promise</code> instances\nwill result in inequality, even if they contain the same content.</li>\n<li><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a> lastIndex, flags, and source are always compared, even if these\nare not enumerable properties.</li>\n<li>Holes in sparse arrays are ignored.</li>\n</ul>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nassert.partialDeepStrictEqual(\n  { a: { b: { c: 1 } } },\n  { a: { b: { c: 1 } } },\n);\n// OK\n\nassert.partialDeepStrictEqual(\n  { a: 1, b: 2, c: 3 },\n  { b: 2 },\n);\n// OK\n\nassert.partialDeepStrictEqual(\n  [1, 2, 3, 4, 5, 6, 7, 8, 9],\n  [4, 5, 8],\n);\n// OK\n\nassert.partialDeepStrictEqual(\n  new Set([{ a: 1 }, { b: 1 }]),\n  new Set([{ a: 1 }]),\n);\n// OK\n\nassert.partialDeepStrictEqual(\n  new Map([['key1', 'value1'], ['key2', 'value2']]),\n  new Map([['key2', 'value2']]),\n);\n// OK\n\nassert.partialDeepStrictEqual(123n, 123n);\n// OK\n\nassert.partialDeepStrictEqual(\n  [1, 2, 3, 4, 5, 6, 7, 8, 9],\n  [5, 4, 8],\n);\n// AssertionError\n\nassert.partialDeepStrictEqual(\n  { a: 1 },\n  { a: 1, b: 2 },\n);\n// AssertionError\n\nassert.partialDeepStrictEqual(\n  { a: { b: 2 } },\n  { a: { b: '2' } },\n);\n// AssertionError\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nassert.partialDeepStrictEqual(\n  { a: { b: { c: 1 } } },\n  { a: { b: { c: 1 } } },\n);\n// OK\n\nassert.partialDeepStrictEqual(\n  { a: 1, b: 2, c: 3 },\n  { b: 2 },\n);\n// OK\n\nassert.partialDeepStrictEqual(\n  [1, 2, 3, 4, 5, 6, 7, 8, 9],\n  [4, 5, 8],\n);\n// OK\n\nassert.partialDeepStrictEqual(\n  new Set([{ a: 1 }, { b: 1 }]),\n  new Set([{ a: 1 }]),\n);\n// OK\n\nassert.partialDeepStrictEqual(\n  new Map([['key1', 'value1'], ['key2', 'value2']]),\n  new Map([['key2', 'value2']]),\n);\n// OK\n\nassert.partialDeepStrictEqual(123n, 123n);\n// OK\n\nassert.partialDeepStrictEqual(\n  [1, 2, 3, 4, 5, 6, 7, 8, 9],\n  [5, 4, 8],\n);\n// AssertionError\n\nassert.partialDeepStrictEqual(\n  { a: 1 },\n  { a: 1, b: 2 },\n);\n// AssertionError\n\nassert.partialDeepStrictEqual(\n  { a: { b: 2 } },\n  { a: { b: '2' } },\n);\n// AssertionError\n</code></pre>",
              "displayName": "Comparison details"
            }
          ]
        }
      ],
      "displayName": "Assert",
      "source": "doc/api/assert.md"
    },
    {
      "textRaw": "Asynchronous context tracking",
      "name": "asynchronous_context_tracking",
      "introduced_in": "v16.4.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "modules": [
        {
          "textRaw": "Introduction",
          "name": "introduction",
          "type": "module",
          "desc": "<p>These classes are used to associate state and propagate it throughout\ncallbacks and promise chains.\nThey allow storing data throughout the lifetime of a web request\nor any other asynchronous duration. It is similar to thread-local storage\nin other languages.</p>\n<p>The <code>AsyncLocalStorage</code> and <code>AsyncResource</code> classes are part of the\n<code>node:async_hooks</code> module:</p>\n<pre><code class=\"language-mjs\">import { AsyncLocalStorage, AsyncResource } from 'node:async_hooks';\n</code></pre>\n<pre><code class=\"language-cjs\">const { AsyncLocalStorage, AsyncResource } = require('node:async_hooks');\n</code></pre>",
          "displayName": "Introduction"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `AsyncLocalStorage`",
          "name": "AsyncLocalStorage",
          "type": "class",
          "meta": {
            "added": [
              "v13.10.0",
              "v12.17.0"
            ],
            "changes": [
              {
                "version": "v16.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/37675",
                "description": "AsyncLocalStorage is now Stable. Previously, it had been Experimental."
              }
            ]
          },
          "desc": "<p>This class creates stores that stay coherent through asynchronous operations.</p>\n<p>While you can create your own implementation on top of the <code>node:async_hooks</code>\nmodule, <code>AsyncLocalStorage</code> should be preferred as it is a performant and memory\nsafe implementation that involves significant optimizations that are non-obvious\nto implement.</p>\n<p>The following example uses <code>AsyncLocalStorage</code> to build a simple logger\nthat assigns IDs to incoming HTTP requests and includes them in messages\nlogged within each request.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nconst asyncLocalStorage = new AsyncLocalStorage();\n\nfunction logWithId(msg) {\n  const id = asyncLocalStorage.getStore();\n  console.log(`${id !== undefined ? id : '-'}:`, msg);\n}\n\nlet idSeq = 0;\nhttp.createServer((req, res) => {\n  asyncLocalStorage.run(idSeq++, () => {\n    logWithId('start');\n    // Imagine any chain of async operations here\n    setImmediate(() => {\n      logWithId('finish');\n      res.end();\n    });\n  });\n}).listen(8080);\n\nhttp.get('http://localhost:8080');\nhttp.get('http://localhost:8080');\n// Prints:\n//   0: start\n//   0: finish\n//   1: start\n//   1: finish\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst { AsyncLocalStorage } = require('node:async_hooks');\n\nconst asyncLocalStorage = new AsyncLocalStorage();\n\nfunction logWithId(msg) {\n  const id = asyncLocalStorage.getStore();\n  console.log(`${id !== undefined ? id : '-'}:`, msg);\n}\n\nlet idSeq = 0;\nhttp.createServer((req, res) => {\n  asyncLocalStorage.run(idSeq++, () => {\n    logWithId('start');\n    // Imagine any chain of async operations here\n    setImmediate(() => {\n      logWithId('finish');\n      res.end();\n    });\n  });\n}).listen(8080);\n\nhttp.get('http://localhost:8080');\nhttp.get('http://localhost:8080');\n// Prints:\n//   0: start\n//   0: finish\n//   1: start\n//   1: finish\n</code></pre>\n<p>Each instance of <code>AsyncLocalStorage</code> maintains an independent storage context.\nMultiple instances can safely exist simultaneously without risk of interfering\nwith each other's data.</p>",
          "signatures": [
            {
              "textRaw": "`new AsyncLocalStorage([options])`",
              "name": "AsyncLocalStorage",
              "type": "ctor",
              "meta": {
                "added": [
                  "v13.10.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": "v24.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57766",
                    "description": "Add `defaultValue` and `name` options."
                  },
                  {
                    "version": [
                      "v19.7.0",
                      "v18.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46386",
                    "description": "Removed experimental onPropagate option."
                  },
                  {
                    "version": [
                      "v19.2.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/45386",
                    "description": "Add option onPropagate."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`defaultValue` {any} The default value to be used when no store is provided.",
                      "name": "defaultValue",
                      "type": "any",
                      "desc": "The default value to be used when no store is provided."
                    },
                    {
                      "textRaw": "`name` {string} A name for the `AsyncLocalStorage` value.",
                      "name": "name",
                      "type": "string",
                      "desc": "A name for the `AsyncLocalStorage` value."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new instance of <code>AsyncLocalStorage</code>. Store is only provided within a\n<code>run()</code> call or after an <code>enterWith()</code> call.</p>"
            }
          ],
          "classMethods": [
            {
              "textRaw": "Static method: `AsyncLocalStorage.bind(fn)`",
              "name": "bind",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v19.8.0",
                  "v18.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.11.0",
                      "v22.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57510",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function} The function to bind to the current execution context.",
                      "name": "fn",
                      "type": "Function",
                      "desc": "The function to bind to the current execution context."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} A new function that calls `fn` within the captured execution context.",
                    "name": "return",
                    "type": "Function",
                    "desc": "A new function that calls `fn` within the captured execution context."
                  }
                }
              ],
              "desc": "<p>Binds the given function to the current execution context.</p>"
            },
            {
              "textRaw": "Static method: `AsyncLocalStorage.snapshot()`",
              "name": "snapshot",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v19.8.0",
                  "v18.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.11.0",
                      "v22.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57510",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Function} A new function with the signature `(fn: (...args) : R, ...args) : R`.",
                    "name": "return",
                    "type": "Function",
                    "desc": "A new function with the signature `(fn: (...args) : R, ...args) : R`."
                  }
                }
              ],
              "desc": "<p>Captures the current execution context and returns a function that accepts a\nfunction as an argument. Whenever the returned function is called, it\ncalls the function passed to it within the captured context.</p>\n<pre><code class=\"language-js\">const asyncLocalStorage = new AsyncLocalStorage();\nconst runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot());\nconst result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore()));\nconsole.log(result);  // returns 123\n</code></pre>\n<p>AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple\nasync context tracking purposes, for example:</p>\n<pre><code class=\"language-js\">class Foo {\n  #runInAsyncScope = AsyncLocalStorage.snapshot();\n\n  get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); }\n}\n\nconst foo = asyncLocalStorage.run(123, () => new Foo());\nconsole.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`asyncLocalStorage.disable()`",
              "name": "disable",
              "type": "method",
              "meta": {
                "added": [
                  "v13.10.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Disables the instance of <code>AsyncLocalStorage</code>. All subsequent calls\nto <code>asyncLocalStorage.getStore()</code> will return <code>undefined</code> until\n<code>asyncLocalStorage.run()</code> or <code>asyncLocalStorage.enterWith()</code> is called again.</p>\n<p>When calling <code>asyncLocalStorage.disable()</code>, all current contexts linked to the\ninstance will be exited.</p>\n<p>Calling <code>asyncLocalStorage.disable()</code> is required before the\n<code>asyncLocalStorage</code> can be garbage collected. This does not apply to stores\nprovided by the <code>asyncLocalStorage</code>, as those objects are garbage collected\nalong with the corresponding async resources.</p>\n<p>Use this method when the <code>asyncLocalStorage</code> is not in use anymore\nin the current process.</p>"
            },
            {
              "textRaw": "`asyncLocalStorage.getStore()`",
              "name": "getStore",
              "type": "method",
              "meta": {
                "added": [
                  "v13.10.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {any}",
                    "name": "return",
                    "type": "any"
                  }
                }
              ],
              "desc": "<p>Returns the current store.\nIf called outside of an asynchronous context initialized by\ncalling <code>asyncLocalStorage.run()</code> or <code>asyncLocalStorage.enterWith()</code>, it\nreturns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`asyncLocalStorage.enterWith(store)`",
              "name": "enterWith",
              "type": "method",
              "meta": {
                "added": [
                  "v13.11.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`store` {any}",
                      "name": "store",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Transitions into the context for the remainder of the current\nsynchronous execution and then persists the store through any following\nasynchronous calls.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const store = { id: 1 };\n// Replaces previous store with the given store object\nasyncLocalStorage.enterWith(store);\nasyncLocalStorage.getStore(); // Returns the store object\nsomeAsyncOperation(() => {\n  asyncLocalStorage.getStore(); // Returns the same object\n});\n</code></pre>\n<p>This transition will continue for the <em>entire</em> synchronous execution.\nThis means that if, for example, the context is entered within an event\nhandler subsequent event handlers will also run within that context unless\nspecifically bound to another context with an <code>AsyncResource</code>. That is why\n<code>run()</code> should be preferred over <code>enterWith()</code> unless there are strong reasons\nto use the latter method.</p>\n<pre><code class=\"language-js\">const store = { id: 1 };\n\nemitter.on('my-event', () => {\n  asyncLocalStorage.enterWith(store);\n});\nemitter.on('my-event', () => {\n  asyncLocalStorage.getStore(); // Returns the same object\n});\n\nasyncLocalStorage.getStore(); // Returns undefined\nemitter.emit('my-event');\nasyncLocalStorage.getStore(); // Returns the same object\n</code></pre>"
            },
            {
              "textRaw": "`asyncLocalStorage.run(store, callback[, ...args])`",
              "name": "run",
              "type": "method",
              "meta": {
                "added": [
                  "v13.10.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`store` {any}",
                      "name": "store",
                      "type": "any"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Runs a function synchronously within a context and returns its\nreturn value. The store is not accessible outside of the callback function.\nThe store is accessible to any asynchronous operations created within the\ncallback.</p>\n<p>The optional <code>args</code> are passed to the callback function.</p>\n<p>If the callback function throws an error, the error is thrown by <code>run()</code> too.\nThe stacktrace is not impacted by this call and the context is exited.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">const store = { id: 2 };\ntry {\n  asyncLocalStorage.run(store, () => {\n    asyncLocalStorage.getStore(); // Returns the store object\n    setTimeout(() => {\n      asyncLocalStorage.getStore(); // Returns the store object\n    }, 200);\n    throw new Error();\n  });\n} catch (e) {\n  asyncLocalStorage.getStore(); // Returns undefined\n  // The error will be caught here\n}\n</code></pre>"
            },
            {
              "textRaw": "`asyncLocalStorage.exit(callback[, ...args])`",
              "name": "exit",
              "type": "method",
              "meta": {
                "added": [
                  "v13.10.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Runs a function synchronously outside of a context and returns its\nreturn value. The store is not accessible within the callback function or\nthe asynchronous operations created within the callback. Any <code>getStore()</code>\ncall done within the callback function will always return <code>undefined</code>.</p>\n<p>The optional <code>args</code> are passed to the callback function.</p>\n<p>If the callback function throws an error, the error is thrown by <code>exit()</code> too.\nThe stacktrace is not impacted by this call and the context is re-entered.</p>\n<p>Example:</p>\n<pre><code class=\"language-js\">// Within a call to run\ntry {\n  asyncLocalStorage.getStore(); // Returns the store object or value\n  asyncLocalStorage.exit(() => {\n    asyncLocalStorage.getStore(); // Returns undefined\n    throw new Error();\n  });\n} catch (e) {\n  asyncLocalStorage.getStore(); // Returns the same object or value\n  // The error will be caught here\n}\n</code></pre>"
            },
            {
              "textRaw": "`asyncLocalStorage.withScope(store)`",
              "name": "withScope",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`store` {any}",
                      "name": "store",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {RunScope}",
                    "name": "return",
                    "type": "RunScope"
                  }
                }
              ],
              "desc": "<p>Creates a disposable scope that enters the given store and automatically\nrestores the previous store value when the scope is disposed. This method is\ndesigned to work with JavaScript's explicit resource management (<code>using</code> syntax).</p>\n<p>Example:</p>\n<pre><code class=\"language-mjs\">import { AsyncLocalStorage } from 'node:async_hooks';\n\nconst asyncLocalStorage = new AsyncLocalStorage();\n\n{\n  using _ = asyncLocalStorage.withScope('my-store');\n  console.log(asyncLocalStorage.getStore()); // Prints: my-store\n}\n\nconsole.log(asyncLocalStorage.getStore()); // Prints: undefined\n</code></pre>\n<pre><code class=\"language-cjs\">const { AsyncLocalStorage } = require('node:async_hooks');\n\nconst asyncLocalStorage = new AsyncLocalStorage();\n\n{\n  using _ = asyncLocalStorage.withScope('my-store');\n  console.log(asyncLocalStorage.getStore()); // Prints: my-store\n}\n\nconsole.log(asyncLocalStorage.getStore()); // Prints: undefined\n</code></pre>\n<p>The <code>withScope()</code> method is particularly useful for managing context in\nsynchronous code where you want to ensure the previous store value is restored\nwhen exiting a block, even if an error is thrown.</p>\n<pre><code class=\"language-mjs\">import { AsyncLocalStorage } from 'node:async_hooks';\n\nconst asyncLocalStorage = new AsyncLocalStorage();\n\ntry {\n  using _ = asyncLocalStorage.withScope('my-store');\n  console.log(asyncLocalStorage.getStore()); // Prints: my-store\n  throw new Error('test');\n} catch (e) {\n  // Store is automatically restored even after error\n  console.log(asyncLocalStorage.getStore()); // Prints: undefined\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { AsyncLocalStorage } = require('node:async_hooks');\n\nconst asyncLocalStorage = new AsyncLocalStorage();\n\ntry {\n  using _ = asyncLocalStorage.withScope('my-store');\n  console.log(asyncLocalStorage.getStore()); // Prints: my-store\n  throw new Error('test');\n} catch (e) {\n  // Store is automatically restored even after error\n  console.log(asyncLocalStorage.getStore()); // Prints: undefined\n}\n</code></pre>\n<p><strong>Important:</strong> When using <code>withScope()</code> in async functions before the first\n<code>await</code>, be aware that the scope change will affect the caller's context. The\nsynchronous portion of an async function (before the first <code>await</code>) runs\nimmediately when called, and when it reaches the first <code>await</code>, it returns the\npromise to the caller. At that point, the scope change becomes visible in the\ncaller's context and will persist in subsequent synchronous code until something\nelse changes the scope value. For async operations, prefer using <code>run()</code> which\nproperly isolates context across async boundaries.</p>\n<pre><code class=\"language-mjs\">import { AsyncLocalStorage } from 'node:async_hooks';\n\nconst asyncLocalStorage = new AsyncLocalStorage();\n\nasync function example() {\n  using _ = asyncLocalStorage.withScope('my-store');\n  console.log(asyncLocalStorage.getStore()); // Prints: my-store\n  await someAsyncOperation(); // Function pauses here and returns promise\n  console.log(asyncLocalStorage.getStore()); // Prints: my-store\n}\n\n// Calling without await\nexample(); // Synchronous portion runs, then pauses at first await\n// After the promise is returned, the scope 'my-store' is now active in caller!\nconsole.log(asyncLocalStorage.getStore()); // Prints: my-store (unexpected!)\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string}",
              "name": "name",
              "type": "string",
              "meta": {
                "added": [
                  "v24.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The name of the <code>AsyncLocalStorage</code> instance if provided.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "Usage with `async/await`",
              "name": "usage_with_`async/await`",
              "type": "module",
              "desc": "<p>If, within an async function, only one <code>await</code> call is to run within a context,\nthe following pattern should be used:</p>\n<pre><code class=\"language-js\">async function fn() {\n  await asyncLocalStorage.run(new Map(), () => {\n    asyncLocalStorage.getStore().set('key', value);\n    return foo(); // The return value of foo will be awaited\n  });\n}\n</code></pre>\n<p>In this example, the store is only available in the callback function and the\nfunctions called by <code>foo</code>. Outside of <code>run</code>, calling <code>getStore</code> will return\n<code>undefined</code>.</p>",
              "displayName": "Usage with `async/await`"
            },
            {
              "textRaw": "Troubleshooting: Context loss",
              "name": "troubleshooting:_context_loss",
              "type": "module",
              "desc": "<p>In most cases, <code>AsyncLocalStorage</code> works without issues. In rare situations, the\ncurrent store is lost in one of the asynchronous operations.</p>\n<p>If your code is callback-based, it is enough to promisify it with\n<a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a> so it starts working with native promises.</p>\n<p>If you need to use a callback-based API or your code assumes\na custom thenable implementation, use the <a href=\"#class-asyncresource\"><code>AsyncResource</code></a> class\nto associate the asynchronous operation with the correct execution context.\nFind the function call responsible for the context loss by logging the content\nof <code>asyncLocalStorage.getStore()</code> after the calls you suspect are responsible\nfor the loss. When the code logs <code>undefined</code>, the last callback called is\nprobably responsible for the context loss.</p>",
              "displayName": "Troubleshooting: Context loss"
            }
          ]
        },
        {
          "textRaw": "Class: `RunScope`",
          "name": "RunScope",
          "type": "class",
          "meta": {
            "added": [
              "v25.9.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>A disposable scope returned by <a href=\"#asynclocalstoragewithscopestore\"><code>asyncLocalStorage.withScope()</code></a> that\nautomatically restores the previous store value when disposed. This class\nimplements the <a href=\"https://github.com/tc39/proposal-explicit-resource-management\">Explicit Resource Management</a> protocol and is designed to work\nwith JavaScript's <code>using</code> syntax.</p>\n<p>The scope automatically restores the previous store value when the <code>using</code> block\nexits, whether through normal completion or by throwing an error.</p>",
          "methods": [
            {
              "textRaw": "`scope.dispose()`",
              "name": "dispose",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Explicitly ends the scope and restores the previous store value. This method\nis idempotent: calling it multiple times has the same effect as calling it once.</p>\n<p>The <code>[Symbol.dispose]()</code> method defers to <code>dispose()</code>.</p>\n<p>If <code>withScope()</code> is called without the <code>using</code> keyword, <code>dispose()</code> must be\ncalled manually to restore the previous store value. Forgetting to call\n<code>dispose()</code> will cause the store value to persist for the remainder of the\ncurrent execution context:</p>\n<pre><code class=\"language-mjs\">import { AsyncLocalStorage } from 'node:async_hooks';\n\nconst storage = new AsyncLocalStorage();\n\n// Without using, the scope must be disposed manually\nconst scope = storage.withScope('my-store');\n// storage.getStore() === 'my-store' here\n\nscope.dispose(); // Restore previous value\n// storage.getStore() === undefined here\n</code></pre>\n<pre><code class=\"language-cjs\">const { AsyncLocalStorage } = require('node:async_hooks');\n\nconst storage = new AsyncLocalStorage();\n\n// Without using, the scope must be disposed manually\nconst scope = storage.withScope('my-store');\n// storage.getStore() === 'my-store' here\n\nscope.dispose(); // Restore previous value\n// storage.getStore() === undefined here\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `AsyncResource`",
          "name": "AsyncResource",
          "type": "class",
          "meta": {
            "changes": [
              {
                "version": "v16.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/37675",
                "description": "AsyncResource is now Stable. Previously, it had been Experimental."
              }
            ]
          },
          "desc": "<p>The class <code>AsyncResource</code> is designed to be extended by the embedder's async\nresources. Using this, users can easily trigger the lifetime events of their\nown resources.</p>\n<p>The <code>init</code> hook will trigger when an <code>AsyncResource</code> is instantiated.</p>\n<p>The following is an overview of the <code>AsyncResource</code> API.</p>\n<pre><code class=\"language-mjs\">import { AsyncResource, executionAsyncId } from 'node:async_hooks';\n\n// AsyncResource() is meant to be extended. Instantiating a\n// new AsyncResource() also triggers init. If triggerAsyncId is omitted then\n// async_hook.executionAsyncId() is used.\nconst asyncResource = new AsyncResource(\n  type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false },\n);\n\n// Run a function in the execution context of the resource. This will\n// * establish the context of the resource\n// * trigger the AsyncHooks before callbacks\n// * call the provided function `fn` with the supplied arguments\n// * trigger the AsyncHooks after callbacks\n// * restore the original execution context\nasyncResource.runInAsyncScope(fn, thisArg, ...args);\n\n// Call AsyncHooks destroy callbacks.\nasyncResource.emitDestroy();\n\n// Return the unique ID assigned to the AsyncResource instance.\nasyncResource.asyncId();\n\n// Return the trigger ID for the AsyncResource instance.\nasyncResource.triggerAsyncId();\n</code></pre>\n<pre><code class=\"language-cjs\">const { AsyncResource, executionAsyncId } = require('node:async_hooks');\n\n// AsyncResource() is meant to be extended. Instantiating a\n// new AsyncResource() also triggers init. If triggerAsyncId is omitted then\n// async_hook.executionAsyncId() is used.\nconst asyncResource = new AsyncResource(\n  type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false },\n);\n\n// Run a function in the execution context of the resource. This will\n// * establish the context of the resource\n// * trigger the AsyncHooks before callbacks\n// * call the provided function `fn` with the supplied arguments\n// * trigger the AsyncHooks after callbacks\n// * restore the original execution context\nasyncResource.runInAsyncScope(fn, thisArg, ...args);\n\n// Call AsyncHooks destroy callbacks.\nasyncResource.emitDestroy();\n\n// Return the unique ID assigned to the AsyncResource instance.\nasyncResource.asyncId();\n\n// Return the trigger ID for the AsyncResource instance.\nasyncResource.triggerAsyncId();\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new AsyncResource(type[, options])`",
              "name": "AsyncResource",
              "type": "ctor",
              "params": [
                {
                  "textRaw": "`type` {string} The type of async event.",
                  "name": "type",
                  "type": "string",
                  "desc": "The type of async event."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`triggerAsyncId` {number} The ID of the execution context that created this async event. **Default:** `executionAsyncId()`.",
                      "name": "triggerAsyncId",
                      "type": "number",
                      "default": "`executionAsyncId()`",
                      "desc": "The ID of the execution context that created this async event."
                    },
                    {
                      "textRaw": "`requireManualDestroy` {boolean} If set to `true`, disables `emitDestroy` when the object is garbage collected. This usually does not need to be set (even if `emitDestroy` is called manually), unless the resource's `asyncId` is retrieved and the sensitive API's `emitDestroy` is called with it. When set to `false`, the `emitDestroy` call on garbage collection will only take place if there is at least one active `destroy` hook. **Default:** `false`.",
                      "name": "requireManualDestroy",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, disables `emitDestroy` when the object is garbage collected. This usually does not need to be set (even if `emitDestroy` is called manually), unless the resource's `asyncId` is retrieved and the sensitive API's `emitDestroy` is called with it. When set to `false`, the `emitDestroy` call on garbage collection will only take place if there is at least one active `destroy` hook."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Example usage:</p>\n<pre><code class=\"language-js\">class DBQuery extends AsyncResource {\n  constructor(db) {\n    super('DBQuery');\n    this.db = db;\n  }\n\n  getInfo(query, callback) {\n    this.db.get(query, (err, data) => {\n      this.runInAsyncScope(callback, null, err, data);\n    });\n  }\n\n  close() {\n    this.db = null;\n    this.emitDestroy();\n  }\n}\n</code></pre>"
            }
          ],
          "classMethods": [
            {
              "textRaw": "Static method: `AsyncResource.bind(fn[, type[, thisArg]])`",
              "name": "bind",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v14.8.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46432",
                    "description": "The `asyncResource` property added to the bound function has been deprecated and will be removed in a future version."
                  },
                  {
                    "version": [
                      "v17.8.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42177",
                    "description": "Changed the default when `thisArg` is undefined to use `this` from the caller."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36782",
                    "description": "Added optional thisArg."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function} The function to bind to the current execution context.",
                      "name": "fn",
                      "type": "Function",
                      "desc": "The function to bind to the current execution context."
                    },
                    {
                      "textRaw": "`type` {string} An optional name to associate with the underlying `AsyncResource`.",
                      "name": "type",
                      "type": "string",
                      "desc": "An optional name to associate with the underlying `AsyncResource`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`thisArg` {any}",
                      "name": "thisArg",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Binds the given function to the current execution context.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`asyncResource.bind(fn[, thisArg])`",
              "name": "bind",
              "type": "method",
              "meta": {
                "added": [
                  "v14.8.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46432",
                    "description": "The `asyncResource` property added to the bound function has been deprecated and will be removed in a future version."
                  },
                  {
                    "version": [
                      "v17.8.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42177",
                    "description": "Changed the default when `thisArg` is undefined to use `this` from the caller."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36782",
                    "description": "Added optional thisArg."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function} The function to bind to the current `AsyncResource`.",
                      "name": "fn",
                      "type": "Function",
                      "desc": "The function to bind to the current `AsyncResource`."
                    },
                    {
                      "textRaw": "`thisArg` {any}",
                      "name": "thisArg",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Binds the given function to execute to this <code>AsyncResource</code>'s scope.</p>"
            },
            {
              "textRaw": "`asyncResource.runInAsyncScope(fn[, thisArg, ...args])`",
              "name": "runInAsyncScope",
              "type": "method",
              "meta": {
                "added": [
                  "v9.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function} The function to call in the execution context of this async resource.",
                      "name": "fn",
                      "type": "Function",
                      "desc": "The function to call in the execution context of this async resource."
                    },
                    {
                      "textRaw": "`thisArg` {any} The receiver to be used for the function call.",
                      "name": "thisArg",
                      "type": "any",
                      "desc": "The receiver to be used for the function call.",
                      "optional": true
                    },
                    {
                      "textRaw": "`...args` {any} Optional arguments to pass to the function.",
                      "name": "...args",
                      "type": "any",
                      "desc": "Optional arguments to pass to the function.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Call the provided function with the provided arguments in the execution context\nof the async resource. This will establish the context, trigger the AsyncHooks\nbefore callbacks, call the function, trigger the AsyncHooks after callbacks, and\nthen restore the original execution context.</p>"
            },
            {
              "textRaw": "`asyncResource.emitDestroy()`",
              "name": "emitDestroy",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {AsyncResource} A reference to `asyncResource`.",
                    "name": "return",
                    "type": "AsyncResource",
                    "desc": "A reference to `asyncResource`."
                  }
                }
              ],
              "desc": "<p>Call all <code>destroy</code> hooks. This should only ever be called once. An error will\nbe thrown if it is called more than once. This <strong>must</strong> be manually called. If\nthe resource is left to be collected by the GC then the <code>destroy</code> hooks will\nnever be called.</p>"
            },
            {
              "textRaw": "`asyncResource.asyncId()`",
              "name": "asyncId",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} The unique `asyncId` assigned to the resource.",
                    "name": "return",
                    "type": "number",
                    "desc": "The unique `asyncId` assigned to the resource."
                  }
                }
              ]
            },
            {
              "textRaw": "`asyncResource.triggerAsyncId()`",
              "name": "triggerAsyncId",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.",
                    "name": "return",
                    "type": "number",
                    "desc": "The same `triggerAsyncId` that is passed to the `AsyncResource` constructor."
                  }
                }
              ],
              "desc": "<p><a id=\"async-resource-worker-pool\"></a></p>"
            }
          ],
          "modules": [
            {
              "textRaw": "Using `AsyncResource` for a `Worker` thread pool",
              "name": "using_`asyncresource`_for_a_`worker`_thread_pool",
              "type": "module",
              "desc": "<p>The following example shows how to use the <code>AsyncResource</code> class to properly\nprovide async tracking for a <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> pool. Other resource pools, such as\ndatabase connection pools, can follow a similar model.</p>\n<p>Assuming that the task is adding two numbers, using a file named\n<code>task_processor.js</code> with the following content:</p>\n<pre><code class=\"language-mjs\">import { parentPort } from 'node:worker_threads';\nparentPort.on('message', (task) => {\n  parentPort.postMessage(task.a + task.b);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { parentPort } = require('node:worker_threads');\nparentPort.on('message', (task) => {\n  parentPort.postMessage(task.a + task.b);\n});\n</code></pre>\n<p>a Worker pool around it could use the following structure:</p>\n<pre><code class=\"language-mjs\">import { AsyncResource } from 'node:async_hooks';\nimport { EventEmitter } from 'node:events';\nimport { Worker } from 'node:worker_threads';\n\nconst kTaskInfo = Symbol('kTaskInfo');\nconst kWorkerFreedEvent = Symbol('kWorkerFreedEvent');\n\nclass WorkerPoolTaskInfo extends AsyncResource {\n  constructor(callback) {\n    super('WorkerPoolTaskInfo');\n    this.callback = callback;\n  }\n\n  done(err, result) {\n    this.runInAsyncScope(this.callback, null, err, result);\n    this.emitDestroy();  // `TaskInfo`s are used only once.\n  }\n}\n\nexport default class WorkerPool extends EventEmitter {\n  constructor(numThreads) {\n    super();\n    this.numThreads = numThreads;\n    this.workers = [];\n    this.freeWorkers = [];\n    this.tasks = [];\n\n    for (let i = 0; i &#x3C; numThreads; i++)\n      this.addNewWorker();\n\n    // Any time the kWorkerFreedEvent is emitted, dispatch\n    // the next task pending in the queue, if any.\n    this.on(kWorkerFreedEvent, () => {\n      if (this.tasks.length > 0) {\n        const { task, callback } = this.tasks.shift();\n        this.runTask(task, callback);\n      }\n    });\n  }\n\n  addNewWorker() {\n    const worker = new Worker(new URL('task_processor.js', import.meta.url));\n    worker.on('message', (result) => {\n      // In case of success: Call the callback that was passed to `runTask`,\n      // remove the `TaskInfo` associated with the Worker, and mark it as free\n      // again.\n      worker[kTaskInfo].done(null, result);\n      worker[kTaskInfo] = null;\n      this.freeWorkers.push(worker);\n      this.emit(kWorkerFreedEvent);\n    });\n    worker.on('error', (err) => {\n      // In case of an uncaught exception: Call the callback that was passed to\n      // `runTask` with the error.\n      if (worker[kTaskInfo])\n        worker[kTaskInfo].done(err, null);\n      else\n        this.emit('error', err);\n      // Remove the worker from the list and start a new Worker to replace the\n      // current one.\n      this.workers.splice(this.workers.indexOf(worker), 1);\n      this.addNewWorker();\n    });\n    this.workers.push(worker);\n    this.freeWorkers.push(worker);\n    this.emit(kWorkerFreedEvent);\n  }\n\n  runTask(task, callback) {\n    if (this.freeWorkers.length === 0) {\n      // No free threads, wait until a worker thread becomes free.\n      this.tasks.push({ task, callback });\n      return;\n    }\n\n    const worker = this.freeWorkers.pop();\n    worker[kTaskInfo] = new WorkerPoolTaskInfo(callback);\n    worker.postMessage(task);\n  }\n\n  close() {\n    for (const worker of this.workers) worker.terminate();\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { AsyncResource } = require('node:async_hooks');\nconst { EventEmitter } = require('node:events');\nconst path = require('node:path');\nconst { Worker } = require('node:worker_threads');\n\nconst kTaskInfo = Symbol('kTaskInfo');\nconst kWorkerFreedEvent = Symbol('kWorkerFreedEvent');\n\nclass WorkerPoolTaskInfo extends AsyncResource {\n  constructor(callback) {\n    super('WorkerPoolTaskInfo');\n    this.callback = callback;\n  }\n\n  done(err, result) {\n    this.runInAsyncScope(this.callback, null, err, result);\n    this.emitDestroy();  // `TaskInfo`s are used only once.\n  }\n}\n\nclass WorkerPool extends EventEmitter {\n  constructor(numThreads) {\n    super();\n    this.numThreads = numThreads;\n    this.workers = [];\n    this.freeWorkers = [];\n    this.tasks = [];\n\n    for (let i = 0; i &#x3C; numThreads; i++)\n      this.addNewWorker();\n\n    // Any time the kWorkerFreedEvent is emitted, dispatch\n    // the next task pending in the queue, if any.\n    this.on(kWorkerFreedEvent, () => {\n      if (this.tasks.length > 0) {\n        const { task, callback } = this.tasks.shift();\n        this.runTask(task, callback);\n      }\n    });\n  }\n\n  addNewWorker() {\n    const worker = new Worker(path.resolve(__dirname, 'task_processor.js'));\n    worker.on('message', (result) => {\n      // In case of success: Call the callback that was passed to `runTask`,\n      // remove the `TaskInfo` associated with the Worker, and mark it as free\n      // again.\n      worker[kTaskInfo].done(null, result);\n      worker[kTaskInfo] = null;\n      this.freeWorkers.push(worker);\n      this.emit(kWorkerFreedEvent);\n    });\n    worker.on('error', (err) => {\n      // In case of an uncaught exception: Call the callback that was passed to\n      // `runTask` with the error.\n      if (worker[kTaskInfo])\n        worker[kTaskInfo].done(err, null);\n      else\n        this.emit('error', err);\n      // Remove the worker from the list and start a new Worker to replace the\n      // current one.\n      this.workers.splice(this.workers.indexOf(worker), 1);\n      this.addNewWorker();\n    });\n    this.workers.push(worker);\n    this.freeWorkers.push(worker);\n    this.emit(kWorkerFreedEvent);\n  }\n\n  runTask(task, callback) {\n    if (this.freeWorkers.length === 0) {\n      // No free threads, wait until a worker thread becomes free.\n      this.tasks.push({ task, callback });\n      return;\n    }\n\n    const worker = this.freeWorkers.pop();\n    worker[kTaskInfo] = new WorkerPoolTaskInfo(callback);\n    worker.postMessage(task);\n  }\n\n  close() {\n    for (const worker of this.workers) worker.terminate();\n  }\n}\n\nmodule.exports = WorkerPool;\n</code></pre>\n<p>Without the explicit tracking added by the <code>WorkerPoolTaskInfo</code> objects,\nit would appear that the callbacks are associated with the individual <code>Worker</code>\nobjects. However, the creation of the <code>Worker</code>s is not associated with the\ncreation of the tasks and does not provide information about when tasks\nwere scheduled.</p>\n<p>This pool could be used as follows:</p>\n<pre><code class=\"language-mjs\">import WorkerPool from './worker_pool.js';\nimport os from 'node:os';\n\nconst pool = new WorkerPool(os.availableParallelism());\n\nlet finished = 0;\nfor (let i = 0; i &#x3C; 10; i++) {\n  pool.runTask({ a: 42, b: 100 }, (err, result) => {\n    console.log(i, err, result);\n    if (++finished === 10)\n      pool.close();\n  });\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const WorkerPool = require('./worker_pool.js');\nconst os = require('node:os');\n\nconst pool = new WorkerPool(os.availableParallelism());\n\nlet finished = 0;\nfor (let i = 0; i &#x3C; 10; i++) {\n  pool.runTask({ a: 42, b: 100 }, (err, result) => {\n    console.log(i, err, result);\n    if (++finished === 10)\n      pool.close();\n  });\n}\n</code></pre>",
              "displayName": "Using `AsyncResource` for a `Worker` thread pool"
            },
            {
              "textRaw": "Integrating `AsyncResource` with `EventEmitter`",
              "name": "integrating_`asyncresource`_with_`eventemitter`",
              "type": "module",
              "desc": "<p>Event listeners triggered by an <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a> may be run in a different\nexecution context than the one that was active when <code>eventEmitter.on()</code> was\ncalled.</p>\n<p>The following example shows how to use the <code>AsyncResource</code> class to properly\nassociate an event listener with the correct execution context. The same\napproach can be applied to a <a href=\"stream.html#stream\"><code>Stream</code></a> or a similar event-driven class.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http';\nimport { AsyncResource, executionAsyncId } from 'node:async_hooks';\n\nconst server = createServer((req, res) => {\n  req.on('close', AsyncResource.bind(() => {\n    // Execution context is bound to the current outer scope.\n  }));\n  req.on('close', () => {\n    // Execution context is bound to the scope that caused 'close' to emit.\n  });\n  res.end();\n}).listen(3000);\n</code></pre>\n<pre><code class=\"language-cjs\">const { createServer } = require('node:http');\nconst { AsyncResource, executionAsyncId } = require('node:async_hooks');\n\nconst server = createServer((req, res) => {\n  req.on('close', AsyncResource.bind(() => {\n    // Execution context is bound to the current outer scope.\n  }));\n  req.on('close', () => {\n    // Execution context is bound to the scope that caused 'close' to emit.\n  });\n  res.end();\n}).listen(3000);\n</code></pre>",
              "displayName": "Integrating `AsyncResource` with `EventEmitter`"
            }
          ]
        }
      ],
      "displayName": "Asynchronous context tracking",
      "source": "doc/api/async_context.md"
    },
    {
      "textRaw": "Async hooks",
      "name": "async_hooks",
      "introduced_in": "v8.1.0",
      "type": "module",
      "stability": 1,
      "stabilityText": "Experimental. Please migrate away from this API, if you can. We do not recommend using the `createHook`, `AsyncHook`, and `executionAsyncResource` APIs as they have usability issues, safety risks, and performance implications. Async context tracking use cases are better served by the stable `AsyncLocalStorage` API. If you have a use case for `createHook`, `AsyncHook`, or `executionAsyncResource` beyond the context tracking need solved by `AsyncLocalStorage` or diagnostics data currently provided by Diagnostics Channel, please open an issue at https://github.com/nodejs/node/issues describing your use case so we can create a more purpose-focused API.",
      "desc": "<p>We strongly discourage the use of the <code>async_hooks</code> API.\nOther APIs that can cover most of its use cases include:</p>\n<ul>\n<li><a href=\"async_context.html#class-asynclocalstorage\"><code>AsyncLocalStorage</code></a> tracks async context</li>\n<li><a href=\"process.html#processgetactiveresourcesinfo\"><code>process.getActiveResourcesInfo()</code></a> tracks active resources</li>\n</ul>\n<p>The <code>node:async_hooks</code> module provides an API to track asynchronous resources.\nIt can be accessed using:</p>\n<pre><code class=\"language-mjs\">import async_hooks from 'node:async_hooks';\n</code></pre>\n<pre><code class=\"language-cjs\">const async_hooks = require('node:async_hooks');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Terminology",
          "name": "terminology",
          "type": "module",
          "desc": "<p>An asynchronous resource represents an object with an associated callback.\nThis callback may be called multiple times, such as the <code>'connection'</code>\nevent in <code>net.createServer()</code>, or just a single time like in <code>fs.open()</code>.\nA resource can also be closed before the callback is called. <code>AsyncHook</code> does\nnot explicitly distinguish between these different cases but will represent them\nas the abstract concept that is a resource.</p>\n<p>If <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a>s are used, each thread has an independent <code>async_hooks</code>\ninterface, and each thread will use a new set of async IDs.</p>",
          "displayName": "Terminology"
        },
        {
          "textRaw": "Overview",
          "name": "overview",
          "type": "module",
          "desc": "<p>Following is a simple overview of the public API.</p>\n<pre><code class=\"language-mjs\">import async_hooks from 'node:async_hooks';\n\n// Return the ID of the current execution context.\nconst eid = async_hooks.executionAsyncId();\n\n// Return the ID of the handle responsible for triggering the callback of the\n// current execution scope to call.\nconst tid = async_hooks.triggerAsyncId();\n\n// Create a new AsyncHook instance. All of these callbacks are optional.\nconst asyncHook =\n    async_hooks.createHook({ init, before, after, destroy, promiseResolve });\n\n// Allow callbacks of this AsyncHook instance to call. This is not an implicit\n// action after running the constructor, and must be explicitly run to begin\n// executing callbacks.\nasyncHook.enable();\n\n// Disable listening for new asynchronous events.\nasyncHook.disable();\n\n//\n// The following are the callbacks that can be passed to createHook().\n//\n\n// init() is called during object construction. The resource may not have\n// completed construction when this callback runs. Therefore, all fields of the\n// resource referenced by \"asyncId\" may not have been populated.\nfunction init(asyncId, type, triggerAsyncId, resource) { }\n\n// before() is called just before the resource's callback is called. It can be\n// called 0-N times for handles (such as TCPWrap), and will be called exactly 1\n// time for requests (such as FSReqCallback).\nfunction before(asyncId) { }\n\n// after() is called just after the resource's callback has finished.\nfunction after(asyncId) { }\n\n// destroy() is called when the resource is destroyed.\nfunction destroy(asyncId) { }\n\n// promiseResolve() is called only for promise resources, when the\n// resolve() function passed to the Promise constructor is invoked\n// (either directly or through other means of resolving a promise).\nfunction promiseResolve(asyncId) { }\n</code></pre>\n<pre><code class=\"language-cjs\">const async_hooks = require('node:async_hooks');\n\n// Return the ID of the current execution context.\nconst eid = async_hooks.executionAsyncId();\n\n// Return the ID of the handle responsible for triggering the callback of the\n// current execution scope to call.\nconst tid = async_hooks.triggerAsyncId();\n\n// Create a new AsyncHook instance. All of these callbacks are optional.\nconst asyncHook =\n    async_hooks.createHook({ init, before, after, destroy, promiseResolve });\n\n// Allow callbacks of this AsyncHook instance to call. This is not an implicit\n// action after running the constructor, and must be explicitly run to begin\n// executing callbacks.\nasyncHook.enable();\n\n// Disable listening for new asynchronous events.\nasyncHook.disable();\n\n//\n// The following are the callbacks that can be passed to createHook().\n//\n\n// init() is called during object construction. The resource may not have\n// completed construction when this callback runs. Therefore, all fields of the\n// resource referenced by \"asyncId\" may not have been populated.\nfunction init(asyncId, type, triggerAsyncId, resource) { }\n\n// before() is called just before the resource's callback is called. It can be\n// called 0-N times for handles (such as TCPWrap), and will be called exactly 1\n// time for requests (such as FSReqCallback).\nfunction before(asyncId) { }\n\n// after() is called just after the resource's callback has finished.\nfunction after(asyncId) { }\n\n// destroy() is called when the resource is destroyed.\nfunction destroy(asyncId) { }\n\n// promiseResolve() is called only for promise resources, when the\n// resolve() function passed to the Promise constructor is invoked\n// (either directly or through other means of resolving a promise).\nfunction promiseResolve(asyncId) { }\n</code></pre>",
          "displayName": "Overview"
        },
        {
          "textRaw": "Promise execution tracking",
          "name": "promise_execution_tracking",
          "type": "module",
          "desc": "<p>By default, promise executions are not assigned <code>asyncId</code>s due to the relatively\nexpensive nature of the <a href=\"https://docs.google.com/document/d/1rda3yKGHimKIhg5YeoAmCOtyURgsbTH_qaYR79FELlk/edit\">promise introspection API</a> provided by\nV8. This means that programs using promises or <code>async</code>/<code>await</code> will not get\ncorrect execution and trigger ids for promise callback contexts by default.</p>\n<pre><code class=\"language-mjs\">import { executionAsyncId, triggerAsyncId } from 'node:async_hooks';\n\nPromise.resolve(1729).then(() => {\n  console.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`);\n});\n// produces:\n// eid 1 tid 0\n</code></pre>\n<pre><code class=\"language-cjs\">const { executionAsyncId, triggerAsyncId } = require('node:async_hooks');\n\nPromise.resolve(1729).then(() => {\n  console.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`);\n});\n// produces:\n// eid 1 tid 0\n</code></pre>\n<p>Observe that the <code>then()</code> callback claims to have executed in the context of the\nouter scope even though there was an asynchronous hop involved. Also,\nthe <code>triggerAsyncId</code> value is <code>0</code>, which means that we are missing context about\nthe resource that caused (triggered) the <code>then()</code> callback to be executed.</p>\n<p>Installing async hooks via <code>async_hooks.createHook</code> enables promise execution\ntracking:</p>\n<pre><code class=\"language-mjs\">import { createHook, executionAsyncId, triggerAsyncId } from 'node:async_hooks';\ncreateHook({ init() {} }).enable(); // forces PromiseHooks to be enabled.\nPromise.resolve(1729).then(() => {\n  console.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`);\n});\n// produces:\n// eid 7 tid 6\n</code></pre>\n<pre><code class=\"language-cjs\">const { createHook, executionAsyncId, triggerAsyncId } = require('node:async_hooks');\n\ncreateHook({ init() {} }).enable(); // forces PromiseHooks to be enabled.\nPromise.resolve(1729).then(() => {\n  console.log(`eid ${executionAsyncId()} tid ${triggerAsyncId()}`);\n});\n// produces:\n// eid 7 tid 6\n</code></pre>\n<p>In this example, adding any actual hook function enabled the tracking of\npromises. There are two promises in the example above; the promise created by\n<code>Promise.resolve()</code> and the promise returned by the call to <code>then()</code>. In the\nexample above, the first promise got the <code>asyncId</code> <code>6</code> and the latter got\n<code>asyncId</code> <code>7</code>. During the execution of the <code>then()</code> callback, we are executing\nin the context of promise with <code>asyncId</code> <code>7</code>. This promise was triggered by\nasync resource <code>6</code>.</p>\n<p>Another subtlety with promises is that <code>before</code> and <code>after</code> callbacks are run\nonly on chained promises. That means promises not created by <code>then()</code>/<code>catch()</code>\nwill not have the <code>before</code> and <code>after</code> callbacks fired on them. For more details\nsee the details of the V8 <a href=\"https://docs.google.com/document/d/1rda3yKGHimKIhg5YeoAmCOtyURgsbTH_qaYR79FELlk/edit\">PromiseHooks</a> API.</p>",
          "modules": [
            {
              "textRaw": "Disabling promise execution tracking",
              "name": "disabling_promise_execution_tracking",
              "type": "module",
              "desc": "<p>Tracking promise execution can cause a significant performance overhead.\nTo opt out of promise tracking, set <code>trackPromises</code> to <code>false</code>:</p>\n<pre><code class=\"language-cjs\">const { createHook } = require('node:async_hooks');\nconst { writeSync } = require('node:fs');\ncreateHook({\n  init(asyncId, type, triggerAsyncId, resource) {\n    // This init hook does not get called when trackPromises is set to false.\n    writeSync(1, `init hook triggered for ${type}\\n`);\n  },\n  trackPromises: false,  // Do not track promises.\n}).enable();\nPromise.resolve(1729);\n</code></pre>\n<pre><code class=\"language-mjs\">import { createHook } from 'node:async_hooks';\nimport { writeSync } from 'node:fs';\n\ncreateHook({\n  init(asyncId, type, triggerAsyncId, resource) {\n    // This init hook does not get called when trackPromises is set to false.\n    writeSync(1, `init hook triggered for ${type}\\n`);\n  },\n  trackPromises: false,  // Do not track promises.\n}).enable();\nPromise.resolve(1729);\n</code></pre>",
              "displayName": "Disabling promise execution tracking"
            }
          ],
          "displayName": "Promise execution tracking"
        },
        {
          "textRaw": "JavaScript embedder API",
          "name": "javascript_embedder_api",
          "type": "module",
          "desc": "<p>Library developers that handle their own asynchronous resources performing tasks\nlike I/O, connection pooling, or managing callback queues may use the\n<code>AsyncResource</code> JavaScript API so that all the appropriate callbacks are called.</p>",
          "classes": [
            {
              "textRaw": "Class: `AsyncResource`",
              "name": "AsyncResource",
              "type": "class",
              "desc": "<p>The documentation for this class has moved <a href=\"async_context.html#class-asyncresource\"><code>AsyncResource</code></a>.</p>"
            }
          ],
          "displayName": "JavaScript embedder API"
        }
      ],
      "methods": [
        {
          "textRaw": "`async_hooks.createHook(options)`",
          "name": "createHook",
          "type": "method",
          "meta": {
            "added": [
              "v8.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object} The Hook Callbacks to register",
                  "name": "options",
                  "type": "Object",
                  "desc": "The Hook Callbacks to register",
                  "options": [
                    {
                      "textRaw": "`init` {Function} The `init` callback.",
                      "name": "init",
                      "type": "Function",
                      "desc": "The `init` callback."
                    },
                    {
                      "textRaw": "`before` {Function} The `before` callback.",
                      "name": "before",
                      "type": "Function",
                      "desc": "The `before` callback."
                    },
                    {
                      "textRaw": "`after` {Function} The `after` callback.",
                      "name": "after",
                      "type": "Function",
                      "desc": "The `after` callback."
                    },
                    {
                      "textRaw": "`destroy` {Function} The `destroy` callback.",
                      "name": "destroy",
                      "type": "Function",
                      "desc": "The `destroy` callback."
                    },
                    {
                      "textRaw": "`promiseResolve` {Function} The `promiseResolve` callback.",
                      "name": "promiseResolve",
                      "type": "Function",
                      "desc": "The `promiseResolve` callback."
                    },
                    {
                      "textRaw": "`trackPromises` {boolean} Whether the hook should track `Promise`s. Cannot be `false` if `promiseResolve` is set. **Default**: `true`.",
                      "name": "trackPromises",
                      "type": "boolean",
                      "desc": "Whether the hook should track `Promise`s. Cannot be `false` if `promiseResolve` is set. **Default**: `true`."
                    }
                  ]
                }
              ],
              "return": {
                "textRaw": "Returns: {AsyncHook} Instance used for disabling and enabling hooks",
                "name": "return",
                "type": "AsyncHook",
                "desc": "Instance used for disabling and enabling hooks"
              }
            }
          ],
          "desc": "<p>Registers functions to be called for different lifetime events of each async\noperation.</p>\n<p>The callbacks <code>init()</code>/<code>before()</code>/<code>after()</code>/<code>destroy()</code> are called for the\nrespective asynchronous event during a resource's lifetime.</p>\n<p>All callbacks are optional. For example, if only resource cleanup needs to\nbe tracked, then only the <code>destroy</code> callback needs to be passed. The\nspecifics of all functions that can be passed to <code>callbacks</code> is in the\n<a href=\"#hook-callbacks\">Hook Callbacks</a> section.</p>\n<pre><code class=\"language-mjs\">import { createHook } from 'node:async_hooks';\n\nconst asyncHook = createHook({\n  init(asyncId, type, triggerAsyncId, resource) { },\n  destroy(asyncId) { },\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const async_hooks = require('node:async_hooks');\n\nconst asyncHook = async_hooks.createHook({\n  init(asyncId, type, triggerAsyncId, resource) { },\n  destroy(asyncId) { },\n});\n</code></pre>\n<p>The callbacks will be inherited via the prototype chain:</p>\n<pre><code class=\"language-js\">class MyAsyncCallbacks {\n  init(asyncId, type, triggerAsyncId, resource) { }\n  destroy(asyncId) {}\n}\n\nclass MyAddedCallbacks extends MyAsyncCallbacks {\n  before(asyncId) { }\n  after(asyncId) { }\n}\n\nconst asyncHook = async_hooks.createHook(new MyAddedCallbacks());\n</code></pre>\n<p>Because promises are asynchronous resources whose lifecycle is tracked\nvia the async hooks mechanism, the <code>init()</code>, <code>before()</code>, <code>after()</code>, and\n<code>destroy()</code> callbacks <em>must not</em> be async functions that return promises.</p>",
          "modules": [
            {
              "textRaw": "Error handling",
              "name": "error_handling",
              "type": "module",
              "desc": "<p>If any <code>AsyncHook</code> callbacks throw, the application will print the stack trace\nand exit. The exit path does follow that of an uncaught exception, but\nall <code>'uncaughtException'</code> listeners are removed, thus forcing the process to\nexit. The <code>'exit'</code> callbacks will still be called unless the application is run\nwith <code>--abort-on-uncaught-exception</code>, in which case a stack trace will be\nprinted and the application exits, leaving a core file.</p>\n<p>The reason for this error handling behavior is that these callbacks are running\nat potentially volatile points in an object's lifetime, for example during\nclass construction and destruction. Because of this, it is deemed necessary to\nbring down the process quickly in order to prevent an unintentional abort in the\nfuture. This is subject to change in the future if a comprehensive analysis is\nperformed to ensure an exception can follow the normal control flow without\nunintentional side effects.</p>",
              "displayName": "Error handling"
            },
            {
              "textRaw": "Printing in `AsyncHook` callbacks",
              "name": "printing_in_`asynchook`_callbacks",
              "type": "module",
              "desc": "<p>Because printing to the console is an asynchronous operation, <code>console.log()</code>\nwill cause <code>AsyncHook</code> callbacks to be called. Using <code>console.log()</code> or\nsimilar asynchronous operations inside an <code>AsyncHook</code> callback function will\ncause an infinite recursion. An easy solution to this when debugging is to use a\nsynchronous logging operation such as <code>fs.writeFileSync(file, msg, flag)</code>.\nThis will print to the file and will not invoke <code>AsyncHook</code> recursively because\nit is synchronous.</p>\n<pre><code class=\"language-mjs\">import { writeFileSync } from 'node:fs';\nimport { format } from 'node:util';\n\nfunction debug(...args) {\n  // Use a function like this one when debugging inside an AsyncHook callback\n  writeFileSync('log.out', `${format(...args)}\\n`, { flag: 'a' });\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const fs = require('node:fs');\nconst util = require('node:util');\n\nfunction debug(...args) {\n  // Use a function like this one when debugging inside an AsyncHook callback\n  fs.writeFileSync('log.out', `${util.format(...args)}\\n`, { flag: 'a' });\n}\n</code></pre>\n<p>If an asynchronous operation is needed for logging, it is possible to keep\ntrack of what caused the asynchronous operation using the information\nprovided by <code>AsyncHook</code> itself. The logging should then be skipped when\nit was the logging itself that caused the <code>AsyncHook</code> callback to be called. By\ndoing this, the otherwise infinite recursion is broken.</p>",
              "displayName": "Printing in `AsyncHook` callbacks"
            }
          ]
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `AsyncHook`",
          "name": "AsyncHook",
          "type": "class",
          "desc": "<p>The class <code>AsyncHook</code> exposes an interface for tracking lifetime events\nof asynchronous operations.</p>",
          "methods": [
            {
              "textRaw": "`asyncHook.enable()`",
              "name": "enable",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {AsyncHook} A reference to `asyncHook`.",
                    "name": "return",
                    "type": "AsyncHook",
                    "desc": "A reference to `asyncHook`."
                  }
                }
              ],
              "desc": "<p>Enable the callbacks for a given <code>AsyncHook</code> instance. If no callbacks are\nprovided, enabling is a no-op.</p>\n<p>The <code>AsyncHook</code> instance is disabled by default. If the <code>AsyncHook</code> instance\nshould be enabled immediately after creation, the following pattern can be used.</p>\n<pre><code class=\"language-mjs\">import { createHook } from 'node:async_hooks';\n\nconst hook = createHook(callbacks).enable();\n</code></pre>\n<pre><code class=\"language-cjs\">const async_hooks = require('node:async_hooks');\n\nconst hook = async_hooks.createHook(callbacks).enable();\n</code></pre>"
            },
            {
              "textRaw": "`asyncHook.disable()`",
              "name": "disable",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {AsyncHook} A reference to `asyncHook`.",
                    "name": "return",
                    "type": "AsyncHook",
                    "desc": "A reference to `asyncHook`."
                  }
                }
              ],
              "desc": "<p>Disable the callbacks for a given <code>AsyncHook</code> instance from the global pool of\n<code>AsyncHook</code> callbacks to be executed. Once a hook has been disabled it will not\nbe called again until enabled.</p>\n<p>For API consistency <code>disable()</code> also returns the <code>AsyncHook</code> instance.</p>"
            },
            {
              "textRaw": "`async_hooks.executionAsyncResource()`",
              "name": "executionAsyncResource",
              "type": "method",
              "meta": {
                "added": [
                  "v13.9.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object} The resource representing the current execution. Useful to store data within the resource.",
                    "name": "return",
                    "type": "Object",
                    "desc": "The resource representing the current execution. Useful to store data within the resource."
                  }
                }
              ],
              "desc": "<p>Resource objects returned by <code>executionAsyncResource()</code> are most often internal\nNode.js handle objects with undocumented APIs. Using any functions or properties\non the object is likely to crash your application and should be avoided.</p>\n<p>Using <code>executionAsyncResource()</code> in the top-level execution context will\nreturn an empty object as there is no handle or request object to use,\nbut having an object representing the top-level can be helpful.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs';\nimport { executionAsyncId, executionAsyncResource } from 'node:async_hooks';\n\nconsole.log(executionAsyncId(), executionAsyncResource());  // 1 {}\nopen(new URL(import.meta.url), 'r', (err, fd) => {\n  console.log(executionAsyncId(), executionAsyncResource());  // 7 FSReqWrap\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs');\nconst { executionAsyncId, executionAsyncResource } = require('node:async_hooks');\n\nconsole.log(executionAsyncId(), executionAsyncResource());  // 1 {}\nopen(__filename, 'r', (err, fd) => {\n  console.log(executionAsyncId(), executionAsyncResource());  // 7 FSReqWrap\n});\n</code></pre>\n<p>This can be used to implement continuation local storage without the\nuse of a tracking <code>Map</code> to store the metadata:</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http';\nimport {\n  executionAsyncId,\n  executionAsyncResource,\n  createHook,\n} from 'node:async_hooks';\nconst sym = Symbol('state'); // Private symbol to avoid pollution\n\ncreateHook({\n  init(asyncId, type, triggerAsyncId, resource) {\n    const cr = executionAsyncResource();\n    if (cr) {\n      resource[sym] = cr[sym];\n    }\n  },\n}).enable();\n\nconst server = createServer((req, res) => {\n  executionAsyncResource()[sym] = { state: req.url };\n  setTimeout(function() {\n    res.end(JSON.stringify(executionAsyncResource()[sym]));\n  }, 100);\n}).listen(3000);\n</code></pre>\n<pre><code class=\"language-cjs\">const { createServer } = require('node:http');\nconst {\n  executionAsyncId,\n  executionAsyncResource,\n  createHook,\n} = require('node:async_hooks');\nconst sym = Symbol('state'); // Private symbol to avoid pollution\n\ncreateHook({\n  init(asyncId, type, triggerAsyncId, resource) {\n    const cr = executionAsyncResource();\n    if (cr) {\n      resource[sym] = cr[sym];\n    }\n  },\n}).enable();\n\nconst server = createServer((req, res) => {\n  executionAsyncResource()[sym] = { state: req.url };\n  setTimeout(function() {\n    res.end(JSON.stringify(executionAsyncResource()[sym]));\n  }, 100);\n}).listen(3000);\n</code></pre>"
            },
            {
              "textRaw": "`async_hooks.executionAsyncId()`",
              "name": "executionAsyncId",
              "type": "method",
              "meta": {
                "added": [
                  "v8.1.0"
                ],
                "changes": [
                  {
                    "version": "v8.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13490",
                    "description": "Renamed from `currentId`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} The `asyncId` of the current execution context. Useful to track when something calls.",
                    "name": "return",
                    "type": "number",
                    "desc": "The `asyncId` of the current execution context. Useful to track when something calls."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { executionAsyncId } from 'node:async_hooks';\nimport fs from 'node:fs';\n\nconsole.log(executionAsyncId());  // 1 - bootstrap\nconst path = '.';\nfs.open(path, 'r', (err, fd) => {\n  console.log(executionAsyncId());  // 6 - open()\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const async_hooks = require('node:async_hooks');\nconst fs = require('node:fs');\n\nconsole.log(async_hooks.executionAsyncId());  // 1 - bootstrap\nconst path = '.';\nfs.open(path, 'r', (err, fd) => {\n  console.log(async_hooks.executionAsyncId());  // 6 - open()\n});\n</code></pre>\n<p>The ID returned from <code>executionAsyncId()</code> is related to execution timing, not\ncausality (which is covered by <code>triggerAsyncId()</code>):</p>\n<pre><code class=\"language-js\">const server = net.createServer((conn) => {\n  // Returns the ID of the server, not of the new connection, because the\n  // callback runs in the execution scope of the server's MakeCallback().\n  async_hooks.executionAsyncId();\n\n}).listen(port, () => {\n  // Returns the ID of a TickObject (process.nextTick()) because all\n  // callbacks passed to .listen() are wrapped in a nextTick().\n  async_hooks.executionAsyncId();\n});\n</code></pre>\n<p>Promise contexts may not get precise <code>executionAsyncIds</code> by default.\nSee the section on <a href=\"#promise-execution-tracking\">promise execution tracking</a>.</p>"
            },
            {
              "textRaw": "`async_hooks.triggerAsyncId()`",
              "name": "triggerAsyncId",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} The ID of the resource responsible for calling the callback that is currently being executed.",
                    "name": "return",
                    "type": "number",
                    "desc": "The ID of the resource responsible for calling the callback that is currently being executed."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-js\">const server = net.createServer((conn) => {\n  // The resource that caused (or triggered) this callback to be called\n  // was that of the new connection. Thus the return value of triggerAsyncId()\n  // is the asyncId of \"conn\".\n  async_hooks.triggerAsyncId();\n\n}).listen(port, () => {\n  // Even though all callbacks passed to .listen() are wrapped in a nextTick()\n  // the callback itself exists because the call to the server's .listen()\n  // was made. So the return value would be the ID of the server.\n  async_hooks.triggerAsyncId();\n});\n</code></pre>\n<p>Promise contexts may not get valid <code>triggerAsyncId</code>s by default. See\nthe section on <a href=\"#promise-execution-tracking\">promise execution tracking</a>.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "Hook callbacks",
              "name": "hook_callbacks",
              "type": "module",
              "desc": "<p>Key events in the lifetime of asynchronous events have been categorized into\nfour areas: instantiation, before/after the callback is called, and when the\ninstance is destroyed.</p>",
              "methods": [
                {
                  "textRaw": "`init(asyncId, type, triggerAsyncId, resource)`",
                  "name": "init",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`asyncId` {number} A unique ID for the async resource.",
                          "name": "asyncId",
                          "type": "number",
                          "desc": "A unique ID for the async resource."
                        },
                        {
                          "textRaw": "`type` {string} The type of the async resource.",
                          "name": "type",
                          "type": "string",
                          "desc": "The type of the async resource."
                        },
                        {
                          "textRaw": "`triggerAsyncId` {number} The unique ID of the async resource in whose execution context this async resource was created.",
                          "name": "triggerAsyncId",
                          "type": "number",
                          "desc": "The unique ID of the async resource in whose execution context this async resource was created."
                        },
                        {
                          "textRaw": "`resource` {Object} Reference to the resource representing the async operation, needs to be released during _destroy_.",
                          "name": "resource",
                          "type": "Object",
                          "desc": "Reference to the resource representing the async operation, needs to be released during _destroy_."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when a class is constructed that has the <em>possibility</em> to emit an\nasynchronous event. This <em>does not</em> mean the instance must call\n<code>before</code>/<code>after</code> before <code>destroy</code> is called, only that the possibility\nexists.</p>\n<p>This behavior can be observed by doing something like opening a resource then\nclosing it before the resource can be used. The following snippet demonstrates\nthis.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:net';\n\ncreateServer().listen(function() { this.close(); });\n// OR\nclearTimeout(setTimeout(() => {}, 10));\n</code></pre>\n<pre><code class=\"language-cjs\">require('node:net').createServer().listen(function() { this.close(); });\n// OR\nclearTimeout(setTimeout(() => {}, 10));\n</code></pre>\n<p>Every new resource is assigned an ID that is unique within the scope of the\ncurrent Node.js instance.</p>",
                  "modules": [
                    {
                      "textRaw": "`type`",
                      "name": "`type`",
                      "type": "module",
                      "desc": "<p>The <code>type</code> is a string identifying the type of resource that caused\n<code>init</code> to be called. Generally, it will correspond to the name of the\nresource's constructor.</p>\n<p>The <code>type</code> of resources created by Node.js itself can change in any Node.js\nrelease. Valid values include <code>TLSWRAP</code>,\n<code>TCPWRAP</code>, <code>TCPSERVERWRAP</code>, <code>GETADDRINFOREQWRAP</code>, <code>FSREQCALLBACK</code>,\n<code>Microtask</code>, and <code>Timeout</code>. Inspect the source code of the Node.js version used\nto get the full list.</p>\n<p>Furthermore users of <a href=\"async_context.html#class-asyncresource\"><code>AsyncResource</code></a> create async resources independent\nof Node.js itself.</p>\n<p>There is also the <code>PROMISE</code> resource type, which is used to track <code>Promise</code>\ninstances and asynchronous work scheduled by them. The <code>Promise</code>s are only\ntracked when <code>trackPromises</code> option is set to <code>true</code>.</p>\n<p>Users are able to define their own <code>type</code> when using the public embedder API.</p>\n<p>It is possible to have type name collisions. Embedders are encouraged to use\nunique prefixes, such as the npm package name, to prevent collisions when\nlistening to the hooks.</p>",
                      "displayName": "`type`"
                    },
                    {
                      "textRaw": "`triggerAsyncId`",
                      "name": "`triggerasyncid`",
                      "type": "module",
                      "desc": "<p><code>triggerAsyncId</code> is the <code>asyncId</code> of the resource that caused (or \"triggered\")\nthe new resource to initialize and that caused <code>init</code> to call. This is different\nfrom <code>async_hooks.executionAsyncId()</code> that only shows <em>when</em> a resource was\ncreated, while <code>triggerAsyncId</code> shows <em>why</em> a resource was created.</p>\n<p>The following is a simple demonstration of <code>triggerAsyncId</code>:</p>\n<pre><code class=\"language-mjs\">import { createHook, executionAsyncId } from 'node:async_hooks';\nimport { stdout } from 'node:process';\nimport net from 'node:net';\nimport fs from 'node:fs';\n\ncreateHook({\n  init(asyncId, type, triggerAsyncId) {\n    const eid = executionAsyncId();\n    fs.writeSync(\n      stdout.fd,\n      `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\\n`);\n  },\n}).enable();\n\nnet.createServer((conn) => {}).listen(8080);\n</code></pre>\n<pre><code class=\"language-cjs\">const { createHook, executionAsyncId } = require('node:async_hooks');\nconst { stdout } = require('node:process');\nconst net = require('node:net');\nconst fs = require('node:fs');\n\ncreateHook({\n  init(asyncId, type, triggerAsyncId) {\n    const eid = executionAsyncId();\n    fs.writeSync(\n      stdout.fd,\n      `${type}(${asyncId}): trigger: ${triggerAsyncId} execution: ${eid}\\n`);\n  },\n}).enable();\n\nnet.createServer((conn) => {}).listen(8080);\n</code></pre>\n<p>Output when hitting the server with <code>nc localhost 8080</code>:</p>\n<pre><code class=\"language-console\">TCPSERVERWRAP(5): trigger: 1 execution: 1\nTCPWRAP(7): trigger: 5 execution: 0\n</code></pre>\n<p>The <code>TCPSERVERWRAP</code> is the server which receives the connections.</p>\n<p>The <code>TCPWRAP</code> is the new connection from the client. When a new\nconnection is made, the <code>TCPWrap</code> instance is immediately constructed. This\nhappens outside of any JavaScript stack. (An <code>executionAsyncId()</code> of <code>0</code> means\nthat it is being executed from C++ with no JavaScript stack above it.) With only\nthat information, it would be impossible to link resources together in\nterms of what caused them to be created, so <code>triggerAsyncId</code> is given the task\nof propagating what resource is responsible for the new resource's existence.</p>",
                      "displayName": "`triggerAsyncId`"
                    },
                    {
                      "textRaw": "`resource`",
                      "name": "`resource`",
                      "type": "module",
                      "desc": "<p><code>resource</code> is an object that represents the actual async resource that has\nbeen initialized. The API to access the object may be specified by the\ncreator of the resource. Resources created by Node.js itself are internal\nand may change at any time. Therefore no API is specified for these.</p>\n<p>In some cases the resource object is reused for performance reasons, it is\nthus not safe to use it as a key in a <code>WeakMap</code> or add properties to it.</p>",
                      "displayName": "`resource`"
                    },
                    {
                      "textRaw": "Asynchronous context example",
                      "name": "asynchronous_context_example",
                      "type": "module",
                      "desc": "<p>The context tracking use case is covered by the stable API <a href=\"async_context.html#class-asynclocalstorage\"><code>AsyncLocalStorage</code></a>.\nThis example only illustrates async hooks operation but <a href=\"async_context.html#class-asynclocalstorage\"><code>AsyncLocalStorage</code></a>\nfits better to this use case.</p>\n<p>The following is an example with additional information about the calls to\n<code>init</code> between the <code>before</code> and <code>after</code> calls, specifically what the\ncallback to <code>listen()</code> will look like. The output formatting is slightly more\nelaborate to make calling context easier to see.</p>\n<pre><code class=\"language-mjs\">import async_hooks from 'node:async_hooks';\nimport fs from 'node:fs';\nimport net from 'node:net';\nimport { stdout } from 'node:process';\nconst { fd } = stdout;\n\nlet indent = 0;\nasync_hooks.createHook({\n  init(asyncId, type, triggerAsyncId) {\n    const eid = async_hooks.executionAsyncId();\n    const indentStr = ' '.repeat(indent);\n    fs.writeSync(\n      fd,\n      `${indentStr}${type}(${asyncId}):` +\n      ` trigger: ${triggerAsyncId} execution: ${eid}\\n`);\n  },\n  before(asyncId) {\n    const indentStr = ' '.repeat(indent);\n    fs.writeSync(fd, `${indentStr}before:  ${asyncId}\\n`);\n    indent += 2;\n  },\n  after(asyncId) {\n    indent -= 2;\n    const indentStr = ' '.repeat(indent);\n    fs.writeSync(fd, `${indentStr}after:  ${asyncId}\\n`);\n  },\n  destroy(asyncId) {\n    const indentStr = ' '.repeat(indent);\n    fs.writeSync(fd, `${indentStr}destroy:  ${asyncId}\\n`);\n  },\n}).enable();\n\nnet.createServer(() => {}).listen(8080, () => {\n  // Let's wait 10ms before logging the server started.\n  setTimeout(() => {\n    console.log('>>>', async_hooks.executionAsyncId());\n  }, 10);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const async_hooks = require('node:async_hooks');\nconst fs = require('node:fs');\nconst net = require('node:net');\nconst { fd } = process.stdout;\n\nlet indent = 0;\nasync_hooks.createHook({\n  init(asyncId, type, triggerAsyncId) {\n    const eid = async_hooks.executionAsyncId();\n    const indentStr = ' '.repeat(indent);\n    fs.writeSync(\n      fd,\n      `${indentStr}${type}(${asyncId}):` +\n      ` trigger: ${triggerAsyncId} execution: ${eid}\\n`);\n  },\n  before(asyncId) {\n    const indentStr = ' '.repeat(indent);\n    fs.writeSync(fd, `${indentStr}before:  ${asyncId}\\n`);\n    indent += 2;\n  },\n  after(asyncId) {\n    indent -= 2;\n    const indentStr = ' '.repeat(indent);\n    fs.writeSync(fd, `${indentStr}after:  ${asyncId}\\n`);\n  },\n  destroy(asyncId) {\n    const indentStr = ' '.repeat(indent);\n    fs.writeSync(fd, `${indentStr}destroy:  ${asyncId}\\n`);\n  },\n}).enable();\n\nnet.createServer(() => {}).listen(8080, () => {\n  // Let's wait 10ms before logging the server started.\n  setTimeout(() => {\n    console.log('>>>', async_hooks.executionAsyncId());\n  }, 10);\n});\n</code></pre>\n<p>Output from only starting the server:</p>\n<pre><code class=\"language-console\">TCPSERVERWRAP(5): trigger: 1 execution: 1\nTickObject(6): trigger: 5 execution: 1\nbefore:  6\n  Timeout(7): trigger: 6 execution: 6\nafter:   6\ndestroy: 6\nbefore:  7\n>>> 7\n  TickObject(8): trigger: 7 execution: 7\nafter:   7\nbefore:  8\nafter:   8\n</code></pre>\n<p>As illustrated in the example, <code>executionAsyncId()</code> and <code>execution</code> each specify\nthe value of the current execution context; which is delineated by calls to\n<code>before</code> and <code>after</code>.</p>\n<p>Only using <code>execution</code> to graph resource allocation results in the following:</p>\n<pre><code class=\"language-console\">  root(1)\n     ^\n     |\nTickObject(6)\n     ^\n     |\n Timeout(7)\n</code></pre>\n<p>The <code>TCPSERVERWRAP</code> is not part of this graph, even though it was the reason for\n<code>console.log()</code> being called. This is because binding to a port without a host\nname is a <em>synchronous</em> operation, but to maintain a completely asynchronous\nAPI the user's callback is placed in a <code>process.nextTick()</code>. Which is why\n<code>TickObject</code> is present in the output and is a 'parent' for <code>.listen()</code>\ncallback.</p>\n<p>The graph only shows <em>when</em> a resource was created, not <em>why</em>, so to track\nthe <em>why</em> use <code>triggerAsyncId</code>. Which can be represented with the following\ngraph:</p>\n<pre><code class=\"language-console\"> bootstrap(1)\n     |\n     ˅\nTCPSERVERWRAP(5)\n     |\n     ˅\n TickObject(6)\n     |\n     ˅\n  Timeout(7)\n</code></pre>",
                      "displayName": "Asynchronous context example"
                    }
                  ]
                },
                {
                  "textRaw": "`before(asyncId)`",
                  "name": "before",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`asyncId` {number}",
                          "name": "asyncId",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>When an asynchronous operation is initiated (such as a TCP server receiving a\nnew connection) or completes (such as writing data to disk) a callback is\ncalled to notify the user. The <code>before</code> callback is called just before said\ncallback is executed. <code>asyncId</code> is the unique identifier assigned to the\nresource about to execute the callback.</p>\n<p>The <code>before</code> callback will be called 0 to N times. The <code>before</code> callback\nwill typically be called 0 times if the asynchronous operation was cancelled\nor, for example, if no connections are received by a TCP server. Persistent\nasynchronous resources like a TCP server will typically call the <code>before</code>\ncallback multiple times, while other operations like <code>fs.open()</code> will call\nit only once.</p>"
                },
                {
                  "textRaw": "`after(asyncId)`",
                  "name": "after",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`asyncId` {number}",
                          "name": "asyncId",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called immediately after the callback specified in <code>before</code> is completed.</p>\n<p>If an uncaught exception occurs during execution of the callback, then <code>after</code>\nwill run <em>after</em> the <code>'uncaughtException'</code> event is emitted or a <code>domain</code>'s\nhandler runs.</p>"
                },
                {
                  "textRaw": "`destroy(asyncId)`",
                  "name": "destroy",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`asyncId` {number}",
                          "name": "asyncId",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called after the resource corresponding to <code>asyncId</code> is destroyed. It is also\ncalled asynchronously from the embedder API <code>emitDestroy()</code>.</p>\n<p>Some resources depend on garbage collection for cleanup, so if a reference is\nmade to the <code>resource</code> object passed to <code>init</code> it is possible that <code>destroy</code>\nwill never be called, causing a memory leak in the application. If the resource\ndoes not depend on garbage collection, then this will not be an issue.</p>\n<p>Using the destroy hook results in additional overhead because it enables\ntracking of <code>Promise</code> instances via the garbage collector.</p>"
                },
                {
                  "textRaw": "`promiseResolve(asyncId)`",
                  "name": "promiseResolve",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.6.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`asyncId` {number}",
                          "name": "asyncId",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when the <code>resolve</code> function passed to the <code>Promise</code> constructor is\ninvoked (either directly or through other means of resolving a promise).</p>\n<p><code>resolve()</code> does not do any observable synchronous work.</p>\n<p>The <code>Promise</code> is not necessarily fulfilled or rejected at this point if the\n<code>Promise</code> was resolved by assuming the state of another <code>Promise</code>.</p>\n<pre><code class=\"language-js\">new Promise((resolve) => resolve(true)).then((a) => {});\n</code></pre>\n<p>calls the following callbacks:</p>\n<pre><code class=\"language-text\">init for PROMISE with id 5, trigger id: 1\n  promise resolve 5      # corresponds to resolve(true)\ninit for PROMISE with id 6, trigger id: 5  # the Promise returned by then()\n  before 6               # the then() callback is entered\n  promise resolve 6      # the then() callback resolves the promise by returning\n  after 6\n</code></pre>"
                }
              ],
              "displayName": "Hook callbacks"
            }
          ],
          "properties": [
            {
              "textRaw": "Returns: A map of provider types to the corresponding numeric id. This map contains all the event types that might be emitted by the `async_hooks.init()` event.",
              "name": "asyncWrapProviders",
              "type": "property",
              "meta": {
                "added": [
                  "v17.2.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>This feature suppresses the deprecated usage of <code>process.binding('async_wrap').Providers</code>.\nSee: <a href=\"deprecations.html#dep0111-processbinding\">DEP0111</a></p>",
              "shortDesc": "A map of provider types to the corresponding numeric id. This map contains all the event types that might be emitted by the `async_hooks.init()` event."
            }
          ]
        },
        {
          "textRaw": "Class: `AsyncLocalStorage`",
          "name": "AsyncLocalStorage",
          "type": "class",
          "desc": "<p>The documentation for this class has moved <a href=\"async_context.html#class-asynclocalstorage\"><code>AsyncLocalStorage</code></a>.</p>"
        }
      ],
      "displayName": "Async hooks",
      "source": "doc/api/async_hooks.md"
    },
    {
      "textRaw": "Buffer",
      "name": "buffer",
      "introduced_in": "v0.1.90",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p><code>Buffer</code> objects are used to represent a fixed-length sequence of bytes. Many\nNode.js APIs support <code>Buffer</code>s.</p>\n<p>The <code>Buffer</code> class is a subclass of JavaScript's <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a> class and\nextends it with methods that cover additional use cases. Node.js APIs accept\nplain <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a>s wherever <code>Buffer</code>s are supported as well.</p>\n<p>While the <code>Buffer</code> class is available within the global scope, it is still\nrecommended to explicitly reference it via an import or require statement.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Creates a zero-filled Buffer of length 10.\nconst buf1 = Buffer.alloc(10);\n\n// Creates a Buffer of length 10,\n// filled with bytes which all have the value `1`.\nconst buf2 = Buffer.alloc(10, 1);\n\n// Creates an uninitialized buffer of length 10.\n// This is faster than calling Buffer.alloc() but the returned\n// Buffer instance might contain old data that needs to be\n// overwritten using fill(), write(), or other functions that fill the Buffer's\n// contents.\nconst buf3 = Buffer.allocUnsafe(10);\n\n// Creates a Buffer containing the bytes [1, 2, 3].\nconst buf4 = Buffer.from([1, 2, 3]);\n\n// Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries\n// are all truncated using `(value &#x26; 255)` to fit into the range 0–255.\nconst buf5 = Buffer.from([257, 257.5, -255, '1']);\n\n// Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':\n// [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)\n// [116, 195, 169, 115, 116] (in decimal notation)\nconst buf6 = Buffer.from('tést');\n\n// Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].\nconst buf7 = Buffer.from('tést', 'latin1');\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Creates a zero-filled Buffer of length 10.\nconst buf1 = Buffer.alloc(10);\n\n// Creates a Buffer of length 10,\n// filled with bytes which all have the value `1`.\nconst buf2 = Buffer.alloc(10, 1);\n\n// Creates an uninitialized buffer of length 10.\n// This is faster than calling Buffer.alloc() but the returned\n// Buffer instance might contain old data that needs to be\n// overwritten using fill(), write(), or other functions that fill the Buffer's\n// contents.\nconst buf3 = Buffer.allocUnsafe(10);\n\n// Creates a Buffer containing the bytes [1, 2, 3].\nconst buf4 = Buffer.from([1, 2, 3]);\n\n// Creates a Buffer containing the bytes [1, 1, 1, 1] – the entries\n// are all truncated using `(value &#x26; 255)` to fit into the range 0–255.\nconst buf5 = Buffer.from([257, 257.5, -255, '1']);\n\n// Creates a Buffer containing the UTF-8-encoded bytes for the string 'tést':\n// [0x74, 0xc3, 0xa9, 0x73, 0x74] (in hexadecimal notation)\n// [116, 195, 169, 115, 116] (in decimal notation)\nconst buf6 = Buffer.from('tést');\n\n// Creates a Buffer containing the Latin-1 bytes [0x74, 0xe9, 0x73, 0x74].\nconst buf7 = Buffer.from('tést', 'latin1');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Buffers and character encodings",
          "name": "buffers_and_character_encodings",
          "type": "module",
          "meta": {
            "changes": [
              {
                "version": [
                  "v15.7.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/36952",
                "description": "Introduced `base64url` encoding."
              },
              {
                "version": "v6.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/7111",
                "description": "Introduced `latin1` as an alias for `binary`."
              },
              {
                "version": "v5.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/2859",
                "description": "Removed the deprecated `raw` and `raws` encodings."
              }
            ]
          },
          "desc": "<p>When converting between <code>Buffer</code>s and strings, a character encoding may be\nspecified. If no character encoding is specified, UTF-8 will be used as the\ndefault.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('hello world', 'utf8');\n\nconsole.log(buf.toString('hex'));\n// Prints: 68656c6c6f20776f726c64\nconsole.log(buf.toString('base64'));\n// Prints: aGVsbG8gd29ybGQ=\n\nconsole.log(Buffer.from('fhqwhgads', 'utf8'));\n// Prints: &#x3C;Buffer 66 68 71 77 68 67 61 64 73>\nconsole.log(Buffer.from('fhqwhgads', 'utf16le'));\n// Prints: &#x3C;Buffer 66 00 68 00 71 00 77 00 68 00 67 00 61 00 64 00 73 00>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('hello world', 'utf8');\n\nconsole.log(buf.toString('hex'));\n// Prints: 68656c6c6f20776f726c64\nconsole.log(buf.toString('base64'));\n// Prints: aGVsbG8gd29ybGQ=\n\nconsole.log(Buffer.from('fhqwhgads', 'utf8'));\n// Prints: &#x3C;Buffer 66 68 71 77 68 67 61 64 73>\nconsole.log(Buffer.from('fhqwhgads', 'utf16le'));\n// Prints: &#x3C;Buffer 66 00 68 00 71 00 77 00 68 00 67 00 61 00 64 00 73 00>\n</code></pre>\n<p>Node.js buffers accept all case variations of encoding strings that they\nreceive. For example, UTF-8 can be specified as <code>'utf8'</code>, <code>'UTF8'</code>, or <code>'uTf8'</code>.</p>\n<p>The character encodings currently supported by Node.js are the following:</p>\n<ul>\n<li>\n<p><code>'utf8'</code> (alias: <code>'utf-8'</code>): Multi-byte encoded Unicode characters. Many web\npages and other document formats use <a href=\"https://en.wikipedia.org/wiki/UTF-8\">UTF-8</a>. This is the default character\nencoding. When decoding a <code>Buffer</code> into a string that does not exclusively\ncontain valid UTF-8 data, the Unicode replacement character <code>U+FFFD</code> � will be\nused to represent those errors.</p>\n</li>\n<li>\n<p><code>'utf16le'</code> (alias: <code>'utf-16le'</code>): Multi-byte encoded Unicode characters.\nUnlike <code>'utf8'</code>, each character in the string will be encoded using either 2\nor 4 bytes. Node.js only supports the <a href=\"https://en.wikipedia.org/wiki/Endianness\">little-endian</a> variant of\n<a href=\"https://en.wikipedia.org/wiki/UTF-16\">UTF-16</a>.</p>\n</li>\n<li>\n<p><code>'latin1'</code>: Latin-1 stands for <a href=\"https://en.wikipedia.org/wiki/ISO-8859-1\">ISO-8859-1</a>. This character encoding only\nsupports the Unicode characters from <code>U+0000</code> to <code>U+00FF</code>. Each character is\nencoded using a single byte. Characters that do not fit into that range are\ntruncated and will be mapped to characters in that range.</p>\n</li>\n</ul>\n<p>Converting a <code>Buffer</code> into a string using one of the above is referred to as\ndecoding, and converting a string into a <code>Buffer</code> is referred to as encoding.</p>\n<p>Node.js also supports the following binary-to-text encodings. For\nbinary-to-text encodings, the naming convention is reversed: Converting a\n<code>Buffer</code> into a string is typically referred to as encoding, and converting a\nstring into a <code>Buffer</code> as decoding.</p>\n<ul>\n<li>\n<p><code>'base64'</code>: <a href=\"https://en.wikipedia.org/wiki/Base64\">Base64</a> encoding. When creating a <code>Buffer</code> from a string,\nthis encoding will also correctly accept \"URL and Filename Safe Alphabet\" as\nspecified in <a href=\"https://tools.ietf.org/html/rfc4648#section-5\">RFC 4648, Section 5</a>. Whitespace characters such as spaces,\ntabs, and new lines contained within the base64-encoded string are ignored.</p>\n</li>\n<li>\n<p><code>'base64url'</code>: <a href=\"https://tools.ietf.org/html/rfc4648#section-5\">base64url</a> encoding as specified in\n<a href=\"https://tools.ietf.org/html/rfc4648#section-5\">RFC 4648, Section 5</a>. When creating a <code>Buffer</code> from a string, this\nencoding will also correctly accept regular base64-encoded strings. When\nencoding a <code>Buffer</code> to a string, this encoding will omit padding.</p>\n</li>\n<li>\n<p><code>'hex'</code>: Encode each byte as two hexadecimal characters. Data truncation\nmay occur when decoding strings that do not exclusively consist of an even\nnumber of hexadecimal characters. See below for an example.</p>\n</li>\n</ul>\n<p>The following legacy character encodings are also supported:</p>\n<ul>\n<li>\n<p><code>'ascii'</code>: For 7-bit <a href=\"https://en.wikipedia.org/wiki/ASCII\">ASCII</a> data only. When encoding a string into a\n<code>Buffer</code>, this is equivalent to using <code>'latin1'</code>. When decoding a <code>Buffer</code>\ninto a string, using this encoding will additionally unset the highest bit of\neach byte before decoding as <code>'latin1'</code>.\nGenerally, there should be no reason to use this encoding, as <code>'utf8'</code>\n(or, if the data is known to always be ASCII-only, <code>'latin1'</code>) will be a\nbetter choice when encoding or decoding ASCII-only text. It is only provided\nfor legacy compatibility.</p>\n</li>\n<li>\n<p><code>'binary'</code>: Alias for <code>'latin1'</code>.\nThe name of this encoding can be very misleading, as all of the\nencodings listed here convert between strings and binary data. For converting\nbetween strings and <code>Buffer</code>s, typically <code>'utf8'</code> is the right choice.</p>\n</li>\n<li>\n<p><code>'ucs2'</code>, <code>'ucs-2'</code>: Aliases of <code>'utf16le'</code>. UCS-2 used to refer to a variant\nof UTF-16 that did not support characters that had code points larger than\nU+FFFF. In Node.js, these code points are always supported.</p>\n</li>\n</ul>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nBuffer.from('1ag123', 'hex');\n// Prints &#x3C;Buffer 1a>, data truncated when first non-hexadecimal value\n// ('g') encountered.\n\nBuffer.from('1a7', 'hex');\n// Prints &#x3C;Buffer 1a>, data truncated when data ends in single digit ('7').\n\nBuffer.from('1634', 'hex');\n// Prints &#x3C;Buffer 16 34>, all data represented.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nBuffer.from('1ag123', 'hex');\n// Prints &#x3C;Buffer 1a>, data truncated when first non-hexadecimal value\n// ('g') encountered.\n\nBuffer.from('1a7', 'hex');\n// Prints &#x3C;Buffer 1a>, data truncated when data ends in single digit ('7').\n\nBuffer.from('1634', 'hex');\n// Prints &#x3C;Buffer 16 34>, all data represented.\n</code></pre>\n<p>Modern Web browsers follow the <a href=\"https://encoding.spec.whatwg.org/\">WHATWG Encoding Standard</a> which aliases\nboth <code>'latin1'</code> and <code>'ISO-8859-1'</code> to <code>'win-1252'</code>. This means that while doing\nsomething like <code>http.get()</code>, if the returned charset is one of those listed in\nthe WHATWG specification it is possible that the server actually returned\n<code>'win-1252'</code>-encoded data, and using <code>'latin1'</code> encoding may incorrectly decode\nthe characters.</p>",
          "displayName": "Buffers and character encodings"
        },
        {
          "textRaw": "Buffers and TypedArrays",
          "name": "buffers_and_typedarrays",
          "type": "module",
          "meta": {
            "changes": [
              {
                "version": "v3.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/2002",
                "description": "The `Buffer` class now inherits from `Uint8Array`."
              }
            ]
          },
          "desc": "<p><code>Buffer</code> instances are also JavaScript <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a> and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>\ninstances. All <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> methods and properties are available on <code>Buffer</code>s. There are,\nhowever, subtle incompatibilities between the <code>Buffer</code> API and the\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> API.</p>\n<p>In particular:</p>\n<ul>\n<li>While <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice\"><code>TypedArray.prototype.slice()</code></a> creates a copy of part of the <code>TypedArray</code>,\n<a href=\"#bufslicestart-end\"><code>Buffer.prototype.slice()</code></a> creates a view over the existing <code>Buffer</code>\nwithout copying. This behavior can be surprising, and only exists for legacy\ncompatibility. <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray\"><code>TypedArray.prototype.subarray()</code></a> can be used to achieve\nthe behavior of <a href=\"#bufslicestart-end\"><code>Buffer.prototype.slice()</code></a> on both <code>Buffer</code>s\nand other <code>TypedArray</code>s and should be preferred.</li>\n<li><a href=\"#buftostringencoding-start-end\"><code>buf.toString()</code></a> is incompatible with its <code>TypedArray</code> equivalent.</li>\n<li>A number of methods, e.g. <a href=\"#bufindexofvalue-byteoffset-encoding\"><code>buf.indexOf()</code></a>, support additional arguments.</li>\n</ul>\n<p>There are two ways to create new <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> instances from a <code>Buffer</code>:</p>\n<ul>\n<li>Passing a <code>Buffer</code> to a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> constructor will copy the <code>Buffer</code>'s\ncontents, interpreted as an array of integers, and not as a byte sequence\nof the target type.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([1, 2, 3, 4]);\nconst uint32array = new Uint32Array(buf);\n\nconsole.log(uint32array);\n\n// Prints: Uint32Array(4) [ 1, 2, 3, 4 ]\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([1, 2, 3, 4]);\nconst uint32array = new Uint32Array(buf);\n\nconsole.log(uint32array);\n\n// Prints: Uint32Array(4) [ 1, 2, 3, 4 ]\n</code></pre>\n<ul>\n<li>Passing the <code>Buffer</code>'s underlying <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> will create a\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> that shares its memory with the <code>Buffer</code>.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('hello', 'utf16le');\nconst uint16array = new Uint16Array(\n  buf.buffer,\n  buf.byteOffset,\n  buf.length / Uint16Array.BYTES_PER_ELEMENT);\n\nconsole.log(uint16array);\n\n// Prints: Uint16Array(5) [ 104, 101, 108, 108, 111 ]\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('hello', 'utf16le');\nconst uint16array = new Uint16Array(\n  buf.buffer,\n  buf.byteOffset,\n  buf.length / Uint16Array.BYTES_PER_ELEMENT);\n\nconsole.log(uint16array);\n\n// Prints: Uint16Array(5) [ 104, 101, 108, 108, 111 ]\n</code></pre>\n<p>It is possible to create a new <code>Buffer</code> that shares the same allocated\nmemory as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> instance by using the <code>TypedArray</code> object's\n<code>.buffer</code> property in the same way. <a href=\"#static-method-bufferfromarraybuffer-byteoffset-length\"><code>Buffer.from()</code></a>\nbehaves like <code>new Uint8Array()</code> in this context.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst arr = new Uint16Array(2);\n\narr[0] = 5000;\narr[1] = 4000;\n\n// Copies the contents of `arr`.\nconst buf1 = Buffer.from(arr);\n\n// Shares memory with `arr`.\nconst buf2 = Buffer.from(arr.buffer);\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 88 a0>\nconsole.log(buf2);\n// Prints: &#x3C;Buffer 88 13 a0 0f>\n\narr[1] = 6000;\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 88 a0>\nconsole.log(buf2);\n// Prints: &#x3C;Buffer 88 13 70 17>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst arr = new Uint16Array(2);\n\narr[0] = 5000;\narr[1] = 4000;\n\n// Copies the contents of `arr`.\nconst buf1 = Buffer.from(arr);\n\n// Shares memory with `arr`.\nconst buf2 = Buffer.from(arr.buffer);\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 88 a0>\nconsole.log(buf2);\n// Prints: &#x3C;Buffer 88 13 a0 0f>\n\narr[1] = 6000;\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 88 a0>\nconsole.log(buf2);\n// Prints: &#x3C;Buffer 88 13 70 17>\n</code></pre>\n<p>When creating a <code>Buffer</code> using a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>'s <code>.buffer</code>, it is\npossible to use only a portion of the underlying <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> by passing in <code>byteOffset</code> and <code>length</code> parameters.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst arr = new Uint16Array(20);\nconst buf = Buffer.from(arr.buffer, 0, 16);\n\nconsole.log(buf.length);\n// Prints: 16\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst arr = new Uint16Array(20);\nconst buf = Buffer.from(arr.buffer, 0, 16);\n\nconsole.log(buf.length);\n// Prints: 16\n</code></pre>\n<p>The <code>Buffer.from()</code> and <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from\"><code>TypedArray.from()</code></a> have different signatures and\nimplementations. Specifically, the <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> variants accept a second\nargument that is a mapping function that is invoked on every element of the\ntyped array:</p>\n<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from\"><code>TypedArray.from(source[, mapFn[, thisArg]])</code></a></li>\n</ul>\n<p>The <code>Buffer.from()</code> method, however, does not support the use of a mapping\nfunction:</p>\n<ul>\n<li><a href=\"#static-method-bufferfromarray\"><code>Buffer.from(array)</code></a></li>\n<li><a href=\"#static-method-bufferfrombuffer\"><code>Buffer.from(buffer)</code></a></li>\n<li><a href=\"#static-method-bufferfromarraybuffer-byteoffset-length\"><code>Buffer.from(arrayBuffer[, byteOffset[, length]])</code></a></li>\n<li><a href=\"#static-method-bufferfromstring-encoding\"><code>Buffer.from(string[, encoding])</code></a></li>\n</ul>",
          "modules": [
            {
              "textRaw": "Buffer methods are callable with `Uint8Array` instances",
              "name": "buffer_methods_are_callable_with_`uint8array`_instances",
              "type": "module",
              "desc": "<p>All methods on the Buffer prototype are callable with a <code>Uint8Array</code> instance.</p>\n<pre><code class=\"language-js\">const { toString, write } = Buffer.prototype;\n\nconst uint8array = new Uint8Array(5);\n\nwrite.call(uint8array, 'hello', 0, 5, 'utf8'); // 5\n// &#x3C;Uint8Array 68 65 6c 6c 6f>\n\ntoString.call(uint8array, 'utf8'); // 'hello'\n</code></pre>",
              "displayName": "Buffer methods are callable with `Uint8Array` instances"
            }
          ],
          "displayName": "Buffers and TypedArrays"
        },
        {
          "textRaw": "Buffers and iteration",
          "name": "buffers_and_iteration",
          "type": "module",
          "desc": "<p><code>Buffer</code> instances can be iterated over using <code>for..of</code> syntax:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([1, 2, 3]);\n\nfor (const b of buf) {\n  console.log(b);\n}\n// Prints:\n//   1\n//   2\n//   3\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([1, 2, 3]);\n\nfor (const b of buf) {\n  console.log(b);\n}\n// Prints:\n//   1\n//   2\n//   3\n</code></pre>\n<p>Additionally, the <a href=\"#bufvalues\"><code>buf.values()</code></a>, <a href=\"#bufkeys\"><code>buf.keys()</code></a>, and\n<a href=\"#bufentries\"><code>buf.entries()</code></a> methods can be used to create iterators.</p>",
          "displayName": "Buffers and iteration"
        },
        {
          "textRaw": "`node:buffer` module APIs",
          "name": "`node:buffer`_module_apis",
          "type": "module",
          "desc": "<p>While, the <code>Buffer</code> object is available as a global, there are additional\n<code>Buffer</code>-related APIs that are available only via the <code>node:buffer</code> module\naccessed using <code>require('node:buffer')</code>.</p>",
          "methods": [
            {
              "textRaw": "`buffer.atob(data)`",
              "name": "atob",
              "type": "method",
              "meta": {
                "added": [
                  "v15.13.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "stability": 3,
              "stabilityText": "Legacy. Use `Buffer.from(data, 'base64')` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any} The Base64-encoded input string.",
                      "name": "data",
                      "type": "any",
                      "desc": "The Base64-encoded input string."
                    }
                  ]
                }
              ],
              "desc": "<p>Decodes a string of Base64-encoded data into bytes, and encodes those bytes\ninto a string using Latin-1 (ISO-8859-1).</p>\n<p>The <code>data</code> may be any JavaScript-value that can be coerced into a string.</p>\n<p><strong>This function is only provided for compatibility with legacy web platform APIs\nand should never be used in new code, because they use strings to represent\nbinary data and predate the introduction of typed arrays in JavaScript.\nFor code running using Node.js APIs, converting between base64-encoded strings\nand binary data should be performed using <code>Buffer.from(str, 'base64')</code> and\n<code>buf.toString('base64')</code>.</strong></p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>:</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>"
            },
            {
              "textRaw": "`buffer.btoa(data)`",
              "name": "btoa",
              "type": "method",
              "meta": {
                "added": [
                  "v15.13.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "stability": 3,
              "stabilityText": "Legacy. Use `buf.toString('base64')` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any} An ASCII (Latin1) string.",
                      "name": "data",
                      "type": "any",
                      "desc": "An ASCII (Latin1) string."
                    }
                  ]
                }
              ],
              "desc": "<p>Decodes a string into bytes using Latin-1 (ISO-8859), and encodes those bytes\ninto a string using Base64.</p>\n<p>The <code>data</code> may be any JavaScript-value that can be coerced into a string.</p>\n<p><strong>This function is only provided for compatibility with legacy web platform APIs\nand should never be used in new code, because they use strings to represent\nbinary data and predate the introduction of typed arrays in JavaScript.\nFor code running using Node.js APIs, converting between base64-encoded strings\nand binary data should be performed using <code>Buffer.from(str, 'base64')</code> and\n<code>buf.toString('base64')</code>.</strong></p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>:</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>"
            },
            {
              "textRaw": "`buffer.isAscii(input)`",
              "name": "isAscii",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {Buffer|ArrayBuffer|TypedArray} The input to validate.",
                      "name": "input",
                      "type": "Buffer|ArrayBuffer|TypedArray",
                      "desc": "The input to validate."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>This function returns <code>true</code> if <code>input</code> contains only valid ASCII-encoded data,\nincluding the case in which <code>input</code> is empty.</p>\n<p>Throws if the <code>input</code> is a detached array buffer.</p>"
            },
            {
              "textRaw": "`buffer.isUtf8(input)`",
              "name": "isUtf8",
              "type": "method",
              "meta": {
                "added": [
                  "v19.4.0",
                  "v18.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {Buffer|ArrayBuffer|TypedArray} The input to validate.",
                      "name": "input",
                      "type": "Buffer|ArrayBuffer|TypedArray",
                      "desc": "The input to validate."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>This function returns <code>true</code> if <code>input</code> contains only valid UTF-8-encoded data,\nincluding the case in which <code>input</code> is empty.</p>\n<p>Throws if the <code>input</code> is a detached array buffer.</p>"
            },
            {
              "textRaw": "`buffer.resolveObjectURL(id)`",
              "name": "resolveObjectURL",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`id` {string} A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.",
                      "name": "id",
                      "type": "string",
                      "desc": "A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Blob}",
                    "name": "return",
                    "type": "Blob"
                  }
                }
              ],
              "desc": "<p>Resolves a <code>'blob:nodedata:...'</code> an associated <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> object registered using\na prior call to <code>URL.createObjectURL()</code>.</p>"
            },
            {
              "textRaw": "`buffer.transcode(source, fromEnc, toEnc)`",
              "name": "transcode",
              "type": "method",
              "meta": {
                "added": [
                  "v7.1.0"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10236",
                    "description": "The `source` parameter can now be a `Uint8Array`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`source` {Buffer|Uint8Array} A `Buffer` or `Uint8Array` instance.",
                      "name": "source",
                      "type": "Buffer|Uint8Array",
                      "desc": "A `Buffer` or `Uint8Array` instance."
                    },
                    {
                      "textRaw": "`fromEnc` {string} The current encoding.",
                      "name": "fromEnc",
                      "type": "string",
                      "desc": "The current encoding."
                    },
                    {
                      "textRaw": "`toEnc` {string} To target encoding.",
                      "name": "toEnc",
                      "type": "string",
                      "desc": "To target encoding."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Re-encodes the given <code>Buffer</code> or <code>Uint8Array</code> instance from one character\nencoding to another. Returns a new <code>Buffer</code> instance.</p>\n<p>Throws if the <code>fromEnc</code> or <code>toEnc</code> specify invalid character encodings or if\nconversion from <code>fromEnc</code> to <code>toEnc</code> is not permitted.</p>\n<p>Encodings supported by <code>buffer.transcode()</code> are: <code>'ascii'</code>, <code>'utf8'</code>,\n<code>'utf16le'</code>, <code>'ucs2'</code>, <code>'latin1'</code>, and <code>'binary'</code>.</p>\n<p>The transcoding process will use substitution characters if a given byte\nsequence cannot be adequately represented in the target encoding. For instance:</p>\n<pre><code class=\"language-mjs\">import { Buffer, transcode } from 'node:buffer';\n\nconst newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');\nconsole.log(newBuf.toString('ascii'));\n// Prints: '?'\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer, transcode } = require('node:buffer');\n\nconst newBuf = transcode(Buffer.from('€'), 'utf8', 'ascii');\nconsole.log(newBuf.toString('ascii'));\n// Prints: '?'\n</code></pre>\n<p>Because the Euro (<code>€</code>) sign is not representable in US-ASCII, it is replaced\nwith <code>?</code> in the transcoded <code>Buffer</code>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {integer} **Default:** `50`",
              "name": "INSPECT_MAX_BYTES",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.5.4"
                ],
                "changes": []
              },
              "default": "`50`",
              "desc": "<p>Returns the maximum number of bytes that will be returned when\n<code>buf.inspect()</code> is called. This can be overridden by user modules. See\n<a href=\"util.html#utilinspectobject-options\"><code>util.inspect()</code></a> for more details on <code>buf.inspect()</code> behavior.</p>"
            },
            {
              "textRaw": "Type: {integer} The largest size allowed for a single `Buffer` instance.",
              "name": "kMaxLength",
              "type": "integer",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An alias for <a href=\"#bufferconstantsmax_length\"><code>buffer.constants.MAX_LENGTH</code></a>.</p>",
              "shortDesc": "The largest size allowed for a single `Buffer` instance."
            },
            {
              "textRaw": "Type: {integer} The largest length allowed for a single `string` instance.",
              "name": "kStringMaxLength",
              "type": "integer",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An alias for <a href=\"#bufferconstantsmax_string_length\"><code>buffer.constants.MAX_STRING_LENGTH</code></a>.</p>",
              "shortDesc": "The largest length allowed for a single `string` instance."
            }
          ],
          "modules": [
            {
              "textRaw": "Buffer constants",
              "name": "buffer_constants",
              "type": "module",
              "meta": {
                "added": [
                  "v8.2.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {integer} The largest size allowed for a single `Buffer` instance.",
                  "name": "MAX_LENGTH",
                  "type": "integer",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "changes": [
                      {
                        "version": "v22.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/52465",
                        "description": "Value is changed to 2<sup>53</sup> - 1 on 64-bit architectures, and 2<sup>31</sup> - 1 on 32-bit architectures."
                      },
                      {
                        "version": "v15.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/35415",
                        "description": "Value is changed to 2<sup>32</sup> on 64-bit architectures."
                      },
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/32116",
                        "description": "Value is changed from 2<sup>31</sup> - 1 to 2<sup>32</sup> - 1 on 64-bit architectures."
                      }
                    ]
                  },
                  "desc": "<p>On 32-bit architectures, this value is equal to 2<sup>31</sup> - 1 (about 2\nGiB).</p>\n<p>On 64-bit architectures, this value is equal to <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>\n(2<sup>53</sup> - 1, about 8 PiB).</p>\n<p>It reflects <a href=\"https://v8.github.io/api/head/classv8_1_1Uint8Array.html#a7677e3d0c9c92e4d40bef7212f5980c6\"><code>v8::Uint8Array::kMaxLength</code></a> under the hood.</p>\n<p>This value is also available as <a href=\"#bufferkmaxlength\"><code>buffer.kMaxLength</code></a>.</p>",
                  "shortDesc": "The largest size allowed for a single `Buffer` instance."
                },
                {
                  "textRaw": "Type: {integer} The largest length allowed for a single `string` instance.",
                  "name": "MAX_STRING_LENGTH",
                  "type": "integer",
                  "meta": {
                    "added": [
                      "v8.2.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Represents the largest <code>length</code> that a <code>string</code> primitive can have, counted\nin UTF-16 code units.</p>\n<p>This value may depend on the JS engine that is being used.</p>",
                  "shortDesc": "The largest length allowed for a single `string` instance."
                }
              ],
              "displayName": "Buffer constants"
            }
          ],
          "displayName": "`node:buffer` module APIs"
        },
        {
          "textRaw": "`Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()`",
          "name": "`buffer.from()`,_`buffer.alloc()`,_and_`buffer.allocunsafe()`",
          "type": "module",
          "desc": "<p>In versions of Node.js prior to 6.0.0, <code>Buffer</code> instances were created using the\n<code>Buffer</code> constructor function, which allocates the returned <code>Buffer</code>\ndifferently based on what arguments are provided:</p>\n<ul>\n<li>Passing a number as the first argument to <code>Buffer()</code> (e.g. <code>new Buffer(10)</code>)\nallocates a new <code>Buffer</code> object of the specified size. Prior to Node.js 8.0.0,\nthe memory allocated for such <code>Buffer</code> instances is <em>not</em> initialized and\n<em>can contain sensitive data</em>. Such <code>Buffer</code> instances <em>must</em> be subsequently\ninitialized by using either <a href=\"#buffillvalue-offset-end-encoding\"><code>buf.fill(0)</code></a> or by writing to the\nentire <code>Buffer</code> before reading data from the <code>Buffer</code>.\nWhile this behavior is <em>intentional</em> to improve performance,\ndevelopment experience has demonstrated that a more explicit distinction is\nrequired between creating a fast-but-uninitialized <code>Buffer</code> versus creating a\nslower-but-safer <code>Buffer</code>. Since Node.js 8.0.0, <code>Buffer(num)</code> and <code>new Buffer(num)</code> return a <code>Buffer</code> with initialized memory.</li>\n<li>Passing a string, array, or <code>Buffer</code> as the first argument copies the\npassed object's data into the <code>Buffer</code>.</li>\n<li>Passing an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> or a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>&#x3C;SharedArrayBuffer></code></a> returns a <code>Buffer</code>\nthat shares allocated memory with the given array buffer.</li>\n</ul>\n<p>Because the behavior of <code>new Buffer()</code> is different depending on the type of the\nfirst argument, security and reliability issues can be inadvertently introduced\ninto applications when argument validation or <code>Buffer</code> initialization is not\nperformed.</p>\n<p>For example, if an attacker can cause an application to receive a number where\na string is expected, the application may call <code>new Buffer(100)</code>\ninstead of <code>new Buffer(\"100\")</code>, leading it to allocate a 100 byte buffer instead\nof allocating a 3 byte buffer with content <code>\"100\"</code>. This is commonly possible\nusing JSON API calls. Since JSON distinguishes between numeric and string types,\nit allows injection of numbers where a naively written application that does not\nvalidate its input sufficiently might expect to always receive a string.\nBefore Node.js 8.0.0, the 100 byte buffer might contain\narbitrary pre-existing in-memory data, so may be used to expose in-memory\nsecrets to a remote attacker. Since Node.js 8.0.0, exposure of memory cannot\noccur because the data is zero-filled. However, other attacks are still\npossible, such as causing very large buffers to be allocated by the server,\nleading to performance degradation or crashing on memory exhaustion.</p>\n<p>To make the creation of <code>Buffer</code> instances more reliable and less error-prone,\nthe various forms of the <code>new Buffer()</code> constructor have been <strong>deprecated</strong>\nand replaced by separate <code>Buffer.from()</code>, <a href=\"#static-method-bufferallocsize-fill-encoding\"><code>Buffer.alloc()</code></a>, and\n<a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> methods.</p>\n<p><em>Developers should migrate all existing uses of the <code>new Buffer()</code> constructors\nto one of these new APIs.</em></p>\n<ul>\n<li><a href=\"#static-method-bufferfromarray\"><code>Buffer.from(array)</code></a> returns a new <code>Buffer</code> that <em>contains a copy</em> of the\nprovided octets.</li>\n<li><a href=\"#static-method-bufferfromarraybuffer-byteoffset-length\"><code>Buffer.from(arrayBuffer[, byteOffset[, length]])</code></a>\nreturns a new <code>Buffer</code> that <em>shares the same allocated memory</em> as the given\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>.</li>\n<li><a href=\"#static-method-bufferfrombuffer\"><code>Buffer.from(buffer)</code></a> returns a new <code>Buffer</code> that <em>contains a copy</em> of the\ncontents of the given <code>Buffer</code>.</li>\n<li><a href=\"#static-method-bufferfromstring-encoding\"><code>Buffer.from(string[, encoding])</code></a> returns a new\n<code>Buffer</code> that <em>contains a copy</em> of the provided string.</li>\n<li><a href=\"#static-method-bufferallocsize-fill-encoding\"><code>Buffer.alloc(size[, fill[, encoding]])</code></a> returns a new\ninitialized <code>Buffer</code> of the specified size. This method is slower than\n<a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe(size)</code></a> but guarantees that newly\ncreated <code>Buffer</code> instances never contain old data that is potentially\nsensitive. A <code>TypeError</code> will be thrown if <code>size</code> is not a number.</li>\n<li><a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe(size)</code></a> and\n<a href=\"#static-method-bufferallocunsafeslowsize\"><code>Buffer.allocUnsafeSlow(size)</code></a> each return a\nnew uninitialized <code>Buffer</code> of the specified <code>size</code>. Because the <code>Buffer</code> is\nuninitialized, the allocated segment of memory might contain old data that is\npotentially sensitive.</li>\n</ul>\n<p><code>Buffer</code> instances returned by <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a>, <a href=\"#static-method-bufferfromstring-encoding\"><code>Buffer.from(string)</code></a>,\n<a href=\"#static-method-bufferconcatlist-totallength\"><code>Buffer.concat()</code></a> and <a href=\"#static-method-bufferfromarray\"><code>Buffer.from(array)</code></a> <em>may</em> be allocated off a shared\ninternal memory pool if <code>size</code> is less than or equal to half <a href=\"#bufferpoolsize\"><code>Buffer.poolSize</code></a>.\nInstances returned by <a href=\"#static-method-bufferallocunsafeslowsize\"><code>Buffer.allocUnsafeSlow()</code></a> <em>never</em> use the shared internal\nmemory pool.</p>",
          "modules": [
            {
              "textRaw": "The `--zero-fill-buffers` command-line option",
              "name": "the_`--zero-fill-buffers`_command-line_option",
              "type": "module",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "desc": "<p>Node.js can be started using the <code>--zero-fill-buffers</code> command-line option to\ncause all newly-allocated <code>Buffer</code> instances to be zero-filled upon creation by\ndefault. Without the option, buffers created with <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> and\n<a href=\"#static-method-bufferallocunsafeslowsize\"><code>Buffer.allocUnsafeSlow()</code></a> are not zero-filled. Use of this flag can have a\nmeasurable negative impact on performance. Use the <code>--zero-fill-buffers</code> option\nonly when necessary to enforce that newly allocated <code>Buffer</code> instances cannot\ncontain old data that is potentially sensitive.</p>\n<pre><code class=\"language-console\">$ node --zero-fill-buffers\n> Buffer.allocUnsafe(5);\n&#x3C;Buffer 00 00 00 00 00>\n</code></pre>",
              "displayName": "The `--zero-fill-buffers` command-line option"
            },
            {
              "textRaw": "What makes `Buffer.allocUnsafe()` and `Buffer.allocUnsafeSlow()` \"unsafe\"?",
              "name": "what_makes_`buffer.allocunsafe()`_and_`buffer.allocunsafeslow()`_\"unsafe\"?",
              "type": "module",
              "desc": "<p>When calling <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> and <a href=\"#static-method-bufferallocunsafeslowsize\"><code>Buffer.allocUnsafeSlow()</code></a>, the\nsegment of allocated memory is <em>uninitialized</em> (it is not zeroed-out). While\nthis design makes the allocation of memory quite fast, the allocated segment of\nmemory might contain old data that is potentially sensitive. Using a <code>Buffer</code>\ncreated by <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> without <em>completely</em> overwriting the\nmemory can allow this old data to be leaked when the <code>Buffer</code> memory is read.</p>\n<p>While there are clear performance advantages to using\n<a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a>, extra care <em>must</em> be taken in order to avoid\nintroducing security vulnerabilities into an application.</p>",
              "displayName": "What makes `Buffer.allocUnsafe()` and `Buffer.allocUnsafeSlow()` \"unsafe\"?"
            }
          ],
          "displayName": "`Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()`"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Blob`",
          "name": "Blob",
          "type": "class",
          "meta": {
            "added": [
              "v15.7.0",
              "v14.18.0"
            ],
            "changes": [
              {
                "version": [
                  "v18.0.0",
                  "v16.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41270",
                "description": "No longer experimental."
              }
            ]
          },
          "desc": "<p>A <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> encapsulates immutable, raw data that can be safely shared across\nmultiple worker threads.</p>",
          "signatures": [
            {
              "textRaw": "`new buffer.Blob([sources[, options]])`",
              "name": "buffer.Blob",
              "type": "ctor",
              "meta": {
                "added": [
                  "v15.7.0",
                  "v14.18.0"
                ],
                "changes": [
                  {
                    "version": "v16.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39708",
                    "description": "Added the standard `endings` option to replace line-endings, and removed the non-standard `encoding` option."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`sources` {string[]|ArrayBuffer[]|TypedArray[]|DataView[]|Blob[]} An array of string, {ArrayBuffer}, {TypedArray}, {DataView}, or {Blob} objects, or any mix of such objects, that will be stored within the `Blob`.",
                  "name": "sources",
                  "type": "string[]|ArrayBuffer[]|TypedArray[]|DataView[]|Blob[]",
                  "desc": "An array of string, {ArrayBuffer}, {TypedArray}, {DataView}, or {Blob} objects, or any mix of such objects, that will be stored within the `Blob`.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`endings` {string} One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be converted to the platform native line-ending as specified by `require('node:os').EOL`.",
                      "name": "endings",
                      "type": "string",
                      "desc": "One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be converted to the platform native line-ending as specified by `require('node:os').EOL`."
                    },
                    {
                      "textRaw": "`type` {string} The Blob content-type. The intent is for `type` to convey the MIME media type of the data, however no validation of the type format is performed.",
                      "name": "type",
                      "type": "string",
                      "desc": "The Blob content-type. The intent is for `type` to convey the MIME media type of the data, however no validation of the type format is performed."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new <code>Blob</code> object containing a concatenation of the given sources.</p>\n<p><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a>, and <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> sources are copied into\nthe 'Blob' and can therefore be safely modified after the 'Blob' is created.</p>\n<p>String sources are encoded as UTF-8 byte sequences and copied into the Blob.\nUnmatched surrogate pairs within each string part will be replaced by Unicode\nU+FFFD replacement characters.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`blob.arrayBuffer()`",
              "name": "arrayBuffer",
              "type": "method",
              "meta": {
                "added": [
                  "v15.7.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Returns a promise that fulfills with an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> containing a copy of\nthe <code>Blob</code> data.</p>"
            },
            {
              "textRaw": "`blob.bytes()`",
              "name": "bytes",
              "type": "method",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>blob.bytes()</code> method returns the byte of the <code>Blob</code> object as a <code>Promise&#x3C;Uint8Array></code>.</p>\n<pre><code class=\"language-js\">const blob = new Blob(['hello']);\nblob.bytes().then((bytes) => {\n  console.log(bytes); // Outputs: Uint8Array(5) [ 104, 101, 108, 108, 111 ]\n});\n</code></pre>"
            },
            {
              "textRaw": "`blob.slice([start[, end[, type]]])`",
              "name": "slice",
              "type": "method",
              "meta": {
                "added": [
                  "v15.7.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`start` {number} The starting index.",
                      "name": "start",
                      "type": "number",
                      "desc": "The starting index.",
                      "optional": true
                    },
                    {
                      "textRaw": "`end` {number} The ending index.",
                      "name": "end",
                      "type": "number",
                      "desc": "The ending index.",
                      "optional": true
                    },
                    {
                      "textRaw": "`type` {string} The content-type for the new `Blob`",
                      "name": "type",
                      "type": "string",
                      "desc": "The content-type for the new `Blob`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Creates and returns a new <code>Blob</code> containing a subset of this <code>Blob</code> objects\ndata. The original <code>Blob</code> is not altered.</p>"
            },
            {
              "textRaw": "`blob.stream()`",
              "name": "stream",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {ReadableStream}",
                    "name": "return",
                    "type": "ReadableStream"
                  }
                }
              ],
              "desc": "<p>Returns a new <code>ReadableStream</code> that allows the content of the <code>Blob</code> to be read.</p>"
            },
            {
              "textRaw": "`blob.text()`",
              "name": "text",
              "type": "method",
              "meta": {
                "added": [
                  "v15.7.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Returns a promise that fulfills with the contents of the <code>Blob</code> decoded as a\nUTF-8 string.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`blob.size`",
              "name": "size",
              "type": "property",
              "meta": {
                "added": [
                  "v15.7.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "desc": "<p>The total size of the <code>Blob</code> in bytes.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "type",
              "type": "string",
              "meta": {
                "added": [
                  "v15.7.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "desc": "<p>The content-type of the <code>Blob</code>.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "`Blob` objects and `MessageChannel`",
              "name": "`blob`_objects_and_`messagechannel`",
              "type": "module",
              "desc": "<p>Once a <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> object is created, it can be sent via <code>MessagePort</code> to multiple\ndestinations without transferring or immediately copying the data. The data\ncontained by the <code>Blob</code> is copied only when the <code>arrayBuffer()</code> or <code>text()</code>\nmethods are called.</p>\n<pre><code class=\"language-mjs\">import { Blob } from 'node:buffer';\nimport { setTimeout as delay } from 'node:timers/promises';\n\nconst blob = new Blob(['hello there']);\n\nconst mc1 = new MessageChannel();\nconst mc2 = new MessageChannel();\n\nmc1.port1.onmessage = async ({ data }) => {\n  console.log(await data.arrayBuffer());\n  mc1.port1.close();\n};\n\nmc2.port1.onmessage = async ({ data }) => {\n  await delay(1000);\n  console.log(await data.arrayBuffer());\n  mc2.port1.close();\n};\n\nmc1.port2.postMessage(blob);\nmc2.port2.postMessage(blob);\n\n// The Blob is still usable after posting.\nblob.text().then(console.log);\n</code></pre>\n<pre><code class=\"language-cjs\">const { Blob } = require('node:buffer');\nconst { setTimeout: delay } = require('node:timers/promises');\n\nconst blob = new Blob(['hello there']);\n\nconst mc1 = new MessageChannel();\nconst mc2 = new MessageChannel();\n\nmc1.port1.onmessage = async ({ data }) => {\n  console.log(await data.arrayBuffer());\n  mc1.port1.close();\n};\n\nmc2.port1.onmessage = async ({ data }) => {\n  await delay(1000);\n  console.log(await data.arrayBuffer());\n  mc2.port1.close();\n};\n\nmc1.port2.postMessage(blob);\nmc2.port2.postMessage(blob);\n\n// The Blob is still usable after posting.\nblob.text().then(console.log);\n</code></pre>",
              "displayName": "`Blob` objects and `MessageChannel`"
            }
          ]
        },
        {
          "textRaw": "Class: `Buffer`",
          "name": "Buffer",
          "type": "class",
          "desc": "<p>The <code>Buffer</code> class is a global type for dealing with binary data directly.\nIt can be constructed in a variety of ways.</p>",
          "classMethods": [
            {
              "textRaw": "Static method: `Buffer.alloc(size[, fill[, encoding]])`",
              "name": "alloc",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/45796",
                    "description": "Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of ERR_INVALID_ARG_VALUE for invalid input arguments."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34682",
                    "description": "Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE for invalid input arguments."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18129",
                    "description": "Attempting to fill a non-zero length buffer with a zero length buffer triggers a thrown exception."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17427",
                    "description": "Specifying an invalid string for `fill` triggers a thrown exception."
                  },
                  {
                    "version": "v8.9.3",
                    "pr-url": "https://github.com/nodejs/node/pull/17428",
                    "description": "Specifying an invalid string for `fill` now results in a zero-filled buffer."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {integer} The desired length of the new `Buffer`.",
                      "name": "size",
                      "type": "integer",
                      "desc": "The desired length of the new `Buffer`."
                    },
                    {
                      "textRaw": "`fill` {string|Buffer|Uint8Array|integer} A value to pre-fill the new `Buffer` with. **Default:** `0`.",
                      "name": "fill",
                      "type": "string|Buffer|Uint8Array|integer",
                      "default": "`0`",
                      "desc": "A value to pre-fill the new `Buffer` with.",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} If `fill` is a string, this is its encoding. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "If `fill` is a string, this is its encoding.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Allocates a new <code>Buffer</code> of <code>size</code> bytes. If <code>fill</code> is <code>undefined</code>, the\n<code>Buffer</code> will be zero-filled.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.alloc(5);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 00 00 00 00 00>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.alloc(5);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 00 00 00 00 00>\n</code></pre>\n<p>If <code>size</code> is larger than\n<a href=\"#bufferconstantsmax_length\"><code>buffer.constants.MAX_LENGTH</code></a> or smaller than 0, <a href=\"errors.html#err_out_of_range\"><code>ERR_OUT_OF_RANGE</code></a>\nis thrown.</p>\n<p>If <code>fill</code> is specified, the allocated <code>Buffer</code> will be initialized by calling\n<a href=\"#buffillvalue-offset-end-encoding\"><code>buf.fill(fill)</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.alloc(5, 'a');\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 61 61 61 61 61>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.alloc(5, 'a');\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 61 61 61 61 61>\n</code></pre>\n<p>If both <code>fill</code> and <code>encoding</code> are specified, the allocated <code>Buffer</code> will be\ninitialized by calling <a href=\"#buffillvalue-offset-end-encoding\"><code>buf.fill(fill, encoding)</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>\n</code></pre>\n<p>Calling <a href=\"#static-method-bufferallocsize-fill-encoding\"><code>Buffer.alloc()</code></a> can be measurably slower than the alternative\n<a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> but ensures that the newly created <code>Buffer</code> instance\ncontents will never contain sensitive data from previous allocations, including\ndata that might not have been allocated for <code>Buffer</code>s.</p>\n<p>A <code>TypeError</code> will be thrown if <code>size</code> is not a number.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.allocUnsafe(size)`",
              "name": "allocUnsafe",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/45796",
                    "description": "Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of ERR_INVALID_ARG_VALUE for invalid input arguments."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34682",
                    "description": "Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE for invalid input arguments."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7079",
                    "description": "Passing a negative `size` will now throw an error."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {integer} The desired length of the new `Buffer`.",
                      "name": "size",
                      "type": "integer",
                      "desc": "The desired length of the new `Buffer`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Allocates a new <code>Buffer</code> of <code>size</code> bytes. If <code>size</code> is larger than\n<a href=\"#bufferconstantsmax_length\"><code>buffer.constants.MAX_LENGTH</code></a> or smaller than 0, <a href=\"errors.html#err_out_of_range\"><code>ERR_OUT_OF_RANGE</code></a>\nis thrown.</p>\n<p>The underlying memory for <code>Buffer</code> instances created in this way is <em>not\ninitialized</em>. The contents of the newly created <code>Buffer</code> are unknown and\n<em>may contain sensitive data</em>. Use <a href=\"#static-method-bufferallocsize-fill-encoding\"><code>Buffer.alloc()</code></a> instead to initialize\n<code>Buffer</code> instances with zeroes.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(10);\n\nconsole.log(buf);\n// Prints (contents may vary): &#x3C;Buffer a0 8b 28 3f 01 00 00 00 50 32>\n\nbuf.fill(0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 00 00 00 00 00 00 00 00 00 00>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(10);\n\nconsole.log(buf);\n// Prints (contents may vary): &#x3C;Buffer a0 8b 28 3f 01 00 00 00 50 32>\n\nbuf.fill(0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 00 00 00 00 00 00 00 00 00 00>\n</code></pre>\n<p>A <code>TypeError</code> will be thrown if <code>size</code> is not a number.</p>\n<p>The <code>Buffer</code> module pre-allocates an internal <code>Buffer</code> instance of\nsize <a href=\"#bufferpoolsize\"><code>Buffer.poolSize</code></a> that is used as a pool for the fast allocation of new\n<code>Buffer</code> instances created using <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a>, <a href=\"#static-method-bufferfromarray\"><code>Buffer.from(array)</code></a>,\n<a href=\"#static-method-bufferfromstring-encoding\"><code>Buffer.from(string)</code></a>, and <a href=\"#static-method-bufferconcatlist-totallength\"><code>Buffer.concat()</code></a> only when <code>size</code> is less than\n<code>Buffer.poolSize >>> 1</code> (floor of <a href=\"#bufferpoolsize\"><code>Buffer.poolSize</code></a> divided by two).</p>\n<p>Use of this pre-allocated internal memory pool is a key difference between\ncalling <code>Buffer.alloc(size, fill)</code> vs. <code>Buffer.allocUnsafe(size).fill(fill)</code>.\nSpecifically, <code>Buffer.alloc(size, fill)</code> will <em>never</em> use the internal <code>Buffer</code>\npool, while <code>Buffer.allocUnsafe(size).fill(fill)</code> <em>will</em> use the internal\n<code>Buffer</code> pool if <code>size</code> is less than or equal to half <a href=\"#bufferpoolsize\"><code>Buffer.poolSize</code></a>. The\ndifference is subtle but can be important when an application requires the\nadditional performance that <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> provides.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.allocUnsafeSlow(size)`",
              "name": "allocUnsafeSlow",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v5.12.0"
                ],
                "changes": [
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/45796",
                    "description": "Throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE instead of ERR_INVALID_ARG_VALUE for invalid input arguments."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34682",
                    "description": "Throw ERR_INVALID_ARG_VALUE instead of ERR_INVALID_OPT_VALUE for invalid input arguments."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {integer} The desired length of the new `Buffer`.",
                      "name": "size",
                      "type": "integer",
                      "desc": "The desired length of the new `Buffer`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Allocates a new <code>Buffer</code> of <code>size</code> bytes. If <code>size</code> is larger than\n<a href=\"#bufferconstantsmax_length\"><code>buffer.constants.MAX_LENGTH</code></a> or smaller than 0, <a href=\"errors.html#err_out_of_range\"><code>ERR_OUT_OF_RANGE</code></a>\nis thrown. A zero-length <code>Buffer</code> is created if <code>size</code> is 0.</p>\n<p>The underlying memory for <code>Buffer</code> instances created in this way is <em>not\ninitialized</em>. The contents of the newly created <code>Buffer</code> are unknown and\n<em>may contain sensitive data</em>. Use <a href=\"#buffillvalue-offset-end-encoding\"><code>buf.fill(0)</code></a> to initialize\nsuch <code>Buffer</code> instances with zeroes.</p>\n<p>When using <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> to allocate new <code>Buffer</code> instances,\nallocations less than <code>Buffer.poolSize >>> 1</code> (32KiB when default poolSize is used) are sliced\nfrom a single pre-allocated <code>Buffer</code>. This allows applications to avoid the\ngarbage collection overhead of creating many individually allocated <code>Buffer</code>\ninstances. This approach improves both performance and memory usage by\neliminating the need to track and clean up as many individual <code>ArrayBuffer</code> objects.</p>\n<p>However, in the case where a developer may need to retain a small chunk of\nmemory from a pool for an indeterminate amount of time, it may be appropriate\nto create an un-pooled <code>Buffer</code> instance using <code>Buffer.allocUnsafeSlow()</code> and\nthen copying out the relevant bits.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Need to keep around a few small chunks of memory.\nconst store = [];\n\nsocket.on('readable', () => {\n  let data;\n  while (null !== (data = readable.read())) {\n    // Allocate for retained data.\n    const sb = Buffer.allocUnsafeSlow(10);\n\n    // Copy the data into the new allocation.\n    data.copy(sb, 0, 0, 10);\n\n    store.push(sb);\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Need to keep around a few small chunks of memory.\nconst store = [];\n\nsocket.on('readable', () => {\n  let data;\n  while (null !== (data = readable.read())) {\n    // Allocate for retained data.\n    const sb = Buffer.allocUnsafeSlow(10);\n\n    // Copy the data into the new allocation.\n    data.copy(sb, 0, 0, 10);\n\n    store.push(sb);\n  }\n});\n</code></pre>\n<p>A <code>TypeError</code> will be thrown if <code>size</code> is not a number.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.byteLength(string[, encoding])`",
              "name": "byteLength",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8946",
                    "description": "Passing invalid input will now throw an error."
                  },
                  {
                    "version": "v5.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5255",
                    "description": "The `string` parameter can now be any `TypedArray`, `DataView` or `ArrayBuffer`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`string` {string|Buffer|TypedArray|DataView|ArrayBuffer|SharedArrayBuffer} A value to calculate the length of.",
                      "name": "string",
                      "type": "string|Buffer|TypedArray|DataView|ArrayBuffer|SharedArrayBuffer",
                      "desc": "A value to calculate the length of."
                    },
                    {
                      "textRaw": "`encoding` {string} If `string` is a string, this is its encoding. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "If `string` is a string, this is its encoding.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} The number of bytes contained within `string`.",
                    "name": "return",
                    "type": "integer",
                    "desc": "The number of bytes contained within `string`."
                  }
                }
              ],
              "desc": "<p>Returns the byte length of a string when encoded using <code>encoding</code>.\nThis is not the same as <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length\"><code>String.prototype.length</code></a>, which does not account\nfor the encoding that is used to convert the string into bytes.</p>\n<p>For <code>'base64'</code>, <code>'base64url'</code>, and <code>'hex'</code>, this function assumes valid input.\nFor strings that contain non-base64/hex-encoded data (e.g. whitespace), the\nreturn value might be greater than the length of a <code>Buffer</code> created from the\nstring.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst str = '\\u00bd + \\u00bc = \\u00be';\n\nconsole.log(`${str}: ${str.length} characters, ` +\n            `${Buffer.byteLength(str, 'utf8')} bytes`);\n// Prints: ½ + ¼ = ¾: 9 characters, 12 bytes\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst str = '\\u00bd + \\u00bc = \\u00be';\n\nconsole.log(`${str}: ${str.length} characters, ` +\n            `${Buffer.byteLength(str, 'utf8')} bytes`);\n// Prints: ½ + ¼ = ¾: 9 characters, 12 bytes\n</code></pre>\n<p>When <code>string</code> is a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>&#x3C;SharedArrayBuffer></code></a>,\nthe byte length as reported by <code>.byteLength</code> is returned.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.compare(buf1, buf2)`",
              "name": "compare",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10236",
                    "description": "The arguments can now be `Uint8Array`s."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buf1` {Buffer|Uint8Array}",
                      "name": "buf1",
                      "type": "Buffer|Uint8Array"
                    },
                    {
                      "textRaw": "`buf2` {Buffer|Uint8Array}",
                      "name": "buf2",
                      "type": "Buffer|Uint8Array"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} Either `-1`, `0`, or `1`, depending on the result of the comparison. See `buf.compare()` for details.",
                    "name": "return",
                    "type": "integer",
                    "desc": "Either `-1`, `0`, or `1`, depending on the result of the comparison. See `buf.compare()` for details."
                  }
                }
              ],
              "desc": "<p>Compares <code>buf1</code> to <code>buf2</code>, typically for the purpose of sorting arrays of\n<code>Buffer</code> instances. This is equivalent to calling\n<a href=\"#bufcomparetarget-targetstart-targetend-sourcestart-sourceend\"><code>buf1.compare(buf2)</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from('1234');\nconst buf2 = Buffer.from('0123');\nconst arr = [buf1, buf2];\n\nconsole.log(arr.sort(Buffer.compare));\n// Prints: [ &#x3C;Buffer 30 31 32 33>, &#x3C;Buffer 31 32 33 34> ]\n// (This result is equal to: [buf2, buf1].)\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from('1234');\nconst buf2 = Buffer.from('0123');\nconst arr = [buf1, buf2];\n\nconsole.log(arr.sort(Buffer.compare));\n// Prints: [ &#x3C;Buffer 30 31 32 33>, &#x3C;Buffer 31 32 33 34> ]\n// (This result is equal to: [buf2, buf1].)\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Buffer.concat(list[, totalLength])`",
              "name": "concat",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v0.7.11"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10236",
                    "description": "The elements of `list` can now be `Uint8Array`s."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`list` {Buffer[]|Uint8Array[]} List of `Buffer` or {Uint8Array} instances to concatenate.",
                      "name": "list",
                      "type": "Buffer[]|Uint8Array[]",
                      "desc": "List of `Buffer` or {Uint8Array} instances to concatenate."
                    },
                    {
                      "textRaw": "`totalLength` {integer} Total length of the `Buffer` instances in `list` when concatenated.",
                      "name": "totalLength",
                      "type": "integer",
                      "desc": "Total length of the `Buffer` instances in `list` when concatenated.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Returns a new <code>Buffer</code> which is the result of concatenating all the <code>Buffer</code>\ninstances in the <code>list</code> together.</p>\n<p>If the list has no items, or if the <code>totalLength</code> is 0, then a new zero-length\n<code>Buffer</code> is returned.</p>\n<p>If <code>totalLength</code> is not provided, it is calculated from the <code>Buffer</code> instances\nin <code>list</code> by adding their lengths.</p>\n<p>If <code>totalLength</code> is provided, it must be an unsigned integer. If the\ncombined length of the <code>Buffer</code>s in <code>list</code> exceeds <code>totalLength</code>, the result is\ntruncated to <code>totalLength</code>. If the combined length of the <code>Buffer</code>s in <code>list</code> is\nless than <code>totalLength</code>, the remaining space is filled with zeros.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Create a single `Buffer` from a list of three `Buffer` instances.\n\nconst buf1 = Buffer.alloc(10);\nconst buf2 = Buffer.alloc(14);\nconst buf3 = Buffer.alloc(18);\nconst totalLength = buf1.length + buf2.length + buf3.length;\n\nconsole.log(totalLength);\n// Prints: 42\n\nconst bufA = Buffer.concat([buf1, buf2, buf3], totalLength);\n\nconsole.log(bufA);\n// Prints: &#x3C;Buffer 00 00 00 00 ...>\nconsole.log(bufA.length);\n// Prints: 42\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Create a single `Buffer` from a list of three `Buffer` instances.\n\nconst buf1 = Buffer.alloc(10);\nconst buf2 = Buffer.alloc(14);\nconst buf3 = Buffer.alloc(18);\nconst totalLength = buf1.length + buf2.length + buf3.length;\n\nconsole.log(totalLength);\n// Prints: 42\n\nconst bufA = Buffer.concat([buf1, buf2, buf3], totalLength);\n\nconsole.log(bufA);\n// Prints: &#x3C;Buffer 00 00 00 00 ...>\nconsole.log(bufA.length);\n// Prints: 42\n</code></pre>\n<p><code>Buffer.concat()</code> may also use the internal <code>Buffer</code> pool like\n<a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> does.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.copyBytesFrom(view[, offset[, length]])`",
              "name": "copyBytesFrom",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v19.8.0",
                  "v18.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`view` {TypedArray} The {TypedArray} to copy.",
                      "name": "view",
                      "type": "TypedArray",
                      "desc": "The {TypedArray} to copy."
                    },
                    {
                      "textRaw": "`offset` {integer} The starting offset within `view`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "The starting offset within `view`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`length` {integer} The number of elements from `view` to copy. **Default:** `view.length - offset`.",
                      "name": "length",
                      "type": "integer",
                      "default": "`view.length - offset`",
                      "desc": "The number of elements from `view` to copy.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Copies the underlying memory of <code>view</code> into a new <code>Buffer</code>.</p>\n<pre><code class=\"language-js\">const u16 = new Uint16Array([0, 0xffff]);\nconst buf = Buffer.copyBytesFrom(u16, 1, 1);\nu16[1] = 0;\nconsole.log(buf.length); // 2\nconsole.log(buf[0]); // 255\nconsole.log(buf[1]); // 255\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Buffer.from(array)`",
              "name": "from",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`array` {integer[]}",
                      "name": "array",
                      "type": "integer[]"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Allocates a new <code>Buffer</code> using an <code>array</code> of bytes in the range <code>0</code> – <code>255</code>.\nArray entries outside that range will be truncated to fit into it.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.\nconst buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.\nconst buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);\n</code></pre>\n<p>If <code>array</code> is an <code>Array</code>-like object (that is, one with a <code>length</code> property of\ntype <code>number</code>), it is treated as if it is an array, unless it is a <code>Buffer</code> or\na <code>Uint8Array</code>. This means all other <code>TypedArray</code> variants get treated as an\n<code>Array</code>. To create a <code>Buffer</code> from the bytes backing a <code>TypedArray</code>, use\n<a href=\"#static-method-buffercopybytesfromview-offset-length\"><code>Buffer.copyBytesFrom()</code></a>.</p>\n<p>A <code>TypeError</code> will be thrown if <code>array</code> is not an <code>Array</code> or another type\nappropriate for <code>Buffer.from()</code> variants.</p>\n<p><code>Buffer.from(array)</code> and <a href=\"#static-method-bufferfromstring-encoding\"><code>Buffer.from(string)</code></a> may also use the internal\n<code>Buffer</code> pool like <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> does.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.from(arrayBuffer[, byteOffset[, length]])`",
              "name": "from",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`arrayBuffer` {ArrayBuffer|SharedArrayBuffer} An {ArrayBuffer}, {SharedArrayBuffer}, for example the `.buffer` property of a {TypedArray}.",
                      "name": "arrayBuffer",
                      "type": "ArrayBuffer|SharedArrayBuffer",
                      "desc": "An {ArrayBuffer}, {SharedArrayBuffer}, for example the `.buffer` property of a {TypedArray}."
                    },
                    {
                      "textRaw": "`byteOffset` {integer} Index of first byte to expose. **Default:** `0`.",
                      "name": "byteOffset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Index of first byte to expose.",
                      "optional": true
                    },
                    {
                      "textRaw": "`length` {integer} Number of bytes to expose. **Default:** `arrayBuffer.byteLength - byteOffset`.",
                      "name": "length",
                      "type": "integer",
                      "default": "`arrayBuffer.byteLength - byteOffset`",
                      "desc": "Number of bytes to expose.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>This creates a view of the <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> without copying the underlying\nmemory. For example, when passed a reference to the <code>.buffer</code> property of a\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> instance, the newly created <code>Buffer</code> will share the same\nallocated memory as the <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>'s underlying <code>ArrayBuffer</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst arr = new Uint16Array(2);\n\narr[0] = 5000;\narr[1] = 4000;\n\n// Shares memory with `arr`.\nconst buf = Buffer.from(arr.buffer);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 88 13 a0 0f>\n\n// Changing the original Uint16Array changes the Buffer also.\narr[1] = 6000;\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 88 13 70 17>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst arr = new Uint16Array(2);\n\narr[0] = 5000;\narr[1] = 4000;\n\n// Shares memory with `arr`.\nconst buf = Buffer.from(arr.buffer);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 88 13 a0 0f>\n\n// Changing the original Uint16Array changes the Buffer also.\narr[1] = 6000;\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 88 13 70 17>\n</code></pre>\n<p>The optional <code>byteOffset</code> and <code>length</code> arguments specify a memory range within\nthe <code>arrayBuffer</code> that will be shared by the <code>Buffer</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst ab = new ArrayBuffer(10);\nconst buf = Buffer.from(ab, 0, 2);\n\nconsole.log(buf.length);\n// Prints: 2\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst ab = new ArrayBuffer(10);\nconst buf = Buffer.from(ab, 0, 2);\n\nconsole.log(buf.length);\n// Prints: 2\n</code></pre>\n<p>A <code>TypeError</code> will be thrown if <code>arrayBuffer</code> is not an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> or a\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>&#x3C;SharedArrayBuffer></code></a> or another type appropriate for <code>Buffer.from()</code>\nvariants.</p>\n<p>It is important to remember that a backing <code>ArrayBuffer</code> can cover a range\nof memory that extends beyond the bounds of a <code>TypedArray</code> view. A new\n<code>Buffer</code> created using the <code>buffer</code> property of a <code>TypedArray</code> may extend\nbeyond the range of the <code>TypedArray</code>:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements\nconst arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements\nconsole.log(arrA.buffer === arrB.buffer); // true\n\nconst buf = Buffer.from(arrB.buffer);\nconsole.log(buf);\n// Prints: &#x3C;Buffer 63 64 65 66>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements\nconst arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements\nconsole.log(arrA.buffer === arrB.buffer); // true\n\nconst buf = Buffer.from(arrB.buffer);\nconsole.log(buf);\n// Prints: &#x3C;Buffer 63 64 65 66>\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Buffer.from(buffer)`",
              "name": "from",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|Uint8Array} An existing `Buffer` or {Uint8Array} from which to copy data.",
                      "name": "buffer",
                      "type": "Buffer|Uint8Array",
                      "desc": "An existing `Buffer` or {Uint8Array} from which to copy data."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Copies the passed <code>buffer</code> data onto a new <code>Buffer</code> instance.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from('buffer');\nconst buf2 = Buffer.from(buf1);\n\nbuf1[0] = 0x61;\n\nconsole.log(buf1.toString());\n// Prints: auffer\nconsole.log(buf2.toString());\n// Prints: buffer\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from('buffer');\nconst buf2 = Buffer.from(buf1);\n\nbuf1[0] = 0x61;\n\nconsole.log(buf1.toString());\n// Prints: auffer\nconsole.log(buf2.toString());\n// Prints: buffer\n</code></pre>\n<p>A <code>TypeError</code> will be thrown if <code>buffer</code> is not a <code>Buffer</code> or another type\nappropriate for <code>Buffer.from()</code> variants.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.from(object[, offsetOrEncoding[, length]])`",
              "name": "from",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v8.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`object` {Object} An object supporting `Symbol.toPrimitive` or `valueOf()`.",
                      "name": "object",
                      "type": "Object",
                      "desc": "An object supporting `Symbol.toPrimitive` or `valueOf()`."
                    },
                    {
                      "textRaw": "`offsetOrEncoding` {integer|string} A byte-offset or encoding.",
                      "name": "offsetOrEncoding",
                      "type": "integer|string",
                      "desc": "A byte-offset or encoding.",
                      "optional": true
                    },
                    {
                      "textRaw": "`length` {integer} A length.",
                      "name": "length",
                      "type": "integer",
                      "desc": "A length.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>For objects whose <code>valueOf()</code> function returns a value not strictly equal to\n<code>object</code>, returns <code>Buffer.from(object.valueOf(), offsetOrEncoding, length)</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from(new String('this is a test'));\n// Prints: &#x3C;Buffer 74 68 69 73 20 69 73 20 61 20 74 65 73 74>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from(new String('this is a test'));\n// Prints: &#x3C;Buffer 74 68 69 73 20 69 73 20 61 20 74 65 73 74>\n</code></pre>\n<p>For objects that support <code>Symbol.toPrimitive</code>, returns\n<code>Buffer.from(object[Symbol.toPrimitive]('string'), offsetOrEncoding)</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nclass Foo {\n  [Symbol.toPrimitive]() {\n    return 'this is a test';\n  }\n}\n\nconst buf = Buffer.from(new Foo(), 'utf8');\n// Prints: &#x3C;Buffer 74 68 69 73 20 69 73 20 61 20 74 65 73 74>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nclass Foo {\n  [Symbol.toPrimitive]() {\n    return 'this is a test';\n  }\n}\n\nconst buf = Buffer.from(new Foo(), 'utf8');\n// Prints: &#x3C;Buffer 74 68 69 73 20 69 73 20 61 20 74 65 73 74>\n</code></pre>\n<p>A <code>TypeError</code> will be thrown if <code>object</code> does not have the mentioned methods or\nis not of another type appropriate for <code>Buffer.from()</code> variants.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.from(string[, encoding])`",
              "name": "from",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`string` {string} A string to encode.",
                      "name": "string",
                      "type": "string",
                      "desc": "A string to encode."
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of `string`. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "The encoding of `string`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Creates a new <code>Buffer</code> containing <code>string</code>. The <code>encoding</code> parameter identifies\nthe character encoding to be used when converting <code>string</code> into bytes.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from('this is a tést');\nconst buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');\n\nconsole.log(buf1.toString());\n// Prints: this is a tést\nconsole.log(buf2.toString());\n// Prints: this is a tést\nconsole.log(buf1.toString('latin1'));\n// Prints: this is a tÃ©st\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from('this is a tést');\nconst buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');\n\nconsole.log(buf1.toString());\n// Prints: this is a tést\nconsole.log(buf2.toString());\n// Prints: this is a tést\nconsole.log(buf1.toString('latin1'));\n// Prints: this is a tÃ©st\n</code></pre>\n<p>A <code>TypeError</code> will be thrown if <code>string</code> is not a string or another type\nappropriate for <code>Buffer.from()</code> variants.</p>\n<p><a href=\"#static-method-bufferfromstring-encoding\"><code>Buffer.from(string)</code></a> may also use the internal <code>Buffer</code> pool like\n<a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> does.</p>"
            },
            {
              "textRaw": "Static method: `Buffer.isBuffer(obj)`",
              "name": "isBuffer",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v0.1.101"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`obj` {Object}",
                      "name": "obj",
                      "type": "Object"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if <code>obj</code> is a <code>Buffer</code>, <code>false</code> otherwise.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nBuffer.isBuffer(Buffer.alloc(10)); // true\nBuffer.isBuffer(Buffer.from('foo')); // true\nBuffer.isBuffer('a string'); // false\nBuffer.isBuffer([]); // false\nBuffer.isBuffer(new Uint8Array(1024)); // false\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nBuffer.isBuffer(Buffer.alloc(10)); // true\nBuffer.isBuffer(Buffer.from('foo')); // true\nBuffer.isBuffer('a string'); // false\nBuffer.isBuffer([]); // false\nBuffer.isBuffer(new Uint8Array(1024)); // false\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Buffer.isEncoding(encoding)`",
              "name": "isEncoding",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} A character encoding name to check.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "A character encoding name to check."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if <code>encoding</code> is the name of a supported character encoding,\nor <code>false</code> otherwise.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconsole.log(Buffer.isEncoding('utf8'));\n// Prints: true\n\nconsole.log(Buffer.isEncoding('hex'));\n// Prints: true\n\nconsole.log(Buffer.isEncoding('utf/8'));\n// Prints: false\n\nconsole.log(Buffer.isEncoding(''));\n// Prints: false\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconsole.log(Buffer.isEncoding('utf8'));\n// Prints: true\n\nconsole.log(Buffer.isEncoding('hex'));\n// Prints: true\n\nconsole.log(Buffer.isEncoding('utf/8'));\n// Prints: false\n\nconsole.log(Buffer.isEncoding(''));\n// Prints: false\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {integer} **Default:** `65536`",
              "name": "poolSize",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.11.3"
                ],
                "changes": [
                  {
                    "version": "v26.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/63597",
                    "description": "Default raised from 8192 to 65536."
                  }
                ]
              },
              "default": "`65536`",
              "desc": "<p>This is the size (in bytes) of pre-allocated internal <code>Buffer</code> instances used\nfor pooling. This value may be modified.</p>"
            },
            {
              "textRaw": "`index` {integer}",
              "name": "[index]",
              "type": "integer",
              "desc": "<p>The index operator <code>[index]</code> can be used to get and set the octet at position\n<code>index</code> in <code>buf</code>. The values refer to individual bytes, so the legal value\nrange is between <code>0x00</code> and <code>0xFF</code> (hex) or <code>0</code> and <code>255</code> (decimal).</p>\n<p>This operator is inherited from <code>Uint8Array</code>, so its behavior on out-of-bounds\naccess is the same as <code>Uint8Array</code>. In other words, <code>buf[index]</code> returns\n<code>undefined</code> when <code>index</code> is negative or greater or equal to <code>buf.length</code>, and\n<code>buf[index] = value</code> does not modify the buffer if <code>index</code> is negative or\n<code>>= buf.length</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Copy an ASCII string into a `Buffer` one byte at a time.\n// (This only works for ASCII-only strings. In general, one should use\n// `Buffer.from()` to perform this conversion.)\n\nconst str = 'Node.js';\nconst buf = Buffer.allocUnsafe(str.length);\n\nfor (let i = 0; i &#x3C; str.length; i++) {\n  buf[i] = str.charCodeAt(i);\n}\n\nconsole.log(buf.toString('utf8'));\n// Prints: Node.js\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Copy an ASCII string into a `Buffer` one byte at a time.\n// (This only works for ASCII-only strings. In general, one should use\n// `Buffer.from()` to perform this conversion.)\n\nconst str = 'Node.js';\nconst buf = Buffer.allocUnsafe(str.length);\n\nfor (let i = 0; i &#x3C; str.length; i++) {\n  buf[i] = str.charCodeAt(i);\n}\n\nconsole.log(buf.toString('utf8'));\n// Prints: Node.js\n</code></pre>"
            },
            {
              "textRaw": "Type: {ArrayBuffer} The underlying `ArrayBuffer` object based on which this `Buffer` object is created.",
              "name": "buffer",
              "type": "ArrayBuffer",
              "desc": "<p>This <code>ArrayBuffer</code> is not guaranteed to correspond exactly to the original\n<code>Buffer</code>. See the notes on <code>buf.byteOffset</code> for details.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst arrayBuffer = new ArrayBuffer(16);\nconst buffer = Buffer.from(arrayBuffer);\n\nconsole.log(buffer.buffer === arrayBuffer);\n// Prints: true\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst arrayBuffer = new ArrayBuffer(16);\nconst buffer = Buffer.from(arrayBuffer);\n\nconsole.log(buffer.buffer === arrayBuffer);\n// Prints: true\n</code></pre>",
              "shortDesc": "The underlying `ArrayBuffer` object based on which this `Buffer` object is created."
            },
            {
              "textRaw": "Type: {integer} The `byteOffset` of the `Buffer`'s underlying `ArrayBuffer` object.",
              "name": "byteOffset",
              "type": "integer",
              "desc": "<p>When setting <code>byteOffset</code> in <code>Buffer.from(ArrayBuffer, byteOffset, length)</code>,\nor sometimes when allocating a <code>Buffer</code> smaller than <code>Buffer.poolSize</code>, the\nbuffer does not start from a zero offset on the underlying <code>ArrayBuffer</code>.</p>\n<p>This can cause problems when accessing the underlying <code>ArrayBuffer</code> directly\nusing <code>buf.buffer</code>, as other parts of the <code>ArrayBuffer</code> may be unrelated\nto the <code>Buffer</code> object itself.</p>\n<p>A common issue when creating a <code>TypedArray</code> object that shares its memory with\na <code>Buffer</code> is that in this case one needs to specify the <code>byteOffset</code> correctly:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Create a buffer smaller than `Buffer.poolSize`.\nconst nodeBuffer = Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);\n\n// When casting the Node.js Buffer to an Int8Array, use the byteOffset\n// to refer only to the part of `nodeBuffer.buffer` that contains the memory\n// for `nodeBuffer`.\nnew Int8Array(nodeBuffer.buffer, nodeBuffer.byteOffset, nodeBuffer.length);\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Create a buffer smaller than `Buffer.poolSize`.\nconst nodeBuffer = Buffer.from([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);\n\n// When casting the Node.js Buffer to an Int8Array, use the byteOffset\n// to refer only to the part of `nodeBuffer.buffer` that contains the memory\n// for `nodeBuffer`.\nnew Int8Array(nodeBuffer.buffer, nodeBuffer.byteOffset, nodeBuffer.length);\n</code></pre>",
              "shortDesc": "The `byteOffset` of the `Buffer`'s underlying `ArrayBuffer` object."
            },
            {
              "textRaw": "Type: {integer}",
              "name": "length",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p>Returns the number of bytes in <code>buf</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Create a `Buffer` and write a shorter string to it using UTF-8.\n\nconst buf = Buffer.alloc(1234);\n\nconsole.log(buf.length);\n// Prints: 1234\n\nbuf.write('some string', 0, 'utf8');\n\nconsole.log(buf.length);\n// Prints: 1234\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Create a `Buffer` and write a shorter string to it using UTF-8.\n\nconst buf = Buffer.alloc(1234);\n\nconsole.log(buf.length);\n// Prints: 1234\n\nbuf.write('some string', 0, 'utf8');\n\nconsole.log(buf.length);\n// Prints: 1234\n</code></pre>"
            },
            {
              "textRaw": "`buf.parent`",
              "name": "parent",
              "type": "property",
              "meta": {
                "changes": [],
                "deprecated": [
                  "v8.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `buf.buffer` instead.",
              "desc": "<p>The <code>buf.parent</code> property is a deprecated alias for <code>buf.buffer</code>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`buf.compare(target[, targetStart[, targetEnd[, sourceStart[, sourceEnd]]]])`",
              "name": "compare",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10236",
                    "description": "The `target` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v5.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5880",
                    "description": "Additional parameters for specifying offsets are supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {Buffer|Uint8Array} A `Buffer` or {Uint8Array} with which to compare `buf`.",
                      "name": "target",
                      "type": "Buffer|Uint8Array",
                      "desc": "A `Buffer` or {Uint8Array} with which to compare `buf`."
                    },
                    {
                      "textRaw": "`targetStart` {integer} The offset within `target` at which to begin comparison. **Default:** `0`.",
                      "name": "targetStart",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "The offset within `target` at which to begin comparison.",
                      "optional": true
                    },
                    {
                      "textRaw": "`targetEnd` {integer} The offset within `target` at which to end comparison (not inclusive). **Default:** `target.length`.",
                      "name": "targetEnd",
                      "type": "integer",
                      "default": "`target.length`",
                      "desc": "The offset within `target` at which to end comparison (not inclusive).",
                      "optional": true
                    },
                    {
                      "textRaw": "`sourceStart` {integer} The offset within `buf` at which to begin comparison. **Default:** `0`.",
                      "name": "sourceStart",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "The offset within `buf` at which to begin comparison.",
                      "optional": true
                    },
                    {
                      "textRaw": "`sourceEnd` {integer} The offset within `buf` at which to end comparison (not inclusive). **Default:** `buf.length`.",
                      "name": "sourceEnd",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "The offset within `buf` at which to end comparison (not inclusive).",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Compares <code>buf</code> with <code>target</code> and returns a number indicating whether <code>buf</code>\ncomes before, after, or is the same as <code>target</code> in sort order.\nComparison is based on the actual sequence of bytes in each <code>Buffer</code>.</p>\n<ul>\n<li><code>0</code> is returned if <code>target</code> is the same as <code>buf</code></li>\n<li><code>1</code> is returned if <code>target</code> should come <em>before</em> <code>buf</code> when sorted.</li>\n<li><code>-1</code> is returned if <code>target</code> should come <em>after</em> <code>buf</code> when sorted.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from('ABC');\nconst buf2 = Buffer.from('BCD');\nconst buf3 = Buffer.from('ABCD');\n\nconsole.log(buf1.compare(buf1));\n// Prints: 0\nconsole.log(buf1.compare(buf2));\n// Prints: -1\nconsole.log(buf1.compare(buf3));\n// Prints: -1\nconsole.log(buf2.compare(buf1));\n// Prints: 1\nconsole.log(buf2.compare(buf3));\n// Prints: 1\nconsole.log([buf1, buf2, buf3].sort(Buffer.compare));\n// Prints: [ &#x3C;Buffer 41 42 43>, &#x3C;Buffer 41 42 43 44>, &#x3C;Buffer 42 43 44> ]\n// (This result is equal to: [buf1, buf3, buf2].)\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from('ABC');\nconst buf2 = Buffer.from('BCD');\nconst buf3 = Buffer.from('ABCD');\n\nconsole.log(buf1.compare(buf1));\n// Prints: 0\nconsole.log(buf1.compare(buf2));\n// Prints: -1\nconsole.log(buf1.compare(buf3));\n// Prints: -1\nconsole.log(buf2.compare(buf1));\n// Prints: 1\nconsole.log(buf2.compare(buf3));\n// Prints: 1\nconsole.log([buf1, buf2, buf3].sort(Buffer.compare));\n// Prints: [ &#x3C;Buffer 41 42 43>, &#x3C;Buffer 41 42 43 44>, &#x3C;Buffer 42 43 44> ]\n// (This result is equal to: [buf1, buf3, buf2].)\n</code></pre>\n<p>The optional <code>targetStart</code>, <code>targetEnd</code>, <code>sourceStart</code>, and <code>sourceEnd</code>\narguments can be used to limit the comparison to specific ranges within <code>target</code>\nand <code>buf</code> respectively.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);\nconst buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);\n\nconsole.log(buf1.compare(buf2, 5, 9, 0, 4));\n// Prints: 0\nconsole.log(buf1.compare(buf2, 0, 6, 4));\n// Prints: -1\nconsole.log(buf1.compare(buf2, 5, 6, 5));\n// Prints: 1\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8, 9]);\nconst buf2 = Buffer.from([5, 6, 7, 8, 9, 1, 2, 3, 4]);\n\nconsole.log(buf1.compare(buf2, 5, 9, 0, 4));\n// Prints: 0\nconsole.log(buf1.compare(buf2, 0, 6, 4));\n// Prints: -1\nconsole.log(buf1.compare(buf2, 5, 6, 5));\n// Prints: 1\n</code></pre>\n<p><a href=\"errors.html#err_out_of_range\"><code>ERR_OUT_OF_RANGE</code></a> is thrown if <code>targetStart &#x3C; 0</code>, <code>sourceStart &#x3C; 0</code>,\n<code>targetEnd > target.byteLength</code>, or <code>sourceEnd > source.byteLength</code>.</p>"
            },
            {
              "textRaw": "`buf.copy(target[, targetStart[, sourceStart[, sourceEnd]]])`",
              "name": "copy",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {Buffer|Uint8Array} A `Buffer` or {Uint8Array} to copy into.",
                      "name": "target",
                      "type": "Buffer|Uint8Array",
                      "desc": "A `Buffer` or {Uint8Array} to copy into."
                    },
                    {
                      "textRaw": "`targetStart` {integer} The offset within `target` at which to begin writing. **Default:** `0`.",
                      "name": "targetStart",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "The offset within `target` at which to begin writing.",
                      "optional": true
                    },
                    {
                      "textRaw": "`sourceStart` {integer} The offset within `buf` from which to begin copying. **Default:** `0`.",
                      "name": "sourceStart",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "The offset within `buf` from which to begin copying.",
                      "optional": true
                    },
                    {
                      "textRaw": "`sourceEnd` {integer} The offset within `buf` at which to stop copying (not inclusive). **Default:** `buf.length`.",
                      "name": "sourceEnd",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "The offset within `buf` at which to stop copying (not inclusive).",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} The number of bytes copied.",
                    "name": "return",
                    "type": "integer",
                    "desc": "The number of bytes copied."
                  }
                }
              ],
              "desc": "<p>Copies data from a region of <code>buf</code> to a region in <code>target</code>, even if the <code>target</code>\nmemory region overlaps with <code>buf</code>.</p>\n<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set\"><code>TypedArray.prototype.set()</code></a> performs the same operation, and is available\nfor all TypedArrays, including Node.js <code>Buffer</code>s, although it takes\ndifferent function arguments.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Create two `Buffer` instances.\nconst buf1 = Buffer.allocUnsafe(26);\nconst buf2 = Buffer.allocUnsafe(26).fill('!');\n\nfor (let i = 0; i &#x3C; 26; i++) {\n  // 97 is the decimal ASCII value for 'a'.\n  buf1[i] = i + 97;\n}\n\n// Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.\nbuf1.copy(buf2, 8, 16, 20);\n// This is equivalent to:\n// buf2.set(buf1.subarray(16, 20), 8);\n\nconsole.log(buf2.toString('ascii', 0, 25));\n// Prints: !!!!!!!!qrst!!!!!!!!!!!!!\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Create two `Buffer` instances.\nconst buf1 = Buffer.allocUnsafe(26);\nconst buf2 = Buffer.allocUnsafe(26).fill('!');\n\nfor (let i = 0; i &#x3C; 26; i++) {\n  // 97 is the decimal ASCII value for 'a'.\n  buf1[i] = i + 97;\n}\n\n// Copy `buf1` bytes 16 through 19 into `buf2` starting at byte 8 of `buf2`.\nbuf1.copy(buf2, 8, 16, 20);\n// This is equivalent to:\n// buf2.set(buf1.subarray(16, 20), 8);\n\nconsole.log(buf2.toString('ascii', 0, 25));\n// Prints: !!!!!!!!qrst!!!!!!!!!!!!!\n</code></pre>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Create a `Buffer` and copy data from one region to an overlapping region\n// within the same `Buffer`.\n\nconst buf = Buffer.allocUnsafe(26);\n\nfor (let i = 0; i &#x3C; 26; i++) {\n  // 97 is the decimal ASCII value for 'a'.\n  buf[i] = i + 97;\n}\n\nbuf.copy(buf, 0, 4, 10);\n\nconsole.log(buf.toString());\n// Prints: efghijghijklmnopqrstuvwxyz\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Create a `Buffer` and copy data from one region to an overlapping region\n// within the same `Buffer`.\n\nconst buf = Buffer.allocUnsafe(26);\n\nfor (let i = 0; i &#x3C; 26; i++) {\n  // 97 is the decimal ASCII value for 'a'.\n  buf[i] = i + 97;\n}\n\nbuf.copy(buf, 0, 4, 10);\n\nconsole.log(buf.toString());\n// Prints: efghijghijklmnopqrstuvwxyz\n</code></pre>"
            },
            {
              "textRaw": "`buf.entries()`",
              "name": "entries",
              "type": "method",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  }
                }
              ],
              "desc": "<p>Creates and returns an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols\">iterator</a> of <code>[index, byte]</code> pairs from the contents\nof <code>buf</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Log the entire contents of a `Buffer`.\n\nconst buf = Buffer.from('buffer');\n\nfor (const pair of buf.entries()) {\n  console.log(pair);\n}\n// Prints:\n//   [0, 98]\n//   [1, 117]\n//   [2, 102]\n//   [3, 102]\n//   [4, 101]\n//   [5, 114]\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Log the entire contents of a `Buffer`.\n\nconst buf = Buffer.from('buffer');\n\nfor (const pair of buf.entries()) {\n  console.log(pair);\n}\n// Prints:\n//   [0, 98]\n//   [1, 117]\n//   [2, 102]\n//   [3, 102]\n//   [4, 101]\n//   [5, 114]\n</code></pre>"
            },
            {
              "textRaw": "`buf.equals(otherBuffer)`",
              "name": "equals",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10236",
                    "description": "The arguments can now be `Uint8Array`s."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherBuffer` {Buffer|Uint8Array} A `Buffer` or {Uint8Array} with which to compare `buf`.",
                      "name": "otherBuffer",
                      "type": "Buffer|Uint8Array",
                      "desc": "A `Buffer` or {Uint8Array} with which to compare `buf`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if both <code>buf</code> and <code>otherBuffer</code> have exactly the same bytes,\n<code>false</code> otherwise. Equivalent to\n<a href=\"#bufcomparetarget-targetstart-targetend-sourcestart-sourceend\"><code>buf.compare(otherBuffer) === 0</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from('ABC');\nconst buf2 = Buffer.from('414243', 'hex');\nconst buf3 = Buffer.from('ABCD');\n\nconsole.log(buf1.equals(buf2));\n// Prints: true\nconsole.log(buf1.equals(buf3));\n// Prints: false\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from('ABC');\nconst buf2 = Buffer.from('414243', 'hex');\nconst buf3 = Buffer.from('ABCD');\n\nconsole.log(buf1.equals(buf2));\n// Prints: true\nconsole.log(buf1.equals(buf3));\n// Prints: false\n</code></pre>"
            },
            {
              "textRaw": "`buf.fill(value[, offset[, end]][, encoding])`",
              "name": "fill",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22969",
                    "description": "Throws `ERR_OUT_OF_RANGE` instead of `ERR_INDEX_OUT_OF_RANGE`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18790",
                    "description": "Negative `end` values throw an `ERR_INDEX_OUT_OF_RANGE` error."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18129",
                    "description": "Attempting to fill a non-zero length buffer with a zero length buffer triggers a thrown exception."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17427",
                    "description": "Specifying an invalid string for `value` triggers a thrown exception."
                  },
                  {
                    "version": "v5.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4935",
                    "description": "The `encoding` parameter is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {string|Buffer|Uint8Array|integer} The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`.",
                      "name": "value",
                      "type": "string|Buffer|Uint8Array|integer",
                      "desc": "The value with which to fill `buf`. Empty value (string, Uint8Array, Buffer) is coerced to `0`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to fill `buf`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to fill `buf`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`end` {integer} Where to stop filling `buf` (not inclusive). **Default:** `buf.length`.",
                      "name": "end",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "Where to stop filling `buf` (not inclusive).",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding for `value` if `value` is a string. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "The encoding for `value` if `value` is a string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A reference to `buf`.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A reference to `buf`."
                  }
                }
              ],
              "desc": "<p>Fills <code>buf</code> with the specified <code>value</code>. If the <code>offset</code> and <code>end</code> are not given,\nthe entire <code>buf</code> will be filled:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Fill a `Buffer` with the ASCII character 'h'.\n\nconst b = Buffer.allocUnsafe(50).fill('h');\n\nconsole.log(b.toString());\n// Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\n\n// Fill a buffer with empty string\nconst c = Buffer.allocUnsafe(5).fill('');\n\nconsole.log(c.fill(''));\n// Prints: &#x3C;Buffer 00 00 00 00 00>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Fill a `Buffer` with the ASCII character 'h'.\n\nconst b = Buffer.allocUnsafe(50).fill('h');\n\nconsole.log(b.toString());\n// Prints: hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh\n\n// Fill a buffer with empty string\nconst c = Buffer.allocUnsafe(5).fill('');\n\nconsole.log(c.fill(''));\n// Prints: &#x3C;Buffer 00 00 00 00 00>\n</code></pre>\n<p><code>value</code> is coerced to a <code>uint32</code> value if it is not a string, <code>Buffer</code>, or\ninteger. If the resulting integer is greater than <code>255</code> (decimal), <code>buf</code> will be\nfilled with <code>value &#x26; 255</code>.</p>\n<p>If the final write of a <code>fill()</code> operation falls on a multi-byte character,\nthen only the bytes of that character that fit into <code>buf</code> are written:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Fill a `Buffer` with character that takes up two bytes in UTF-8.\n\nconsole.log(Buffer.allocUnsafe(5).fill('\\u0222'));\n// Prints: &#x3C;Buffer c8 a2 c8 a2 c8>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Fill a `Buffer` with character that takes up two bytes in UTF-8.\n\nconsole.log(Buffer.allocUnsafe(5).fill('\\u0222'));\n// Prints: &#x3C;Buffer c8 a2 c8 a2 c8>\n</code></pre>\n<p>If <code>value</code> contains invalid characters, it is truncated; if no valid\nfill data remains, an exception is thrown:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(5);\n\nconsole.log(buf.fill('a'));\n// Prints: &#x3C;Buffer 61 61 61 61 61>\nconsole.log(buf.fill('aazz', 'hex'));\n// Prints: &#x3C;Buffer aa aa aa aa aa>\nconsole.log(buf.fill('zz', 'hex'));\n// Throws an exception.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(5);\n\nconsole.log(buf.fill('a'));\n// Prints: &#x3C;Buffer 61 61 61 61 61>\nconsole.log(buf.fill('aazz', 'hex'));\n// Prints: &#x3C;Buffer aa aa aa aa aa>\nconsole.log(buf.fill('zz', 'hex'));\n// Throws an exception.\n</code></pre>"
            },
            {
              "textRaw": "`buf.includes(value[, start[, end]][, encoding])`",
              "name": "includes",
              "type": "method",
              "meta": {
                "added": [
                  "v5.3.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62390",
                    "description": "Added the `end` parameter."
                  },
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56578",
                    "description": "supports Uint8Array as `this` value."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {string|Buffer|Uint8Array|integer} What to search for.",
                      "name": "value",
                      "type": "string|Buffer|Uint8Array|integer",
                      "desc": "What to search for."
                    },
                    {
                      "textRaw": "`start` {integer} Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. **Default:** `0`.",
                      "name": "start",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`end` {integer} Where to stop searching in `buf` (exclusive). **Default:** `buf.length`.",
                      "name": "end",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "Where to stop searching in `buf` (exclusive).",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} If `value` is a string, this is its encoding. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "If `value` is a string, this is its encoding.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if `value` was found in `buf`, `false` otherwise.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if `value` was found in `buf`, `false` otherwise."
                  }
                }
              ],
              "desc": "<p>Equivalent to <a href=\"#bufindexofvalue-byteoffset-encoding\"><code>buf.indexOf() !== -1</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('this is a buffer');\n\nconsole.log(buf.includes('this'));\n// Prints: true\nconsole.log(buf.includes('is'));\n// Prints: true\nconsole.log(buf.includes(Buffer.from('a buffer')));\n// Prints: true\nconsole.log(buf.includes(97));\n// Prints: true (97 is the decimal ASCII value for 'a')\nconsole.log(buf.includes(Buffer.from('a buffer example')));\n// Prints: false\nconsole.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));\n// Prints: true\nconsole.log(buf.includes('this', 4));\n// Prints: false\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('this is a buffer');\n\nconsole.log(buf.includes('this'));\n// Prints: true\nconsole.log(buf.includes('is'));\n// Prints: true\nconsole.log(buf.includes(Buffer.from('a buffer')));\n// Prints: true\nconsole.log(buf.includes(97));\n// Prints: true (97 is the decimal ASCII value for 'a')\nconsole.log(buf.includes(Buffer.from('a buffer example')));\n// Prints: false\nconsole.log(buf.includes(Buffer.from('a buffer example').slice(0, 8)));\n// Prints: true\nconsole.log(buf.includes('this', 4));\n// Prints: false\n</code></pre>"
            },
            {
              "textRaw": "`buf.indexOf(value[, start[, end]][, encoding])`",
              "name": "indexOf",
              "type": "method",
              "meta": {
                "added": [
                  "v1.5.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62390",
                    "description": "Added the `end` parameter."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10236",
                    "description": "The `value` can now be a `Uint8Array`."
                  },
                  {
                    "version": [
                      "v5.7.0",
                      "v4.4.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/4803",
                    "description": "When `encoding` is being passed, the `byteOffset` parameter is no longer required."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {string|Buffer|Uint8Array|integer} What to search for.",
                      "name": "value",
                      "type": "string|Buffer|Uint8Array|integer",
                      "desc": "What to search for."
                    },
                    {
                      "textRaw": "`start` {integer} Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. **Default:** `0`.",
                      "name": "start",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`end` {integer} Where to stop searching in `buf` (exclusive). **Default:** `buf.length`.",
                      "name": "end",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "Where to stop searching in `buf` (exclusive).",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.",
                    "name": "return",
                    "type": "integer",
                    "desc": "The index of the first occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`."
                  }
                }
              ],
              "desc": "<p>If <code>value</code> is:</p>\n<ul>\n<li>a string, <code>value</code> is interpreted according to the character encoding in\n<code>encoding</code>.</li>\n<li>a <code>Buffer</code> or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a>, <code>value</code> will be used in its entirety.\nTo compare a partial <code>Buffer</code>, use <a href=\"#bufsubarraystart-end\"><code>buf.subarray</code></a>.</li>\n<li>a number, <code>value</code> will be interpreted as an unsigned 8-bit integer\nvalue between <code>0</code> and <code>255</code>.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('this is a buffer');\n\nconsole.log(buf.indexOf('this'));\n// Prints: 0\nconsole.log(buf.indexOf('is'));\n// Prints: 2\nconsole.log(buf.indexOf(Buffer.from('a buffer')));\n// Prints: 8\nconsole.log(buf.indexOf(97));\n// Prints: 8 (97 is the decimal ASCII value for 'a')\nconsole.log(buf.indexOf(Buffer.from('a buffer example')));\n// Prints: -1\nconsole.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));\n// Prints: 8\n\nconst utf16Buffer = Buffer.from('\\u039a\\u0391\\u03a3\\u03a3\\u0395', 'utf16le');\n\nconsole.log(utf16Buffer.indexOf('\\u03a3', 0, 'utf16le'));\n// Prints: 4\nconsole.log(utf16Buffer.indexOf('\\u03a3', -4, 'utf16le'));\n// Prints: 6\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('this is a buffer');\n\nconsole.log(buf.indexOf('this'));\n// Prints: 0\nconsole.log(buf.indexOf('is'));\n// Prints: 2\nconsole.log(buf.indexOf(Buffer.from('a buffer')));\n// Prints: 8\nconsole.log(buf.indexOf(97));\n// Prints: 8 (97 is the decimal ASCII value for 'a')\nconsole.log(buf.indexOf(Buffer.from('a buffer example')));\n// Prints: -1\nconsole.log(buf.indexOf(Buffer.from('a buffer example').slice(0, 8)));\n// Prints: 8\n\nconst utf16Buffer = Buffer.from('\\u039a\\u0391\\u03a3\\u03a3\\u0395', 'utf16le');\n\nconsole.log(utf16Buffer.indexOf('\\u03a3', 0, 'utf16le'));\n// Prints: 4\nconsole.log(utf16Buffer.indexOf('\\u03a3', -4, 'utf16le'));\n// Prints: 6\n</code></pre>\n<p>If <code>value</code> is not a string, number, or <code>Buffer</code>, this method will throw a\n<code>TypeError</code>. If <code>value</code> is a number, it will be coerced to a valid byte value,\nan integer between 0 and 255.</p>\n<p>If <code>byteOffset</code> is not a number, it will be coerced to a number. If the result\nof coercion is <code>NaN</code> or <code>0</code>, then the entire buffer will be searched. This\nbehavior matches <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf\"><code>String.prototype.indexOf()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst b = Buffer.from('abcdef');\n\n// Passing a value that's a number, but not a valid byte.\n// Prints: 2, equivalent to searching for 99 or 'c'.\nconsole.log(b.indexOf(99.9));\nconsole.log(b.indexOf(256 + 99));\n\n// Passing a byteOffset that coerces to NaN or 0.\n// Prints: 1, searching the whole buffer.\nconsole.log(b.indexOf('b', undefined));\nconsole.log(b.indexOf('b', {}));\nconsole.log(b.indexOf('b', null));\nconsole.log(b.indexOf('b', []));\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst b = Buffer.from('abcdef');\n\n// Passing a value that's a number, but not a valid byte.\n// Prints: 2, equivalent to searching for 99 or 'c'.\nconsole.log(b.indexOf(99.9));\nconsole.log(b.indexOf(256 + 99));\n\n// Passing a byteOffset that coerces to NaN or 0.\n// Prints: 1, searching the whole buffer.\nconsole.log(b.indexOf('b', undefined));\nconsole.log(b.indexOf('b', {}));\nconsole.log(b.indexOf('b', null));\nconsole.log(b.indexOf('b', []));\n</code></pre>\n<p>If <code>value</code> is an empty string or empty <code>Buffer</code> and <code>byteOffset</code> is less\nthan <code>buf.length</code>, <code>byteOffset</code> will be returned. If <code>value</code> is empty and\n<code>byteOffset</code> is at least <code>buf.length</code>, <code>buf.length</code> will be returned.</p>"
            },
            {
              "textRaw": "`buf.keys()`",
              "name": "keys",
              "type": "method",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  }
                }
              ],
              "desc": "<p>Creates and returns an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols\">iterator</a> of <code>buf</code> keys (indexes).</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('buffer');\n\nfor (const key of buf.keys()) {\n  console.log(key);\n}\n// Prints:\n//   0\n//   1\n//   2\n//   3\n//   4\n//   5\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('buffer');\n\nfor (const key of buf.keys()) {\n  console.log(key);\n}\n// Prints:\n//   0\n//   1\n//   2\n//   3\n//   4\n//   5\n</code></pre>"
            },
            {
              "textRaw": "`buf.lastIndexOf(value[, start[, end]][, encoding])`",
              "name": "lastIndexOf",
              "type": "method",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62390",
                    "description": "Added the `end` parameter."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10236",
                    "description": "The `value` can now be a `Uint8Array`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {string|Buffer|Uint8Array|integer} What to search for.",
                      "name": "value",
                      "type": "string|Buffer|Uint8Array|integer",
                      "desc": "What to search for."
                    },
                    {
                      "textRaw": "`start` {integer} Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`. **Default:** `buf.length - 1`.",
                      "name": "start",
                      "type": "integer",
                      "default": "`buf.length - 1`",
                      "desc": "Where to begin searching in `buf`. If negative, then offset is calculated from the end of `buf`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`end` {integer} Where to stop searching in `buf` (exclusive). **Default:** `buf.length`.",
                      "name": "end",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "Where to stop searching in `buf` (exclusive).",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "If `value` is a string, this is the encoding used to determine the binary representation of the string that will be searched for in `buf`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`.",
                    "name": "return",
                    "type": "integer",
                    "desc": "The index of the last occurrence of `value` in `buf`, or `-1` if `buf` does not contain `value`."
                  }
                }
              ],
              "desc": "<p>Identical to <a href=\"#bufindexofvalue-byteoffset-encoding\"><code>buf.indexOf()</code></a>, except the last occurrence of <code>value</code> is found\nrather than the first occurrence.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('this buffer is a buffer');\n\nconsole.log(buf.lastIndexOf('this'));\n// Prints: 0\nconsole.log(buf.lastIndexOf('buffer'));\n// Prints: 17\nconsole.log(buf.lastIndexOf(Buffer.from('buffer')));\n// Prints: 17\nconsole.log(buf.lastIndexOf(97));\n// Prints: 15 (97 is the decimal ASCII value for 'a')\nconsole.log(buf.lastIndexOf(Buffer.from('yolo')));\n// Prints: -1\nconsole.log(buf.lastIndexOf('buffer', 5));\n// Prints: 5\nconsole.log(buf.lastIndexOf('buffer', 4));\n// Prints: -1\n\nconst utf16Buffer = Buffer.from('\\u039a\\u0391\\u03a3\\u03a3\\u0395', 'utf16le');\n\nconsole.log(utf16Buffer.lastIndexOf('\\u03a3', undefined, 'utf16le'));\n// Prints: 6\nconsole.log(utf16Buffer.lastIndexOf('\\u03a3', -5, 'utf16le'));\n// Prints: 4\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('this buffer is a buffer');\n\nconsole.log(buf.lastIndexOf('this'));\n// Prints: 0\nconsole.log(buf.lastIndexOf('buffer'));\n// Prints: 17\nconsole.log(buf.lastIndexOf(Buffer.from('buffer')));\n// Prints: 17\nconsole.log(buf.lastIndexOf(97));\n// Prints: 15 (97 is the decimal ASCII value for 'a')\nconsole.log(buf.lastIndexOf(Buffer.from('yolo')));\n// Prints: -1\nconsole.log(buf.lastIndexOf('buffer', 5));\n// Prints: 5\nconsole.log(buf.lastIndexOf('buffer', 4));\n// Prints: -1\n\nconst utf16Buffer = Buffer.from('\\u039a\\u0391\\u03a3\\u03a3\\u0395', 'utf16le');\n\nconsole.log(utf16Buffer.lastIndexOf('\\u03a3', undefined, 'utf16le'));\n// Prints: 6\nconsole.log(utf16Buffer.lastIndexOf('\\u03a3', -5, 'utf16le'));\n// Prints: 4\n</code></pre>\n<p>If <code>value</code> is not a string, number, or <code>Buffer</code>, this method will throw a\n<code>TypeError</code>. If <code>value</code> is a number, it will be coerced to a valid byte value,\nan integer between 0 and 255.</p>\n<p>If <code>byteOffset</code> is not a number, it will be coerced to a number. Any arguments\nthat coerce to <code>NaN</code>, like <code>{}</code> or <code>undefined</code>, will search the whole buffer.\nThis behavior matches <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf\"><code>String.prototype.lastIndexOf()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst b = Buffer.from('abcdef');\n\n// Passing a value that's a number, but not a valid byte.\n// Prints: 2, equivalent to searching for 99 or 'c'.\nconsole.log(b.lastIndexOf(99.9));\nconsole.log(b.lastIndexOf(256 + 99));\n\n// Passing a byteOffset that coerces to NaN.\n// Prints: 1, searching the whole buffer.\nconsole.log(b.lastIndexOf('b', undefined));\nconsole.log(b.lastIndexOf('b', {}));\n\n// Passing a byteOffset that coerces to 0.\n// Prints: -1, equivalent to passing 0.\nconsole.log(b.lastIndexOf('b', null));\nconsole.log(b.lastIndexOf('b', []));\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst b = Buffer.from('abcdef');\n\n// Passing a value that's a number, but not a valid byte.\n// Prints: 2, equivalent to searching for 99 or 'c'.\nconsole.log(b.lastIndexOf(99.9));\nconsole.log(b.lastIndexOf(256 + 99));\n\n// Passing a byteOffset that coerces to NaN.\n// Prints: 1, searching the whole buffer.\nconsole.log(b.lastIndexOf('b', undefined));\nconsole.log(b.lastIndexOf('b', {}));\n\n// Passing a byteOffset that coerces to 0.\n// Prints: -1, equivalent to passing 0.\nconsole.log(b.lastIndexOf('b', null));\nconsole.log(b.lastIndexOf('b', []));\n</code></pre>\n<p>If <code>value</code> is an empty string or empty <code>Buffer</code>, <code>byteOffset</code> will be returned.</p>"
            },
            {
              "textRaw": "`buf.readBigInt64BE([offset])`",
              "name": "readBigInt64BE",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  }
                }
              ],
              "desc": "<p>Reads a signed, big-endian 64-bit integer from <code>buf</code> at the specified <code>offset</code>.</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed\nvalues.</p>"
            },
            {
              "textRaw": "`buf.readBigInt64LE([offset])`",
              "name": "readBigInt64LE",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  }
                }
              ],
              "desc": "<p>Reads a signed, little-endian 64-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed\nvalues.</p>"
            },
            {
              "textRaw": "`buf.readBigUInt64BE([offset])`",
              "name": "readBigUInt64BE",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.10.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34960",
                    "description": "This function is also available as `buf.readBigUint64BE()`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  }
                }
              ],
              "desc": "<p>Reads an unsigned, big-endian 64-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>This function is also available under the <code>readBigUint64BE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);\n\nconsole.log(buf.readBigUInt64BE(0));\n// Prints: 4294967295n\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);\n\nconsole.log(buf.readBigUInt64BE(0));\n// Prints: 4294967295n\n</code></pre>"
            },
            {
              "textRaw": "`buf.readBigUInt64LE([offset])`",
              "name": "readBigUInt64LE",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.10.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34960",
                    "description": "This function is also available as `buf.readBigUint64LE()`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy: `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  }
                }
              ],
              "desc": "<p>Reads an unsigned, little-endian 64-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>This function is also available under the <code>readBigUint64LE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);\n\nconsole.log(buf.readBigUInt64LE(0));\n// Prints: 18446744069414584320n\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff]);\n\nconsole.log(buf.readBigUInt64LE(0));\n// Prints: 18446744069414584320n\n</code></pre>"
            },
            {
              "textRaw": "`buf.readDoubleBE([offset])`",
              "name": "readDoubleBE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Reads a 64-bit, big-endian double from <code>buf</code> at the specified <code>offset</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);\n\nconsole.log(buf.readDoubleBE(0));\n// Prints: 8.20788039913184e-304\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);\n\nconsole.log(buf.readDoubleBE(0));\n// Prints: 8.20788039913184e-304\n</code></pre>"
            },
            {
              "textRaw": "`buf.readDoubleLE([offset])`",
              "name": "readDoubleLE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Reads a 64-bit, little-endian double from <code>buf</code> at the specified <code>offset</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);\n\nconsole.log(buf.readDoubleLE(0));\n// Prints: 5.447603722011605e-270\nconsole.log(buf.readDoubleLE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([1, 2, 3, 4, 5, 6, 7, 8]);\n\nconsole.log(buf.readDoubleLE(0));\n// Prints: 5.447603722011605e-270\nconsole.log(buf.readDoubleLE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readFloatBE([offset])`",
              "name": "readFloatBE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Reads a 32-bit, big-endian float from <code>buf</code> at the specified <code>offset</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([1, 2, 3, 4]);\n\nconsole.log(buf.readFloatBE(0));\n// Prints: 2.387939260590663e-38\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([1, 2, 3, 4]);\n\nconsole.log(buf.readFloatBE(0));\n// Prints: 2.387939260590663e-38\n</code></pre>"
            },
            {
              "textRaw": "`buf.readFloatLE([offset])`",
              "name": "readFloatLE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Reads a 32-bit, little-endian float from <code>buf</code> at the specified <code>offset</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([1, 2, 3, 4]);\n\nconsole.log(buf.readFloatLE(0));\n// Prints: 1.539989614439558e-36\nconsole.log(buf.readFloatLE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([1, 2, 3, 4]);\n\nconsole.log(buf.readFloatLE(0));\n// Prints: 1.539989614439558e-36\nconsole.log(buf.readFloatLE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readInt8([offset])`",
              "name": "readInt8",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads a signed 8-bit integer from <code>buf</code> at the specified <code>offset</code>.</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([-1, 5]);\n\nconsole.log(buf.readInt8(0));\n// Prints: -1\nconsole.log(buf.readInt8(1));\n// Prints: 5\nconsole.log(buf.readInt8(2));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([-1, 5]);\n\nconsole.log(buf.readInt8(0));\n// Prints: -1\nconsole.log(buf.readInt8(1));\n// Prints: 5\nconsole.log(buf.readInt8(2));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readInt16BE([offset])`",
              "name": "readInt16BE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads a signed, big-endian 16-bit integer from <code>buf</code> at the specified <code>offset</code>.</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0, 5]);\n\nconsole.log(buf.readInt16BE(0));\n// Prints: 5\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0, 5]);\n\nconsole.log(buf.readInt16BE(0));\n// Prints: 5\n</code></pre>"
            },
            {
              "textRaw": "`buf.readInt16LE([offset])`",
              "name": "readInt16LE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads a signed, little-endian 16-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0, 5]);\n\nconsole.log(buf.readInt16LE(0));\n// Prints: 1280\nconsole.log(buf.readInt16LE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0, 5]);\n\nconsole.log(buf.readInt16LE(0));\n// Prints: 1280\nconsole.log(buf.readInt16LE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readInt32BE([offset])`",
              "name": "readInt32BE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads a signed, big-endian 32-bit integer from <code>buf</code> at the specified <code>offset</code>.</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0, 0, 0, 5]);\n\nconsole.log(buf.readInt32BE(0));\n// Prints: 5\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0, 0, 0, 5]);\n\nconsole.log(buf.readInt32BE(0));\n// Prints: 5\n</code></pre>"
            },
            {
              "textRaw": "`buf.readInt32LE([offset])`",
              "name": "readInt32LE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads a signed, little-endian 32-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>Integers read from a <code>Buffer</code> are interpreted as two's complement signed values.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0, 0, 0, 5]);\n\nconsole.log(buf.readInt32LE(0));\n// Prints: 83886080\nconsole.log(buf.readInt32LE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0, 0, 0, 5]);\n\nconsole.log(buf.readInt32LE(0));\n// Prints: 83886080\nconsole.log(buf.readInt32LE(1));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readIntBE(offset, byteLength)`",
              "name": "readIntBE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56578",
                    "description": "supports Uint8Array as `this` value."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`."
                    },
                    {
                      "textRaw": "`byteLength` {integer} Number of bytes to read. Must satisfy `0 < byteLength <= 6`.",
                      "name": "byteLength",
                      "type": "integer",
                      "desc": "Number of bytes to read. Must satisfy `0 < byteLength <= 6`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads <code>byteLength</code> number of bytes from <code>buf</code> at the specified <code>offset</code>\nand interprets the result as a big-endian, two's complement signed value\nsupporting up to 48 bits of accuracy.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readIntBE(0, 6).toString(16));\n// Prints: 1234567890ab\nconsole.log(buf.readIntBE(1, 6).toString(16));\n// Throws ERR_OUT_OF_RANGE.\nconsole.log(buf.readIntBE(1, 0).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readIntBE(0, 6).toString(16));\n// Prints: 1234567890ab\nconsole.log(buf.readIntBE(1, 6).toString(16));\n// Throws ERR_OUT_OF_RANGE.\nconsole.log(buf.readIntBE(1, 0).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readIntLE(offset, byteLength)`",
              "name": "readIntLE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56578",
                    "description": "supports Uint8Array as `this` value."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`."
                    },
                    {
                      "textRaw": "`byteLength` {integer} Number of bytes to read. Must satisfy `0 < byteLength <= 6`.",
                      "name": "byteLength",
                      "type": "integer",
                      "desc": "Number of bytes to read. Must satisfy `0 < byteLength <= 6`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads <code>byteLength</code> number of bytes from <code>buf</code> at the specified <code>offset</code>\nand interprets the result as a little-endian, two's complement signed value\nsupporting up to 48 bits of accuracy.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readIntLE(0, 6).toString(16));\n// Prints: -546f87a9cbee\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readIntLE(0, 6).toString(16));\n// Prints: -546f87a9cbee\n</code></pre>"
            },
            {
              "textRaw": "`buf.readUInt8([offset])`",
              "name": "readUInt8",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.readUint8()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 1`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads an unsigned 8-bit integer from <code>buf</code> at the specified <code>offset</code>.</p>\n<p>This function is also available under the <code>readUint8</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([1, -2]);\n\nconsole.log(buf.readUInt8(0));\n// Prints: 1\nconsole.log(buf.readUInt8(1));\n// Prints: 254\nconsole.log(buf.readUInt8(2));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([1, -2]);\n\nconsole.log(buf.readUInt8(0));\n// Prints: 1\nconsole.log(buf.readUInt8(1));\n// Prints: 254\nconsole.log(buf.readUInt8(2));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readUInt16BE([offset])`",
              "name": "readUInt16BE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.readUint16BE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads an unsigned, big-endian 16-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>This function is also available under the <code>readUint16BE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x12, 0x34, 0x56]);\n\nconsole.log(buf.readUInt16BE(0).toString(16));\n// Prints: 1234\nconsole.log(buf.readUInt16BE(1).toString(16));\n// Prints: 3456\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x12, 0x34, 0x56]);\n\nconsole.log(buf.readUInt16BE(0).toString(16));\n// Prints: 1234\nconsole.log(buf.readUInt16BE(1).toString(16));\n// Prints: 3456\n</code></pre>"
            },
            {
              "textRaw": "`buf.readUInt16LE([offset])`",
              "name": "readUInt16LE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.readUint16LE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 2`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads an unsigned, little-endian 16-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>This function is also available under the <code>readUint16LE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x12, 0x34, 0x56]);\n\nconsole.log(buf.readUInt16LE(0).toString(16));\n// Prints: 3412\nconsole.log(buf.readUInt16LE(1).toString(16));\n// Prints: 5634\nconsole.log(buf.readUInt16LE(2).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x12, 0x34, 0x56]);\n\nconsole.log(buf.readUInt16LE(0).toString(16));\n// Prints: 3412\nconsole.log(buf.readUInt16LE(1).toString(16));\n// Prints: 5634\nconsole.log(buf.readUInt16LE(2).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readUInt32BE([offset])`",
              "name": "readUInt32BE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.readUint32BE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads an unsigned, big-endian 32-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>This function is also available under the <code>readUint32BE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);\n\nconsole.log(buf.readUInt32BE(0).toString(16));\n// Prints: 12345678\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);\n\nconsole.log(buf.readUInt32BE(0).toString(16));\n// Prints: 12345678\n</code></pre>"
            },
            {
              "textRaw": "`buf.readUInt32LE([offset])`",
              "name": "readUInt32LE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.readUint32LE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads an unsigned, little-endian 32-bit integer from <code>buf</code> at the specified\n<code>offset</code>.</p>\n<p>This function is also available under the <code>readUint32LE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);\n\nconsole.log(buf.readUInt32LE(0).toString(16));\n// Prints: 78563412\nconsole.log(buf.readUInt32LE(1).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78]);\n\nconsole.log(buf.readUInt32LE(0).toString(16));\n// Prints: 78563412\nconsole.log(buf.readUInt32LE(1).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readUIntBE(offset, byteLength)`",
              "name": "readUIntBE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56578",
                    "description": "supports Uint8Array as `this` value."
                  },
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.readUintBE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`."
                    },
                    {
                      "textRaw": "`byteLength` {integer} Number of bytes to read. Must satisfy `0 < byteLength <= 6`.",
                      "name": "byteLength",
                      "type": "integer",
                      "desc": "Number of bytes to read. Must satisfy `0 < byteLength <= 6`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads <code>byteLength</code> number of bytes from <code>buf</code> at the specified <code>offset</code>\nand interprets the result as an unsigned big-endian integer supporting\nup to 48 bits of accuracy.</p>\n<p>This function is also available under the <code>readUintBE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readUIntBE(0, 6).toString(16));\n// Prints: 1234567890ab\nconsole.log(buf.readUIntBE(1, 6).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readUIntBE(0, 6).toString(16));\n// Prints: 1234567890ab\nconsole.log(buf.readUIntBE(1, 6).toString(16));\n// Throws ERR_OUT_OF_RANGE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.readUIntLE(offset, byteLength)`",
              "name": "readUIntLE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56578",
                    "description": "supports Uint8Array as `this` value."
                  },
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.readUintLE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Number of bytes to skip before starting to read. Must satisfy `0 <= offset <= buf.length - byteLength`."
                    },
                    {
                      "textRaw": "`byteLength` {integer} Number of bytes to read. Must satisfy `0 < byteLength <= 6`.",
                      "name": "byteLength",
                      "type": "integer",
                      "desc": "Number of bytes to read. Must satisfy `0 < byteLength <= 6`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Reads <code>byteLength</code> number of bytes from <code>buf</code> at the specified <code>offset</code>\nand interprets the result as an unsigned, little-endian integer supporting\nup to 48 bits of accuracy.</p>\n<p>This function is also available under the <code>readUintLE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readUIntLE(0, 6).toString(16));\n// Prints: ab9078563412\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x12, 0x34, 0x56, 0x78, 0x90, 0xab]);\n\nconsole.log(buf.readUIntLE(0, 6).toString(16));\n// Prints: ab9078563412\n</code></pre>"
            },
            {
              "textRaw": "`buf.subarray([start[, end]])`",
              "name": "subarray",
              "type": "method",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`start` {integer} Where the new `Buffer` will start. **Default:** `0`.",
                      "name": "start",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Where the new `Buffer` will start.",
                      "optional": true
                    },
                    {
                      "textRaw": "`end` {integer} Where the new `Buffer` will end (not inclusive). **Default:** `buf.length`.",
                      "name": "end",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "Where the new `Buffer` will end (not inclusive).",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Returns a new <code>Buffer</code> that references the same memory as the original, but\noffset and cropped by the <code>start</code> and <code>end</code> indexes.</p>\n<p>Specifying <code>end</code> greater than <a href=\"#buflength\"><code>buf.length</code></a> will return the same result as\nthat of <code>end</code> equal to <a href=\"#buflength\"><code>buf.length</code></a>.</p>\n<p>This method is inherited from <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray\"><code>TypedArray.prototype.subarray()</code></a>.</p>\n<p>Modifying the new <code>Buffer</code> slice will modify the memory in the original <code>Buffer</code>\nbecause the allocated memory of the two objects overlap.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\n// Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte\n// from the original `Buffer`.\n\nconst buf1 = Buffer.allocUnsafe(26);\n\nfor (let i = 0; i &#x3C; 26; i++) {\n  // 97 is the decimal ASCII value for 'a'.\n  buf1[i] = i + 97;\n}\n\nconst buf2 = buf1.subarray(0, 3);\n\nconsole.log(buf2.toString('ascii', 0, buf2.length));\n// Prints: abc\n\nbuf1[0] = 33;\n\nconsole.log(buf2.toString('ascii', 0, buf2.length));\n// Prints: !bc\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\n// Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte\n// from the original `Buffer`.\n\nconst buf1 = Buffer.allocUnsafe(26);\n\nfor (let i = 0; i &#x3C; 26; i++) {\n  // 97 is the decimal ASCII value for 'a'.\n  buf1[i] = i + 97;\n}\n\nconst buf2 = buf1.subarray(0, 3);\n\nconsole.log(buf2.toString('ascii', 0, buf2.length));\n// Prints: abc\n\nbuf1[0] = 33;\n\nconsole.log(buf2.toString('ascii', 0, buf2.length));\n// Prints: !bc\n</code></pre>\n<p>Specifying negative indexes causes the slice to be generated relative to the\nend of <code>buf</code> rather than the beginning.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('buffer');\n\nconsole.log(buf.subarray(-6, -1).toString());\n// Prints: buffe\n// (Equivalent to buf.subarray(0, 5).)\n\nconsole.log(buf.subarray(-6, -2).toString());\n// Prints: buff\n// (Equivalent to buf.subarray(0, 4).)\n\nconsole.log(buf.subarray(-5, -2).toString());\n// Prints: uff\n// (Equivalent to buf.subarray(1, 4).)\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('buffer');\n\nconsole.log(buf.subarray(-6, -1).toString());\n// Prints: buffe\n// (Equivalent to buf.subarray(0, 5).)\n\nconsole.log(buf.subarray(-6, -2).toString());\n// Prints: buff\n// (Equivalent to buf.subarray(0, 4).)\n\nconsole.log(buf.subarray(-5, -2).toString());\n// Prints: uff\n// (Equivalent to buf.subarray(1, 4).)\n</code></pre>"
            },
            {
              "textRaw": "`buf.slice([start[, end]])`",
              "name": "slice",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.5.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41596",
                    "description": "The buf.slice() method has been deprecated."
                  },
                  {
                    "version": [
                      "v7.1.0",
                      "v6.9.2"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/9341",
                    "description": "Coercing the offsets to integers now handles values outside the 32-bit integer range properly."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9101",
                    "description": "All offsets are now coerced to integers before doing any calculations with them."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `buf.subarray` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`start` {integer} Where the new `Buffer` will start. **Default:** `0`.",
                      "name": "start",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Where the new `Buffer` will start.",
                      "optional": true
                    },
                    {
                      "textRaw": "`end` {integer} Where the new `Buffer` will end (not inclusive). **Default:** `buf.length`.",
                      "name": "end",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "Where the new `Buffer` will end (not inclusive).",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Returns a new <code>Buffer</code> that references the same memory as the original, but\noffset and cropped by the <code>start</code> and <code>end</code> indexes.</p>\n<p>This method is not compatible with the <code>Uint8Array.prototype.slice()</code>,\nwhich is a superclass of <code>Buffer</code>. To copy the slice, use\n<code>Uint8Array.prototype.slice()</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('buffer');\n\nconst copiedBuf = Uint8Array.prototype.slice.call(buf);\ncopiedBuf[0]++;\nconsole.log(copiedBuf.toString());\n// Prints: cuffer\n\nconsole.log(buf.toString());\n// Prints: buffer\n\n// With buf.slice(), the original buffer is modified.\nconst notReallyCopiedBuf = buf.slice();\nnotReallyCopiedBuf[0]++;\nconsole.log(notReallyCopiedBuf.toString());\n// Prints: cuffer\nconsole.log(buf.toString());\n// Also prints: cuffer (!)\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('buffer');\n\nconst copiedBuf = Uint8Array.prototype.slice.call(buf);\ncopiedBuf[0]++;\nconsole.log(copiedBuf.toString());\n// Prints: cuffer\n\nconsole.log(buf.toString());\n// Prints: buffer\n\n// With buf.slice(), the original buffer is modified.\nconst notReallyCopiedBuf = buf.slice();\nnotReallyCopiedBuf[0]++;\nconsole.log(notReallyCopiedBuf.toString());\n// Prints: cuffer\nconsole.log(buf.toString());\n// Also prints: cuffer (!)\n</code></pre>"
            },
            {
              "textRaw": "`buf.swap16()`",
              "name": "swap16",
              "type": "method",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer} A reference to `buf`.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A reference to `buf`."
                  }
                }
              ],
              "desc": "<p>Interprets <code>buf</code> as an array of unsigned 16-bit integers and swaps the\nbyte order <em>in-place</em>. Throws <a href=\"errors.html#err_invalid_buffer_size\"><code>ERR_INVALID_BUFFER_SIZE</code></a> if <a href=\"#buflength\"><code>buf.length</code></a>\nis not a multiple of 2.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 01 02 03 04 05 06 07 08>\n\nbuf1.swap16();\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 02 01 04 03 06 05 08 07>\n\nconst buf2 = Buffer.from([0x1, 0x2, 0x3]);\n\nbuf2.swap16();\n// Throws ERR_INVALID_BUFFER_SIZE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 01 02 03 04 05 06 07 08>\n\nbuf1.swap16();\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 02 01 04 03 06 05 08 07>\n\nconst buf2 = Buffer.from([0x1, 0x2, 0x3]);\n\nbuf2.swap16();\n// Throws ERR_INVALID_BUFFER_SIZE.\n</code></pre>\n<p>One convenient use of <code>buf.swap16()</code> is to perform a fast in-place conversion\nbetween UTF-16 little-endian and UTF-16 big-endian:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('This is little-endian UTF-16', 'utf16le');\nbuf.swap16(); // Convert to big-endian UTF-16 text.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('This is little-endian UTF-16', 'utf16le');\nbuf.swap16(); // Convert to big-endian UTF-16 text.\n</code></pre>"
            },
            {
              "textRaw": "`buf.swap32()`",
              "name": "swap32",
              "type": "method",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer} A reference to `buf`.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A reference to `buf`."
                  }
                }
              ],
              "desc": "<p>Interprets <code>buf</code> as an array of unsigned 32-bit integers and swaps the\nbyte order <em>in-place</em>. Throws <a href=\"errors.html#err_invalid_buffer_size\"><code>ERR_INVALID_BUFFER_SIZE</code></a> if <a href=\"#buflength\"><code>buf.length</code></a>\nis not a multiple of 4.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 01 02 03 04 05 06 07 08>\n\nbuf1.swap32();\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 04 03 02 01 08 07 06 05>\n\nconst buf2 = Buffer.from([0x1, 0x2, 0x3]);\n\nbuf2.swap32();\n// Throws ERR_INVALID_BUFFER_SIZE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 01 02 03 04 05 06 07 08>\n\nbuf1.swap32();\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 04 03 02 01 08 07 06 05>\n\nconst buf2 = Buffer.from([0x1, 0x2, 0x3]);\n\nbuf2.swap32();\n// Throws ERR_INVALID_BUFFER_SIZE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.swap64()`",
              "name": "swap64",
              "type": "method",
              "meta": {
                "added": [
                  "v6.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer} A reference to `buf`.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A reference to `buf`."
                  }
                }
              ],
              "desc": "<p>Interprets <code>buf</code> as an array of 64-bit numbers and swaps byte order <em>in-place</em>.\nThrows <a href=\"errors.html#err_invalid_buffer_size\"><code>ERR_INVALID_BUFFER_SIZE</code></a> if <a href=\"#buflength\"><code>buf.length</code></a> is not a multiple of 8.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 01 02 03 04 05 06 07 08>\n\nbuf1.swap64();\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 08 07 06 05 04 03 02 01>\n\nconst buf2 = Buffer.from([0x1, 0x2, 0x3]);\n\nbuf2.swap64();\n// Throws ERR_INVALID_BUFFER_SIZE.\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]);\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 01 02 03 04 05 06 07 08>\n\nbuf1.swap64();\n\nconsole.log(buf1);\n// Prints: &#x3C;Buffer 08 07 06 05 04 03 02 01>\n\nconst buf2 = Buffer.from([0x1, 0x2, 0x3]);\n\nbuf2.swap64();\n// Throws ERR_INVALID_BUFFER_SIZE.\n</code></pre>"
            },
            {
              "textRaw": "`buf.toJSON()`",
              "name": "toJSON",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.2"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns a JSON representation of <code>buf</code>. <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\"><code>JSON.stringify()</code></a> implicitly calls\nthis function when stringifying a <code>Buffer</code> instance.</p>\n<p><code>Buffer.from()</code> accepts objects in the format returned from this method.\nIn particular, <code>Buffer.from(buf.toJSON())</code> works like <code>Buffer.from(buf)</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);\nconst json = JSON.stringify(buf);\n\nconsole.log(json);\n// Prints: {\"type\":\"Buffer\",\"data\":[1,2,3,4,5]}\n\nconst copy = JSON.parse(json, (key, value) => {\n  return value &#x26;&#x26; value.type === 'Buffer' ?\n    Buffer.from(value) :\n    value;\n});\n\nconsole.log(copy);\n// Prints: &#x3C;Buffer 01 02 03 04 05>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5]);\nconst json = JSON.stringify(buf);\n\nconsole.log(json);\n// Prints: {\"type\":\"Buffer\",\"data\":[1,2,3,4,5]}\n\nconst copy = JSON.parse(json, (key, value) => {\n  return value &#x26;&#x26; value.type === 'Buffer' ?\n    Buffer.from(value) :\n    value;\n});\n\nconsole.log(copy);\n// Prints: &#x3C;Buffer 01 02 03 04 05>\n</code></pre>"
            },
            {
              "textRaw": "`buf.toString([encoding[, start[, end]]])`",
              "name": "toString",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56578",
                    "description": "supports Uint8Array as `this` value."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The character encoding to use. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "The character encoding to use.",
                      "optional": true
                    },
                    {
                      "textRaw": "`start` {integer} The byte offset to start decoding at. **Default:** `0`.",
                      "name": "start",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "The byte offset to start decoding at.",
                      "optional": true
                    },
                    {
                      "textRaw": "`end` {integer} The byte offset to stop decoding at (not inclusive). **Default:** `buf.length`.",
                      "name": "end",
                      "type": "integer",
                      "default": "`buf.length`",
                      "desc": "The byte offset to stop decoding at (not inclusive).",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Decodes <code>buf</code> to a string according to the specified character encoding in\n<code>encoding</code>. <code>start</code> and <code>end</code> may be passed to decode only a subset of <code>buf</code>.</p>\n<p>If <code>encoding</code> is <code>'utf8'</code> and a byte sequence in the input is not valid UTF-8,\nthen each invalid byte is replaced with the replacement character <code>U+FFFD</code>.</p>\n<p>The maximum length of a string instance (in UTF-16 code units) is available\nas <a href=\"#bufferconstantsmax_string_length\"><code>buffer.constants.MAX_STRING_LENGTH</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.allocUnsafe(26);\n\nfor (let i = 0; i &#x3C; 26; i++) {\n  // 97 is the decimal ASCII value for 'a'.\n  buf1[i] = i + 97;\n}\n\nconsole.log(buf1.toString('utf8'));\n// Prints: abcdefghijklmnopqrstuvwxyz\nconsole.log(buf1.toString('utf8', 0, 5));\n// Prints: abcde\n\nconst buf2 = Buffer.from('tést');\n\nconsole.log(buf2.toString('hex'));\n// Prints: 74c3a97374\nconsole.log(buf2.toString('utf8', 0, 3));\n// Prints: té\nconsole.log(buf2.toString(undefined, 0, 3));\n// Prints: té\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.allocUnsafe(26);\n\nfor (let i = 0; i &#x3C; 26; i++) {\n  // 97 is the decimal ASCII value for 'a'.\n  buf1[i] = i + 97;\n}\n\nconsole.log(buf1.toString('utf8'));\n// Prints: abcdefghijklmnopqrstuvwxyz\nconsole.log(buf1.toString('utf8', 0, 5));\n// Prints: abcde\n\nconst buf2 = Buffer.from('tést');\n\nconsole.log(buf2.toString('hex'));\n// Prints: 74c3a97374\nconsole.log(buf2.toString('utf8', 0, 3));\n// Prints: té\nconsole.log(buf2.toString(undefined, 0, 3));\n// Prints: té\n</code></pre>"
            },
            {
              "textRaw": "`buf.values()`",
              "name": "values",
              "type": "method",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  }
                }
              ],
              "desc": "<p>Creates and returns an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols\">iterator</a> for <code>buf</code> values (bytes). This function is\ncalled automatically when a <code>Buffer</code> is used in a <code>for..of</code> statement.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.from('buffer');\n\nfor (const value of buf.values()) {\n  console.log(value);\n}\n// Prints:\n//   98\n//   117\n//   102\n//   102\n//   101\n//   114\n\nfor (const value of buf) {\n  console.log(value);\n}\n// Prints:\n//   98\n//   117\n//   102\n//   102\n//   101\n//   114\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.from('buffer');\n\nfor (const value of buf.values()) {\n  console.log(value);\n}\n// Prints:\n//   98\n//   117\n//   102\n//   102\n//   101\n//   114\n\nfor (const value of buf) {\n  console.log(value);\n}\n// Prints:\n//   98\n//   117\n//   102\n//   102\n//   101\n//   114\n</code></pre>"
            },
            {
              "textRaw": "`buf.write(string[, offset[, length]][, encoding])`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56578",
                    "description": "supports Uint8Array as `this` value."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`string` {string} String to write to `buf`.",
                      "name": "string",
                      "type": "string",
                      "desc": "String to write to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write `string`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write `string`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`length` {integer} Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`). **Default:** `buf.length - offset`.",
                      "name": "length",
                      "type": "integer",
                      "default": "`buf.length - offset`",
                      "desc": "Maximum number of bytes to write (written bytes will not exceed `buf.length - offset`).",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} The character encoding of `string`. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "The character encoding of `string`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} Number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "Number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>string</code> to <code>buf</code> at <code>offset</code> according to the character encoding in\n<code>encoding</code>. The <code>length</code> parameter is the number of bytes to write. If <code>buf</code> did\nnot contain enough space to fit the entire string, only part of <code>string</code> will be\nwritten. However, partially encoded characters will not be written.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.alloc(256);\n\nconst len = buf.write('\\u00bd + \\u00bc = \\u00be', 0);\n\nconsole.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);\n// Prints: 12 bytes: ½ + ¼ = ¾\n\nconst buffer = Buffer.alloc(10);\n\nconst length = buffer.write('abcd', 8);\n\nconsole.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);\n// Prints: 2 bytes : ab\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.alloc(256);\n\nconst len = buf.write('\\u00bd + \\u00bc = \\u00be', 0);\n\nconsole.log(`${len} bytes: ${buf.toString('utf8', 0, len)}`);\n// Prints: 12 bytes: ½ + ¼ = ¾\n\nconst buffer = Buffer.alloc(10);\n\nconst length = buffer.write('abcd', 8);\n\nconsole.log(`${length} bytes: ${buffer.toString('utf8', 8, 10)}`);\n// Prints: 2 bytes : ab\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeBigInt64BE(value[, offset])`",
              "name": "writeBigInt64BE",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {bigint} Number to be written to `buf`.",
                      "name": "value",
                      "type": "bigint",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as big-endian.</p>\n<p><code>value</code> is interpreted and written as a two's complement signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeBigInt64BE(0x0102030405060708n, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02 03 04 05 06 07 08>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeBigInt64BE(0x0102030405060708n, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02 03 04 05 06 07 08>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeBigInt64LE(value[, offset])`",
              "name": "writeBigInt64LE",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {bigint} Number to be written to `buf`.",
                      "name": "value",
                      "type": "bigint",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as little-endian.</p>\n<p><code>value</code> is interpreted and written as a two's complement signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeBigInt64LE(0x0102030405060708n, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 08 07 06 05 04 03 02 01>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeBigInt64LE(0x0102030405060708n, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 08 07 06 05 04 03 02 01>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeBigUInt64BE(value[, offset])`",
              "name": "writeBigUInt64BE",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.10.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34960",
                    "description": "This function is also available as `buf.writeBigUint64BE()`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {bigint} Number to be written to `buf`.",
                      "name": "value",
                      "type": "bigint",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as big-endian.</p>\n<p>This function is also available under the <code>writeBigUint64BE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeBigUInt64BE(0xdecafafecacefaden, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer de ca fa fe ca ce fa de>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeBigUInt64BE(0xdecafafecacefaden, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer de ca fa fe ca ce fa de>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeBigUInt64LE(value[, offset])`",
              "name": "writeBigUInt64LE",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0",
                  "v10.20.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.10.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34960",
                    "description": "This function is also available as `buf.writeBigUint64LE()`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {bigint} Number to be written to `buf`.",
                      "name": "value",
                      "type": "bigint",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy: `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as little-endian</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeBigUInt64LE(0xdecafafecacefaden, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer de fa ce ca fe fa ca de>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeBigUInt64LE(0xdecafafecacefaden, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer de fa ce ca fe fa ca de>\n</code></pre>\n<p>This function is also available under the <code>writeBigUint64LE</code> alias.</p>"
            },
            {
              "textRaw": "`buf.writeDoubleBE(value[, offset])`",
              "name": "writeDoubleBE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {number} Number to be written to `buf`.",
                      "name": "value",
                      "type": "number",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as big-endian. The <code>value</code>\nmust be a JavaScript number. Behavior is undefined when <code>value</code> is anything\nother than a JavaScript number.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeDoubleBE(123.456, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 40 5e dd 2f 1a 9f be 77>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeDoubleBE(123.456, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 40 5e dd 2f 1a 9f be 77>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeDoubleLE(value[, offset])`",
              "name": "writeDoubleLE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {number} Number to be written to `buf`.",
                      "name": "value",
                      "type": "number",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 8`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as little-endian. The <code>value</code>\nmust be a JavaScript number. Behavior is undefined when <code>value</code> is anything\nother than a JavaScript number.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeDoubleLE(123.456, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 77 be 9f 1a 2f dd 5e 40>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(8);\n\nbuf.writeDoubleLE(123.456, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 77 be 9f 1a 2f dd 5e 40>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeFloatBE(value[, offset])`",
              "name": "writeFloatBE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {number} Number to be written to `buf`.",
                      "name": "value",
                      "type": "number",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as big-endian. Behavior is\nundefined when <code>value</code> is anything other than a JavaScript number.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeFloatBE(0xcafebabe, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 4f 4a fe bb>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeFloatBE(0xcafebabe, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 4f 4a fe bb>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeFloatLE(value[, offset])`",
              "name": "writeFloatLE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {number} Number to be written to `buf`.",
                      "name": "value",
                      "type": "number",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as little-endian. Behavior is\nundefined when <code>value</code> is anything other than a JavaScript number.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeFloatLE(0xcafebabe, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer bb fe 4a 4f>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeFloatLE(0xcafebabe, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer bb fe 4a 4f>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeInt8(value[, offset])`",
              "name": "writeInt8",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code>. <code>value</code> must be a valid\nsigned 8-bit integer. Behavior is undefined when <code>value</code> is anything other than\na signed 8-bit integer.</p>\n<p><code>value</code> is interpreted and written as a two's complement signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(2);\n\nbuf.writeInt8(2, 0);\nbuf.writeInt8(-2, 1);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 02 fe>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(2);\n\nbuf.writeInt8(2, 0);\nbuf.writeInt8(-2, 1);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 02 fe>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeInt16BE(value[, offset])`",
              "name": "writeInt16BE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as big-endian.  The <code>value</code>\nmust be a valid signed 16-bit integer. Behavior is undefined when <code>value</code> is\nanything other than a signed 16-bit integer.</p>\n<p>The <code>value</code> is interpreted and written as a two's complement signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(2);\n\nbuf.writeInt16BE(0x0102, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(2);\n\nbuf.writeInt16BE(0x0102, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeInt16LE(value[, offset])`",
              "name": "writeInt16LE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as little-endian.  The <code>value</code>\nmust be a valid signed 16-bit integer. Behavior is undefined when <code>value</code> is\nanything other than a signed 16-bit integer.</p>\n<p>The <code>value</code> is interpreted and written as a two's complement signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(2);\n\nbuf.writeInt16LE(0x0304, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 04 03>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(2);\n\nbuf.writeInt16LE(0x0304, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 04 03>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeInt32BE(value[, offset])`",
              "name": "writeInt32BE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as big-endian. The <code>value</code>\nmust be a valid signed 32-bit integer. Behavior is undefined when <code>value</code> is\nanything other than a signed 32-bit integer.</p>\n<p>The <code>value</code> is interpreted and written as a two's complement signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeInt32BE(0x01020304, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02 03 04>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeInt32BE(0x01020304, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 01 02 03 04>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeInt32LE(value[, offset])`",
              "name": "writeInt32LE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as little-endian. The <code>value</code>\nmust be a valid signed 32-bit integer. Behavior is undefined when <code>value</code> is\nanything other than a signed 32-bit integer.</p>\n<p>The <code>value</code> is interpreted and written as a two's complement signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeInt32LE(0x05060708, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 08 07 06 05>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeInt32LE(0x05060708, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 08 07 06 05>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeIntBE(value, offset, byteLength)`",
              "name": "writeIntBE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`."
                    },
                    {
                      "textRaw": "`byteLength` {integer} Number of bytes to write. Must satisfy `0 < byteLength <= 6`.",
                      "name": "byteLength",
                      "type": "integer",
                      "desc": "Number of bytes to write. Must satisfy `0 < byteLength <= 6`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>byteLength</code> bytes of <code>value</code> to <code>buf</code> at the specified <code>offset</code>\nas big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when\n<code>value</code> is anything other than a signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(6);\n\nbuf.writeIntBE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 12 34 56 78 90 ab>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(6);\n\nbuf.writeIntBE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 12 34 56 78 90 ab>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeIntLE(value, offset, byteLength)`",
              "name": "writeIntLE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`."
                    },
                    {
                      "textRaw": "`byteLength` {integer} Number of bytes to write. Must satisfy `0 < byteLength <= 6`.",
                      "name": "byteLength",
                      "type": "integer",
                      "desc": "Number of bytes to write. Must satisfy `0 < byteLength <= 6`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>byteLength</code> bytes of <code>value</code> to <code>buf</code> at the specified <code>offset</code>\nas little-endian. Supports up to 48 bits of accuracy. Behavior is undefined\nwhen <code>value</code> is anything other than a signed integer.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(6);\n\nbuf.writeIntLE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ab 90 78 56 34 12>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(6);\n\nbuf.writeIntLE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ab 90 78 56 34 12>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUInt8(value[, offset])`",
              "name": "writeUInt8",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.writeUint8()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 1`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code>. <code>value</code> must be a\nvalid unsigned 8-bit integer. Behavior is undefined when <code>value</code> is anything\nother than an unsigned 8-bit integer.</p>\n<p>This function is also available under the <code>writeUint8</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt8(0x3, 0);\nbuf.writeUInt8(0x4, 1);\nbuf.writeUInt8(0x23, 2);\nbuf.writeUInt8(0x42, 3);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 03 04 23 42>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt8(0x3, 0);\nbuf.writeUInt8(0x4, 1);\nbuf.writeUInt8(0x23, 2);\nbuf.writeUInt8(0x42, 3);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 03 04 23 42>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUInt16BE(value[, offset])`",
              "name": "writeUInt16BE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.writeUint16BE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as big-endian. The <code>value</code>\nmust be a valid unsigned 16-bit integer. Behavior is undefined when <code>value</code>\nis anything other than an unsigned 16-bit integer.</p>\n<p>This function is also available under the <code>writeUint16BE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt16BE(0xdead, 0);\nbuf.writeUInt16BE(0xbeef, 2);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer de ad be ef>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt16BE(0xdead, 0);\nbuf.writeUInt16BE(0xbeef, 2);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer de ad be ef>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUInt16LE(value[, offset])`",
              "name": "writeUInt16LE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.writeUint16LE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 2`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as little-endian. The <code>value</code>\nmust be a valid unsigned 16-bit integer. Behavior is undefined when <code>value</code> is\nanything other than an unsigned 16-bit integer.</p>\n<p>This function is also available under the <code>writeUint16LE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt16LE(0xdead, 0);\nbuf.writeUInt16LE(0xbeef, 2);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ad de ef be>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt16LE(0xdead, 0);\nbuf.writeUInt16LE(0xbeef, 2);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ad de ef be>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUInt32BE(value[, offset])`",
              "name": "writeUInt32BE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.writeUint32BE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as big-endian. The <code>value</code>\nmust be a valid unsigned 32-bit integer. Behavior is undefined when <code>value</code>\nis anything other than an unsigned 32-bit integer.</p>\n<p>This function is also available under the <code>writeUint32BE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt32BE(0xfeedface, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer fe ed fa ce>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt32BE(0xfeedface, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer fe ed fa ce>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUInt32LE(value[, offset])`",
              "name": "writeUInt32LE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.writeUint32LE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`. **Default:** `0`.",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - 4`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>value</code> to <code>buf</code> at the specified <code>offset</code> as little-endian. The <code>value</code>\nmust be a valid unsigned 32-bit integer. Behavior is undefined when <code>value</code> is\nanything other than an unsigned 32-bit integer.</p>\n<p>This function is also available under the <code>writeUint32LE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt32LE(0xfeedface, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ce fa ed fe>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(4);\n\nbuf.writeUInt32LE(0xfeedface, 0);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ce fa ed fe>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUIntBE(value, offset, byteLength)`",
              "name": "writeUIntBE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.writeUintBE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`."
                    },
                    {
                      "textRaw": "`byteLength` {integer} Number of bytes to write. Must satisfy `0 < byteLength <= 6`.",
                      "name": "byteLength",
                      "type": "integer",
                      "desc": "Number of bytes to write. Must satisfy `0 < byteLength <= 6`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>byteLength</code> bytes of <code>value</code> to <code>buf</code> at the specified <code>offset</code>\nas big-endian. Supports up to 48 bits of accuracy. Behavior is undefined\nwhen <code>value</code> is anything other than an unsigned integer.</p>\n<p>This function is also available under the <code>writeUintBE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(6);\n\nbuf.writeUIntBE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 12 34 56 78 90 ab>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(6);\n\nbuf.writeUIntBE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer 12 34 56 78 90 ab>\n</code></pre>"
            },
            {
              "textRaw": "`buf.writeUIntLE(value, offset, byteLength)`",
              "name": "writeUIntLE",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.9.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34729",
                    "description": "This function is also available as `buf.writeUintLE()`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18395",
                    "description": "Removed `noAssert` and no implicit coercion of the offset and `byteLength` to `uint32` anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {integer} Number to be written to `buf`.",
                      "name": "value",
                      "type": "integer",
                      "desc": "Number to be written to `buf`."
                    },
                    {
                      "textRaw": "`offset` {integer} Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`."
                    },
                    {
                      "textRaw": "`byteLength` {integer} Number of bytes to write. Must satisfy `0 < byteLength <= 6`.",
                      "name": "byteLength",
                      "type": "integer",
                      "desc": "Number of bytes to write. Must satisfy `0 < byteLength <= 6`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer} `offset` plus the number of bytes written.",
                    "name": "return",
                    "type": "integer",
                    "desc": "`offset` plus the number of bytes written."
                  }
                }
              ],
              "desc": "<p>Writes <code>byteLength</code> bytes of <code>value</code> to <code>buf</code> at the specified <code>offset</code>\nas little-endian. Supports up to 48 bits of accuracy. Behavior is undefined\nwhen <code>value</code> is anything other than an unsigned integer.</p>\n<p>This function is also available under the <code>writeUintLE</code> alias.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst buf = Buffer.allocUnsafe(6);\n\nbuf.writeUIntLE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ab 90 78 56 34 12>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\n\nconst buf = Buffer.allocUnsafe(6);\n\nbuf.writeUIntLE(0x1234567890ab, 0, 6);\n\nconsole.log(buf);\n// Prints: &#x3C;Buffer ab 90 78 56 34 12>\n</code></pre>"
            }
          ],
          "signatures": [
            {
              "textRaw": "`new Buffer(array)`",
              "name": "Buffer",
              "type": "ctor",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19524",
                    "description": "Calling this constructor emits a deprecation warning when run from code outside the `node_modules` directory."
                  },
                  {
                    "version": "v7.2.1",
                    "pr-url": "https://github.com/nodejs/node/pull/9529",
                    "description": "Calling this constructor no longer emits a deprecation warning."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8169",
                    "description": "Calling this constructor emits a deprecation warning now."
                  }
                ],
                "deprecated": [
                  "v6.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `Buffer.from(array)` instead.",
              "params": [
                {
                  "textRaw": "`array` {integer[]} An array of bytes to copy from.",
                  "name": "array",
                  "type": "integer[]",
                  "desc": "An array of bytes to copy from."
                }
              ],
              "desc": "<p>See <a href=\"#static-method-bufferfromarray\"><code>Buffer.from(array)</code></a>.</p>"
            },
            {
              "textRaw": "`new Buffer(arrayBuffer[, byteOffset[, length]])`",
              "name": "Buffer",
              "type": "ctor",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19524",
                    "description": "Calling this constructor emits a deprecation warning when run from code outside the `node_modules` directory."
                  },
                  {
                    "version": "v7.2.1",
                    "pr-url": "https://github.com/nodejs/node/pull/9529",
                    "description": "Calling this constructor no longer emits a deprecation warning."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8169",
                    "description": "Calling this constructor emits a deprecation warning now."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4682",
                    "description": "The `byteOffset` and `length` parameters are supported now."
                  }
                ],
                "deprecated": [
                  "v6.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.",
              "params": [
                {
                  "textRaw": "`arrayBuffer` {ArrayBuffer|SharedArrayBuffer} An {ArrayBuffer}, {SharedArrayBuffer} or the `.buffer` property of a {TypedArray}.",
                  "name": "arrayBuffer",
                  "type": "ArrayBuffer|SharedArrayBuffer",
                  "desc": "An {ArrayBuffer}, {SharedArrayBuffer} or the `.buffer` property of a {TypedArray}."
                },
                {
                  "textRaw": "`byteOffset` {integer} Index of first byte to expose. **Default:** `0`.",
                  "name": "byteOffset",
                  "type": "integer",
                  "default": "`0`",
                  "desc": "Index of first byte to expose.",
                  "optional": true
                },
                {
                  "textRaw": "`length` {integer} Number of bytes to expose. **Default:** `arrayBuffer.byteLength - byteOffset`.",
                  "name": "length",
                  "type": "integer",
                  "default": "`arrayBuffer.byteLength - byteOffset`",
                  "desc": "Number of bytes to expose.",
                  "optional": true
                }
              ],
              "desc": "<p>See\n<a href=\"#static-method-bufferfromarraybuffer-byteoffset-length\"><code>Buffer.from(arrayBuffer[, byteOffset[, length]])</code></a>.</p>"
            },
            {
              "textRaw": "`new Buffer(buffer)`",
              "name": "Buffer",
              "type": "ctor",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19524",
                    "description": "Calling this constructor emits a deprecation warning when run from code outside the `node_modules` directory."
                  },
                  {
                    "version": "v7.2.1",
                    "pr-url": "https://github.com/nodejs/node/pull/9529",
                    "description": "Calling this constructor no longer emits a deprecation warning."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8169",
                    "description": "Calling this constructor emits a deprecation warning now."
                  }
                ],
                "deprecated": [
                  "v6.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `Buffer.from(buffer)` instead.",
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|Uint8Array} An existing `Buffer` or {Uint8Array} from which to copy data.",
                  "name": "buffer",
                  "type": "Buffer|Uint8Array",
                  "desc": "An existing `Buffer` or {Uint8Array} from which to copy data."
                }
              ],
              "desc": "<p>See <a href=\"#static-method-bufferfrombuffer\"><code>Buffer.from(buffer)</code></a>.</p>"
            },
            {
              "textRaw": "`new Buffer(size)`",
              "name": "Buffer",
              "type": "ctor",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19524",
                    "description": "Calling this constructor emits a deprecation warning when run from code outside the `node_modules` directory."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12141",
                    "description": "The `new Buffer(size)` will return zero-filled memory by default."
                  },
                  {
                    "version": "v7.2.1",
                    "pr-url": "https://github.com/nodejs/node/pull/9529",
                    "description": "Calling this constructor no longer emits a deprecation warning."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8169",
                    "description": "Calling this constructor emits a deprecation warning now."
                  }
                ],
                "deprecated": [
                  "v6.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).",
              "params": [
                {
                  "textRaw": "`size` {integer} The desired length of the new `Buffer`.",
                  "name": "size",
                  "type": "integer",
                  "desc": "The desired length of the new `Buffer`."
                }
              ],
              "desc": "<p>See <a href=\"#static-method-bufferallocsize-fill-encoding\"><code>Buffer.alloc()</code></a> and <a href=\"#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a>. This variant of the\nconstructor is equivalent to <a href=\"#static-method-bufferallocsize-fill-encoding\"><code>Buffer.alloc()</code></a>.</p>"
            },
            {
              "textRaw": "`new Buffer(string[, encoding])`",
              "name": "Buffer",
              "type": "ctor",
              "meta": {
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19524",
                    "description": "Calling this constructor emits a deprecation warning when run from code outside the `node_modules` directory."
                  },
                  {
                    "version": "v7.2.1",
                    "pr-url": "https://github.com/nodejs/node/pull/9529",
                    "description": "Calling this constructor no longer emits a deprecation warning."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8169",
                    "description": "Calling this constructor emits a deprecation warning now."
                  }
                ],
                "deprecated": [
                  "v6.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `Buffer.from(string[, encoding])` instead.",
              "params": [
                {
                  "textRaw": "`string` {string} String to encode.",
                  "name": "string",
                  "type": "string",
                  "desc": "String to encode."
                },
                {
                  "textRaw": "`encoding` {string} The encoding of `string`. **Default:** `'utf8'`.",
                  "name": "encoding",
                  "type": "string",
                  "default": "`'utf8'`",
                  "desc": "The encoding of `string`.",
                  "optional": true
                }
              ],
              "desc": "<p>See <a href=\"#static-method-bufferfromstring-encoding\"><code>Buffer.from(string[, encoding])</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `File`",
          "name": "File",
          "type": "class",
          "meta": {
            "added": [
              "v19.2.0",
              "v18.13.0"
            ],
            "changes": [
              {
                "version": "v23.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/47613",
                "description": "Makes File instances cloneable."
              },
              {
                "version": "v20.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/47153",
                "description": "No longer experimental."
              }
            ]
          },
          "desc": "<ul>\n<li>Extends: <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a></li>\n</ul>\n<p>A <a href=\"buffer.html#class-file\"><code>&#x3C;File></code></a> provides information about files.</p>",
          "signatures": [
            {
              "textRaw": "`new buffer.File(sources, fileName[, options])`",
              "name": "buffer.File",
              "type": "ctor",
              "meta": {
                "added": [
                  "v19.2.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`sources` {string[]|ArrayBuffer[]|TypedArray[]|DataView[]|Blob[]|File[]} An array of string, {ArrayBuffer}, {TypedArray}, {DataView}, {File}, or {Blob} objects, or any mix of such objects, that will be stored within the `File`.",
                  "name": "sources",
                  "type": "string[]|ArrayBuffer[]|TypedArray[]|DataView[]|Blob[]|File[]",
                  "desc": "An array of string, {ArrayBuffer}, {TypedArray}, {DataView}, {File}, or {Blob} objects, or any mix of such objects, that will be stored within the `File`."
                },
                {
                  "textRaw": "`fileName` {string} The name of the file.",
                  "name": "fileName",
                  "type": "string",
                  "desc": "The name of the file."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`endings` {string} One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be converted to the platform native line-ending as specified by `require('node:os').EOL`.",
                      "name": "endings",
                      "type": "string",
                      "desc": "One of either `'transparent'` or `'native'`. When set to `'native'`, line endings in string source parts will be converted to the platform native line-ending as specified by `require('node:os').EOL`."
                    },
                    {
                      "textRaw": "`type` {string} The File content-type.",
                      "name": "type",
                      "type": "string",
                      "desc": "The File content-type."
                    },
                    {
                      "textRaw": "`lastModified` {number} The last modified date of the file. **Default:** `Date.now()`.",
                      "name": "lastModified",
                      "type": "number",
                      "default": "`Date.now()`",
                      "desc": "The last modified date of the file."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string}",
              "name": "name",
              "type": "string",
              "meta": {
                "added": [
                  "v19.2.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "desc": "<p>The name of the <code>File</code>.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "lastModified",
              "type": "number",
              "meta": {
                "added": [
                  "v19.2.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "desc": "<p>The last modified date of the <code>File</code>.</p>"
            }
          ]
        }
      ],
      "displayName": "Buffer",
      "source": "doc/api/buffer.md"
    },
    {
      "textRaw": "C++ embedder API",
      "name": "c++_embedder_api",
      "introduced_in": "v12.19.0",
      "type": "module",
      "desc": "<p>Node.js provides a number of C++ APIs that can be used to execute JavaScript\nin a Node.js environment from other C++ software.</p>\n<p>The documentation for these APIs can be found in <a href=\"https://github.com/nodejs/node/blob/HEAD/src/node.h\">src/node.h</a> in the Node.js\nsource tree. In addition to the APIs exposed by Node.js, some required concepts\nare provided by the V8 embedder API.</p>\n<p>Because using Node.js as an embedded library is different from writing code\nthat is executed by Node.js, breaking changes do not follow typical Node.js\n<a href=\"deprecations.html\">deprecation policy</a> and may occur on each semver-major release without prior\nwarning.</p>",
      "modules": [
        {
          "textRaw": "Example embedding application",
          "name": "example_embedding_application",
          "type": "module",
          "desc": "<p>The following sections will provide an overview over how to use these APIs\nto create an application from scratch that will perform the equivalent of\n<code>node -e &#x3C;code></code>, i.e. that will take a piece of JavaScript and run it in\na Node.js-specific environment.</p>\n<p>The full code can be found <a href=\"https://github.com/nodejs/node/blob/HEAD/test/embedding/embedtest.cc\">in the Node.js source tree</a>.</p>",
          "modules": [
            {
              "textRaw": "Setting up a per-process state",
              "name": "setting_up_a_per-process_state",
              "type": "module",
              "desc": "<p>Node.js requires some per-process state management in order to run:</p>\n<ul>\n<li>Arguments parsing for Node.js <a href=\"cli.html\">CLI options</a>,</li>\n<li>V8 per-process requirements, such as a <code>v8::Platform</code> instance.</li>\n</ul>\n<p>The following example shows how these can be set up. Some class names are from\nthe <code>node</code> and <code>v8</code> C++ namespaces, respectively.</p>\n<pre><code class=\"language-cpp\">int main(int argc, char** argv) {\n  argv = uv_setup_args(argc, argv);\n  std::vector&#x3C;std::string> args(argv, argv + argc);\n  // Parse Node.js CLI options, and print any errors that have occurred while\n  // trying to parse them.\n  std::unique_ptr&#x3C;node::InitializationResult> result =\n      node::InitializeOncePerProcess(args, {\n        node::ProcessInitializationFlags::kNoInitializeV8,\n        node::ProcessInitializationFlags::kNoInitializeNodeV8Platform\n      });\n\n  for (const std::string&#x26; error : result->errors())\n    fprintf(stderr, \"%s: %s\\n\", args[0].c_str(), error.c_str());\n  if (result->early_return() != 0) {\n    return result->exit_code();\n  }\n\n  // Create a v8::Platform instance. `MultiIsolatePlatform::Create()` is a way\n  // to create a v8::Platform instance that Node.js can use when creating\n  // Worker threads. When no `MultiIsolatePlatform` instance is present,\n  // Worker threads are disabled.\n  std::unique_ptr&#x3C;MultiIsolatePlatform> platform =\n      MultiIsolatePlatform::Create(4);\n  V8::InitializePlatform(platform.get());\n  V8::Initialize();\n\n  // See below for the contents of this function.\n  int ret = RunNodeInstance(\n      platform.get(), result->args(), result->exec_args());\n\n  V8::Dispose();\n  V8::DisposePlatform();\n\n  node::TearDownOncePerProcess();\n  return ret;\n}\n</code></pre>",
              "displayName": "Setting up a per-process state"
            },
            {
              "textRaw": "Setting up a per-instance state",
              "name": "setting_up_a_per-instance_state",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35597",
                    "description": "The `CommonEnvironmentSetup` and `SpinEventLoop` utilities were added."
                  }
                ]
              },
              "desc": "<p>Node.js has a concept of a “Node.js instance”, that is commonly being referred\nto as <code>node::Environment</code>. Each <code>node::Environment</code> is associated with:</p>\n<ul>\n<li>Exactly one <code>v8::Isolate</code>, i.e. one JS Engine instance,</li>\n<li>Exactly one <code>uv_loop_t</code>, i.e. one event loop,</li>\n<li>A number of <code>v8::Context</code>s, but exactly one main <code>v8::Context</code>, and</li>\n<li>One <code>node::IsolateData</code> instance that contains information that could be\nshared by multiple <code>node::Environment</code>s. The embedder should make sure\nthat <code>node::IsolateData</code> is shared only among <code>node::Environment</code>s that\nuse the same <code>v8::Isolate</code>, Node.js does not perform this check.</li>\n</ul>\n<p>In order to set up a <code>v8::Isolate</code>, an <code>v8::ArrayBuffer::Allocator</code> needs\nto be provided. One possible choice is the default Node.js allocator, which\ncan be created through <code>node::ArrayBufferAllocator::Create()</code>. Using the Node.js\nallocator allows minor performance optimizations when addons use the Node.js\nC++ <code>Buffer</code> API, and is required in order to track <code>ArrayBuffer</code> memory in\n<a href=\"process.html#processmemoryusage\"><code>process.memoryUsage()</code></a>.</p>\n<p>Additionally, each <code>v8::Isolate</code> that is used for a Node.js instance needs to\nbe registered and unregistered with the <code>MultiIsolatePlatform</code> instance, if one\nis being used, in order for the platform to know which event loop to use\nfor tasks scheduled by the <code>v8::Isolate</code>.</p>\n<p>The <code>node::NewIsolate()</code> helper function creates a <code>v8::Isolate</code>,\nsets it up with some Node.js-specific hooks (e.g. the Node.js error handler),\nand registers it with the platform automatically.</p>\n<pre><code class=\"language-cpp\">int RunNodeInstance(MultiIsolatePlatform* platform,\n                    const std::vector&#x3C;std::string>&#x26; args,\n                    const std::vector&#x3C;std::string>&#x26; exec_args) {\n  int exit_code = 0;\n\n  // Setup up a libuv event loop, v8::Isolate, and Node.js Environment.\n  std::vector&#x3C;std::string> errors;\n  std::unique_ptr&#x3C;CommonEnvironmentSetup> setup =\n      CommonEnvironmentSetup::Create(platform, &#x26;errors, args, exec_args);\n  if (!setup) {\n    for (const std::string&#x26; err : errors)\n      fprintf(stderr, \"%s: %s\\n\", args[0].c_str(), err.c_str());\n    return 1;\n  }\n\n  Isolate* isolate = setup->isolate();\n  Environment* env = setup->env();\n\n  {\n    Locker locker(isolate);\n    Isolate::Scope isolate_scope(isolate);\n    HandleScope handle_scope(isolate);\n    // The v8::Context needs to be entered when node::CreateEnvironment() and\n    // node::LoadEnvironment() are being called.\n    Context::Scope context_scope(setup->context());\n\n    // Set up the Node.js instance for execution, and run code inside of it.\n    // There is also a variant that takes a callback and provides it with\n    // the `require` and `process` objects, so that it can manually compile\n    // and run scripts as needed.\n    // The `require` function inside this script does *not* access the file\n    // system, and can only load built-in Node.js modules.\n    // `module.createRequire()` is being used to create one that is able to\n    // load files from the disk, and uses the standard CommonJS file loader\n    // instead of the internal-only `require` function.\n    MaybeLocal&#x3C;Value> loadenv_ret = node::LoadEnvironment(\n        env,\n        \"const publicRequire =\"\n        \"  require('node:module').createRequire(process.cwd() + '/');\"\n        \"globalThis.require = publicRequire;\"\n        \"require('node:vm').runInThisContext(process.argv[1]);\");\n\n    if (loadenv_ret.IsEmpty())  // There has been a JS exception.\n      return 1;\n\n    exit_code = node::SpinEventLoop(env).FromMaybe(1);\n\n    // node::Stop() can be used to explicitly stop the event loop and keep\n    // further JavaScript from running. It can be called from any thread,\n    // and will act like worker.terminate() if called from another thread.\n    node::Stop(env);\n  }\n\n  return exit_code;\n}\n</code></pre>",
              "displayName": "Setting up a per-instance state"
            }
          ],
          "displayName": "Example embedding application"
        }
      ],
      "displayName": "C++ embedder API",
      "source": "doc/api/embedding.md"
    },
    {
      "textRaw": "Child process",
      "name": "child_process",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:child_process</code> module provides the ability to spawn subprocesses in\na manner that is similar, but not identical, to <a href=\"http://man7.org/linux/man-pages/man3/popen.3.html\"><code>popen(3)</code></a>. This capability\nis primarily provided by the <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> function:</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\nconst ls = spawn('ls', ['-lh', '/usr']);\n\nls.stdout.on('data', (data) => {\n  console.log(`stdout: ${data}`);\n});\n\nls.stderr.on('data', (data) => {\n  console.error(`stderr: ${data}`);\n});\n\nls.on('close', (code) => {\n  console.log(`child process exited with code ${code}`);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nimport { once } from 'node:events';\nconst ls = spawn('ls', ['-lh', '/usr']);\n\nls.stdout.on('data', (data) => {\n  console.log(`stdout: ${data}`);\n});\n\nls.stderr.on('data', (data) => {\n  console.error(`stderr: ${data}`);\n});\n\nconst [code] = await once(ls, 'close');\nconsole.log(`child process exited with code ${code}`);\n</code></pre>\n<p>By default, pipes for <code>stdin</code>, <code>stdout</code>, and <code>stderr</code> are established between\nthe parent Node.js process and the spawned subprocess. These pipes have\nlimited (and platform-specific) capacity. If the subprocess writes to\nstdout in excess of that limit without the output being captured, the\nsubprocess blocks, waiting for the pipe buffer to accept more data. This is\nidentical to the behavior of pipes in the shell. Use the <code>{ stdio: 'ignore' }</code>\noption if the output will not be consumed.</p>\n<p>The command lookup is performed using the <code>options.env.PATH</code> environment\nvariable if <code>env</code> is in the <code>options</code> object. Otherwise, <code>process.env.PATH</code> is\nused. If <code>options.env</code> is set without <code>PATH</code>, lookup on Unix is performed\non a default search path search of <code>/usr/bin:/bin</code> (see your operating system's\nmanual for execvpe/execvp), on Windows the current processes environment\nvariable <code>PATH</code> is used.</p>\n<p>On Windows, environment variables are case-insensitive. Node.js\nlexicographically sorts the <code>env</code> keys and uses the first one that\ncase-insensitively matches. Only first (in lexicographic order) entry will be\npassed to the subprocess. This might lead to issues on Windows when passing\nobjects to the <code>env</code> option that have multiple variants of the same key, such as\n<code>PATH</code> and <code>Path</code>.</p>\n<p>The <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> method spawns the child process asynchronously,\nwithout blocking the Node.js event loop. The <a href=\"#child_processspawnsynccommand-args-options\"><code>child_process.spawnSync()</code></a>\nfunction provides equivalent functionality in a synchronous manner that blocks\nthe event loop until the spawned process either exits or is terminated.</p>\n<p>For convenience, the <code>node:child_process</code> module provides a handful of\nsynchronous and asynchronous alternatives to <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> and\n<a href=\"#child_processspawnsynccommand-args-options\"><code>child_process.spawnSync()</code></a>. Each of these alternatives are implemented on\ntop of <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> or <a href=\"#child_processspawnsynccommand-args-options\"><code>child_process.spawnSync()</code></a>.</p>\n<ul>\n<li><a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a>: spawns a shell and runs a command within that\nshell, passing the <code>stdout</code> and <code>stderr</code> to a callback function when\ncomplete.</li>\n<li><a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a>: similar to <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a> except\nthat it spawns the command directly without first spawning a shell by\ndefault.</li>\n<li><a href=\"#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>: spawns a new Node.js process and invokes a\nspecified module with an IPC communication channel established that allows\nsending messages between parent and child.</li>\n<li><a href=\"#child_processexecsynccommand-options\"><code>child_process.execSync()</code></a>: a synchronous version of\n<a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a> that will block the Node.js event loop.</li>\n<li><a href=\"#child_processexecfilesyncfile-args-options\"><code>child_process.execFileSync()</code></a>: a synchronous version of\n<a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a> that will block the Node.js event loop.</li>\n</ul>\n<p>For certain use cases, such as automating shell scripts, the\n<a href=\"#synchronous-process-creation\">synchronous counterparts</a> may be more convenient. In many cases, however,\nthe synchronous methods can have significant impact on performance due to\nstalling the event loop while spawned processes complete.</p>",
      "modules": [
        {
          "textRaw": "Asynchronous process creation",
          "name": "asynchronous_process_creation",
          "type": "module",
          "desc": "<p>The <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a>, <a href=\"#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>, <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a>,\nand <a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a> methods all follow the idiomatic asynchronous\nprogramming pattern typical of other Node.js APIs.</p>\n<p>Each of the methods returns a <a href=\"#class-childprocess\"><code>ChildProcess</code></a> instance. These objects\nimplement the Node.js <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a> API, allowing the parent process to\nregister listener functions that are called when certain events occur during\nthe life cycle of the child process.</p>\n<p>The <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a> and <a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a> methods\nadditionally allow for an optional <code>callback</code> function to be specified that is\ninvoked when the child process terminates.</p>",
          "modules": [
            {
              "textRaw": "Spawning `.bat` and `.cmd` files on Windows",
              "name": "spawning_`.bat`_and_`.cmd`_files_on_windows",
              "type": "module",
              "desc": "<p>The importance of the distinction between <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a> and\n<a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a> can vary based on platform. On Unix-type\noperating systems (Unix, Linux, macOS) <a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a> can be\nmore efficient because it does not spawn a shell by default. On Windows,\nhowever, <code>.bat</code> and <code>.cmd</code> files are not executable on their own without a\nterminal, and therefore cannot be launched using <a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a>.\nWhen running on Windows, <code>.bat</code> and <code>.cmd</code> files can be invoked by:</p>\n<ul>\n<li>using <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> with the <code>shell</code> option set (not recommended, see <a href=\"deprecations.html#DEP0190\">DEP0190</a>), or</li>\n<li>using <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a>, or</li>\n<li>spawning <code>cmd.exe</code> and passing the <code>.bat</code> or <code>.cmd</code> file as an argument\n(which is what <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a> does internally).</li>\n</ul>\n<p>In any case, if the script filename contains spaces, it needs to be quoted.</p>\n<pre><code class=\"language-cjs\">const { exec, spawn } = require('node:child_process');\n\nexec('my.bat', (err, stdout, stderr) => { /* ... */ });\n\n// Or, spawning cmd.exe directly:\nconst bat = spawn('cmd.exe', ['/c', 'my.bat']);\n\n// If the script filename contains spaces, it needs to be quoted\nexec('\"my script.cmd\" a b', (err, stdout, stderr) => { /* ... */ });\n</code></pre>\n<pre><code class=\"language-mjs\">import { exec, spawn } from 'node:child_process';\n\nexec('my.bat', (err, stdout, stderr) => { /* ... */ });\n\n// Or, spawning cmd.exe directly:\nconst bat = spawn('cmd.exe', ['/c', 'my.bat']);\n\n// If the script filename contains spaces, it needs to be quoted\nexec('\"my script.cmd\" a b', (err, stdout, stderr) => { /* ... */ });\n</code></pre>",
              "displayName": "Spawning `.bat` and `.cmd` files on Windows"
            }
          ],
          "methods": [
            {
              "textRaw": "`child_process.exec(command[, options][, callback])`",
              "name": "exec",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.4.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38862",
                    "description": "The `cwd` option can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v15.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36308",
                    "description": "AbortSignal support was added."
                  },
                  {
                    "version": "v8.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15380",
                    "description": "The `windowsHide` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`command` {string} The command to run, with space-separated arguments.",
                      "name": "command",
                      "type": "string",
                      "desc": "The command to run, with space-separated arguments."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} Current working directory of the child process. **Default:** `process.cwd()`.",
                          "name": "cwd",
                          "type": "string|URL",
                          "default": "`process.cwd()`",
                          "desc": "Current working directory of the child process."
                        },
                        {
                          "textRaw": "`env` {Object} Environment key-value pairs. **Default:** `process.env`.",
                          "name": "env",
                          "type": "Object",
                          "default": "`process.env`",
                          "desc": "Environment key-value pairs."
                        },
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`shell` {string} Shell to execute the command with. See Shell requirements and Default Windows shell. **Default:** `'/bin/sh'` on Unix, `process.env.ComSpec` on Windows.",
                          "name": "shell",
                          "type": "string",
                          "default": "`'/bin/sh'` on Unix, `process.env.ComSpec` on Windows",
                          "desc": "Shell to execute the command with. See Shell requirements and Default Windows shell."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting the child process using an AbortSignal.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting the child process using an AbortSignal."
                        },
                        {
                          "textRaw": "`timeout` {number} **Default:** `0`",
                          "name": "timeout",
                          "type": "number",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`maxBuffer` {number} Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated and any output is truncated. See caveat at `maxBuffer` and Unicode. **Default:** `1024 * 1024`.",
                          "name": "maxBuffer",
                          "type": "number",
                          "default": "`1024 * 1024`",
                          "desc": "Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated and any output is truncated. See caveat at `maxBuffer` and Unicode."
                        },
                        {
                          "textRaw": "`killSignal` {string|integer} **Default:** `'SIGTERM'`",
                          "name": "killSignal",
                          "type": "string|integer",
                          "default": "`'SIGTERM'`"
                        },
                        {
                          "textRaw": "`uid` {number} Sets the user identity of the process (see `setuid(2)`).",
                          "name": "uid",
                          "type": "number",
                          "desc": "Sets the user identity of the process (see `setuid(2)`)."
                        },
                        {
                          "textRaw": "`gid` {number} Sets the group identity of the process (see `setgid(2)`).",
                          "name": "gid",
                          "type": "number",
                          "desc": "Sets the group identity of the process (see `setgid(2)`)."
                        },
                        {
                          "textRaw": "`windowsHide` {boolean} Hide the subprocess console window that would normally be created on Windows systems. **Default:** `false`.",
                          "name": "windowsHide",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Hide the subprocess console window that would normally be created on Windows systems."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} called with the output when process terminates.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "called with the output when process terminates.",
                      "options": [
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stdout` {string|Buffer}",
                          "name": "stdout",
                          "type": "string|Buffer"
                        },
                        {
                          "textRaw": "`stderr` {string|Buffer}",
                          "name": "stderr",
                          "type": "string|Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ChildProcess}",
                    "name": "return",
                    "type": "ChildProcess"
                  }
                }
              ],
              "desc": "<p>Spawns a shell then executes the <code>command</code> within that shell, buffering any\ngenerated output. The <code>command</code> string passed to the exec function is processed\ndirectly by the shell and special characters (vary based on\n<a href=\"https://en.wikipedia.org/wiki/List_of_command-line_interpreters\">shell</a>)\nneed to be dealt with accordingly:</p>\n<pre><code class=\"language-cjs\">const { exec } = require('node:child_process');\n\nexec('\"/path/to/test file/test.sh\" arg1 arg2');\n// Double quotes are used so that the space in the path is not interpreted as\n// a delimiter of multiple arguments.\n\nexec('echo \"The \\\\$HOME variable is $HOME\"');\n// The $HOME variable is escaped in the first instance, but not in the second.\n</code></pre>\n<pre><code class=\"language-mjs\">import { exec } from 'node:child_process';\n\nexec('\"/path/to/test file/test.sh\" arg1 arg2');\n// Double quotes are used so that the space in the path is not interpreted as\n// a delimiter of multiple arguments.\n\nexec('echo \"The \\\\$HOME variable is $HOME\"');\n// The $HOME variable is escaped in the first instance, but not in the second.\n</code></pre>\n<p><strong>Never pass unsanitized user input to this function. Any input containing shell\nmetacharacters may be used to trigger arbitrary command execution.</strong></p>\n<p>If a <code>callback</code> function is provided, it is called with the arguments\n<code>(error, stdout, stderr)</code>. On success, <code>error</code> will be <code>null</code>. On error,\n<code>error</code> will be an instance of <a href=\"errors.html#class-error\"><code>Error</code></a>. The <code>error.code</code> property will be\nthe exit code of the process. By convention, any exit code other than <code>0</code>\nindicates an error. <code>error.signal</code> will be the signal that terminated the\nprocess.</p>\n<p>The <code>stdout</code> and <code>stderr</code> arguments passed to the callback will contain the\nstdout and stderr output of the child process. By default, Node.js will decode\nthe output as UTF-8 and pass strings to the callback. The <code>encoding</code> option\ncan be used to specify the character encoding used to decode the stdout and\nstderr output. If <code>encoding</code> is <code>'buffer'</code>, or an unrecognized character\nencoding, <code>Buffer</code> objects will be passed to the callback instead.</p>\n<pre><code class=\"language-cjs\">const { exec } = require('node:child_process');\nexec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {\n  if (error) {\n    console.error(`exec error: ${error}`);\n    return;\n  }\n  console.log(`stdout: ${stdout}`);\n  console.error(`stderr: ${stderr}`);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { exec } from 'node:child_process';\nexec('cat *.js missing_file | wc -l', (error, stdout, stderr) => {\n  if (error) {\n    console.error(`exec error: ${error}`);\n    return;\n  }\n  console.log(`stdout: ${stdout}`);\n  console.error(`stderr: ${stderr}`);\n});\n</code></pre>\n<p>If <code>timeout</code> is greater than <code>0</code>, the parent process will send the signal\nidentified by the <code>killSignal</code> property (the default is <code>'SIGTERM'</code>) if the\nchild process runs longer than <code>timeout</code> milliseconds.</p>\n<p>Unlike the <a href=\"http://man7.org/linux/man-pages/man3/exec.3.html\"><code>exec(3)</code></a> POSIX system call, <code>child_process.exec()</code> does not replace\nthe existing process and uses a shell to execute the command.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na <code>Promise</code> for an <code>Object</code> with <code>stdout</code> and <code>stderr</code> properties. The returned\n<code>ChildProcess</code> instance is attached to the <code>Promise</code> as a <code>child</code> property. In\ncase of an error (including any error resulting in an exit code other than 0), a\nrejected promise is returned, with the same <code>error</code> object given in the\ncallback, but with two additional properties <code>stdout</code> and <code>stderr</code>.</p>\n<pre><code class=\"language-cjs\">const util = require('node:util');\nconst exec = util.promisify(require('node:child_process').exec);\n\nasync function lsExample() {\n  const { stdout, stderr } = await exec('ls');\n  console.log('stdout:', stdout);\n  console.error('stderr:', stderr);\n}\nlsExample();\n</code></pre>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nimport child_process from 'node:child_process';\nconst exec = promisify(child_process.exec);\n\nasync function lsExample() {\n  const { stdout, stderr } = await exec('ls');\n  console.log('stdout:', stdout);\n  console.error('stderr:', stderr);\n}\nlsExample();\n</code></pre>\n<p>If the <code>signal</code> option is enabled, calling <code>.abort()</code> on the corresponding\n<code>AbortController</code> is similar to calling <code>.kill()</code> on the child process except\nthe error passed to the callback will be an <code>AbortError</code>:</p>\n<pre><code class=\"language-cjs\">const { exec } = require('node:child_process');\nconst controller = new AbortController();\nconst { signal } = controller;\nconst child = exec('grep ssh', { signal }, (error) => {\n  console.error(error); // an AbortError\n});\ncontroller.abort();\n</code></pre>\n<pre><code class=\"language-mjs\">import { exec } from 'node:child_process';\nconst controller = new AbortController();\nconst { signal } = controller;\nconst child = exec('grep ssh', { signal }, (error) => {\n  console.error(error); // an AbortError\n});\ncontroller.abort();\n</code></pre>"
            },
            {
              "textRaw": "`child_process.execFile(file[, args][, options][, callback])`",
              "name": "execFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.91"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.11.0",
                      "v22.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57389",
                    "description": "Passing `args` when `shell` is set to `true` is deprecated."
                  },
                  {
                    "version": [
                      "v16.4.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38862",
                    "description": "The `cwd` option can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": [
                      "v15.4.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/36308",
                    "description": "AbortSignal support was added."
                  },
                  {
                    "version": "v8.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15380",
                    "description": "The `windowsHide` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`file` {string} The name or path of the executable file to run.",
                      "name": "file",
                      "type": "string",
                      "desc": "The name or path of the executable file to run."
                    },
                    {
                      "textRaw": "`args` {string[]} List of string arguments.",
                      "name": "args",
                      "type": "string[]",
                      "desc": "List of string arguments.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string|URL",
                          "desc": "Current working directory of the child process."
                        },
                        {
                          "textRaw": "`env` {Object} Environment key-value pairs. **Default:** `process.env`.",
                          "name": "env",
                          "type": "Object",
                          "default": "`process.env`",
                          "desc": "Environment key-value pairs."
                        },
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`timeout` {number} **Default:** `0`",
                          "name": "timeout",
                          "type": "number",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`maxBuffer` {number} Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated and any output is truncated. See caveat at `maxBuffer` and Unicode. **Default:** `1024 * 1024`.",
                          "name": "maxBuffer",
                          "type": "number",
                          "default": "`1024 * 1024`",
                          "desc": "Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated and any output is truncated. See caveat at `maxBuffer` and Unicode."
                        },
                        {
                          "textRaw": "`killSignal` {string|integer} **Default:** `'SIGTERM'`",
                          "name": "killSignal",
                          "type": "string|integer",
                          "default": "`'SIGTERM'`"
                        },
                        {
                          "textRaw": "`uid` {number} Sets the user identity of the process (see `setuid(2)`).",
                          "name": "uid",
                          "type": "number",
                          "desc": "Sets the user identity of the process (see `setuid(2)`)."
                        },
                        {
                          "textRaw": "`gid` {number} Sets the group identity of the process (see `setgid(2)`).",
                          "name": "gid",
                          "type": "number",
                          "desc": "Sets the group identity of the process (see `setgid(2)`)."
                        },
                        {
                          "textRaw": "`windowsHide` {boolean} Hide the subprocess console window that would normally be created on Windows systems. **Default:** `false`.",
                          "name": "windowsHide",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Hide the subprocess console window that would normally be created on Windows systems."
                        },
                        {
                          "textRaw": "`windowsVerbatimArguments` {boolean} No quoting or escaping of arguments is done on Windows. Ignored on Unix. **Default:** `false`.",
                          "name": "windowsVerbatimArguments",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "No quoting or escaping of arguments is done on Windows. Ignored on Unix."
                        },
                        {
                          "textRaw": "`shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses `'/bin/sh'` on Unix, and `process.env.ComSpec` on Windows. A different shell can be specified as a string. See Shell requirements and Default Windows shell. **Default:** `false` (no shell).",
                          "name": "shell",
                          "type": "boolean|string",
                          "default": "`false` (no shell)",
                          "desc": "If `true`, runs `command` inside of a shell. Uses `'/bin/sh'` on Unix, and `process.env.ComSpec` on Windows. A different shell can be specified as a string. See Shell requirements and Default Windows shell."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting the child process using an AbortSignal.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting the child process using an AbortSignal."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} Called with the output when process terminates.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Called with the output when process terminates.",
                      "options": [
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stdout` {string|Buffer}",
                          "name": "stdout",
                          "type": "string|Buffer"
                        },
                        {
                          "textRaw": "`stderr` {string|Buffer}",
                          "name": "stderr",
                          "type": "string|Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ChildProcess}",
                    "name": "return",
                    "type": "ChildProcess"
                  }
                }
              ],
              "desc": "<p>The <code>child_process.execFile()</code> function is similar to <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a>\nexcept that it does not spawn a shell by default. Rather, the specified\nexecutable <code>file</code> is spawned directly as a new process making it slightly more\nefficient than <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a>.</p>\n<p>The same options as <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a> are supported. Since a shell is\nnot spawned, behaviors such as I/O redirection and file globbing are not\nsupported.</p>\n<pre><code class=\"language-cjs\">const { execFile } = require('node:child_process');\nconst child = execFile('node', ['--version'], (error, stdout, stderr) => {\n  if (error) {\n    throw error;\n  }\n  console.log(stdout);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { execFile } from 'node:child_process';\nconst child = execFile('node', ['--version'], (error, stdout, stderr) => {\n  if (error) {\n    throw error;\n  }\n  console.log(stdout);\n});\n</code></pre>\n<p>The <code>stdout</code> and <code>stderr</code> arguments passed to the callback will contain the\nstdout and stderr output of the child process. By default, Node.js will decode\nthe output as UTF-8 and pass strings to the callback. The <code>encoding</code> option\ncan be used to specify the character encoding used to decode the stdout and\nstderr output. If <code>encoding</code> is <code>'buffer'</code>, or an unrecognized character\nencoding, <code>Buffer</code> objects will be passed to the callback instead.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na <code>Promise</code> for an <code>Object</code> with <code>stdout</code> and <code>stderr</code> properties. The returned\n<code>ChildProcess</code> instance is attached to the <code>Promise</code> as a <code>child</code> property. In\ncase of an error (including any error resulting in an exit code other than 0), a\nrejected promise is returned, with the same <code>error</code> object given in the\ncallback, but with two additional properties <code>stdout</code> and <code>stderr</code>.</p>\n<pre><code class=\"language-cjs\">const util = require('node:util');\nconst execFile = util.promisify(require('node:child_process').execFile);\nasync function getVersion() {\n  const { stdout } = await execFile('node', ['--version']);\n  console.log(stdout);\n}\ngetVersion();\n</code></pre>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nimport child_process from 'node:child_process';\nconst execFile = promisify(child_process.execFile);\nasync function getVersion() {\n  const { stdout } = await execFile('node', ['--version']);\n  console.log(stdout);\n}\ngetVersion();\n</code></pre>\n<p><strong>If the <code>shell</code> option is enabled, do not pass unsanitized user input to this\nfunction. Any input containing shell metacharacters may be used to trigger\narbitrary command execution.</strong></p>\n<p>If the <code>signal</code> option is enabled, calling <code>.abort()</code> on the corresponding\n<code>AbortController</code> is similar to calling <code>.kill()</code> on the child process except\nthe error passed to the callback will be an <code>AbortError</code>:</p>\n<pre><code class=\"language-cjs\">const { execFile } = require('node:child_process');\nconst controller = new AbortController();\nconst { signal } = controller;\nconst child = execFile('node', ['--version'], { signal }, (error) => {\n  console.error(error); // an AbortError\n});\ncontroller.abort();\n</code></pre>\n<pre><code class=\"language-mjs\">import { execFile } from 'node:child_process';\nconst controller = new AbortController();\nconst { signal } = controller;\nconst child = execFile('node', ['--version'], { signal }, (error) => {\n  console.error(error); // an AbortError\n});\ncontroller.abort();\n</code></pre>"
            },
            {
              "textRaw": "`child_process.fork(modulePath[, args][, options])`",
              "name": "fork",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.4.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41225",
                    "description": "The `modulePath` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": [
                      "v16.4.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38862",
                    "description": "The `cwd` option can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": [
                      "v15.13.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37256",
                    "description": "timeout was added."
                  },
                  {
                    "version": [
                      "v15.11.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37325",
                    "description": "killSignal for AbortSignal was added."
                  },
                  {
                    "version": [
                      "v15.6.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/36603",
                    "description": "AbortSignal support was added."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30162",
                    "description": "The `serialization` option is supported now."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10866",
                    "description": "The `stdio` option can now be a string."
                  },
                  {
                    "version": "v6.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7811",
                    "description": "The `stdio` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`modulePath` {string|URL} The module to run in the child.",
                      "name": "modulePath",
                      "type": "string|URL",
                      "desc": "The module to run in the child."
                    },
                    {
                      "textRaw": "`args` {string[]} List of string arguments.",
                      "name": "args",
                      "type": "string[]",
                      "desc": "List of string arguments.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string|URL",
                          "desc": "Current working directory of the child process."
                        },
                        {
                          "textRaw": "`detached` {boolean} Prepare child process to run independently of its parent process. Specific behavior depends on the platform (see `options.detached`).",
                          "name": "detached",
                          "type": "boolean",
                          "desc": "Prepare child process to run independently of its parent process. Specific behavior depends on the platform (see `options.detached`)."
                        },
                        {
                          "textRaw": "`env` {Object} Environment key-value pairs. **Default:** `process.env`.",
                          "name": "env",
                          "type": "Object",
                          "default": "`process.env`",
                          "desc": "Environment key-value pairs."
                        },
                        {
                          "textRaw": "`execPath` {string} Executable used to create the child process.",
                          "name": "execPath",
                          "type": "string",
                          "desc": "Executable used to create the child process."
                        },
                        {
                          "textRaw": "`execArgv` {string[]} List of string arguments passed to the executable. **Default:** `process.execArgv`.",
                          "name": "execArgv",
                          "type": "string[]",
                          "default": "`process.execArgv`",
                          "desc": "List of string arguments passed to the executable."
                        },
                        {
                          "textRaw": "`gid` {number} Sets the group identity of the process (see `setgid(2)`).",
                          "name": "gid",
                          "type": "number",
                          "desc": "Sets the group identity of the process (see `setgid(2)`)."
                        },
                        {
                          "textRaw": "`serialization` {string} Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. See Advanced serialization for more details. **Default:** `'json'`.",
                          "name": "serialization",
                          "type": "string",
                          "default": "`'json'`",
                          "desc": "Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. See Advanced serialization for more details."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} Allows closing the child process using an AbortSignal.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Allows closing the child process using an AbortSignal."
                        },
                        {
                          "textRaw": "`killSignal` {string|integer} The signal value to be used when the spawned process will be killed by timeout or abort signal. **Default:** `'SIGTERM'`.",
                          "name": "killSignal",
                          "type": "string|integer",
                          "default": "`'SIGTERM'`",
                          "desc": "The signal value to be used when the spawned process will be killed by timeout or abort signal."
                        },
                        {
                          "textRaw": "`silent` {boolean} If `true`, stdin, stdout, and stderr of the child process will be piped to the parent process, otherwise they will be inherited from the parent process, see the `'pipe'` and `'inherit'` options for `child_process.spawn()`'s `stdio` for more details. **Default:** `false`.",
                          "name": "silent",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, stdin, stdout, and stderr of the child process will be piped to the parent process, otherwise they will be inherited from the parent process, see the `'pipe'` and `'inherit'` options for `child_process.spawn()`'s `stdio` for more details."
                        },
                        {
                          "textRaw": "`stdio` {Array|string} See `child_process.spawn()`'s `stdio`. When this option is provided, it overrides `silent`. If the array variant is used, it must contain exactly one item with value `'ipc'` or an error will be thrown. For instance `[0, 1, 2, 'ipc']`.",
                          "name": "stdio",
                          "type": "Array|string",
                          "desc": "See `child_process.spawn()`'s `stdio`. When this option is provided, it overrides `silent`. If the array variant is used, it must contain exactly one item with value `'ipc'` or an error will be thrown. For instance `[0, 1, 2, 'ipc']`."
                        },
                        {
                          "textRaw": "`uid` {number} Sets the user identity of the process (see `setuid(2)`).",
                          "name": "uid",
                          "type": "number",
                          "desc": "Sets the user identity of the process (see `setuid(2)`)."
                        },
                        {
                          "textRaw": "`windowsVerbatimArguments` {boolean} No quoting or escaping of arguments is done on Windows. Ignored on Unix. **Default:** `false`.",
                          "name": "windowsVerbatimArguments",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "No quoting or escaping of arguments is done on Windows. Ignored on Unix."
                        },
                        {
                          "textRaw": "`timeout` {number} In milliseconds the maximum amount of time the process is allowed to run. **Default:** `undefined`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`undefined`",
                          "desc": "In milliseconds the maximum amount of time the process is allowed to run."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ChildProcess}",
                    "name": "return",
                    "type": "ChildProcess"
                  }
                }
              ],
              "desc": "<p>The <code>child_process.fork()</code> method is a special case of\n<a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> used specifically to spawn new Node.js processes.\nLike <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a>, a <a href=\"#class-childprocess\"><code>ChildProcess</code></a> object is returned. The\nreturned <a href=\"#class-childprocess\"><code>ChildProcess</code></a> will have an additional communication channel\nbuilt-in that allows messages to be passed back and forth between the parent and\nchild. See <a href=\"#subprocesssendmessage-sendhandle-options-callback\"><code>subprocess.send()</code></a> for details.</p>\n<p>Keep in mind that spawned Node.js child processes are\nindependent of the parent with exception of the IPC communication channel\nthat is established between the two. Each process has its own memory, with\ntheir own V8 instances. Because of the additional resource allocations\nrequired, spawning a large number of child Node.js processes is not\nrecommended.</p>\n<p>By default, <code>child_process.fork()</code> will spawn new Node.js instances using the\n<a href=\"process.html#processexecpath\"><code>process.execPath</code></a> of the parent process. The <code>execPath</code> property in the\n<code>options</code> object allows for an alternative execution path to be used.</p>\n<p>Node.js processes launched with a custom <code>execPath</code> will communicate with the\nparent process using the file descriptor (fd) identified using the\nenvironment variable <code>NODE_CHANNEL_FD</code> on the child process.</p>\n<p>Unlike the <a href=\"http://man7.org/linux/man-pages/man2/fork.2.html\"><code>fork(2)</code></a> POSIX system call, <code>child_process.fork()</code> does not clone the\ncurrent process.</p>\n<p>The <code>shell</code> option available in <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> is not supported by\n<code>child_process.fork()</code> and will be ignored if set.</p>\n<p>If the <code>signal</code> option is enabled, calling <code>.abort()</code> on the corresponding\n<code>AbortController</code> is similar to calling <code>.kill()</code> on the child process except\nthe error passed to the callback will be an <code>AbortError</code>:</p>\n<pre><code class=\"language-cjs\">const { fork } = require('node:child_process');\n\nif (process.argv[2] === 'child') {\n  setTimeout(() => {\n    console.log(`Hello from ${process.argv[2]}!`);\n  }, 1_000);\n} else {\n  const controller = new AbortController();\n  const { signal } = controller;\n  const child = fork(__filename, ['child'], { signal });\n  child.on('error', (err) => {\n    // This will be called with err being an AbortError if the controller aborts\n  });\n  controller.abort(); // Stops the child process\n}\n</code></pre>\n<pre><code class=\"language-mjs\">import { fork } from 'node:child_process';\nimport process from 'node:process';\n\nif (process.argv[2] === 'child') {\n  setTimeout(() => {\n    console.log(`Hello from ${process.argv[2]}!`);\n  }, 1_000);\n} else {\n  const controller = new AbortController();\n  const { signal } = controller;\n  const child = fork(import.meta.url, ['child'], { signal });\n  child.on('error', (err) => {\n    // This will be called with err being an AbortError if the controller aborts\n  });\n  controller.abort(); // Stops the child process\n}\n</code></pre>"
            },
            {
              "textRaw": "`child_process.spawn(command[, args][, options])`",
              "name": "spawn",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.11.0",
                      "v22.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57389",
                    "description": "Passing `args` when `shell` is set to `true` is deprecated."
                  },
                  {
                    "version": [
                      "v16.4.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38862",
                    "description": "The `cwd` option can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": [
                      "v15.13.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37256",
                    "description": "timeout was added."
                  },
                  {
                    "version": [
                      "v15.11.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37325",
                    "description": "killSignal for AbortSignal was added."
                  },
                  {
                    "version": [
                      "v15.5.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/36432",
                    "description": "AbortSignal support was added."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30162",
                    "description": "The `serialization` option is supported now."
                  },
                  {
                    "version": "v8.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15380",
                    "description": "The `windowsHide` option is supported now."
                  },
                  {
                    "version": "v6.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7696",
                    "description": "The `argv0` option is supported now."
                  },
                  {
                    "version": "v5.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4598",
                    "description": "The `shell` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`command` {string} The command to run.",
                      "name": "command",
                      "type": "string",
                      "desc": "The command to run."
                    },
                    {
                      "textRaw": "`args` {string[]} List of string arguments.",
                      "name": "args",
                      "type": "string[]",
                      "desc": "List of string arguments.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string|URL",
                          "desc": "Current working directory of the child process."
                        },
                        {
                          "textRaw": "`env` {Object} Environment key-value pairs. **Default:** `process.env`.",
                          "name": "env",
                          "type": "Object",
                          "default": "`process.env`",
                          "desc": "Environment key-value pairs."
                        },
                        {
                          "textRaw": "`argv0` {string} Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` if not specified.",
                          "name": "argv0",
                          "type": "string",
                          "desc": "Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` if not specified."
                        },
                        {
                          "textRaw": "`stdio` {Array|string} Child's stdio configuration (see `options.stdio`).",
                          "name": "stdio",
                          "type": "Array|string",
                          "desc": "Child's stdio configuration (see `options.stdio`)."
                        },
                        {
                          "textRaw": "`detached` {boolean} Prepare child process to run independently of its parent process. Specific behavior depends on the platform (see `options.detached`).",
                          "name": "detached",
                          "type": "boolean",
                          "desc": "Prepare child process to run independently of its parent process. Specific behavior depends on the platform (see `options.detached`)."
                        },
                        {
                          "textRaw": "`uid` {number} Sets the user identity of the process (see `setuid(2)`).",
                          "name": "uid",
                          "type": "number",
                          "desc": "Sets the user identity of the process (see `setuid(2)`)."
                        },
                        {
                          "textRaw": "`gid` {number} Sets the group identity of the process (see `setgid(2)`).",
                          "name": "gid",
                          "type": "number",
                          "desc": "Sets the group identity of the process (see `setgid(2)`)."
                        },
                        {
                          "textRaw": "`serialization` {string} Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. See Advanced serialization for more details. **Default:** `'json'`.",
                          "name": "serialization",
                          "type": "string",
                          "default": "`'json'`",
                          "desc": "Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. See Advanced serialization for more details."
                        },
                        {
                          "textRaw": "`shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses `'/bin/sh'` on Unix, and `process.env.ComSpec` on Windows. A different shell can be specified as a string. See Shell requirements and Default Windows shell. **Default:** `false` (no shell).",
                          "name": "shell",
                          "type": "boolean|string",
                          "default": "`false` (no shell)",
                          "desc": "If `true`, runs `command` inside of a shell. Uses `'/bin/sh'` on Unix, and `process.env.ComSpec` on Windows. A different shell can be specified as a string. See Shell requirements and Default Windows shell."
                        },
                        {
                          "textRaw": "`windowsVerbatimArguments` {boolean} No quoting or escaping of arguments is done on Windows. Ignored on Unix. This is set to `true` automatically when `shell` is specified and is CMD. **Default:** `false`.",
                          "name": "windowsVerbatimArguments",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "No quoting or escaping of arguments is done on Windows. Ignored on Unix. This is set to `true` automatically when `shell` is specified and is CMD."
                        },
                        {
                          "textRaw": "`windowsHide` {boolean} Hide the subprocess console window that would normally be created on Windows systems. **Default:** `false`.",
                          "name": "windowsHide",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Hide the subprocess console window that would normally be created on Windows systems."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting the child process using an AbortSignal.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting the child process using an AbortSignal."
                        },
                        {
                          "textRaw": "`timeout` {number} In milliseconds the maximum amount of time the process is allowed to run. **Default:** `undefined`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`undefined`",
                          "desc": "In milliseconds the maximum amount of time the process is allowed to run."
                        },
                        {
                          "textRaw": "`killSignal` {string|integer} The signal value to be used when the spawned process will be killed by timeout or abort signal. **Default:** `'SIGTERM'`.",
                          "name": "killSignal",
                          "type": "string|integer",
                          "default": "`'SIGTERM'`",
                          "desc": "The signal value to be used when the spawned process will be killed by timeout or abort signal."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ChildProcess}",
                    "name": "return",
                    "type": "ChildProcess"
                  }
                }
              ],
              "desc": "<p>The <code>child_process.spawn()</code> method spawns a new process using the given\n<code>command</code>, with command-line arguments in <code>args</code>. If omitted, <code>args</code> defaults\nto an empty array.</p>\n<p><strong>If the <code>shell</code> option is enabled, do not pass unsanitized user input to this\nfunction. Any input containing shell metacharacters may be used to trigger\narbitrary command execution.</strong></p>\n<p>A third argument may be used to specify additional options, with these defaults:</p>\n<pre><code class=\"language-js\">const defaults = {\n  cwd: undefined,\n  env: process.env,\n};\n</code></pre>\n<p>Use <code>cwd</code> to specify the working directory from which the process is spawned.\nIf not given, the default is to inherit the current working directory. If given,\nbut the path does not exist, the child process emits an <code>ENOENT</code> error\nand exits immediately. <code>ENOENT</code> is also emitted when the command\ndoes not exist.</p>\n<p>Use <code>env</code> to specify environment variables that will be visible to the new\nprocess, the default is <a href=\"process.html#processenv\"><code>process.env</code></a>.</p>\n<p><code>undefined</code> values in <code>env</code> will be ignored.</p>\n<p>Example of running <code>ls -lh /usr</code>, capturing <code>stdout</code>, <code>stderr</code>, and the\nexit code:</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\nconst ls = spawn('ls', ['-lh', '/usr']);\n\nls.stdout.on('data', (data) => {\n  console.log(`stdout: ${data}`);\n});\n\nls.stderr.on('data', (data) => {\n  console.error(`stderr: ${data}`);\n});\n\nls.on('close', (code) => {\n  console.log(`child process exited with code ${code}`);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nimport { once } from 'node:events';\nconst ls = spawn('ls', ['-lh', '/usr']);\n\nls.stdout.on('data', (data) => {\n  console.log(`stdout: ${data}`);\n});\n\nls.stderr.on('data', (data) => {\n  console.error(`stderr: ${data}`);\n});\n\nconst [code] = await once(ls, 'close');\nconsole.log(`child process exited with code ${code}`);\n</code></pre>\n<p>Example: A very elaborate way to run <code>ps ax | grep ssh</code></p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\nconst ps = spawn('ps', ['ax']);\nconst grep = spawn('grep', ['ssh']);\n\nps.stdout.on('data', (data) => {\n  grep.stdin.write(data);\n});\n\nps.stderr.on('data', (data) => {\n  console.error(`ps stderr: ${data}`);\n});\n\nps.on('close', (code) => {\n  if (code !== 0) {\n    console.log(`ps process exited with code ${code}`);\n  }\n  grep.stdin.end();\n});\n\ngrep.stdout.on('data', (data) => {\n  console.log(data.toString());\n});\n\ngrep.stderr.on('data', (data) => {\n  console.error(`grep stderr: ${data}`);\n});\n\ngrep.on('close', (code) => {\n  if (code !== 0) {\n    console.log(`grep process exited with code ${code}`);\n  }\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nconst ps = spawn('ps', ['ax']);\nconst grep = spawn('grep', ['ssh']);\n\nps.stdout.on('data', (data) => {\n  grep.stdin.write(data);\n});\n\nps.stderr.on('data', (data) => {\n  console.error(`ps stderr: ${data}`);\n});\n\nps.on('close', (code) => {\n  if (code !== 0) {\n    console.log(`ps process exited with code ${code}`);\n  }\n  grep.stdin.end();\n});\n\ngrep.stdout.on('data', (data) => {\n  console.log(data.toString());\n});\n\ngrep.stderr.on('data', (data) => {\n  console.error(`grep stderr: ${data}`);\n});\n\ngrep.on('close', (code) => {\n  if (code !== 0) {\n    console.log(`grep process exited with code ${code}`);\n  }\n});\n</code></pre>\n<p>Example of checking for failed <code>spawn</code>:</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\nconst subprocess = spawn('bad_command');\n\nsubprocess.on('error', (err) => {\n  console.error('Failed to start subprocess.');\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nconst subprocess = spawn('bad_command');\n\nsubprocess.on('error', (err) => {\n  console.error('Failed to start subprocess.');\n});\n</code></pre>\n<p>Certain platforms (macOS, Linux) will use the value of <code>argv[0]</code> for the process\ntitle while others (Windows, SunOS) will use <code>command</code>.</p>\n<p>Node.js overwrites <code>argv[0]</code> with <code>process.execPath</code> on startup, so\n<code>process.argv[0]</code> in a Node.js child process will not match the <code>argv0</code>\nparameter passed to <code>spawn</code> from the parent. Retrieve it with the\n<code>process.argv0</code> property instead.</p>\n<p>If the <code>signal</code> option is enabled, calling <code>.abort()</code> on the corresponding\n<code>AbortController</code> is similar to calling <code>.kill()</code> on the child process except\nthe error passed to the callback will be an <code>AbortError</code>:</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\nconst controller = new AbortController();\nconst { signal } = controller;\nconst grep = spawn('grep', ['ssh'], { signal });\ngrep.on('error', (err) => {\n  // This will be called with err being an AbortError if the controller aborts\n});\ncontroller.abort(); // Stops the child process\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nconst controller = new AbortController();\nconst { signal } = controller;\nconst grep = spawn('grep', ['ssh'], { signal });\ngrep.on('error', (err) => {\n  // This will be called with err being an AbortError if the controller aborts\n});\ncontroller.abort(); // Stops the child process\n</code></pre>",
              "properties": [
                {
                  "textRaw": "`options.detached`",
                  "name": "detached",
                  "type": "property",
                  "meta": {
                    "added": [
                      "v0.7.10"
                    ],
                    "changes": []
                  },
                  "desc": "<p>On Windows, setting <code>options.detached</code> to <code>true</code> makes it possible for the\nchild process to continue running after the parent exits. The child process\nwill have its own console window. Once enabled for a child process,\nit cannot be disabled.</p>\n<p>On non-Windows platforms, if <code>options.detached</code> is set to <code>true</code>, the child\nprocess will be made the leader of a new process group and session. Child\nprocesses may continue running after the parent exits regardless of whether\nthey are detached or not. See <a href=\"http://man7.org/linux/man-pages/man2/setsid.2.html\"><code>setsid(2)</code></a> for more information.</p>\n<p>By default, the parent will wait for the detached child process to exit.\nTo prevent the parent process from waiting for a given <code>subprocess</code> to exit, use\nthe <code>subprocess.unref()</code> method. Doing so will cause the parent process' event\nloop to not include the child process in its reference count, allowing the\nparent process to exit independently of the child process, unless there is an established\nIPC channel between the child and the parent processes.</p>\n<p>When using the <code>detached</code> option to start a long-running process, the process\nwill not stay running in the background after the parent exits unless it is\nprovided with a <code>stdio</code> configuration that is not connected to the parent.\nIf the parent process' <code>stdio</code> is inherited, the child process will remain attached\nto the controlling terminal.</p>\n<p>Example of a long-running process, by detaching and also ignoring its parent\n<code>stdio</code> file descriptors, in order to ignore the parent's termination:</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\n\nconst subprocess = spawn(process.argv[0], ['child_program.js'], {\n  detached: true,\n  stdio: 'ignore',\n});\n\nsubprocess.unref();\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nimport process from 'node:process';\n\nconst subprocess = spawn(process.argv[0], ['child_program.js'], {\n  detached: true,\n  stdio: 'ignore',\n});\n\nsubprocess.unref();\n</code></pre>\n<p>Alternatively one can redirect the child process' output into files:</p>\n<pre><code class=\"language-cjs\">const { openSync } = require('node:fs');\nconst { spawn } = require('node:child_process');\nconst out = openSync('./out.log', 'a');\nconst err = openSync('./out.log', 'a');\n\nconst subprocess = spawn('prg', [], {\n  detached: true,\n  stdio: [ 'ignore', out, err ],\n});\n\nsubprocess.unref();\n</code></pre>\n<pre><code class=\"language-mjs\">import { openSync } from 'node:fs';\nimport { spawn } from 'node:child_process';\nconst out = openSync('./out.log', 'a');\nconst err = openSync('./out.log', 'a');\n\nconst subprocess = spawn('prg', [], {\n  detached: true,\n  stdio: [ 'ignore', out, err ],\n});\n\nsubprocess.unref();\n</code></pre>"
                },
                {
                  "textRaw": "`options.stdio`",
                  "name": "stdio",
                  "type": "property",
                  "meta": {
                    "added": [
                      "v0.7.10"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v15.6.0",
                          "v14.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/29412",
                        "description": "Added the `overlapped` stdio flag."
                      },
                      {
                        "version": "v3.3.1",
                        "pr-url": "https://github.com/nodejs/node/pull/2727",
                        "description": "The value `0` is now accepted as a file descriptor."
                      }
                    ]
                  },
                  "desc": "<p>The <code>options.stdio</code> option is used to configure the pipes that are established\nbetween the parent and child process. By default, the child's stdin, stdout,\nand stderr are redirected to corresponding <a href=\"#subprocessstdin\"><code>subprocess.stdin</code></a>,\n<a href=\"#subprocessstdout\"><code>subprocess.stdout</code></a>, and <a href=\"#subprocessstderr\"><code>subprocess.stderr</code></a> streams on the\n<a href=\"#class-childprocess\"><code>ChildProcess</code></a> object. This is equivalent to setting the <code>options.stdio</code>\nequal to <code>['pipe', 'pipe', 'pipe']</code>.</p>\n<p>For convenience, <code>options.stdio</code> may be one of the following strings:</p>\n<ul>\n<li><code>'pipe'</code>: equivalent to <code>['pipe', 'pipe', 'pipe']</code> (the default)</li>\n<li><code>'overlapped'</code>: equivalent to <code>['overlapped', 'overlapped', 'overlapped']</code></li>\n<li><code>'ignore'</code>: equivalent to <code>['ignore', 'ignore', 'ignore']</code></li>\n<li><code>'inherit'</code>: equivalent to <code>['inherit', 'inherit', 'inherit']</code> or <code>[0, 1, 2]</code></li>\n</ul>\n<p>Otherwise, the value of <code>options.stdio</code> is an array where each index corresponds\nto an fd in the child. The fds 0, 1, and 2 correspond to stdin, stdout,\nand stderr, respectively. Additional fds can be specified to create additional\npipes between the parent and child. The value is one of the following:</p>\n<ol>\n<li>\n<p><code>'pipe'</code>: Create a pipe between the child process and the parent process.\nThe parent end of the pipe is exposed to the parent as a property on the\n<code>child_process</code> object as <a href=\"#subprocessstdio\"><code>subprocess.stdio[fd]</code></a>. Pipes\ncreated for fds 0, 1, and 2 are also available as <a href=\"#subprocessstdin\"><code>subprocess.stdin</code></a>,\n<a href=\"#subprocessstdout\"><code>subprocess.stdout</code></a> and <a href=\"#subprocessstderr\"><code>subprocess.stderr</code></a>, respectively.\nThese are not actual Unix pipes and therefore the child process\ncan not use them by their descriptor files,\ne.g. <code>/dev/fd/2</code> or <code>/dev/stdout</code>.</p>\n</li>\n<li>\n<p><code>'overlapped'</code>: Same as <code>'pipe'</code> except that the <code>FILE_FLAG_OVERLAPPED</code> flag\nis set on the handle. This is necessary for overlapped I/O on the child\nprocess's stdio handles. See the\n<a href=\"https://docs.microsoft.com/en-us/windows/win32/fileio/synchronous-and-asynchronous-i-o\">docs</a>\nfor more details. This is exactly the same as <code>'pipe'</code> on non-Windows\nsystems.</p>\n</li>\n<li>\n<p><code>'ipc'</code>: Create an IPC channel for passing messages/file descriptors\nbetween parent and child. A <a href=\"#class-childprocess\"><code>ChildProcess</code></a> may have at most one IPC\nstdio file descriptor. Setting this option enables the\n<a href=\"#subprocesssendmessage-sendhandle-options-callback\"><code>subprocess.send()</code></a> method. If the child process is a Node.js instance,\nthe presence of an IPC channel will enable <a href=\"process.html#processsendmessage-sendhandle-options-callback\"><code>process.send()</code></a> and\n<a href=\"process.html#processdisconnect\"><code>process.disconnect()</code></a> methods, as well as <a href=\"process.html#event-disconnect\"><code>'disconnect'</code></a> and\n<a href=\"process.html#event-message\"><code>'message'</code></a> events within the child process.</p>\n<p>Accessing the IPC channel fd in any way other than <a href=\"process.html#processsendmessage-sendhandle-options-callback\"><code>process.send()</code></a>\nor using the IPC channel with a child process that is not a Node.js instance\nis not supported.</p>\n</li>\n<li>\n<p><code>'ignore'</code>: Instructs Node.js to ignore the fd in the child. While Node.js\nwill always open fds 0, 1, and 2 for the processes it spawns, setting the fd\nto <code>'ignore'</code> will cause Node.js to open <code>/dev/null</code> and attach it to the\nchild's fd.</p>\n</li>\n<li>\n<p><code>'inherit'</code>: Pass through the corresponding stdio stream to/from the\nparent process. In the first three positions, this is equivalent to\n<code>process.stdin</code>, <code>process.stdout</code>, and <code>process.stderr</code>, respectively. In\nany other position, equivalent to <code>'ignore'</code>.</p>\n</li>\n<li>\n<p><a href=\"stream.html#stream\"><code>&#x3C;Stream></code></a> object: Share a readable or writable stream that refers to a tty,\nfile, socket, or a pipe with the child process. The stream's underlying\nfile descriptor is duplicated in the child process to the fd that\ncorresponds to the index in the <code>stdio</code> array. The stream must have an\nunderlying descriptor (file streams do not start until the <code>'open'</code> event has\noccurred).\n<strong>NOTE:</strong> While it is technically possible to pass <code>stdin</code> as a writable or\n<code>stdout</code>/<code>stderr</code> as readable, it is not recommended.\nReadable and writable streams are designed with distinct behaviors, and using\nthem incorrectly (e.g., passing a readable stream where a writable stream is\nexpected) can lead to unexpected results or errors. This practice is discouraged\nas it may result in undefined behavior or dropped callbacks if the stream\nencounters errors. Always ensure that <code>stdin</code> is used as readable and\n<code>stdout</code>/<code>stderr</code> as writable to maintain the intended flow of data between\nthe parent and child processes.</p>\n</li>\n<li>\n<p>Positive integer: The integer value is interpreted as a file descriptor\nthat is open in the parent process. It is shared with the child\nprocess, similar to how <a href=\"stream.html#stream\"><code>&#x3C;Stream></code></a> objects can be shared. Passing sockets\nis not supported on Windows.</p>\n</li>\n<li>\n<p><code>null</code>, <code>undefined</code>: Use default value. For stdio fds 0, 1, and 2 (in other\nwords, stdin, stdout, and stderr) a pipe is created. For fd 3 and up, the\ndefault is <code>'ignore'</code>.</p>\n</li>\n</ol>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\n\n// Child will use parent's stdios.\nspawn('prg', [], { stdio: 'inherit' });\n\n// Spawn child sharing only stderr.\nspawn('prg', [], { stdio: ['pipe', 'pipe', process.stderr] });\n\n// Open an extra fd=4, to interact with programs presenting a\n// startd-style interface.\nspawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] });\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nimport process from 'node:process';\n\n// Child will use parent's stdios.\nspawn('prg', [], { stdio: 'inherit' });\n\n// Spawn child sharing only stderr.\nspawn('prg', [], { stdio: ['pipe', 'pipe', process.stderr] });\n\n// Open an extra fd=4, to interact with programs presenting a\n// startd-style interface.\nspawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] });\n</code></pre>\n<p><em>It is worth noting that when an IPC channel is established between the\nparent and child processes, and the child process is a Node.js instance,\nthe child process is launched with the IPC channel unreferenced (using\n<code>unref()</code>) until the child process registers an event handler for the\n<a href=\"process.html#event-disconnect\"><code>'disconnect'</code></a> event or the <a href=\"process.html#event-message\"><code>'message'</code></a> event. This allows the\nchild process to exit normally without the process being held open by the\nopen IPC channel.</em>\nSee also: <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a> and <a href=\"#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>.</p>"
                }
              ]
            }
          ],
          "displayName": "Asynchronous process creation"
        },
        {
          "textRaw": "Synchronous process creation",
          "name": "synchronous_process_creation",
          "type": "module",
          "desc": "<p>The <a href=\"#child_processspawnsynccommand-args-options\"><code>child_process.spawnSync()</code></a>, <a href=\"#child_processexecsynccommand-options\"><code>child_process.execSync()</code></a>, and\n<a href=\"#child_processexecfilesyncfile-args-options\"><code>child_process.execFileSync()</code></a> methods are synchronous and will block the\nNode.js event loop, pausing execution of any additional code until the spawned\nprocess exits.</p>\n<p>Blocking calls like these are mostly useful for simplifying general-purpose\nscripting tasks and for simplifying the loading/processing of application\nconfiguration at startup.</p>",
          "methods": [
            {
              "textRaw": "`child_process.execFileSync(file[, args][, options])`",
              "name": "execFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.4.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38862",
                    "description": "The `cwd` option can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22409",
                    "description": "The `input` option can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v8.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15380",
                    "description": "The `windowsHide` option is supported now."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10653",
                    "description": "The `input` option can now be a `Uint8Array`."
                  },
                  {
                    "version": [
                      "v6.2.1",
                      "v4.5.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/6939",
                    "description": "The `encoding` option can now explicitly be set to `buffer`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`file` {string} The name or path of the executable file to run.",
                      "name": "file",
                      "type": "string",
                      "desc": "The name or path of the executable file to run."
                    },
                    {
                      "textRaw": "`args` {string[]} List of string arguments.",
                      "name": "args",
                      "type": "string[]",
                      "desc": "List of string arguments.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string|URL",
                          "desc": "Current working directory of the child process."
                        },
                        {
                          "textRaw": "`input` {string|Buffer|TypedArray|DataView} The value which will be passed as stdin to the spawned process. If `stdio[0]` is set to `'pipe'`, Supplying this value will override `stdio[0]`.",
                          "name": "input",
                          "type": "string|Buffer|TypedArray|DataView",
                          "desc": "The value which will be passed as stdin to the spawned process. If `stdio[0]` is set to `'pipe'`, Supplying this value will override `stdio[0]`."
                        },
                        {
                          "textRaw": "`stdio` {string|Array} Child's stdio configuration. See `child_process.spawn()`'s `stdio`. `stderr` by default will be output to the parent process' stderr unless `stdio` is specified. **Default:** `'pipe'`.",
                          "name": "stdio",
                          "type": "string|Array",
                          "default": "`'pipe'`",
                          "desc": "Child's stdio configuration. See `child_process.spawn()`'s `stdio`. `stderr` by default will be output to the parent process' stderr unless `stdio` is specified."
                        },
                        {
                          "textRaw": "`env` {Object} Environment key-value pairs. **Default:** `process.env`.",
                          "name": "env",
                          "type": "Object",
                          "default": "`process.env`",
                          "desc": "Environment key-value pairs."
                        },
                        {
                          "textRaw": "`uid` {number} Sets the user identity of the process (see `setuid(2)`).",
                          "name": "uid",
                          "type": "number",
                          "desc": "Sets the user identity of the process (see `setuid(2)`)."
                        },
                        {
                          "textRaw": "`gid` {number} Sets the group identity of the process (see `setgid(2)`).",
                          "name": "gid",
                          "type": "number",
                          "desc": "Sets the group identity of the process (see `setgid(2)`)."
                        },
                        {
                          "textRaw": "`timeout` {number} In milliseconds the maximum amount of time the process is allowed to run. **Default:** `undefined`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`undefined`",
                          "desc": "In milliseconds the maximum amount of time the process is allowed to run."
                        },
                        {
                          "textRaw": "`killSignal` {string|integer} The signal value to be used when the spawned process will be killed. **Default:** `'SIGTERM'`.",
                          "name": "killSignal",
                          "type": "string|integer",
                          "default": "`'SIGTERM'`",
                          "desc": "The signal value to be used when the spawned process will be killed."
                        },
                        {
                          "textRaw": "`maxBuffer` {number} Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated. See caveat at `maxBuffer` and Unicode. **Default:** `1024 * 1024`.",
                          "name": "maxBuffer",
                          "type": "number",
                          "default": "`1024 * 1024`",
                          "desc": "Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated. See caveat at `maxBuffer` and Unicode."
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding used for all stdio inputs and outputs. **Default:** `'buffer'`.",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'buffer'`",
                          "desc": "The encoding used for all stdio inputs and outputs."
                        },
                        {
                          "textRaw": "`windowsHide` {boolean} Hide the subprocess console window that would normally be created on Windows systems. **Default:** `false`.",
                          "name": "windowsHide",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Hide the subprocess console window that would normally be created on Windows systems."
                        },
                        {
                          "textRaw": "`shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses `'/bin/sh'` on Unix, and `process.env.ComSpec` on Windows. A different shell can be specified as a string. See Shell requirements and Default Windows shell. **Default:** `false` (no shell).",
                          "name": "shell",
                          "type": "boolean|string",
                          "default": "`false` (no shell)",
                          "desc": "If `true`, runs `command` inside of a shell. Uses `'/bin/sh'` on Unix, and `process.env.ComSpec` on Windows. A different shell can be specified as a string. See Shell requirements and Default Windows shell."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} The stdout from the command.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "The stdout from the command."
                  }
                }
              ],
              "desc": "<p>The <code>child_process.execFileSync()</code> method is generally identical to\n<a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a> with the exception that the method will not\nreturn until the child process has fully closed. When a timeout has been\nencountered and <code>killSignal</code> is sent, the method won't return until the process\nhas completely exited.</p>\n<p>If the child process intercepts and handles the <code>SIGTERM</code> signal and\ndoes not exit, the parent process will still wait until the child process has\nexited.</p>\n<p>If the process times out or has a non-zero exit code, this method will throw an\n<a href=\"errors.html#class-error\"><code>Error</code></a> that will include the full result of the underlying\n<a href=\"#child_processspawnsynccommand-args-options\"><code>child_process.spawnSync()</code></a>.</p>\n<p><strong>If the <code>shell</code> option is enabled, do not pass unsanitized user input to this\nfunction. Any input containing shell metacharacters may be used to trigger\narbitrary command execution.</strong></p>\n<pre><code class=\"language-cjs\">const { execFileSync } = require('node:child_process');\n\ntry {\n  const stdout = execFileSync('my-script.sh', ['my-arg'], {\n    // Capture stdout and stderr from child process. Overrides the\n    // default behavior of streaming child stderr to the parent stderr\n    stdio: 'pipe',\n\n    // Use utf8 encoding for stdio pipes\n    encoding: 'utf8',\n  });\n\n  console.log(stdout);\n} catch (err) {\n  if (err.code) {\n    // Spawning child process failed\n    console.error(err.code);\n  } else {\n    // Child was spawned but exited with non-zero exit code\n    // Error contains any stdout and stderr from the child\n    const { stdout, stderr } = err;\n\n    console.error({ stdout, stderr });\n  }\n}\n</code></pre>\n<pre><code class=\"language-mjs\">import { execFileSync } from 'node:child_process';\n\ntry {\n  const stdout = execFileSync('my-script.sh', ['my-arg'], {\n    // Capture stdout and stderr from child process. Overrides the\n    // default behavior of streaming child stderr to the parent stderr\n    stdio: 'pipe',\n\n    // Use utf8 encoding for stdio pipes\n    encoding: 'utf8',\n  });\n\n  console.log(stdout);\n} catch (err) {\n  if (err.code) {\n    // Spawning child process failed\n    console.error(err.code);\n  } else {\n    // Child was spawned but exited with non-zero exit code\n    // Error contains any stdout and stderr from the child\n    const { stdout, stderr } = err;\n\n    console.error({ stdout, stderr });\n  }\n}\n</code></pre>"
            },
            {
              "textRaw": "`child_process.execSync(command[, options])`",
              "name": "execSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.4.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38862",
                    "description": "The `cwd` option can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22409",
                    "description": "The `input` option can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v8.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15380",
                    "description": "The `windowsHide` option is supported now."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10653",
                    "description": "The `input` option can now be a `Uint8Array`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`command` {string} The command to run.",
                      "name": "command",
                      "type": "string",
                      "desc": "The command to run."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string|URL",
                          "desc": "Current working directory of the child process."
                        },
                        {
                          "textRaw": "`input` {string|Buffer|TypedArray|DataView} The value which will be passed as stdin to the spawned process. If `stdio[0]` is set to `'pipe'`, Supplying this value will override `stdio[0]`.",
                          "name": "input",
                          "type": "string|Buffer|TypedArray|DataView",
                          "desc": "The value which will be passed as stdin to the spawned process. If `stdio[0]` is set to `'pipe'`, Supplying this value will override `stdio[0]`."
                        },
                        {
                          "textRaw": "`stdio` {string|Array} Child's stdio configuration. See `child_process.spawn()`'s `stdio`. `stderr` by default will be output to the parent process' stderr unless `stdio` is specified. **Default:** `'pipe'`.",
                          "name": "stdio",
                          "type": "string|Array",
                          "default": "`'pipe'`",
                          "desc": "Child's stdio configuration. See `child_process.spawn()`'s `stdio`. `stderr` by default will be output to the parent process' stderr unless `stdio` is specified."
                        },
                        {
                          "textRaw": "`env` {Object} Environment key-value pairs. **Default:** `process.env`.",
                          "name": "env",
                          "type": "Object",
                          "default": "`process.env`",
                          "desc": "Environment key-value pairs."
                        },
                        {
                          "textRaw": "`shell` {string} Shell to execute the command with. See Shell requirements and Default Windows shell. **Default:** `'/bin/sh'` on Unix, `process.env.ComSpec` on Windows.",
                          "name": "shell",
                          "type": "string",
                          "default": "`'/bin/sh'` on Unix, `process.env.ComSpec` on Windows",
                          "desc": "Shell to execute the command with. See Shell requirements and Default Windows shell."
                        },
                        {
                          "textRaw": "`uid` {number} Sets the user identity of the process. (See `setuid(2)`).",
                          "name": "uid",
                          "type": "number",
                          "desc": "Sets the user identity of the process. (See `setuid(2)`)."
                        },
                        {
                          "textRaw": "`gid` {number} Sets the group identity of the process. (See `setgid(2)`).",
                          "name": "gid",
                          "type": "number",
                          "desc": "Sets the group identity of the process. (See `setgid(2)`)."
                        },
                        {
                          "textRaw": "`timeout` {number} In milliseconds the maximum amount of time the process is allowed to run. **Default:** `undefined`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`undefined`",
                          "desc": "In milliseconds the maximum amount of time the process is allowed to run."
                        },
                        {
                          "textRaw": "`killSignal` {string|integer} The signal value to be used when the spawned process will be killed. **Default:** `'SIGTERM'`.",
                          "name": "killSignal",
                          "type": "string|integer",
                          "default": "`'SIGTERM'`",
                          "desc": "The signal value to be used when the spawned process will be killed."
                        },
                        {
                          "textRaw": "`maxBuffer` {number} Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated and any output is truncated. See caveat at `maxBuffer` and Unicode. **Default:** `1024 * 1024`.",
                          "name": "maxBuffer",
                          "type": "number",
                          "default": "`1024 * 1024`",
                          "desc": "Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated and any output is truncated. See caveat at `maxBuffer` and Unicode."
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding used for all stdio inputs and outputs. **Default:** `'buffer'`.",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'buffer'`",
                          "desc": "The encoding used for all stdio inputs and outputs."
                        },
                        {
                          "textRaw": "`windowsHide` {boolean} Hide the subprocess console window that would normally be created on Windows systems. **Default:** `false`.",
                          "name": "windowsHide",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Hide the subprocess console window that would normally be created on Windows systems."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} The stdout from the command.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "The stdout from the command."
                  }
                }
              ],
              "desc": "<p>The <code>child_process.execSync()</code> method is generally identical to\n<a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a> with the exception that the method will not return\nuntil the child process has fully closed. When a timeout has been encountered\nand <code>killSignal</code> is sent, the method won't return until the process has\ncompletely exited. If the child process intercepts and handles the <code>SIGTERM</code>\nsignal and doesn't exit, the parent process will wait until the child process\nhas exited.</p>\n<p>If the process times out or has a non-zero exit code, this method will throw.\nThe <a href=\"errors.html#class-error\"><code>Error</code></a> object will contain the entire result from\n<a href=\"#child_processspawnsynccommand-args-options\"><code>child_process.spawnSync()</code></a>.</p>\n<p><strong>Never pass unsanitized user input to this function. Any input containing shell\nmetacharacters may be used to trigger arbitrary command execution.</strong></p>"
            },
            {
              "textRaw": "`child_process.spawnSync(command[, args][, options])`",
              "name": "spawnSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.4.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/38862",
                    "description": "The `cwd` option can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22409",
                    "description": "The `input` option can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v8.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15380",
                    "description": "The `windowsHide` option is supported now."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10653",
                    "description": "The `input` option can now be a `Uint8Array`."
                  },
                  {
                    "version": [
                      "v6.2.1",
                      "v4.5.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/6939",
                    "description": "The `encoding` option can now explicitly be set to `buffer`."
                  },
                  {
                    "version": "v5.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4598",
                    "description": "The `shell` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`command` {string} The command to run.",
                      "name": "command",
                      "type": "string",
                      "desc": "The command to run."
                    },
                    {
                      "textRaw": "`args` {string[]} List of string arguments.",
                      "name": "args",
                      "type": "string[]",
                      "desc": "List of string arguments.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} Current working directory of the child process.",
                          "name": "cwd",
                          "type": "string|URL",
                          "desc": "Current working directory of the child process."
                        },
                        {
                          "textRaw": "`input` {string|Buffer|TypedArray|DataView} The value which will be passed as stdin to the spawned process. If `stdio[0]` is set to `'pipe'`, Supplying this value will override `stdio[0]`.",
                          "name": "input",
                          "type": "string|Buffer|TypedArray|DataView",
                          "desc": "The value which will be passed as stdin to the spawned process. If `stdio[0]` is set to `'pipe'`, Supplying this value will override `stdio[0]`."
                        },
                        {
                          "textRaw": "`argv0` {string} Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` if not specified.",
                          "name": "argv0",
                          "type": "string",
                          "desc": "Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` if not specified."
                        },
                        {
                          "textRaw": "`stdio` {string|Array} Child's stdio configuration. See `child_process.spawn()`'s `stdio`. **Default:** `'pipe'`.",
                          "name": "stdio",
                          "type": "string|Array",
                          "default": "`'pipe'`",
                          "desc": "Child's stdio configuration. See `child_process.spawn()`'s `stdio`."
                        },
                        {
                          "textRaw": "`env` {Object} Environment key-value pairs. **Default:** `process.env`.",
                          "name": "env",
                          "type": "Object",
                          "default": "`process.env`",
                          "desc": "Environment key-value pairs."
                        },
                        {
                          "textRaw": "`uid` {number} Sets the user identity of the process (see `setuid(2)`).",
                          "name": "uid",
                          "type": "number",
                          "desc": "Sets the user identity of the process (see `setuid(2)`)."
                        },
                        {
                          "textRaw": "`gid` {number} Sets the group identity of the process (see `setgid(2)`).",
                          "name": "gid",
                          "type": "number",
                          "desc": "Sets the group identity of the process (see `setgid(2)`)."
                        },
                        {
                          "textRaw": "`timeout` {number} In milliseconds the maximum amount of time the process is allowed to run. **Default:** `undefined`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`undefined`",
                          "desc": "In milliseconds the maximum amount of time the process is allowed to run."
                        },
                        {
                          "textRaw": "`killSignal` {string|integer} The signal value to be used when the spawned process will be killed. **Default:** `'SIGTERM'`.",
                          "name": "killSignal",
                          "type": "string|integer",
                          "default": "`'SIGTERM'`",
                          "desc": "The signal value to be used when the spawned process will be killed."
                        },
                        {
                          "textRaw": "`maxBuffer` {number} Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated and any output is truncated. See caveat at `maxBuffer` and Unicode. **Default:** `1024 * 1024`.",
                          "name": "maxBuffer",
                          "type": "number",
                          "default": "`1024 * 1024`",
                          "desc": "Largest amount of data in bytes allowed on stdout or stderr. If exceeded, the child process is terminated and any output is truncated. See caveat at `maxBuffer` and Unicode."
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding used for all stdio inputs and outputs. **Default:** `'buffer'`.",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'buffer'`",
                          "desc": "The encoding used for all stdio inputs and outputs."
                        },
                        {
                          "textRaw": "`shell` {boolean|string} If `true`, runs `command` inside of a shell. Uses `'/bin/sh'` on Unix, and `process.env.ComSpec` on Windows. A different shell can be specified as a string. See Shell requirements and Default Windows shell. **Default:** `false` (no shell).",
                          "name": "shell",
                          "type": "boolean|string",
                          "default": "`false` (no shell)",
                          "desc": "If `true`, runs `command` inside of a shell. Uses `'/bin/sh'` on Unix, and `process.env.ComSpec` on Windows. A different shell can be specified as a string. See Shell requirements and Default Windows shell."
                        },
                        {
                          "textRaw": "`windowsVerbatimArguments` {boolean} No quoting or escaping of arguments is done on Windows. Ignored on Unix. This is set to `true` automatically when `shell` is specified and is CMD. **Default:** `false`.",
                          "name": "windowsVerbatimArguments",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "No quoting or escaping of arguments is done on Windows. Ignored on Unix. This is set to `true` automatically when `shell` is specified and is CMD."
                        },
                        {
                          "textRaw": "`windowsHide` {boolean} Hide the subprocess console window that would normally be created on Windows systems. **Default:** `false`.",
                          "name": "windowsHide",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Hide the subprocess console window that would normally be created on Windows systems."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`pid` {number} Pid of the child process.",
                        "name": "pid",
                        "type": "number",
                        "desc": "Pid of the child process."
                      },
                      {
                        "textRaw": "`output` {Array} Array of results from stdio output.",
                        "name": "output",
                        "type": "Array",
                        "desc": "Array of results from stdio output."
                      },
                      {
                        "textRaw": "`stdout` {Buffer|string} The contents of `output[1]`.",
                        "name": "stdout",
                        "type": "Buffer|string",
                        "desc": "The contents of `output[1]`."
                      },
                      {
                        "textRaw": "`stderr` {Buffer|string} The contents of `output[2]`.",
                        "name": "stderr",
                        "type": "Buffer|string",
                        "desc": "The contents of `output[2]`."
                      },
                      {
                        "textRaw": "`status` {number|null} The exit code of the subprocess, or `null` if the subprocess terminated due to a signal.",
                        "name": "status",
                        "type": "number|null",
                        "desc": "The exit code of the subprocess, or `null` if the subprocess terminated due to a signal."
                      },
                      {
                        "textRaw": "`signal` {string|null} The signal used to kill the subprocess, or `null` if the subprocess did not terminate due to a signal.",
                        "name": "signal",
                        "type": "string|null",
                        "desc": "The signal used to kill the subprocess, or `null` if the subprocess did not terminate due to a signal."
                      },
                      {
                        "textRaw": "`error` {Error} The error object if the child process failed or timed out.",
                        "name": "error",
                        "type": "Error",
                        "desc": "The error object if the child process failed or timed out."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>The <code>child_process.spawnSync()</code> method is generally identical to\n<a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> with the exception that the function will not return\nuntil the child process has fully closed. When a timeout has been encountered\nand <code>killSignal</code> is sent, the method won't return until the process has\ncompletely exited. If the process intercepts and handles the <code>SIGTERM</code> signal\nand doesn't exit, the parent process will wait until the child process has\nexited.</p>\n<p><strong>If the <code>shell</code> option is enabled, do not pass unsanitized user input to this\nfunction. Any input containing shell metacharacters may be used to trigger\narbitrary command execution.</strong></p>"
            }
          ],
          "displayName": "Synchronous process creation"
        },
        {
          "textRaw": "`maxBuffer` and Unicode",
          "name": "`maxbuffer`_and_unicode",
          "type": "module",
          "desc": "<p>The <code>maxBuffer</code> option specifies the largest number of bytes allowed on <code>stdout</code>\nor <code>stderr</code>. If this value is exceeded, then the child process is terminated.\nThis impacts output that includes multibyte character encodings such as UTF-8 or\nUTF-16. For instance, <code>console.log('中文测试')</code> will send 13 UTF-8 encoded bytes\nto <code>stdout</code> although there are only 4 characters.</p>",
          "displayName": "`maxBuffer` and Unicode"
        },
        {
          "textRaw": "Shell requirements",
          "name": "shell_requirements",
          "type": "module",
          "desc": "<p>The shell should understand the <code>-c</code> switch. If the shell is <code>'cmd.exe'</code>, it\nshould understand the <code>/d /s /c</code> switches and command-line parsing should be\ncompatible.</p>",
          "displayName": "Shell requirements"
        },
        {
          "textRaw": "Default Windows shell",
          "name": "default_windows_shell",
          "type": "module",
          "desc": "<p>Although Microsoft specifies <code>%COMSPEC%</code> must contain the path to\n<code>'cmd.exe'</code> in the root environment, child processes are not always subject to\nthe same requirement. Thus, in <code>child_process</code> functions where a shell can be\nspawned, <code>'cmd.exe'</code> is used as a fallback if <code>process.env.ComSpec</code> is\nunavailable.</p>",
          "displayName": "Default Windows shell"
        },
        {
          "textRaw": "Advanced serialization",
          "name": "advanced_serialization",
          "type": "module",
          "meta": {
            "added": [
              "v13.2.0",
              "v12.16.0"
            ],
            "changes": []
          },
          "desc": "<p>Child processes support a serialization mechanism for IPC that is based on the\n<a href=\"v8.html#serialization-api\">serialization API of the <code>node:v8</code> module</a>, based on the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\">HTML structured clone algorithm</a>. This is generally more powerful and\nsupports more built-in JavaScript object types, such as <code>BigInt</code>, <code>Map</code>\nand <code>Set</code>, <code>ArrayBuffer</code> and <code>TypedArray</code>, <code>Buffer</code>, <code>Error</code>, <code>RegExp</code> etc.</p>\n<p>However, this format is not a full superset of JSON, and e.g. properties set on\nobjects of such built-in types will not be passed on through the serialization\nstep. Additionally, performance may not be equivalent to that of JSON, depending\non the structure of the passed data.\nTherefore, this feature requires opting in by setting the\n<code>serialization</code> option to <code>'advanced'</code> when calling <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a>\nor <a href=\"#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>.</p>",
          "displayName": "Advanced serialization"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `ChildProcess`",
          "name": "ChildProcess",
          "type": "class",
          "meta": {
            "added": [
              "v2.2.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>Instances of the <code>ChildProcess</code> represent spawned child processes.</p>\n<p>Instances of <code>ChildProcess</code> are not intended to be created directly. Rather,\nuse the <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a>, <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a>,\n<a href=\"#child_processexecfilefile-args-options-callback\"><code>child_process.execFile()</code></a>, or <a href=\"#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a> methods to create\ninstances of <code>ChildProcess</code>.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`code` {number} The exit code if the child process exited on its own, or `null` if the child process terminated due to a signal.",
                  "name": "code",
                  "type": "number",
                  "desc": "The exit code if the child process exited on its own, or `null` if the child process terminated due to a signal."
                },
                {
                  "textRaw": "`signal` {string} The signal by which the child process was terminated, or `null` if the child process did not terminated due to a signal.",
                  "name": "signal",
                  "type": "string",
                  "desc": "The signal by which the child process was terminated, or `null` if the child process did not terminated due to a signal."
                }
              ],
              "desc": "<p>The <code>'close'</code> event is emitted after a process has ended <em>and</em> the stdio\nstreams of a child process have been closed. This is distinct from the\n<a href=\"#event-exit\"><code>'exit'</code></a> event, since multiple processes might share the same stdio\nstreams. The <code>'close'</code> event will always emit after <a href=\"#event-exit\"><code>'exit'</code></a> was\nalready emitted, or <a href=\"#event-error\"><code>'error'</code></a> if the child process failed to spawn.</p>\n<p>If the process exited, <code>code</code> is the final exit code of the process, otherwise\n<code>null</code>. If the process terminated due to receipt of a signal, <code>signal</code> is the\nstring name of the signal, otherwise <code>null</code>. One of the two will always be\nnon-<code>null</code>.</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\nconst ls = spawn('ls', ['-lh', '/usr']);\n\nls.stdout.on('data', (data) => {\n  console.log(`stdout: ${data}`);\n});\n\nls.on('close', (code) => {\n  console.log(`child process close all stdio with code ${code}`);\n});\n\nls.on('exit', (code) => {\n  console.log(`child process exited with code ${code}`);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nimport { once } from 'node:events';\nconst ls = spawn('ls', ['-lh', '/usr']);\n\nls.stdout.on('data', (data) => {\n  console.log(`stdout: ${data}`);\n});\n\nls.on('close', (code) => {\n  console.log(`child process close all stdio with code ${code}`);\n});\n\nls.on('exit', (code) => {\n  console.log(`child process exited with code ${code}`);\n});\n\nconst [code] = await once(ls, 'close');\nconsole.log(`child process close all stdio with code ${code}`);\n</code></pre>"
            },
            {
              "textRaw": "Event: `'disconnect'`",
              "name": "disconnect",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.2"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'disconnect'</code> event is emitted after calling the\n<a href=\"#subprocessdisconnect\"><code>subprocess.disconnect()</code></a> method in parent process or\n<a href=\"process.html#processdisconnect\"><code>process.disconnect()</code></a> in child process. After disconnecting it is no longer\npossible to send or receive messages, and the <a href=\"#subprocessconnected\"><code>subprocess.connected</code></a>\nproperty is <code>false</code>.</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "name": "error",
              "type": "event",
              "params": [
                {
                  "textRaw": "`err` {Error} The error.",
                  "name": "err",
                  "type": "Error",
                  "desc": "The error."
                }
              ],
              "desc": "<p>The <code>'error'</code> event is emitted whenever:</p>\n<ul>\n<li>The process could not be spawned.</li>\n<li>The process could not be killed.</li>\n<li>Sending a message to the child process failed.</li>\n<li>The child process was aborted via the <code>signal</code> option.</li>\n</ul>\n<p>The <code>'exit'</code> event may or may not fire after an error has occurred. When\nlistening to both the <code>'exit'</code> and <code>'error'</code> events, guard\nagainst accidentally invoking handler functions multiple times.</p>\n<p>See also <a href=\"#subprocesskillsignal\"><code>subprocess.kill()</code></a> and <a href=\"#subprocesssendmessage-sendhandle-options-callback\"><code>subprocess.send()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'exit'`",
              "name": "exit",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`code` {number} The exit code if the child process exited on its own, or `null` if the child process terminated due to a signal.",
                  "name": "code",
                  "type": "number",
                  "desc": "The exit code if the child process exited on its own, or `null` if the child process terminated due to a signal."
                },
                {
                  "textRaw": "`signal` {string} The signal by which the child process was terminated, or `null` if the child process did not terminated due to a signal.",
                  "name": "signal",
                  "type": "string",
                  "desc": "The signal by which the child process was terminated, or `null` if the child process did not terminated due to a signal."
                }
              ],
              "desc": "<p>The <code>'exit'</code> event is emitted after the child process ends. If the process\nexited, <code>code</code> is the final exit code of the process, otherwise <code>null</code>. If the\nprocess terminated due to receipt of a signal, <code>signal</code> is the string name of\nthe signal, otherwise <code>null</code>. One of the two will always be non-<code>null</code>.</p>\n<p>When the <code>'exit'</code> event is triggered, child process stdio streams might still be\nopen.</p>\n<p>Node.js establishes signal handlers for <code>SIGINT</code> and <code>SIGTERM</code> and Node.js\nprocesses will not terminate immediately due to receipt of those signals.\nRather, Node.js will perform a sequence of cleanup actions and then will\nre-raise the handled signal.</p>\n<p>See <a href=\"http://man7.org/linux/man-pages/man2/waitpid.2.html\"><code>waitpid(2)</code></a>.</p>\n<p>When <code>code</code> is <code>null</code> due to signal termination, you can use\n<a href=\"util.html#utilconvertprocesssignaltoexitcodesignalcode\"><code>util.convertProcessSignalToExitCode()</code></a> to convert the signal to a POSIX\nexit code.</p>"
            },
            {
              "textRaw": "Event: `'message'`",
              "name": "message",
              "type": "event",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`message` {Object} A parsed JSON object or primitive value.",
                  "name": "message",
                  "type": "Object",
                  "desc": "A parsed JSON object or primitive value."
                },
                {
                  "textRaw": "`sendHandle` {Handle|undefined} `undefined` or a `net.Socket`, `net.Server`, or `dgram.Socket` object.",
                  "name": "sendHandle",
                  "type": "Handle|undefined",
                  "desc": "`undefined` or a `net.Socket`, `net.Server`, or `dgram.Socket` object."
                }
              ],
              "desc": "<p>The <code>'message'</code> event is triggered when a child process uses\n<a href=\"process.html#processsendmessage-sendhandle-options-callback\"><code>process.send()</code></a> to send messages.</p>\n<p>The message goes through serialization and parsing. The resulting\nmessage might not be the same as what is originally sent.</p>\n<p>If the <code>serialization</code> option was set to <code>'advanced'</code> used when spawning the\nchild process, the <code>message</code> argument can contain data that JSON is not able\nto represent.\nSee <a href=\"#advanced-serialization\">Advanced serialization</a> for more details.</p>"
            },
            {
              "textRaw": "Event: `'spawn'`",
              "name": "spawn",
              "type": "event",
              "meta": {
                "added": [
                  "v15.1.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'spawn'</code> event is emitted once the child process has spawned successfully.\nIf the child process does not spawn successfully, the <code>'spawn'</code> event is not\nemitted and the <code>'error'</code> event is emitted instead.</p>\n<p>If emitted, the <code>'spawn'</code> event comes before all other events and before any\ndata is received via <code>stdout</code> or <code>stderr</code>.</p>\n<p>The <code>'spawn'</code> event will fire regardless of whether an error occurs <strong>within</strong>\nthe spawned process. For example, if <code>bash some-command</code> spawns successfully,\nthe <code>'spawn'</code> event will fire, though <code>bash</code> may fail to spawn <code>some-command</code>.\nThis caveat also applies when using <code>{ shell: true }</code>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object} A pipe representing the IPC channel to the child process.",
              "name": "channel",
              "type": "Object",
              "meta": {
                "added": [
                  "v7.1.0"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30165",
                    "description": "The object no longer accidentally exposes native C++ bindings."
                  }
                ]
              },
              "desc": "<p>The <code>subprocess.channel</code> property is a reference to the child's IPC channel. If\nno IPC channel exists, this property is <code>undefined</code>.</p>",
              "shortDesc": "A pipe representing the IPC channel to the child process.",
              "methods": [
                {
                  "textRaw": "`subprocess.channel.ref()`",
                  "name": "ref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v7.1.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>This method makes the IPC channel keep the event loop of the parent process\nrunning if <code>.unref()</code> has been called before.</p>"
                },
                {
                  "textRaw": "`subprocess.channel.unref()`",
                  "name": "unref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v7.1.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>This method makes the IPC channel not keep the event loop of the parent process\nrunning, and lets it finish even while the channel is open.</p>"
                }
              ]
            },
            {
              "textRaw": "Type: {boolean} Set to `false` after `subprocess.disconnect()` is called.",
              "name": "connected",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.7.2"
                ],
                "changes": []
              },
              "desc": "<p>The <code>subprocess.connected</code> property indicates whether it is still possible to\nsend and receive messages from a child process. When <code>subprocess.connected</code> is\n<code>false</code>, it is no longer possible to send or receive messages.</p>",
              "shortDesc": "Set to `false` after `subprocess.disconnect()` is called."
            },
            {
              "textRaw": "Type: {integer}",
              "name": "exitCode",
              "type": "integer",
              "desc": "<p>The <code>subprocess.exitCode</code> property indicates the exit code of the child process.\nIf the child process is still running, the field will be <code>null</code>.</p>\n<p>When the child process is terminated by a signal, <code>subprocess.exitCode</code> will be\n<code>null</code> and <a href=\"#subprocesssignalcode\"><code>subprocess.signalCode</code></a> will be set. To get the corresponding\nPOSIX exit code, use\n<a href=\"util.html#utilconvertprocesssignaltoexitcodesignalcode\"><code>util.convertProcessSignalToExitCode(subprocess.signalCode)</code></a>.</p>"
            },
            {
              "textRaw": "Type: {boolean} Set to `true` after `subprocess.kill()` is used to successfully send a signal to the child process.",
              "name": "killed",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.5.10"
                ],
                "changes": []
              },
              "desc": "<p>The <code>subprocess.killed</code> property indicates whether the child process\nsuccessfully received a signal from <code>subprocess.kill()</code>. The <code>killed</code> property\ndoes not indicate that the child process has been terminated.</p>",
              "shortDesc": "Set to `true` after `subprocess.kill()` is used to successfully send a signal to the child process."
            },
            {
              "textRaw": "Type: {integer|undefined}",
              "name": "pid",
              "type": "integer|undefined",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p>Returns the process identifier (PID) of the child process. If the child process\nfails to spawn due to errors, then the value is <code>undefined</code> and <code>error</code> is\nemitted.</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\nconst grep = spawn('grep', ['ssh']);\n\nconsole.log(`Spawned child pid: ${grep.pid}`);\ngrep.stdin.end();\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nconst grep = spawn('grep', ['ssh']);\n\nconsole.log(`Spawned child pid: ${grep.pid}`);\ngrep.stdin.end();\n</code></pre>"
            },
            {
              "textRaw": "Type: {string|null}",
              "name": "signalCode",
              "type": "string|null",
              "desc": "<p>The <code>subprocess.signalCode</code> property indicates the signal received by\nthe child process if any, else <code>null</code>.</p>\n<p>When the child process is terminated by a signal, <a href=\"#subprocessexitcode\"><code>subprocess.exitCode</code></a> will be <code>null</code>.\nTo get the corresponding POSIX exit code, use\n<a href=\"util.html#utilconvertprocesssignaltoexitcodesignalcode\"><code>util.convertProcessSignalToExitCode(subprocess.signalCode)</code></a>.</p>"
            },
            {
              "textRaw": "Type: {Array}",
              "name": "spawnargs",
              "type": "Array",
              "desc": "<p>The <code>subprocess.spawnargs</code> property represents the full list of command-line\narguments the child process was launched with.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "spawnfile",
              "type": "string",
              "desc": "<p>The <code>subprocess.spawnfile</code> property indicates the executable file name of\nthe child process that is launched.</p>\n<p>For <a href=\"#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>, its value will be equal to\n<a href=\"process.html#processexecpath\"><code>process.execPath</code></a>.\nFor <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a>, its value will be the name of\nthe executable file.\nFor <a href=\"#child_processexeccommand-options-callback\"><code>child_process.exec()</code></a>,  its value will be the name of the shell\nin which the child process is launched.</p>"
            },
            {
              "textRaw": "Type: {stream.Readable|null|undefined}",
              "name": "stderr",
              "type": "stream.Readable|null|undefined",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p>A <code>Readable Stream</code> that represents the child process's <code>stderr</code>.</p>\n<p>If the child process was spawned with <code>stdio[2]</code> set to anything other than <code>'pipe'</code>,\nthen this will be <code>null</code>.</p>\n<p><code>subprocess.stderr</code> is an alias for <code>subprocess.stdio[2]</code>. Both properties will\nrefer to the same value.</p>\n<p>The <code>subprocess.stderr</code> property can be <code>null</code> or <code>undefined</code>\nif the child process could not be successfully spawned.</p>"
            },
            {
              "textRaw": "Type: {stream.Writable|null|undefined}",
              "name": "stdin",
              "type": "stream.Writable|null|undefined",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p>A <code>Writable Stream</code> that represents the child process's <code>stdin</code>.</p>\n<p>If a child process waits to read all of its input, the child process will not continue\nuntil this stream has been closed via <code>end()</code>.</p>\n<p>If the child process was spawned with <code>stdio[0]</code> set to anything other than <code>'pipe'</code>,\nthen this will be <code>null</code>.</p>\n<p><code>subprocess.stdin</code> is an alias for <code>subprocess.stdio[0]</code>. Both properties will\nrefer to the same value.</p>\n<p>The <code>subprocess.stdin</code> property can be <code>null</code> or <code>undefined</code>\nif the child process could not be successfully spawned.</p>"
            },
            {
              "textRaw": "Type: {Array}",
              "name": "stdio",
              "type": "Array",
              "meta": {
                "added": [
                  "v0.7.10"
                ],
                "changes": []
              },
              "desc": "<p>A sparse array of pipes to the child process, corresponding with positions in\nthe <a href=\"#optionsstdio\"><code>stdio</code></a> option passed to <a href=\"#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> that have been set\nto the value <code>'pipe'</code>. <code>subprocess.stdio[0]</code>, <code>subprocess.stdio[1]</code>, and\n<code>subprocess.stdio[2]</code> are also available as <code>subprocess.stdin</code>,\n<code>subprocess.stdout</code>, and <code>subprocess.stderr</code>, respectively.</p>\n<p>In the following example, only the child's fd <code>1</code> (stdout) is configured as a\npipe, so only the parent's <code>subprocess.stdio[1]</code> is a stream, all other values\nin the array are <code>null</code>.</p>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst fs = require('node:fs');\nconst child_process = require('node:child_process');\n\nconst subprocess = child_process.spawn('ls', {\n  stdio: [\n    0, // Use parent's stdin for child.\n    'pipe', // Pipe child's stdout to parent.\n    fs.openSync('err.out', 'w'), // Direct child's stderr to a file.\n  ],\n});\n\nassert.strictEqual(subprocess.stdio[0], null);\nassert.strictEqual(subprocess.stdio[0], subprocess.stdin);\n\nassert(subprocess.stdout);\nassert.strictEqual(subprocess.stdio[1], subprocess.stdout);\n\nassert.strictEqual(subprocess.stdio[2], null);\nassert.strictEqual(subprocess.stdio[2], subprocess.stderr);\n</code></pre>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport fs from 'node:fs';\nimport child_process from 'node:child_process';\n\nconst subprocess = child_process.spawn('ls', {\n  stdio: [\n    0, // Use parent's stdin for child.\n    'pipe', // Pipe child's stdout to parent.\n    fs.openSync('err.out', 'w'), // Direct child's stderr to a file.\n  ],\n});\n\nassert.strictEqual(subprocess.stdio[0], null);\nassert.strictEqual(subprocess.stdio[0], subprocess.stdin);\n\nassert(subprocess.stdout);\nassert.strictEqual(subprocess.stdio[1], subprocess.stdout);\n\nassert.strictEqual(subprocess.stdio[2], null);\nassert.strictEqual(subprocess.stdio[2], subprocess.stderr);\n</code></pre>\n<p>The <code>subprocess.stdio</code> property can be <code>undefined</code> if the child process could\nnot be successfully spawned.</p>"
            },
            {
              "textRaw": "Type: {stream.Readable|null|undefined}",
              "name": "stdout",
              "type": "stream.Readable|null|undefined",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p>A <code>Readable Stream</code> that represents the child process's <code>stdout</code>.</p>\n<p>If the child process was spawned with <code>stdio[1]</code> set to anything other than <code>'pipe'</code>,\nthen this will be <code>null</code>.</p>\n<p><code>subprocess.stdout</code> is an alias for <code>subprocess.stdio[1]</code>. Both properties will\nrefer to the same value.</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\n\nconst subprocess = spawn('ls');\n\nsubprocess.stdout.on('data', (data) => {\n  console.log(`Received chunk ${data}`);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\n\nconst subprocess = spawn('ls');\n\nsubprocess.stdout.on('data', (data) => {\n  console.log(`Received chunk ${data}`);\n});\n</code></pre>\n<p>The <code>subprocess.stdout</code> property can be <code>null</code> or <code>undefined</code>\nif the child process could not be successfully spawned.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`subprocess.disconnect()`",
              "name": "disconnect",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.2"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes the IPC channel between parent and child processes, allowing the child\nprocess to exit gracefully once there are no other connections keeping it alive.\nAfter calling this method the <code>subprocess.connected</code> and\n<code>process.connected</code> properties in both the parent and child processes\n(respectively) will be set to <code>false</code>, and it will be no longer possible\nto pass messages between the processes.</p>\n<p>The <code>'disconnect'</code> event will be emitted when there are no messages in the\nprocess of being received. This will most often be triggered immediately after\ncalling <code>subprocess.disconnect()</code>.</p>\n<p>When the child process is a Node.js instance (e.g. spawned using\n<a href=\"#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>), the <code>process.disconnect()</code> method can be invoked\nwithin the child process to close the IPC channel as well.</p>"
            },
            {
              "textRaw": "`subprocess.kill([signal])`",
              "name": "kill",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`signal` {number|string}",
                      "name": "signal",
                      "type": "number|string",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>The <code>subprocess.kill()</code> method sends a signal to the child process. If no\nargument is given, the process will be sent the <code>'SIGTERM'</code> signal. See\n<a href=\"http://man7.org/linux/man-pages/man7/signal.7.html\"><code>signal(7)</code></a> for a list of available signals. This function returns <code>true</code> if\n<a href=\"http://man7.org/linux/man-pages/man2/kill.2.html\"><code>kill(2)</code></a> succeeds, and <code>false</code> otherwise.</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\nconst grep = spawn('grep', ['ssh']);\n\ngrep.on('close', (code, signal) => {\n  console.log(\n    `child process terminated due to receipt of signal ${signal}`);\n});\n\n// Send SIGHUP to process.\ngrep.kill('SIGHUP');\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nconst grep = spawn('grep', ['ssh']);\n\ngrep.on('close', (code, signal) => {\n  console.log(\n    `child process terminated due to receipt of signal ${signal}`);\n});\n\n// Send SIGHUP to process.\ngrep.kill('SIGHUP');\n</code></pre>\n<p>The <a href=\"#class-childprocess\"><code>ChildProcess</code></a> object may emit an <a href=\"#event-error\"><code>'error'</code></a> event if the signal\ncannot be delivered. Sending a signal to a child process that has already exited\nis not an error but may have unforeseen consequences. Specifically, if the\nprocess identifier (PID) has been reassigned to another process, the signal will\nbe delivered to that process instead which can have unexpected results.</p>\n<p>While the function is called <code>kill</code>, the signal delivered to the child process\nmay not actually terminate the process.</p>\n<p>See <a href=\"http://man7.org/linux/man-pages/man2/kill.2.html\"><code>kill(2)</code></a> for reference.</p>\n<p>On Windows, where POSIX signals do not exist, the <code>signal</code> argument will be\nignored except for <code>'SIGKILL'</code>, <code>'SIGTERM'</code>, <code>'SIGINT'</code> and <code>'SIGQUIT'</code>, and the\nprocess will always be killed forcefully and abruptly (similar to <code>'SIGKILL'</code>).\nSee <a href=\"process.html#signal-events\">Signal Events</a> for more details.</p>\n<p>On Linux, child processes of child processes will not be terminated\nwhen attempting to kill their parent. This is likely to happen when running a\nnew process in a shell or with the use of the <code>shell</code> option of <code>ChildProcess</code>:</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\n\nconst subprocess = spawn(\n  'sh',\n  [\n    '-c',\n    `node -e \"setInterval(() => {\n      console.log(process.pid, 'is alive')\n    }, 500);\"`,\n  ], {\n    stdio: ['inherit', 'inherit', 'inherit'],\n  },\n);\n\nsetTimeout(() => {\n  subprocess.kill(); // Does not terminate the Node.js process in the shell.\n}, 2000);\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\n\nconst subprocess = spawn(\n  'sh',\n  [\n    '-c',\n    `node -e \"setInterval(() => {\n      console.log(process.pid, 'is alive')\n    }, 500);\"`,\n  ], {\n    stdio: ['inherit', 'inherit', 'inherit'],\n  },\n);\n\nsetTimeout(() => {\n  subprocess.kill(); // Does not terminate the Node.js process in the shell.\n}, 2000);\n</code></pre>"
            },
            {
              "textRaw": "`subprocess[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v20.5.0",
                  "v18.18.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58467",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <a href=\"#subprocesskillsignal\"><code>subprocess.kill()</code></a> with <code>'SIGTERM'</code>.</p>"
            },
            {
              "textRaw": "`subprocess.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calling <code>subprocess.ref()</code> after making a call to <code>subprocess.unref()</code> will\nrestore the removed reference count for the child process, forcing the parent\nprocess to wait for the child process to exit before exiting itself.</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\n\nconst subprocess = spawn(process.argv[0], ['child_program.js'], {\n  detached: true,\n  stdio: 'ignore',\n});\n\nsubprocess.unref();\nsubprocess.ref();\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nimport process from 'node:process';\n\nconst subprocess = spawn(process.argv[0], ['child_program.js'], {\n  detached: true,\n  stdio: 'ignore',\n});\n\nsubprocess.unref();\nsubprocess.ref();\n</code></pre>"
            },
            {
              "textRaw": "`subprocess.send(message[, sendHandle[, options]][, callback])`",
              "name": "send",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": [
                  {
                    "version": "v5.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5283",
                    "description": "The `options` parameter, and the `keepOpen` option in particular, is supported now."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3516",
                    "description": "This method returns a boolean for flow control now."
                  },
                  {
                    "version": "v4.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2620",
                    "description": "The `callback` parameter is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {Object}",
                      "name": "message",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`sendHandle` {Handle|undefined} `undefined`, or a `net.Socket`, `net.Server`, or `dgram.Socket` object.",
                      "name": "sendHandle",
                      "type": "Handle|undefined",
                      "desc": "`undefined`, or a `net.Socket`, `net.Server`, or `dgram.Socket` object.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:",
                      "name": "options",
                      "type": "Object",
                      "desc": "The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:",
                      "options": [
                        {
                          "textRaw": "`keepOpen` {boolean} A value that can be used when passing instances of `net.Socket`. When `true`, the socket is kept open in the sending process. **Default:** `false`.",
                          "name": "keepOpen",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "A value that can be used when passing instances of `net.Socket`. When `true`, the socket is kept open in the sending process."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>When an IPC channel has been established between the parent and child processes\n( i.e. when using <a href=\"#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>), the <code>subprocess.send()</code> method\ncan be used to send messages to the child process. When the child process is a\nNode.js instance, these messages can be received via the <a href=\"process.html#event-message\"><code>'message'</code></a> event.</p>\n<p>The message goes through serialization and parsing. The resulting\nmessage might not be the same as what is originally sent.</p>\n<p>For example, in the parent script:</p>\n<pre><code class=\"language-cjs\">const { fork } = require('node:child_process');\nconst forkedProcess = fork(`${__dirname}/sub.js`);\n\nforkedProcess.on('message', (message) => {\n  console.log('PARENT got message:', message);\n});\n\n// Causes the child to print: CHILD got message: { hello: 'world' }\nforkedProcess.send({ hello: 'world' });\n</code></pre>\n<pre><code class=\"language-mjs\">import { fork } from 'node:child_process';\nconst forkedProcess = fork(`${import.meta.dirname}/sub.js`);\n\nforkedProcess.on('message', (message) => {\n  console.log('PARENT got message:', message);\n});\n\n// Causes the child to print: CHILD got message: { hello: 'world' }\nforkedProcess.send({ hello: 'world' });\n</code></pre>\n<p>And then the child script, <code>'sub.js'</code> might look like this:</p>\n<pre><code class=\"language-js\">process.on('message', (message) => {\n  console.log('CHILD got message:', message);\n});\n\n// Causes the parent to print: PARENT got message: { foo: 'bar', baz: null }\nprocess.send({ foo: 'bar', baz: NaN });\n</code></pre>\n<p>Child Node.js processes will have a <a href=\"process.html#processsendmessage-sendhandle-options-callback\"><code>process.send()</code></a> method of their own\nthat allows the child process to send messages back to the parent process.</p>\n<p>There is a special case when sending a <code>{cmd: 'NODE_foo'}</code> message. Messages\ncontaining a <code>NODE_</code> prefix in the <code>cmd</code> property are reserved for use within\nNode.js core and will not be emitted in the child's <a href=\"process.html#event-message\"><code>'message'</code></a>\nevent. Rather, such messages are emitted using the\n<code>'internalMessage'</code> event and are consumed internally by Node.js.\nApplications should avoid using such messages or listening for\n<code>'internalMessage'</code> events as it is subject to change without notice.</p>\n<p>The optional <code>sendHandle</code> argument that may be passed to <code>subprocess.send()</code> is\nfor passing a TCP server or socket object to the child process. The child process will\nreceive the object as the second argument passed to the callback function\nregistered on the <a href=\"process.html#event-message\"><code>'message'</code></a> event. Any data that is received\nand buffered in the socket will not be sent to the child. Sending IPC sockets is\nnot supported on Windows.</p>\n<p>The optional <code>callback</code> is a function that is invoked after the message is\nsent but before the child process may have received it. The function is called with a\nsingle argument: <code>null</code> on success, or an <a href=\"errors.html#class-error\"><code>Error</code></a> object on failure.</p>\n<p>If no <code>callback</code> function is provided and the message cannot be sent, an\n<code>'error'</code> event will be emitted by the <a href=\"#class-childprocess\"><code>ChildProcess</code></a> object. This can\nhappen, for instance, when the child process has already exited.</p>\n<p><code>subprocess.send()</code> will return <code>false</code> if the channel has closed or when the\nbacklog of unsent messages exceeds a threshold that makes it unwise to send\nmore. Otherwise, the method returns <code>true</code>. The <code>callback</code> function can be\nused to implement flow control.</p>",
              "modules": [
                {
                  "textRaw": "Example: sending a server object",
                  "name": "example:_sending_a_server_object",
                  "type": "module",
                  "desc": "<p>The <code>sendHandle</code> argument can be used, for instance, to pass the handle of\na TCP server object to the child process as illustrated in the example below:</p>\n<pre><code class=\"language-cjs\">const { fork } = require('node:child_process');\nconst { createServer } = require('node:net');\n\nconst subprocess = fork('subprocess.js');\n\n// Open up the server object and send the handle.\nconst server = createServer();\nserver.on('connection', (socket) => {\n  socket.end('handled by parent');\n});\nserver.listen(1337, () => {\n  subprocess.send('server', server);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { fork } from 'node:child_process';\nimport { createServer } from 'node:net';\n\nconst subprocess = fork('subprocess.js');\n\n// Open up the server object and send the handle.\nconst server = createServer();\nserver.on('connection', (socket) => {\n  socket.end('handled by parent');\n});\nserver.listen(1337, () => {\n  subprocess.send('server', server);\n});\n</code></pre>\n<p>The child process would then receive the server object as:</p>\n<pre><code class=\"language-js\">process.on('message', (m, server) => {\n  if (m === 'server') {\n    server.on('connection', (socket) => {\n      socket.end('handled by child');\n    });\n  }\n});\n</code></pre>\n<p>Once the server is now shared between the parent and child, some connections\ncan be handled by the parent and some by the child.</p>\n<p>While the example above uses a server created using the <code>node:net</code> module,\n<code>node:dgram</code> module servers use exactly the same workflow with the exceptions of\nlistening on a <code>'message'</code> event instead of <code>'connection'</code> and using\n<code>server.bind()</code> instead of <code>server.listen()</code>. This is, however, only\nsupported on Unix platforms.</p>",
                  "displayName": "Example: sending a server object"
                },
                {
                  "textRaw": "Example: sending a socket object",
                  "name": "example:_sending_a_socket_object",
                  "type": "module",
                  "desc": "<p>Similarly, the <code>sendHandler</code> argument can be used to pass the handle of a\nsocket to the child process. The example below spawns two children that each\nhandle connections with \"normal\" or \"special\" priority:</p>\n<pre><code class=\"language-cjs\">const { fork } = require('node:child_process');\nconst { createServer } = require('node:net');\n\nconst normal = fork('subprocess.js', ['normal']);\nconst special = fork('subprocess.js', ['special']);\n\n// Open up the server and send sockets to child. Use pauseOnConnect to prevent\n// the sockets from being read before they are sent to the child process.\nconst server = createServer({ pauseOnConnect: true });\nserver.on('connection', (socket) => {\n\n  // If this is special priority...\n  if (socket.remoteAddress === '74.125.127.100') {\n    special.send('socket', socket);\n    return;\n  }\n  // This is normal priority.\n  normal.send('socket', socket);\n});\nserver.listen(1337);\n</code></pre>\n<pre><code class=\"language-mjs\">import { fork } from 'node:child_process';\nimport { createServer } from 'node:net';\n\nconst normal = fork('subprocess.js', ['normal']);\nconst special = fork('subprocess.js', ['special']);\n\n// Open up the server and send sockets to child. Use pauseOnConnect to prevent\n// the sockets from being read before they are sent to the child process.\nconst server = createServer({ pauseOnConnect: true });\nserver.on('connection', (socket) => {\n\n  // If this is special priority...\n  if (socket.remoteAddress === '74.125.127.100') {\n    special.send('socket', socket);\n    return;\n  }\n  // This is normal priority.\n  normal.send('socket', socket);\n});\nserver.listen(1337);\n</code></pre>\n<p>The <code>subprocess.js</code> would receive the socket handle as the second argument\npassed to the event callback function:</p>\n<pre><code class=\"language-js\">process.on('message', (m, socket) => {\n  if (m === 'socket') {\n    if (socket) {\n      // Check that the client socket exists.\n      // It is possible for the socket to be closed between the time it is\n      // sent and the time it is received in the child process.\n      socket.end(`Request handled with ${process.argv[2]} priority`);\n    }\n  }\n});\n</code></pre>\n<p>Do not use <code>.maxConnections</code> on a socket that has been passed to a subprocess.\nThe parent cannot track when the socket is destroyed.</p>\n<p>Any <code>'message'</code> handlers in the subprocess should verify that <code>socket</code> exists,\nas the connection may have been closed during the time it takes to send the\nconnection to the child.</p>",
                  "displayName": "Example: sending a socket object"
                }
              ]
            },
            {
              "textRaw": "`subprocess.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.10"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>By default, the parent process will wait for the detached child process to exit.\nTo prevent the parent process from waiting for a given <code>subprocess</code> to exit, use the\n<code>subprocess.unref()</code> method. Doing so will cause the parent's event loop to not\ninclude the child process in its reference count, allowing the parent to exit\nindependently of the child, unless there is an established IPC channel between\nthe child and the parent processes.</p>\n<pre><code class=\"language-cjs\">const { spawn } = require('node:child_process');\n\nconst subprocess = spawn(process.argv[0], ['child_program.js'], {\n  detached: true,\n  stdio: 'ignore',\n});\n\nsubprocess.unref();\n</code></pre>\n<pre><code class=\"language-mjs\">import { spawn } from 'node:child_process';\nimport process from 'node:process';\n\nconst subprocess = spawn(process.argv[0], ['child_program.js'], {\n  detached: true,\n  stdio: 'ignore',\n});\n\nsubprocess.unref();\n</code></pre>"
            }
          ]
        }
      ],
      "displayName": "Child process",
      "source": "doc/api/child_process.md"
    },
    {
      "textRaw": "Cluster",
      "name": "cluster",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>Clusters of Node.js processes can be used to run multiple instances of Node.js\nthat can distribute workloads among their application threads. When process\nisolation is not needed, use the <a href=\"worker_threads.html\"><code>worker_threads</code></a> module instead, which\nallows running multiple application threads within a single Node.js instance.</p>\n<p>The cluster module allows easy creation of child processes that all share\nserver ports.</p>\n<pre><code class=\"language-mjs\">import cluster from 'node:cluster';\nimport http from 'node:http';\nimport { availableParallelism } from 'node:os';\nimport process from 'node:process';\n\nconst numCPUs = availableParallelism();\n\nif (cluster.isPrimary) {\n  console.log(`Primary ${process.pid} is running`);\n\n  // Fork workers.\n  for (let i = 0; i &#x3C; numCPUs; i++) {\n    cluster.fork();\n  }\n\n  cluster.on('exit', (worker, code, signal) => {\n    console.log(`worker ${worker.process.pid} died`);\n  });\n} else {\n  // Workers can share any TCP connection\n  // In this case it is an HTTP server\n  http.createServer((req, res) => {\n    res.writeHead(200);\n    res.end('hello world\\n');\n  }).listen(8000);\n\n  console.log(`Worker ${process.pid} started`);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const cluster = require('node:cluster');\nconst http = require('node:http');\nconst numCPUs = require('node:os').availableParallelism();\n\nif (cluster.isPrimary) {\n  console.log(`Primary ${process.pid} is running`);\n\n  // Fork workers.\n  for (let i = 0; i &#x3C; numCPUs; i++) {\n    cluster.fork();\n  }\n\n  cluster.on('exit', (worker, code, signal) => {\n    console.log(`worker ${worker.process.pid} died`);\n  });\n} else {\n  // Workers can share any TCP connection\n  // In this case it is an HTTP server\n  http.createServer((req, res) => {\n    res.writeHead(200);\n    res.end('hello world\\n');\n  }).listen(8000);\n\n  console.log(`Worker ${process.pid} started`);\n}\n</code></pre>\n<p>Running Node.js will now share port 8000 between the workers:</p>\n<pre><code class=\"language-console\">$ node server.js\nPrimary 3596 is running\nWorker 4324 started\nWorker 4520 started\nWorker 6056 started\nWorker 5644 started\n</code></pre>\n<p>On Windows, it is not yet possible to set up a named pipe server in a worker.</p>",
      "miscs": [
        {
          "textRaw": "How it works",
          "name": "How it works",
          "type": "misc",
          "desc": "<p>The worker processes are spawned using the <a href=\"child_process.html#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a> method,\nso that they can communicate with the parent via IPC and pass server\nhandles back and forth.</p>\n<p>The cluster module supports two methods of distributing incoming\nconnections.</p>\n<p>The first one (and the default one on all platforms except Windows)\nis the round-robin approach, where the primary process listens on a\nport, accepts new connections and distributes them across the workers\nin a round-robin fashion, with some built-in smarts to avoid\noverloading a worker process.</p>\n<p>The second approach is where the primary process creates the listen\nsocket and sends it to interested workers. The workers then accept\nincoming connections directly.</p>\n<p>The second approach should, in theory, give the best performance.\nIn practice however, distribution tends to be very unbalanced due\nto operating system scheduler vagaries. Loads have been observed\nwhere over 70% of all connections ended up in just two processes,\nout of a total of eight.</p>\n<p>Because <code>server.listen()</code> hands off most of the work to the primary\nprocess, there are three cases where the behavior between a normal\nNode.js process and a cluster worker differs:</p>\n<ol>\n<li><code>server.listen({fd: 7})</code> Because the message is passed to the primary,\nfile descriptor 7 <strong>in the parent</strong> will be listened on, and the\nhandle passed to the worker, rather than listening to the worker's\nidea of what the number 7 file descriptor references.</li>\n<li><code>server.listen(handle)</code> Listening on handles explicitly will cause\nthe worker to use the supplied handle, rather than talk to the primary\nprocess.</li>\n<li><code>server.listen(0)</code> Normally, this will cause servers to listen on a\nrandom port. However, in a cluster, each worker will receive the\nsame \"random\" port each time they do <code>listen(0)</code>. In essence, the\nport is random the first time, but predictable thereafter. To listen\non a unique port, generate a port number based on the cluster worker ID.</li>\n</ol>\n<p>Node.js does not provide routing logic. It is therefore important to design an\napplication such that it does not rely too heavily on in-memory data objects for\nthings like sessions and login.</p>\n<p>Because workers are all separate processes, they can be killed or\nre-spawned depending on a program's needs, without affecting other\nworkers. As long as there are some workers still alive, the server will\ncontinue to accept connections. If no workers are alive, existing connections\nwill be dropped and new connections will be refused. Node.js does not\nautomatically manage the number of workers, however. It is the application's\nresponsibility to manage the worker pool based on its own needs.</p>\n<p>Although a primary use case for the <code>node:cluster</code> module is networking, it can\nalso be used for other use cases requiring worker processes.</p>"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Worker`",
          "name": "Worker",
          "type": "class",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>A <code>Worker</code> object contains all public information and method about a worker.\nIn the primary it can be obtained using <code>cluster.workers</code>. In a worker\nit can be obtained using <code>cluster.worker</code>.</p>",
          "events": [
            {
              "textRaw": "Event: `'disconnect'`",
              "name": "disconnect",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Similar to the <code>cluster.on('disconnect')</code> event, but specific to this worker.</p>\n<pre><code class=\"language-js\">cluster.fork().on('disconnect', () => {\n  // Worker has disconnected\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'error'`",
              "name": "error",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.3"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>This event is the same as the one provided by <a href=\"child_process.html#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>.</p>\n<p>Within a worker, <code>process.on('error')</code> may also be used.</p>"
            },
            {
              "textRaw": "Event: `'exit'`",
              "name": "exit",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.2"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`code` {number} The exit code, if it exited normally.",
                  "name": "code",
                  "type": "number",
                  "desc": "The exit code, if it exited normally."
                },
                {
                  "textRaw": "`signal` {string} The name of the signal (e.g. `'SIGHUP'`) that caused the process to be killed.",
                  "name": "signal",
                  "type": "string",
                  "desc": "The name of the signal (e.g. `'SIGHUP'`) that caused the process to be killed."
                }
              ],
              "desc": "<p>Similar to the <code>cluster.on('exit')</code> event, but specific to this worker.</p>\n<pre><code class=\"language-mjs\">import cluster from 'node:cluster';\n\nif (cluster.isPrimary) {\n  const worker = cluster.fork();\n  worker.on('exit', (code, signal) => {\n    if (signal) {\n      console.log(`worker was killed by signal: ${signal}`);\n    } else if (code !== 0) {\n      console.log(`worker exited with error code: ${code}`);\n    } else {\n      console.log('worker success!');\n    }\n  });\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const cluster = require('node:cluster');\n\nif (cluster.isPrimary) {\n  const worker = cluster.fork();\n  worker.on('exit', (code, signal) => {\n    if (signal) {\n      console.log(`worker was killed by signal: ${signal}`);\n    } else if (code !== 0) {\n      console.log(`worker exited with error code: ${code}`);\n    } else {\n      console.log('worker success!');\n    }\n  });\n}\n</code></pre>"
            },
            {
              "textRaw": "Event: `'listening'`",
              "name": "listening",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`address` {Object}",
                  "name": "address",
                  "type": "Object"
                }
              ],
              "desc": "<p>Similar to the <code>cluster.on('listening')</code> event, but specific to this worker.</p>\n<pre><code class=\"language-mjs\">cluster.fork().on('listening', (address) => {\n  // Worker is listening\n});\n</code></pre>\n<pre><code class=\"language-cjs\">cluster.fork().on('listening', (address) => {\n  // Worker is listening\n});\n</code></pre>\n<p>It is not emitted in the worker.</p>"
            },
            {
              "textRaw": "Event: `'message'`",
              "name": "message",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`message` {Object}",
                  "name": "message",
                  "type": "Object"
                },
                {
                  "textRaw": "`handle` {undefined|Object}",
                  "name": "handle",
                  "type": "undefined|Object"
                }
              ],
              "desc": "<p>Similar to the <code>'message'</code> event of <code>cluster</code>, but specific to this worker.</p>\n<p>Within a worker, <code>process.on('message')</code> may also be used.</p>\n<p>See <a href=\"process.html#event-message\"><code>process</code> event: <code>'message'</code></a>.</p>\n<p>Here is an example using the message system. It keeps a count in the primary\nprocess of the number of HTTP requests received by the workers:</p>\n<pre><code class=\"language-mjs\">import cluster from 'node:cluster';\nimport http from 'node:http';\nimport { availableParallelism } from 'node:os';\nimport process from 'node:process';\n\nif (cluster.isPrimary) {\n\n  // Keep track of http requests\n  let numReqs = 0;\n  setInterval(() => {\n    console.log(`numReqs = ${numReqs}`);\n  }, 1000);\n\n  // Count requests\n  function messageHandler(msg) {\n    if (msg.cmd &#x26;&#x26; msg.cmd === 'notifyRequest') {\n      numReqs += 1;\n    }\n  }\n\n  // Start workers and listen for messages containing notifyRequest\n  const numCPUs = availableParallelism();\n  for (let i = 0; i &#x3C; numCPUs; i++) {\n    cluster.fork();\n  }\n\n  for (const id in cluster.workers) {\n    cluster.workers[id].on('message', messageHandler);\n  }\n\n} else {\n\n  // Worker processes have a http server.\n  http.Server((req, res) => {\n    res.writeHead(200);\n    res.end('hello world\\n');\n\n    // Notify primary about the request\n    process.send({ cmd: 'notifyRequest' });\n  }).listen(8000);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const cluster = require('node:cluster');\nconst http = require('node:http');\nconst numCPUs = require('node:os').availableParallelism();\n\nif (cluster.isPrimary) {\n\n  // Keep track of http requests\n  let numReqs = 0;\n  setInterval(() => {\n    console.log(`numReqs = ${numReqs}`);\n  }, 1000);\n\n  // Count requests\n  function messageHandler(msg) {\n    if (msg.cmd &#x26;&#x26; msg.cmd === 'notifyRequest') {\n      numReqs += 1;\n    }\n  }\n\n  // Start workers and listen for messages containing notifyRequest\n  for (let i = 0; i &#x3C; numCPUs; i++) {\n    cluster.fork();\n  }\n\n  for (const id in cluster.workers) {\n    cluster.workers[id].on('message', messageHandler);\n  }\n\n} else {\n\n  // Worker processes have a http server.\n  http.Server((req, res) => {\n    res.writeHead(200);\n    res.end('hello world\\n');\n\n    // Notify primary about the request\n    process.send({ cmd: 'notifyRequest' });\n  }).listen(8000);\n}\n</code></pre>"
            },
            {
              "textRaw": "Event: `'online'`",
              "name": "online",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Similar to the <code>cluster.on('online')</code> event, but specific to this worker.</p>\n<pre><code class=\"language-js\">cluster.fork().on('online', () => {\n  // Worker is online\n});\n</code></pre>\n<p>It is not emitted in the worker.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`worker.disconnect()`",
              "name": "disconnect",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v7.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10019",
                    "description": "This method now returns a reference to `worker`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {cluster.Worker} A reference to `worker`.",
                    "name": "return",
                    "type": "cluster.Worker",
                    "desc": "A reference to `worker`."
                  }
                }
              ],
              "desc": "<p>In a worker, this function will close all servers, wait for the <code>'close'</code> event\non those servers, and then disconnect the IPC channel.</p>\n<p>In the primary, an internal message is sent to the worker causing it to call\n<code>.disconnect()</code> on itself.</p>\n<p>Causes <code>.exitedAfterDisconnect</code> to be set.</p>\n<p>After a server is closed, it will no longer accept new connections,\nbut connections may be accepted by any other listening worker. Existing\nconnections will be allowed to close as usual. When no more connections exist,\nsee <a href=\"net.html#event-close\"><code>server.close()</code></a>, the IPC channel to the worker will close allowing it\nto die gracefully.</p>\n<p>The above applies <em>only</em> to server connections, client connections are not\nautomatically closed by workers, and disconnect does not wait for them to close\nbefore exiting.</p>\n<p>In a worker, <code>process.disconnect</code> exists, but it is not this function;\nit is <a href=\"child_process.html#subprocessdisconnect\"><code>disconnect()</code></a>.</p>\n<p>Because long living server connections may block workers from disconnecting, it\nmay be useful to send a message, so application specific actions may be taken to\nclose them. It also may be useful to implement a timeout, killing a worker if\nthe <code>'disconnect'</code> event has not been emitted after some time.</p>\n<pre><code class=\"language-js\">if (cluster.isPrimary) {\n  const worker = cluster.fork();\n  let timeout;\n\n  worker.on('listening', (address) => {\n    worker.send('shutdown');\n    worker.disconnect();\n    timeout = setTimeout(() => {\n      worker.kill();\n    }, 2000);\n  });\n\n  worker.on('disconnect', () => {\n    clearTimeout(timeout);\n  });\n\n} else if (cluster.isWorker) {\n  const net = require('node:net');\n  const server = net.createServer((socket) => {\n    // Connections never end\n  });\n\n  server.listen(8000);\n\n  process.on('message', (msg) => {\n    if (msg === 'shutdown') {\n      // Initiate graceful close of any connections to server\n    }\n  });\n}\n</code></pre>"
            },
            {
              "textRaw": "`worker.isConnected()`",
              "name": "isConnected",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This function returns <code>true</code> if the worker is connected to its primary via its\nIPC channel, <code>false</code> otherwise. A worker is connected to its primary after it\nhas been created. It is disconnected after the <code>'disconnect'</code> event is emitted.</p>"
            },
            {
              "textRaw": "`worker.isDead()`",
              "name": "isDead",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This function returns <code>true</code> if the worker's process has terminated (either\nbecause of exiting or being signaled). Otherwise, it returns <code>false</code>.</p>\n<pre><code class=\"language-mjs\">import cluster from 'node:cluster';\nimport http from 'node:http';\nimport { availableParallelism } from 'node:os';\nimport process from 'node:process';\n\nconst numCPUs = availableParallelism();\n\nif (cluster.isPrimary) {\n  console.log(`Primary ${process.pid} is running`);\n\n  // Fork workers.\n  for (let i = 0; i &#x3C; numCPUs; i++) {\n    cluster.fork();\n  }\n\n  cluster.on('fork', (worker) => {\n    console.log('worker is dead:', worker.isDead());\n  });\n\n  cluster.on('exit', (worker, code, signal) => {\n    console.log('worker is dead:', worker.isDead());\n  });\n} else {\n  // Workers can share any TCP connection. In this case, it is an HTTP server.\n  http.createServer((req, res) => {\n    res.writeHead(200);\n    res.end(`Current process\\n ${process.pid}`);\n    process.kill(process.pid);\n  }).listen(8000);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const cluster = require('node:cluster');\nconst http = require('node:http');\nconst numCPUs = require('node:os').availableParallelism();\n\nif (cluster.isPrimary) {\n  console.log(`Primary ${process.pid} is running`);\n\n  // Fork workers.\n  for (let i = 0; i &#x3C; numCPUs; i++) {\n    cluster.fork();\n  }\n\n  cluster.on('fork', (worker) => {\n    console.log('worker is dead:', worker.isDead());\n  });\n\n  cluster.on('exit', (worker, code, signal) => {\n    console.log('worker is dead:', worker.isDead());\n  });\n} else {\n  // Workers can share any TCP connection. In this case, it is an HTTP server.\n  http.createServer((req, res) => {\n    res.writeHead(200);\n    res.end(`Current process\\n ${process.pid}`);\n    process.kill(process.pid);\n  }).listen(8000);\n}\n</code></pre>"
            },
            {
              "textRaw": "`worker.kill([signal])`",
              "name": "kill",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`signal` {string} Name of the kill signal to send to the worker process. **Default:** `'SIGTERM'`",
                      "name": "signal",
                      "type": "string",
                      "default": "`'SIGTERM'`",
                      "desc": "Name of the kill signal to send to the worker process.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function will kill the worker. In the primary worker, it does this by\ndisconnecting the <code>worker.process</code>, and once disconnected, killing with\n<code>signal</code>. In the worker, it does it by killing the process with <code>signal</code>.</p>\n<p>The <code>kill()</code> function kills the worker process without waiting for a graceful\ndisconnect, it has the same behavior as <code>worker.process.kill()</code>.</p>\n<p>This method is aliased as <code>worker.destroy()</code> for backwards compatibility.</p>\n<p>In a worker, <code>process.kill()</code> exists, but it is not this function;\nit is <a href=\"process.html#processkillpid-signal\"><code>kill()</code></a>.</p>"
            },
            {
              "textRaw": "`worker.send(message[, sendHandle[, options]][, callback])`",
              "name": "send",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": [
                  {
                    "version": "v4.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2620",
                    "description": "The `callback` parameter is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {Object}",
                      "name": "message",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`sendHandle` {Handle}",
                      "name": "sendHandle",
                      "type": "Handle",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:",
                      "name": "options",
                      "type": "Object",
                      "desc": "The `options` argument, if present, is an object used to parameterize the sending of certain types of handles. `options` supports the following properties:",
                      "options": [
                        {
                          "textRaw": "`keepOpen` {boolean} A value that can be used when passing instances of `net.Socket`. When `true`, the socket is kept open in the sending process. **Default:** `false`.",
                          "name": "keepOpen",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "A value that can be used when passing instances of `net.Socket`. When `true`, the socket is kept open in the sending process."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Send a message to a worker or primary, optionally with a handle.</p>\n<p>In the primary, this sends a message to a specific worker. It is identical to\n<a href=\"child_process.html#subprocesssendmessage-sendhandle-options-callback\"><code>ChildProcess.send()</code></a>.</p>\n<p>In a worker, this sends a message to the primary. It is identical to\n<code>process.send()</code>.</p>\n<p>This example will echo back all messages from the primary:</p>\n<pre><code class=\"language-js\">if (cluster.isPrimary) {\n  const worker = cluster.fork();\n  worker.send('hi there');\n\n} else if (cluster.isWorker) {\n  process.on('message', (msg) => {\n    process.send(msg);\n  });\n}\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean}",
              "name": "exitedAfterDisconnect",
              "type": "boolean",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "desc": "<p>This property is <code>true</code> if the worker exited due to <code>.disconnect()</code>.\nIf the worker exited any other way, it is <code>false</code>. If the\nworker has not exited, it is <code>undefined</code>.</p>\n<p>The boolean <a href=\"#workerexitedafterdisconnect\"><code>worker.exitedAfterDisconnect</code></a> allows distinguishing between\nvoluntary and accidental exit, the primary may choose not to respawn a worker\nbased on this value.</p>\n<pre><code class=\"language-js\">cluster.on('exit', (worker, code, signal) => {\n  if (worker.exitedAfterDisconnect === true) {\n    console.log('Oh, it was just voluntary – no need to worry');\n  }\n});\n\n// kill worker\nworker.kill();\n</code></pre>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "id",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.8.0"
                ],
                "changes": []
              },
              "desc": "<p>Each new worker is given its own unique id, this id is stored in the\n<code>id</code>.</p>\n<p>While a worker is alive, this is the key that indexes it in\n<code>cluster.workers</code>.</p>"
            },
            {
              "textRaw": "Type: {ChildProcess}",
              "name": "process",
              "type": "ChildProcess",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "desc": "<p>All workers are created using <a href=\"child_process.html#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>, the returned object\nfrom this function is stored as <code>.process</code>. In a worker, the global <code>process</code>\nis stored.</p>\n<p>See: <a href=\"child_process.html#child_processforkmodulepath-args-options\">Child Process module</a>.</p>\n<p>Workers will call <code>process.exit(0)</code> if the <code>'disconnect'</code> event occurs\non <code>process</code> and <code>.exitedAfterDisconnect</code> is not <code>true</code>. This protects against\naccidental disconnection.</p>"
            }
          ]
        }
      ],
      "events": [
        {
          "textRaw": "Event: `'disconnect'`",
          "name": "disconnect",
          "type": "event",
          "meta": {
            "added": [
              "v0.7.9"
            ],
            "changes": []
          },
          "params": [
            {
              "textRaw": "`worker` {cluster.Worker}",
              "name": "worker",
              "type": "cluster.Worker"
            }
          ],
          "desc": "<p>Emitted after the worker IPC channel has disconnected. This can occur when a\nworker exits gracefully, is killed, or is disconnected manually (such as with\n<code>worker.disconnect()</code>).</p>\n<p>There may be a delay between the <code>'disconnect'</code> and <code>'exit'</code> events. These\nevents can be used to detect if the process is stuck in a cleanup or if there\nare long-living connections.</p>\n<pre><code class=\"language-js\">cluster.on('disconnect', (worker) => {\n  console.log(`The worker #${worker.id} has disconnected`);\n});\n</code></pre>"
        },
        {
          "textRaw": "Event: `'exit'`",
          "name": "exit",
          "type": "event",
          "meta": {
            "added": [
              "v0.7.9"
            ],
            "changes": []
          },
          "params": [
            {
              "textRaw": "`worker` {cluster.Worker}",
              "name": "worker",
              "type": "cluster.Worker"
            },
            {
              "textRaw": "`code` {number} The exit code, if it exited normally.",
              "name": "code",
              "type": "number",
              "desc": "The exit code, if it exited normally."
            },
            {
              "textRaw": "`signal` {string} The name of the signal (e.g. `'SIGHUP'`) that caused the process to be killed.",
              "name": "signal",
              "type": "string",
              "desc": "The name of the signal (e.g. `'SIGHUP'`) that caused the process to be killed."
            }
          ],
          "desc": "<p>When any of the workers die the cluster module will emit the <code>'exit'</code> event.</p>\n<p>This can be used to restart the worker by calling <a href=\"#clusterforkenv\"><code>.fork()</code></a> again.</p>\n<pre><code class=\"language-js\">cluster.on('exit', (worker, code, signal) => {\n  console.log('worker %d died (%s). restarting...',\n              worker.process.pid, signal || code);\n  cluster.fork();\n});\n</code></pre>\n<p>See <a href=\"child_process.html#event-exit\"><code>child_process</code> event: <code>'exit'</code></a>.</p>"
        },
        {
          "textRaw": "Event: `'fork'`",
          "name": "fork",
          "type": "event",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "params": [
            {
              "textRaw": "`worker` {cluster.Worker}",
              "name": "worker",
              "type": "cluster.Worker"
            }
          ],
          "desc": "<p>When a new worker is forked the cluster module will emit a <code>'fork'</code> event.\nThis can be used to log worker activity, and create a custom timeout.</p>\n<pre><code class=\"language-js\">const timeouts = [];\nfunction errorMsg() {\n  console.error('Something must be wrong with the connection ...');\n}\n\ncluster.on('fork', (worker) => {\n  timeouts[worker.id] = setTimeout(errorMsg, 2000);\n});\ncluster.on('listening', (worker, address) => {\n  clearTimeout(timeouts[worker.id]);\n});\ncluster.on('exit', (worker, code, signal) => {\n  clearTimeout(timeouts[worker.id]);\n  errorMsg();\n});\n</code></pre>"
        },
        {
          "textRaw": "Event: `'listening'`",
          "name": "listening",
          "type": "event",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "params": [
            {
              "textRaw": "`worker` {cluster.Worker}",
              "name": "worker",
              "type": "cluster.Worker"
            },
            {
              "textRaw": "`address` {Object}",
              "name": "address",
              "type": "Object"
            }
          ],
          "desc": "<p>After calling <code>listen()</code> from a worker, when the <code>'listening'</code> event is emitted\non the server, a <code>'listening'</code> event will also be emitted on <code>cluster</code> in the\nprimary.</p>\n<p>The event handler is executed with two arguments, the <code>worker</code> contains the\nworker object and the <code>address</code> object contains the following connection\nproperties: <code>address</code>, <code>port</code>, and <code>addressType</code>. This is very useful if the\nworker is listening on more than one address.</p>\n<pre><code class=\"language-js\">cluster.on('listening', (worker, address) => {\n  console.log(\n    `A worker is now connected to ${address.address}:${address.port}`);\n});\n</code></pre>\n<p>The <code>addressType</code> is one of:</p>\n<ul>\n<li><code>4</code> (TCPv4)</li>\n<li><code>6</code> (TCPv6)</li>\n<li><code>-1</code> (Unix domain socket)</li>\n<li><code>'udp4'</code> or <code>'udp6'</code> (UDPv4 or UDPv6)</li>\n</ul>"
        },
        {
          "textRaw": "Event: `'message'`",
          "name": "message",
          "type": "event",
          "meta": {
            "added": [
              "v2.5.0"
            ],
            "changes": [
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/5361",
                "description": "The `worker` parameter is passed now; see below for details."
              }
            ]
          },
          "params": [
            {
              "textRaw": "`worker` {cluster.Worker}",
              "name": "worker",
              "type": "cluster.Worker"
            },
            {
              "textRaw": "`message` {Object}",
              "name": "message",
              "type": "Object"
            },
            {
              "textRaw": "`handle` {undefined|Object}",
              "name": "handle",
              "type": "undefined|Object"
            }
          ],
          "desc": "<p>Emitted when the cluster primary receives a message from any worker.</p>\n<p>See <a href=\"child_process.html#event-message\"><code>child_process</code> event: <code>'message'</code></a>.</p>"
        },
        {
          "textRaw": "Event: `'online'`",
          "name": "online",
          "type": "event",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "params": [
            {
              "textRaw": "`worker` {cluster.Worker}",
              "name": "worker",
              "type": "cluster.Worker"
            }
          ],
          "desc": "<p>After forking a new worker, the worker should respond with an online message.\nWhen the primary receives an online message it will emit this event.\nThe difference between <code>'fork'</code> and <code>'online'</code> is that fork is emitted when the\nprimary forks a worker, and <code>'online'</code> is emitted when the worker is running.</p>\n<pre><code class=\"language-js\">cluster.on('online', (worker) => {\n  console.log('Yay, the worker responded after it was forked');\n});\n</code></pre>"
        },
        {
          "textRaw": "Event: `'setup'`",
          "name": "setup",
          "type": "event",
          "meta": {
            "added": [
              "v0.7.1"
            ],
            "changes": []
          },
          "params": [
            {
              "textRaw": "`settings` {Object}",
              "name": "settings",
              "type": "Object"
            }
          ],
          "desc": "<p>Emitted every time <a href=\"#clustersetupprimarysettings\"><code>.setupPrimary()</code></a> is called.</p>\n<p>The <code>settings</code> object is the <code>cluster.settings</code> object at the time\n<a href=\"#clustersetupprimarysettings\"><code>.setupPrimary()</code></a> was called and is advisory only, since multiple calls to\n<a href=\"#clustersetupprimarysettings\"><code>.setupPrimary()</code></a> can be made in a single tick.</p>\n<p>If accuracy is important, use <code>cluster.settings</code>.</p>"
        }
      ],
      "methods": [
        {
          "textRaw": "`cluster.disconnect([callback])`",
          "name": "disconnect",
          "type": "method",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`callback` {Function} Called when all workers are disconnected and handles are closed.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "Called when all workers are disconnected and handles are closed.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Calls <code>.disconnect()</code> on each worker in <code>cluster.workers</code>.</p>\n<p>When they are disconnected all internal handles will be closed, allowing the\nprimary process to die gracefully if no other event is waiting.</p>\n<p>The method takes an optional callback argument which will be called when\nfinished.</p>\n<p>This can only be called from the primary process.</p>"
        },
        {
          "textRaw": "`cluster.fork([env])`",
          "name": "fork",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`env` {Object} Key/value pairs to add to worker process environment.",
                  "name": "env",
                  "type": "Object",
                  "desc": "Key/value pairs to add to worker process environment.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {cluster.Worker}",
                "name": "return",
                "type": "cluster.Worker"
              }
            }
          ],
          "desc": "<p>Spawn a new worker process.</p>\n<p>This can only be called from the primary process.</p>"
        },
        {
          "textRaw": "`cluster.setupMaster([settings])`",
          "name": "setupMaster",
          "type": "method",
          "meta": {
            "added": [
              "v0.7.1"
            ],
            "changes": [
              {
                "version": "v6.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/7838",
                "description": "The `stdio` option is supported now."
              }
            ],
            "deprecated": [
              "v16.0.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated",
          "signatures": [
            {
              "params": [
                {
                  "name": "settings",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Deprecated alias for <a href=\"#clustersetupprimarysettings\"><code>.setupPrimary()</code></a>.</p>"
        },
        {
          "textRaw": "`cluster.setupPrimary([settings])`",
          "name": "setupPrimary",
          "type": "method",
          "meta": {
            "added": [
              "v16.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`settings` {Object} See `cluster.settings`.",
                  "name": "settings",
                  "type": "Object",
                  "desc": "See `cluster.settings`.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><code>setupPrimary</code> is used to change the default 'fork' behavior. Once called,\nthe settings will be present in <code>cluster.settings</code>.</p>\n<p>Any settings changes only affect future calls to <a href=\"#clusterforkenv\"><code>.fork()</code></a> and have no\neffect on workers that are already running.</p>\n<p>The only attribute of a worker that cannot be set via <code>.setupPrimary()</code> is\nthe <code>env</code> passed to <a href=\"#clusterforkenv\"><code>.fork()</code></a>.</p>\n<p>The defaults above apply to the first call only; the defaults for later\ncalls are the current values at the time of <code>cluster.setupPrimary()</code> is called.</p>\n<pre><code class=\"language-mjs\">import cluster from 'node:cluster';\n\ncluster.setupPrimary({\n  exec: 'worker.js',\n  args: ['--use', 'https'],\n  silent: true,\n});\ncluster.fork(); // https worker\ncluster.setupPrimary({\n  exec: 'worker.js',\n  args: ['--use', 'http'],\n});\ncluster.fork(); // http worker\n</code></pre>\n<pre><code class=\"language-cjs\">const cluster = require('node:cluster');\n\ncluster.setupPrimary({\n  exec: 'worker.js',\n  args: ['--use', 'https'],\n  silent: true,\n});\ncluster.fork(); // https worker\ncluster.setupPrimary({\n  exec: 'worker.js',\n  args: ['--use', 'http'],\n});\ncluster.fork(); // http worker\n</code></pre>\n<p>This can only be called from the primary process.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "`cluster.isMaster`",
          "name": "isMaster",
          "type": "property",
          "meta": {
            "added": [
              "v0.8.1"
            ],
            "changes": [],
            "deprecated": [
              "v16.0.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated",
          "desc": "<p>Deprecated alias for <a href=\"#clusterisprimary\"><code>cluster.isPrimary</code></a>.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "isPrimary",
          "type": "boolean",
          "meta": {
            "added": [
              "v16.0.0"
            ],
            "changes": []
          },
          "desc": "<p>True if the process is a primary. This is determined\nby the <code>process.env.NODE_UNIQUE_ID</code>. If <code>process.env.NODE_UNIQUE_ID</code> is\nundefined, then <code>isPrimary</code> is <code>true</code>.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "isWorker",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": []
          },
          "desc": "<p>True if the process is not a primary (it is the negation of <code>cluster.isPrimary</code>).</p>"
        },
        {
          "textRaw": "`cluster.schedulingPolicy`",
          "name": "schedulingPolicy",
          "type": "property",
          "meta": {
            "added": [
              "v0.11.2"
            ],
            "changes": []
          },
          "desc": "<p>The scheduling policy, either <code>cluster.SCHED_RR</code> for round-robin or\n<code>cluster.SCHED_NONE</code> to leave it to the operating system. This is a\nglobal setting and effectively frozen once either the first worker is spawned,\nor <a href=\"#clustersetupprimarysettings\"><code>.setupPrimary()</code></a> is called, whichever comes first.</p>\n<p><code>SCHED_RR</code> is the default on all operating systems except Windows.\nWindows will change to <code>SCHED_RR</code> once libuv is able to effectively\ndistribute IOCP handles without incurring a large performance hit.</p>\n<p><code>cluster.schedulingPolicy</code> can also be set through the\n<code>NODE_CLUSTER_SCHED_POLICY</code> environment variable. Valid\nvalues are <code>'rr'</code> and <code>'none'</code>.</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "settings",
          "type": "Object",
          "meta": {
            "added": [
              "v0.7.1"
            ],
            "changes": [
              {
                "version": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/30162",
                "description": "The `serialization` option is supported now."
              },
              {
                "version": "v9.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/18399",
                "description": "The `cwd` option is supported now."
              },
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/17412",
                "description": "The `windowsHide` option is supported now."
              },
              {
                "version": "v8.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/14140",
                "description": "The `inspectPort` option is supported now."
              },
              {
                "version": "v6.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/7838",
                "description": "The `stdio` option is supported now."
              }
            ]
          },
          "desc": "<p>After calling <a href=\"#clustersetupprimarysettings\"><code>.setupPrimary()</code></a> (or <a href=\"#clusterforkenv\"><code>.fork()</code></a>) this settings object will\ncontain the settings, including the default values.</p>\n<p>This object is not intended to be changed or set manually.</p>",
          "options": [
            {
              "textRaw": "`execArgv` {string[]} List of string arguments passed to the Node.js executable. **Default:** `process.execArgv`.",
              "name": "execArgv",
              "type": "string[]",
              "default": "`process.execArgv`",
              "desc": "List of string arguments passed to the Node.js executable."
            },
            {
              "textRaw": "`exec` {string} File path to worker file. **Default:** `process.argv[1]`.",
              "name": "exec",
              "type": "string",
              "default": "`process.argv[1]`",
              "desc": "File path to worker file."
            },
            {
              "textRaw": "`args` {string[]} String arguments passed to worker. **Default:** `process.argv.slice(2)`.",
              "name": "args",
              "type": "string[]",
              "default": "`process.argv.slice(2)`",
              "desc": "String arguments passed to worker."
            },
            {
              "textRaw": "`cwd` {string} Current working directory of the worker process. **Default:** `undefined` (inherits from parent process).",
              "name": "cwd",
              "type": "string",
              "default": "`undefined` (inherits from parent process)",
              "desc": "Current working directory of the worker process."
            },
            {
              "textRaw": "`serialization` {string} Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. See Advanced serialization for `child_process` for more details. **Default:** `false`.",
              "name": "serialization",
              "type": "string",
              "default": "`false`",
              "desc": "Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`. See Advanced serialization for `child_process` for more details."
            },
            {
              "textRaw": "`silent` {boolean} Whether or not to send output to parent's stdio. **Default:** `false`.",
              "name": "silent",
              "type": "boolean",
              "default": "`false`",
              "desc": "Whether or not to send output to parent's stdio."
            },
            {
              "textRaw": "`stdio` {Array} Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See `child_process.spawn()`'s `stdio`.",
              "name": "stdio",
              "type": "Array",
              "desc": "Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See `child_process.spawn()`'s `stdio`."
            },
            {
              "textRaw": "`uid` {number} Sets the user identity of the process. (See `setuid(2)`.)",
              "name": "uid",
              "type": "number",
              "desc": "Sets the user identity of the process. (See `setuid(2)`.)"
            },
            {
              "textRaw": "`gid` {number} Sets the group identity of the process. (See `setgid(2)`.)",
              "name": "gid",
              "type": "number",
              "desc": "Sets the group identity of the process. (See `setgid(2)`.)"
            },
            {
              "textRaw": "`inspectPort` {number|Function} Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. By default each worker gets its own port, incremented from the primary's `process.debugPort`.",
              "name": "inspectPort",
              "type": "number|Function",
              "desc": "Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number. By default each worker gets its own port, incremented from the primary's `process.debugPort`."
            },
            {
              "textRaw": "`windowsHide` {boolean} Hide the forked processes console window that would normally be created on Windows systems. **Default:** `false`.",
              "name": "windowsHide",
              "type": "boolean",
              "default": "`false`",
              "desc": "Hide the forked processes console window that would normally be created on Windows systems."
            }
          ]
        },
        {
          "textRaw": "Type: {Object}",
          "name": "worker",
          "type": "Object",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "desc": "<p>A reference to the current worker object. Not available in the primary process.</p>\n<pre><code class=\"language-mjs\">import cluster from 'node:cluster';\n\nif (cluster.isPrimary) {\n  console.log('I am primary');\n  cluster.fork();\n  cluster.fork();\n} else if (cluster.isWorker) {\n  console.log(`I am worker #${cluster.worker.id}`);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const cluster = require('node:cluster');\n\nif (cluster.isPrimary) {\n  console.log('I am primary');\n  cluster.fork();\n  cluster.fork();\n} else if (cluster.isWorker) {\n  console.log(`I am worker #${cluster.worker.id}`);\n}\n</code></pre>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "workers",
          "type": "Object",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "desc": "<p>A hash that stores the active worker objects, keyed by <code>id</code> field. This makes it\neasy to loop through all the workers. It is only available in the primary\nprocess.</p>\n<p>A worker is removed from <code>cluster.workers</code> after the worker has disconnected\n<em>and</em> exited. The order between these two events cannot be determined in\nadvance. However, it is guaranteed that the removal from the <code>cluster.workers</code>\nlist happens before the last <code>'disconnect'</code> or <code>'exit'</code> event is emitted.</p>\n<pre><code class=\"language-mjs\">import cluster from 'node:cluster';\n\nfor (const worker of Object.values(cluster.workers)) {\n  worker.send('big announcement to all workers');\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const cluster = require('node:cluster');\n\nfor (const worker of Object.values(cluster.workers)) {\n  worker.send('big announcement to all workers');\n}\n</code></pre>"
        }
      ],
      "displayName": "Cluster",
      "source": "doc/api/cluster.md"
    },
    {
      "textRaw": "Console",
      "name": "console",
      "introduced_in": "v0.10.13",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:console</code> module provides a simple debugging console that is similar to\nthe JavaScript console mechanism provided by web browsers.</p>\n<p>The module exports two specific components:</p>\n<ul>\n<li>A <code>Console</code> class with methods such as <code>console.log()</code>, <code>console.error()</code>, and\n<code>console.warn()</code> that can be used to write to any Node.js stream.</li>\n<li>A global <code>console</code> instance configured to write to <a href=\"process.html#processstdout\"><code>process.stdout</code></a> and\n<a href=\"process.html#processstderr\"><code>process.stderr</code></a>. The global <code>console</code> can be used without calling\n<code>require('node:console')</code>.</li>\n</ul>\n<p><em><strong>Warning</strong></em>: The global console object's methods are neither consistently\nsynchronous like the browser APIs they resemble, nor are they consistently\nasynchronous like all other Node.js streams. Programs that desire to depend\non the synchronous / asynchronous behavior of the console functions should\nfirst figure out the nature of console's backing stream. This is because the\nstream is dependent on the underlying platform and standard stream\nconfiguration of the current process. See the <a href=\"process.html#a-note-on-process-io\">note on process I/O</a> for\nmore information.</p>\n<p>Example using the global <code>console</code>:</p>\n<pre><code class=\"language-js\">console.log('hello world');\n// Prints: hello world, to stdout\nconsole.log('hello %s', 'world');\n// Prints: hello world, to stdout\nconsole.error(new Error('Whoops, something bad happened'));\n// Prints error message and stack trace to stderr:\n//   Error: Whoops, something bad happened\n//     at [eval]:5:15\n//     at Script.runInThisContext (node:vm:132:18)\n//     at Object.runInThisContext (node:vm:309:38)\n//     at node:internal/process/execution:77:19\n//     at [eval]-wrapper:6:22\n//     at evalScript (node:internal/process/execution:76:60)\n//     at node:internal/main/eval_string:23:3\n\nconst name = 'Will Robinson';\nconsole.warn(`Danger ${name}! Danger!`);\n// Prints: Danger Will Robinson! Danger!, to stderr\n</code></pre>\n<p>Example using the <code>Console</code> class:</p>\n<pre><code class=\"language-js\">const out = getStreamSomehow();\nconst err = getStreamSomehow();\nconst myConsole = new console.Console(out, err);\n\nmyConsole.log('hello world');\n// Prints: hello world, to out\nmyConsole.log('hello %s', 'world');\n// Prints: hello world, to out\nmyConsole.error(new Error('Whoops, something bad happened'));\n// Prints: [Error: Whoops, something bad happened], to err\n\nconst name = 'Will Robinson';\nmyConsole.warn(`Danger ${name}! Danger!`);\n// Prints: Danger Will Robinson! Danger!, to err\n</code></pre>",
      "classes": [
        {
          "textRaw": "Class: `Console`",
          "name": "Console",
          "type": "class",
          "meta": {
            "changes": [
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/9744",
                "description": "Errors that occur while writing to the underlying streams will now be ignored by default."
              }
            ]
          },
          "desc": "<p>The <code>Console</code> class can be used to create a simple logger with configurable\noutput streams and can be accessed using either <code>require('node:console').Console</code>\nor <code>console.Console</code> (or their destructured counterparts):</p>\n<pre><code class=\"language-mjs\">import { Console } from 'node:console';\n</code></pre>\n<pre><code class=\"language-cjs\">const { Console } = require('node:console');\n</code></pre>\n<pre><code class=\"language-js\">const { Console } = console;\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new Console(stdout[, stderr][, ignoreErrors])`",
              "name": "Console",
              "type": "ctor",
              "params": [
                {
                  "name": "stdout"
                },
                {
                  "name": "stderr",
                  "optional": true
                },
                {
                  "name": "ignoreErrors",
                  "optional": true
                }
              ]
            },
            {
              "textRaw": "`new Console(options)`",
              "name": "Console",
              "type": "ctor",
              "meta": {
                "changes": [
                  {
                    "version": "v24.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60082",
                    "description": "The `inspectOptions` option can be a `Map` from stream to options."
                  },
                  {
                    "version": [
                      "v14.2.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32964",
                    "description": "The `groupIndentation` option was introduced."
                  },
                  {
                    "version": "v11.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24978",
                    "description": "The `inspectOptions` option is introduced."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19372",
                    "description": "The `Console` constructor now supports an `options` argument, and the `colorMode` option was introduced."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9744",
                    "description": "The `ignoreErrors` option was introduced."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`stdout` {stream.Writable}",
                      "name": "stdout",
                      "type": "stream.Writable"
                    },
                    {
                      "textRaw": "`stderr` {stream.Writable}",
                      "name": "stderr",
                      "type": "stream.Writable"
                    },
                    {
                      "textRaw": "`ignoreErrors` {boolean} Ignore errors when writing to the underlying streams. **Default:** `true`.",
                      "name": "ignoreErrors",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "Ignore errors when writing to the underlying streams."
                    },
                    {
                      "textRaw": "`colorMode` {boolean|string} Set color support for this `Console` instance. Setting to `true` enables coloring while inspecting values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the respective stream. This option can not be used, if `inspectOptions.colors` is set as well. **Default:** `'auto'`.",
                      "name": "colorMode",
                      "type": "boolean|string",
                      "default": "`'auto'`",
                      "desc": "Set color support for this `Console` instance. Setting to `true` enables coloring while inspecting values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the respective stream. This option can not be used, if `inspectOptions.colors` is set as well."
                    },
                    {
                      "textRaw": "`inspectOptions` {Object|Map} Specifies options that are passed along to `util.inspect()`. Can be an options object or, if different options for stdout and stderr are desired, a `Map` from stream objects to options.",
                      "name": "inspectOptions",
                      "type": "Object|Map",
                      "desc": "Specifies options that are passed along to `util.inspect()`. Can be an options object or, if different options for stdout and stderr are desired, a `Map` from stream objects to options."
                    },
                    {
                      "textRaw": "`groupIndentation` {number} Set group indentation. **Default:** `2`.",
                      "name": "groupIndentation",
                      "type": "number",
                      "default": "`2`",
                      "desc": "Set group indentation."
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new <code>Console</code> with one or two writable stream instances. <code>stdout</code> is a\nwritable stream to print log or info output. <code>stderr</code> is used for warning or\nerror output. If <code>stderr</code> is not provided, <code>stdout</code> is used for <code>stderr</code>.</p>\n<pre><code class=\"language-mjs\">import { createWriteStream } from 'node:fs';\nimport { Console } from 'node:console';\n// Alternatively\n// const { Console } = console;\n\nconst output = createWriteStream('./stdout.log');\nconst errorOutput = createWriteStream('./stderr.log');\n// Custom simple logger\nconst logger = new Console({ stdout: output, stderr: errorOutput });\n// use it like console\nconst count = 5;\nlogger.log('count: %d', count);\n// In stdout.log: count 5\n</code></pre>\n<pre><code class=\"language-cjs\">const fs = require('node:fs');\nconst { Console } = require('node:console');\n// Alternatively\n// const { Console } = console;\n\nconst output = fs.createWriteStream('./stdout.log');\nconst errorOutput = fs.createWriteStream('./stderr.log');\n// Custom simple logger\nconst logger = new Console({ stdout: output, stderr: errorOutput });\n// use it like console\nconst count = 5;\nlogger.log('count: %d', count);\n// In stdout.log: count 5\n</code></pre>\n<p>The global <code>console</code> is a special <code>Console</code> whose output is sent to\n<a href=\"process.html#processstdout\"><code>process.stdout</code></a> and <a href=\"process.html#processstderr\"><code>process.stderr</code></a>. It is equivalent to calling:</p>\n<pre><code class=\"language-js\">new Console({ stdout: process.stdout, stderr: process.stderr });\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`console.assert(value[, ...message])`",
              "name": "assert",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.101"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17706",
                    "description": "The implementation is now spec compliant and does not throw anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any} The value tested for being truthy.",
                      "name": "value",
                      "type": "any",
                      "desc": "The value tested for being truthy."
                    },
                    {
                      "textRaw": "`...message` {any} All arguments besides `value` are used as error message.",
                      "name": "...message",
                      "type": "any",
                      "desc": "All arguments besides `value` are used as error message.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p><code>console.assert()</code> writes a message if <code>value</code> is <a href=\"https://developer.mozilla.org/en-US/docs/Glossary/Falsy\">falsy</a> or omitted. It only\nwrites a message and does not otherwise affect execution. The output always\nstarts with <code>\"Assertion failed\"</code>. If provided, <code>message</code> is formatted using\n<a href=\"util.html#utilformatformat-args\"><code>util.format()</code></a>.</p>\n<p>If <code>value</code> is <a href=\"https://developer.mozilla.org/en-US/docs/Glossary/Truthy\">truthy</a>, nothing happens.</p>\n<pre><code class=\"language-js\">console.assert(true, 'does nothing');\n\nconsole.assert(false, 'Whoops %s work', 'didn\\'t');\n// Assertion failed: Whoops didn't work\n\nconsole.assert();\n// Assertion failed\n</code></pre>"
            },
            {
              "textRaw": "`console.clear()`",
              "name": "clear",
              "type": "method",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>When <code>stdout</code> is a TTY, calling <code>console.clear()</code> will attempt to clear the\nTTY. When <code>stdout</code> is not a TTY, this method does nothing.</p>\n<p>The specific operation of <code>console.clear()</code> can vary across operating systems\nand terminal types. For most Linux operating systems, <code>console.clear()</code>\noperates similarly to the <code>clear</code> shell command. On Windows, <code>console.clear()</code>\nwill clear only the output in the current terminal viewport for the Node.js\nbinary.</p>"
            },
            {
              "textRaw": "`console.count([label])`",
              "name": "count",
              "type": "method",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string} The display label for the counter. **Default:** `'default'`.",
                      "name": "label",
                      "type": "string",
                      "default": "`'default'`",
                      "desc": "The display label for the counter.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Maintains an internal counter specific to <code>label</code> and outputs to <code>stdout</code> the\nnumber of times <code>console.count()</code> has been called with the given <code>label</code>.</p>\n<pre><code class=\"language-console\">> console.count()\ndefault: 1\nundefined\n> console.count('default')\ndefault: 2\nundefined\n> console.count('abc')\nabc: 1\nundefined\n> console.count('xyz')\nxyz: 1\nundefined\n> console.count('abc')\nabc: 2\nundefined\n> console.count()\ndefault: 3\nundefined\n>\n</code></pre>"
            },
            {
              "textRaw": "`console.countReset([label])`",
              "name": "countReset",
              "type": "method",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string} The display label for the counter. **Default:** `'default'`.",
                      "name": "label",
                      "type": "string",
                      "default": "`'default'`",
                      "desc": "The display label for the counter.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Resets the internal counter specific to <code>label</code>.</p>\n<pre><code class=\"language-console\">> console.count('abc');\nabc: 1\nundefined\n> console.countReset('abc');\nundefined\n> console.count('abc');\nabc: 1\nundefined\n>\n</code></pre>"
            },
            {
              "textRaw": "`console.debug(data[, ...args])`",
              "name": "debug",
              "type": "method",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [
                  {
                    "version": "v8.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17033",
                    "description": "`console.debug` is now an alias for `console.log`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>console.debug()</code> function is an alias for <a href=\"#consolelogdata-args\"><code>console.log()</code></a>.</p>"
            },
            {
              "textRaw": "`console.dir(obj[, options])`",
              "name": "dir",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.101"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`obj` {any}",
                      "name": "obj",
                      "type": "any"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`showHidden` {boolean} If `true` then the object's non-enumerable and symbol properties will be shown too. **Default:** `false`.",
                          "name": "showHidden",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true` then the object's non-enumerable and symbol properties will be shown too."
                        },
                        {
                          "textRaw": "`depth` {number} Tells `util.inspect()` how many times to recurse while formatting the object. This is useful for inspecting large complicated objects. To make it recurse indefinitely, pass `null`. **Default:** `2`.",
                          "name": "depth",
                          "type": "number",
                          "default": "`2`",
                          "desc": "Tells `util.inspect()` how many times to recurse while formatting the object. This is useful for inspecting large complicated objects. To make it recurse indefinitely, pass `null`."
                        },
                        {
                          "textRaw": "`colors` {boolean} If `true`, then the output will be styled with ANSI color codes. Colors are customizable; see customizing `util.inspect()` colors. **Default:** `false`.",
                          "name": "colors",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, then the output will be styled with ANSI color codes. Colors are customizable; see customizing `util.inspect()` colors."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Uses <a href=\"util.html#utilinspectobject-options\"><code>util.inspect()</code></a> on <code>obj</code> and prints the resulting string to <code>stdout</code>.\nThis function bypasses any custom <code>inspect()</code> function defined on <code>obj</code>.</p>"
            },
            {
              "textRaw": "`console.dirxml(...data)`",
              "name": "dirxml",
              "type": "method",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [
                  {
                    "version": "v9.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17152",
                    "description": "`console.dirxml` now calls `console.log` for its arguments."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`...data` {any}",
                      "name": "...data",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>This method calls <code>console.log()</code> passing it the arguments received.\nThis method does not produce any XML formatting.</p>"
            },
            {
              "textRaw": "`console.error([data][, ...args])`",
              "name": "error",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.100"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any",
                      "optional": true
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Prints to <code>stderr</code> with newline. Multiple arguments can be passed, with the\nfirst used as the primary message and all additional used as substitution\nvalues similar to <a href=\"http://man7.org/linux/man-pages/man3/printf.3.html\"><code>printf(3)</code></a> (the arguments are all passed to <a href=\"util.html#utilformatformat-args\"><code>util.format()</code></a>).</p>\n<pre><code class=\"language-js\">const code = 5;\nconsole.error('error #%d', code);\n// Prints: error #5, to stderr\nconsole.error('error', code);\n// Prints: error 5, to stderr\n</code></pre>\n<p>If formatting elements (e.g. <code>%d</code>) are not found in the first string then\n<a href=\"util.html#utilinspectobject-options\"><code>util.inspect()</code></a> is called on each argument and the resulting string\nvalues are concatenated. See <a href=\"util.html#utilformatformat-args\"><code>util.format()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`console.group([...label])`",
              "name": "group",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`...label` {any}",
                      "name": "...label",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Increases indentation of subsequent lines by spaces for <code>groupIndentation</code>\nlength.</p>\n<p>If one or more <code>label</code>s are provided, those are printed first without the\nadditional indentation.</p>"
            },
            {
              "textRaw": "`console.groupCollapsed()`",
              "name": "groupCollapsed",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>An alias for <a href=\"#consolegrouplabel\"><code>console.group()</code></a>.</p>"
            },
            {
              "textRaw": "`console.groupEnd()`",
              "name": "groupEnd",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Decreases indentation of subsequent lines by spaces for <code>groupIndentation</code>\nlength.</p>"
            },
            {
              "textRaw": "`console.info([data][, ...args])`",
              "name": "info",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.100"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any",
                      "optional": true
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>console.info()</code> function is an alias for <a href=\"#consolelogdata-args\"><code>console.log()</code></a>.</p>"
            },
            {
              "textRaw": "`console.log([data][, ...args])`",
              "name": "log",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.100"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any",
                      "optional": true
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Prints to <code>stdout</code> with newline. Multiple arguments can be passed, with the\nfirst used as the primary message and all additional used as substitution\nvalues similar to <a href=\"http://man7.org/linux/man-pages/man3/printf.3.html\"><code>printf(3)</code></a> (the arguments are all passed to <a href=\"util.html#utilformatformat-args\"><code>util.format()</code></a>).</p>\n<pre><code class=\"language-js\">const count = 5;\nconsole.log('count: %d', count);\n// Prints: count: 5, to stdout\nconsole.log('count:', count);\n// Prints: count: 5, to stdout\n</code></pre>\n<p>See <a href=\"util.html#utilformatformat-args\"><code>util.format()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`console.table(tabularData[, properties])`",
              "name": "table",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`tabularData` {any}",
                      "name": "tabularData",
                      "type": "any"
                    },
                    {
                      "textRaw": "`properties` {string[]} Alternate properties for constructing the table.",
                      "name": "properties",
                      "type": "string[]",
                      "desc": "Alternate properties for constructing the table.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Try to construct a table with the columns of the properties of <code>tabularData</code>\n(or use <code>properties</code>) and rows of <code>tabularData</code> and log it. Falls back to just\nlogging the argument if it can't be parsed as tabular.</p>\n<pre><code class=\"language-js\">// These can't be parsed as tabular data\nconsole.table(Symbol());\n// Symbol()\n\nconsole.table(undefined);\n// undefined\n\nconsole.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]);\n// ┌─────────┬─────┬─────┐\n// │ (index) │ a   │ b   │\n// ├─────────┼─────┼─────┤\n// │ 0       │ 1   │ 'Y' │\n// │ 1       │ 'Z' │ 2   │\n// └─────────┴─────┴─────┘\n\nconsole.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']);\n// ┌─────────┬─────┐\n// │ (index) │ a   │\n// ├─────────┼─────┤\n// │ 0       │ 1   │\n// │ 1       │ 'Z' │\n// └─────────┴─────┘\n</code></pre>"
            },
            {
              "textRaw": "`console.time([label])`",
              "name": "time",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.104"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string} **Default:** `'default'`",
                      "name": "label",
                      "type": "string",
                      "default": "`'default'`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Starts a timer that can be used to compute the duration of an operation. Timers\nare identified by a unique <code>label</code>. Use the same <code>label</code> when calling\n<a href=\"#consoletimeendlabel\"><code>console.timeEnd()</code></a> to stop the timer and output the elapsed time in\nsuitable time units to <code>stdout</code>. For example, if the elapsed\ntime is 3869ms, <code>console.timeEnd()</code> displays \"3.869s\".</p>"
            },
            {
              "textRaw": "`console.timeEnd([label])`",
              "name": "timeEnd",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.104"
                ],
                "changes": [
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29251",
                    "description": "The elapsed time is displayed with a suitable time unit."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5901",
                    "description": "This method no longer supports multiple calls that don't map to individual `console.time()` calls; see below for details."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string} **Default:** `'default'`",
                      "name": "label",
                      "type": "string",
                      "default": "`'default'`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Stops a timer that was previously started by calling <a href=\"#consoletimelabel\"><code>console.time()</code></a> and\nprints the result to <code>stdout</code>:</p>\n<pre><code class=\"language-js\">console.time('bunch-of-stuff');\n// Do a bunch of stuff.\nconsole.timeEnd('bunch-of-stuff');\n// Prints: bunch-of-stuff: 225.438ms\n</code></pre>"
            },
            {
              "textRaw": "`console.timeLog([label][, ...data])`",
              "name": "timeLog",
              "type": "method",
              "meta": {
                "added": [
                  "v10.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string} **Default:** `'default'`",
                      "name": "label",
                      "type": "string",
                      "default": "`'default'`",
                      "optional": true
                    },
                    {
                      "textRaw": "`...data` {any}",
                      "name": "...data",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>For a timer that was previously started by calling <a href=\"#consoletimelabel\"><code>console.time()</code></a>, prints\nthe elapsed time and other <code>data</code> arguments to <code>stdout</code>:</p>\n<pre><code class=\"language-js\">console.time('process');\nconst value = expensiveProcess1(); // Returns 42\nconsole.timeLog('process', value);\n// Prints \"process: 365.227ms 42\".\ndoExpensiveProcess2(value);\nconsole.timeEnd('process');\n</code></pre>"
            },
            {
              "textRaw": "`console.trace([message][, ...args])`",
              "name": "trace",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.104"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {any}",
                      "name": "message",
                      "type": "any",
                      "optional": true
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Prints to <code>stderr</code> the string <code>'Trace: '</code>, followed by the <a href=\"util.html#utilformatformat-args\"><code>util.format()</code></a>\nformatted message and stack trace to the current position in the code.</p>\n<pre><code class=\"language-js\">console.trace('Show me');\n// Prints: (stack trace will vary based on where trace is called)\n//  Trace: Show me\n//    at repl:2:9\n//    at REPLServer.defaultEval (repl.js:248:27)\n//    at bound (domain.js:287:14)\n//    at REPLServer.runBound [as eval] (domain.js:300:12)\n//    at REPLServer.&#x3C;anonymous> (repl.js:412:12)\n//    at emitOne (events.js:82:20)\n//    at REPLServer.emit (events.js:169:7)\n//    at REPLServer.Interface._onLine (readline.js:210:10)\n//    at REPLServer.Interface._line (readline.js:549:8)\n//    at REPLServer.Interface._ttyWrite (readline.js:826:14)\n</code></pre>"
            },
            {
              "textRaw": "`console.warn([data][, ...args])`",
              "name": "warn",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.100"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {any}",
                      "name": "data",
                      "type": "any",
                      "optional": true
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>console.warn()</code> function is an alias for <a href=\"#consoleerrordata-args\"><code>console.error()</code></a>.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Inspector only methods",
          "name": "inspector_only_methods",
          "type": "module",
          "desc": "<p>The following methods are exposed by the V8 engine in the general API but do\nnot display anything unless used in conjunction with the <a href=\"debugger.html\">inspector</a>\n(<code>--inspect</code> flag).</p>",
          "methods": [
            {
              "textRaw": "`console.profile([label])`",
              "name": "profile",
              "type": "method",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string}",
                      "name": "label",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This method does not display anything unless used in the inspector. The\n<code>console.profile()</code> method starts a JavaScript CPU profile with an optional\nlabel until <a href=\"#consoleprofileendlabel\"><code>console.profileEnd()</code></a> is called. The profile is then added to\nthe <strong>Profile</strong> panel of the inspector.</p>\n<pre><code class=\"language-js\">console.profile('MyLabel');\n// Some code\nconsole.profileEnd('MyLabel');\n// Adds the profile 'MyLabel' to the Profiles panel of the inspector.\n</code></pre>"
            },
            {
              "textRaw": "`console.profileEnd([label])`",
              "name": "profileEnd",
              "type": "method",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string}",
                      "name": "label",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This method does not display anything unless used in the inspector. Stops the\ncurrent JavaScript CPU profiling session if one has been started and prints\nthe report to the <strong>Profiles</strong> panel of the inspector. See\n<a href=\"#consoleprofilelabel\"><code>console.profile()</code></a> for an example.</p>\n<p>If this method is called without a label, the most recently started profile is\nstopped.</p>"
            },
            {
              "textRaw": "`console.timeStamp([label])`",
              "name": "timeStamp",
              "type": "method",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`label` {string}",
                      "name": "label",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This method does not display anything unless used in the inspector. The\n<code>console.timeStamp()</code> method adds an event with the label <code>'label'</code> to the\n<strong>Timeline</strong> panel of the inspector.</p>"
            }
          ],
          "displayName": "Inspector only methods"
        }
      ],
      "displayName": "Console",
      "source": "doc/api/console.md"
    },
    {
      "textRaw": "Crypto",
      "name": "crypto",
      "introduced_in": "v0.3.6",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:crypto</code> module provides cryptographic functionality that includes a\nset of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign, and verify\nfunctions.</p>\n<pre><code class=\"language-mjs\">const { createHmac } = await import('node:crypto');\n\nconst secret = 'abcdefg';\nconst hash = createHmac('sha256', secret)\n               .update('I love cupcakes')\n               .digest('hex');\nconsole.log(hash);\n// Prints:\n//   c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e\n</code></pre>\n<pre><code class=\"language-cjs\">const { createHmac } = require('node:crypto');\n\nconst secret = 'abcdefg';\nconst hash = createHmac('sha256', secret)\n               .update('I love cupcakes')\n               .digest('hex');\nconsole.log(hash);\n// Prints:\n//   c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e\n</code></pre>",
      "modules": [
        {
          "textRaw": "Determining if crypto support is unavailable",
          "name": "determining_if_crypto_support_is_unavailable",
          "type": "module",
          "desc": "<p>It is possible for Node.js to be built without including support for the\n<code>node:crypto</code> module. In such cases, attempting to <code>import</code> from <code>crypto</code> or\ncalling <code>require('node:crypto')</code> will result in an error being thrown.</p>\n<p>When using CommonJS, the error thrown can be caught using try/catch:</p>\n<pre><code class=\"language-cjs\">let crypto;\ntry {\n  crypto = require('node:crypto');\n} catch (err) {\n  console.error('crypto support is disabled!');\n}\n</code></pre>\n<p>When using the lexical ESM <code>import</code> keyword, the error can only be\ncaught if a handler for <code>process.on('uncaughtException')</code> is registered\n<em>before</em> any attempt to load the module is made (using, for instance,\na preload module).</p>\n<p>When using ESM, if there is a chance that the code may be run on a build\nof Node.js where crypto support is not enabled, consider using the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import\"><code>import()</code></a> function instead of the lexical <code>import</code> keyword:</p>\n<pre><code class=\"language-mjs\">let crypto;\ntry {\n  crypto = await import('node:crypto');\n} catch (err) {\n  console.error('crypto support is disabled!');\n}\n</code></pre>",
          "displayName": "Determining if crypto support is unavailable"
        },
        {
          "textRaw": "Asymmetric key types",
          "name": "asymmetric_key_types",
          "type": "module",
          "desc": "<p>The following table lists the asymmetric key types recognized by the\n<a href=\"#class-keyobject\"><code>KeyObject</code></a> API and the export/import formats supported for each key type.</p>\n<table>\n<thead>\n<tr>\n<th>Key Type</th>\n<th>Description</th>\n<th>OID</th>\n<th><code>'pem'</code></th>\n<th><code>'der'</code></th>\n<th><code>'jwk'</code></th>\n<th><code>'raw-public'</code></th>\n<th><code>'raw-private'</code></th>\n<th><code>'raw-seed'</code></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'dh'</code></td>\n<td>Diffie-Hellman</td>\n<td>1.2.840.113549.1.3.1</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'dsa'</code></td>\n<td>DSA</td>\n<td>1.2.840.10040.4.1</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ec'</code></td>\n<td>Elliptic curve</td>\n<td>1.2.840.10045.2.1</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ed25519'</code></td>\n<td>Ed25519</td>\n<td>1.3.101.112</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ed448'</code></td>\n<td>Ed448</td>\n<td>1.3.101.113</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ml-dsa-44'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-DSA-44</td>\n<td>2.16.840.1.101.3.4.3.17</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-dsa-65'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-DSA-65</td>\n<td>2.16.840.1.101.3.4.3.18</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-dsa-87'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-DSA-87</td>\n<td>2.16.840.1.101.3.4.3.19</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-kem-512'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-KEM-512</td>\n<td>2.16.840.1.101.3.4.4.1</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-kem-768'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-KEM-768</td>\n<td>2.16.840.1.101.3.4.4.2</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ml-kem-1024'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>ML-KEM-1024</td>\n<td>2.16.840.1.101.3.4.4.3</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'rsa-pss'</code></td>\n<td>RSA PSS</td>\n<td>1.2.840.113549.1.1.10</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'rsa'</code></td>\n<td>RSA</td>\n<td>1.2.840.113549.1.1.1</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-128f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-128f</td>\n<td>2.16.840.1.101.3.4.3.21</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-128s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-128s</td>\n<td>2.16.840.1.101.3.4.3.20</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-192f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-192f</td>\n<td>2.16.840.1.101.3.4.3.23</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-192s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-10\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-192s</td>\n<td>2.16.840.1.101.3.4.3.22</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-256f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-11\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-256f</td>\n<td>2.16.840.1.101.3.4.3.25</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-sha2-256s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-12\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHA2-256s</td>\n<td>2.16.840.1.101.3.4.3.24</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-128f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-13\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-128f</td>\n<td>2.16.840.1.101.3.4.3.27</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-128s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-14\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-128s</td>\n<td>2.16.840.1.101.3.4.3.26</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-192f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-15\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-192f</td>\n<td>2.16.840.1.101.3.4.3.29</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-192s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-16\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-192s</td>\n<td>2.16.840.1.101.3.4.3.28</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-256f'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-17\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-256f</td>\n<td>2.16.840.1.101.3.4.3.31</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'slh-dsa-shake-256s'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-18\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>SLH-DSA-SHAKE-256s</td>\n<td>2.16.840.1.101.3.4.3.30</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'x25519'</code></td>\n<td>X25519</td>\n<td>1.3.101.110</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'x448'</code></td>\n<td>X448</td>\n<td>1.3.101.111</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n</tbody>\n</table>",
          "modules": [
            {
              "textRaw": "Key formats",
              "name": "key_formats",
              "type": "module",
              "desc": "<p>Asymmetric keys can be represented in several formats. <strong>The recommended\napproach is to import key material into a <a href=\"#class-keyobject\"><code>KeyObject</code></a> once and reuse it</strong>\nfor all subsequent operations, as this avoids repeated parsing and delivers\nthe best performance.</p>\n<p>When a <a href=\"#class-keyobject\"><code>KeyObject</code></a> is not practical - for example, when key material\narrives in a protocol message and is used only once - most cryptographic\nfunctions also accept a PEM string or an object specifying the format\nand key material directly. See <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>,\n<a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>, and <a href=\"#keyobjectexportoptions\"><code>keyObject.export()</code></a> for the full\noptions accepted by each format.</p>",
              "modules": [
                {
                  "textRaw": "KeyObject",
                  "name": "keyobject",
                  "type": "module",
                  "desc": "<p>A <a href=\"#class-keyobject\"><code>KeyObject</code></a> is the in-memory representation of a parsed key. It is\ncreated by <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>, <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>,\n<a href=\"#cryptocreatesecretkeykey-encoding\"><code>crypto.createSecretKey()</code></a>, or key generation functions such as\n<a href=\"#cryptogeneratekeypairtype-options-callback\"><code>crypto.generateKeyPair()</code></a>. The first cryptographic operation with a given\n<a href=\"#class-keyobject\"><code>KeyObject</code></a> may be slower than subsequent ones because OpenSSL lazily\ninitializes internal caches on first use.</p>",
                  "displayName": "KeyObject"
                },
                {
                  "textRaw": "PEM and DER",
                  "name": "pem_and_der",
                  "type": "module",
                  "desc": "<p>PEM and DER are the traditional encoding formats for asymmetric keys based on\nASN.1 structures.</p>\n<ul>\n<li><strong>PEM</strong> is a text encoding that wraps Base64-encoded DER data between\nheader and footer lines (e.g. <code>-----BEGIN PUBLIC KEY-----</code>). PEM strings can\nbe passed directly to most cryptographic operations.</li>\n<li><strong>DER</strong> is the binary encoding of the same ASN.1 structures. When providing\nDER input, the <code>type</code> (typically <code>'spki'</code> or <code>'pkcs8'</code>) must be specified\nexplicitly.</li>\n</ul>",
                  "displayName": "PEM and DER"
                },
                {
                  "textRaw": "JSON Web Key (JWK)",
                  "name": "json_web_key_(jwk)",
                  "type": "module",
                  "desc": "<p>JSON Web Key (JWK) is a JSON-based key representation defined in\n<a href=\"https://www.rfc-editor.org/rfc/rfc7517.txt\">RFC 7517</a>. JWK encodes each key component as an individual Base64url-encoded\nvalue inside a JSON object. For RSA keys, JWK avoids ASN.1 parsing overhead\nand is the fastest serialized import format.</p>",
                  "displayName": "JSON Web Key (JWK)"
                },
                {
                  "textRaw": "Raw key formats",
                  "name": "raw_key_formats",
                  "type": "module",
                  "stability": 1.1,
                  "stabilityText": "Active development",
                  "desc": "<p>The <code>'raw-public'</code>, <code>'raw-private'</code>, and <code>'raw-seed'</code> key formats allow\nimporting and exporting raw key material without any encoding wrapper.\nSee <a href=\"#keyobjectexportoptions\"><code>keyObject.export()</code></a>, <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>, and\n<a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a> for usage details.</p>\n<p><code>'raw-public'</code> is generally the fastest way to import a public key.\n<code>'raw-private'</code> and <code>'raw-seed'</code> are not always faster than other formats\nbecause they only contain the private scalar or seed - importing them requires\nderiving the public key component (e.g. elliptic curve point multiplication or\nseed expansion), which can be expensive. Other formats include both private\nand public components, avoiding that computation.</p>",
                  "displayName": "Raw key formats"
                }
              ],
              "displayName": "Key formats"
            },
            {
              "textRaw": "Choosing a key format",
              "name": "choosing_a_key_format",
              "type": "module",
              "desc": "<p><strong>Always prefer a <a href=\"#class-keyobject\"><code>KeyObject</code></a></strong> - create one from whatever format you\nhave and reuse it. The guidance below applies only when choosing between\nserialization formats, either for importing into a <a href=\"#class-keyobject\"><code>KeyObject</code></a> or for\npassing key material inline when a <a href=\"#class-keyobject\"><code>KeyObject</code></a> is not practical.</p>",
              "modules": [
                {
                  "textRaw": "Importing keys",
                  "name": "importing_keys",
                  "type": "module",
                  "desc": "<p>When creating a <a href=\"#class-keyobject\"><code>KeyObject</code></a> for repeated use, the import cost is paid once,\nso choosing a faster format reduces startup latency.</p>\n<p>The import cost breaks down into two parts: <strong>parsing overhead</strong> (decoding the\nserialization wrapper) and <strong>key computation</strong> (any mathematical work needed to\nreconstruct the full key, such as deriving a public key from a private scalar\nor expanding a seed). Which part dominates depends on the key type. For\nexample:</p>\n<ul>\n<li>Public keys - <code>'raw-public'</code> is the fastest serialized format because the\nraw format skips all ASN.1 and Base64 decoding.</li>\n<li>EC private keys - <code>'raw-private'</code> is faster than PEM or DER because it\navoids ASN.1 parsing. However, for larger curves (e.g. P-384, P-521) the\nrequired derivation of the public point from the private scalar becomes\nexpensive, reducing the advantage.</li>\n<li>RSA keys - <code>'jwk'</code> is the fastest serialized format. JWK represents RSA\nkey components as individual Base64url-encoded integers, avoiding the\noverhead of ASN.1 parsing entirely.</li>\n</ul>",
                  "displayName": "Importing keys"
                },
                {
                  "textRaw": "Inline key material in operations",
                  "name": "inline_key_material_in_operations",
                  "type": "module",
                  "desc": "<p>When a <a href=\"#class-keyobject\"><code>KeyObject</code></a> cannot be reused (e.g. the key arrives as raw bytes in\na protocol message and is used only once), most cryptographic functions also\naccept a PEM string or an object specifying the format and key\nmaterial directly. In this case the total cost is the sum of key import and\nthe cryptographic computation itself.</p>\n<p>For operations where the cryptographic computation dominates - such as\nsigning with RSA or ECDH key agreement with P-384 or P-521 - the\nserialization format has negligible impact on overall throughput, so choose\nwhichever format is most convenient. For lightweight operations like Ed25519\nsigning or verification, the import cost is a larger fraction of the total,\nso a faster format like <code>'raw-public'</code> or <code>'raw-private'</code> can meaningfully\nimprove throughput.</p>\n<p>Even if the same key material is used only a few times, it is worth importing it\ninto a <a href=\"#class-keyobject\"><code>KeyObject</code></a> rather than passing the raw or PEM representation\nrepeatedly.</p>",
                  "displayName": "Inline key material in operations"
                }
              ],
              "displayName": "Choosing a key format"
            },
            {
              "textRaw": "Examples",
              "name": "examples",
              "type": "module",
              "desc": "<p>Example: Reusing a <a href=\"#class-keyobject\"><code>KeyObject</code></a> across sign and verify operations:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst { generateKeyPair, sign, verify } = await import('node:crypto');\n\nconst { publicKey, privateKey } = await promisify(generateKeyPair)('ed25519');\n\n// A KeyObject holds the parsed key in memory and can be reused\n// across multiple operations without re-parsing.\nconst data = new TextEncoder().encode('message to sign');\nconst signature = sign(null, data, privateKey);\nverify(null, data, publicKey, signature);\n</code></pre>\n<p>Example: Importing keys of various formats into <a href=\"#class-keyobject\"><code>KeyObject</code></a>s:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst {\n  createPrivateKey, createPublicKey, generateKeyPair,\n} = await import('node:crypto');\n\nconst generated = await promisify(generateKeyPair)('ed25519');\n\n// PEM\nconst privatePem = generated.privateKey.export({ format: 'pem', type: 'pkcs8' });\nconst publicPem = generated.publicKey.export({ format: 'pem', type: 'spki' });\ncreatePrivateKey(privatePem);\ncreatePublicKey(publicPem);\n\n// DER - requires explicit type\nconst privateDer = generated.privateKey.export({ format: 'der', type: 'pkcs8' });\nconst publicDer = generated.publicKey.export({ format: 'der', type: 'spki' });\ncreatePrivateKey({ key: privateDer, format: 'der', type: 'pkcs8' });\ncreatePublicKey({ key: publicDer, format: 'der', type: 'spki' });\n\n// JWK\nconst privateJwk = generated.privateKey.export({ format: 'jwk' });\nconst publicJwk = generated.publicKey.export({ format: 'jwk' });\ncreatePrivateKey({ key: privateJwk, format: 'jwk' });\ncreatePublicKey({ key: publicJwk, format: 'jwk' });\n\n// Raw\nconst rawPriv = generated.privateKey.export({ format: 'raw-private' });\nconst rawPub = generated.publicKey.export({ format: 'raw-public' });\ncreatePrivateKey({ key: rawPriv, format: 'raw-private', asymmetricKeyType: 'ed25519' });\ncreatePublicKey({ key: rawPub, format: 'raw-public', asymmetricKeyType: 'ed25519' });\n</code></pre>\n<p>Example: Passing key material directly to <a href=\"#cryptosignalgorithm-data-key-callback\"><code>crypto.sign()</code></a> and\n<a href=\"#cryptoverifyalgorithm-data-key-signature-callback\"><code>crypto.verify()</code></a> without creating a <a href=\"#class-keyobject\"><code>KeyObject</code></a> first:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst { generateKeyPair, sign, verify } = await import('node:crypto');\n\nconst generated = await promisify(generateKeyPair)('ed25519');\n\nconst data = new TextEncoder().encode('message to sign');\n\n// PEM strings\nconst privatePem = generated.privateKey.export({ format: 'pem', type: 'pkcs8' });\nconst publicPem = generated.publicKey.export({ format: 'pem', type: 'spki' });\nconst sig1 = sign(null, data, privatePem);\nverify(null, data, publicPem, sig1);\n\n// JWK objects\nconst privateJwk = generated.privateKey.export({ format: 'jwk' });\nconst publicJwk = generated.publicKey.export({ format: 'jwk' });\nconst sig2 = sign(null, data, { key: privateJwk, format: 'jwk' });\nverify(null, data, { key: publicJwk, format: 'jwk' }, sig2);\n\n// Raw key bytes\nconst rawPriv = generated.privateKey.export({ format: 'raw-private' });\nconst rawPub = generated.publicKey.export({ format: 'raw-public' });\nconst sig3 = sign(null, data, {\n  key: rawPriv, format: 'raw-private', asymmetricKeyType: 'ed25519',\n});\nverify(null, data, {\n  key: rawPub, format: 'raw-public', asymmetricKeyType: 'ed25519',\n}, sig3);\n</code></pre>\n<p>Example: For EC keys, the <code>namedCurve</code> option is required when importing\nraw keys:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst {\n  createPrivateKey, createPublicKey, generateKeyPair, sign, verify,\n} = await import('node:crypto');\n\nconst generated = await promisify(generateKeyPair)('ec', {\n  namedCurve: 'P-256',\n});\n\n// Export the raw EC public key (uncompressed by default).\nconst rawPublicKey = generated.publicKey.export({ format: 'raw-public' });\n\n// The following is equivalent.\nconst rawPublicKeyUncompressed = generated.publicKey.export({\n  format: 'raw-public',\n  type: 'uncompressed',\n});\n\n// Export compressed point format.\nconst rawPublicKeyCompressed = generated.publicKey.export({\n  format: 'raw-public',\n  type: 'compressed',\n});\n\n// Export the raw EC private key.\nconst rawPrivateKey = generated.privateKey.export({ format: 'raw-private' });\n\n// Import the raw EC keys.\n// Both compressed and uncompressed point formats are accepted.\nconst publicKey = createPublicKey({\n  key: rawPublicKey,\n  format: 'raw-public',\n  asymmetricKeyType: 'ec',\n  namedCurve: 'P-256',\n});\nconst privateKey = createPrivateKey({\n  key: rawPrivateKey,\n  format: 'raw-private',\n  asymmetricKeyType: 'ec',\n  namedCurve: 'P-256',\n});\n\nconst data = new TextEncoder().encode('message to sign');\nconst signature = sign('sha256', data, privateKey);\nverify('sha256', data, publicKey, signature);\n</code></pre>\n<p>Example: Exporting raw seeds and importing them:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nconst {\n  createPrivateKey, decapsulate, encapsulate, generateKeyPair,\n} = await import('node:crypto');\n\nconst generated = await promisify(generateKeyPair)('ml-kem-768');\n\n// Export the raw seed (64 bytes for ML-KEM).\nconst seed = generated.privateKey.export({ format: 'raw-seed' });\n\n// Import the raw seed.\nconst privateKey = createPrivateKey({\n  key: seed,\n  format: 'raw-seed',\n  asymmetricKeyType: 'ml-kem-768',\n});\n\nconst { ciphertext } = encapsulate(generated.publicKey);\ndecapsulate(privateKey, ciphertext);\n</code></pre>",
              "displayName": "Examples"
            }
          ],
          "displayName": "Asymmetric key types"
        },
        {
          "textRaw": "`node:crypto` module methods and properties",
          "name": "`node:crypto`_module_methods_and_properties",
          "type": "module",
          "methods": [
            {
              "textRaw": "`crypto.argon2(algorithm, parameters, callback)`",
              "name": "argon2",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string} Variant of Argon2, one of `\"argon2d\"`, `\"argon2i\"` or `\"argon2id\"`.",
                      "name": "algorithm",
                      "type": "string",
                      "desc": "Variant of Argon2, one of `\"argon2d\"`, `\"argon2i\"` or `\"argon2id\"`."
                    },
                    {
                      "textRaw": "`parameters` {Object}",
                      "name": "parameters",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`message` {string|ArrayBuffer|Buffer|TypedArray|DataView} REQUIRED, this is the password for password hashing applications of Argon2.",
                          "name": "message",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "REQUIRED, this is the password for password hashing applications of Argon2."
                        },
                        {
                          "textRaw": "`nonce` {string|ArrayBuffer|Buffer|TypedArray|DataView} REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2.",
                          "name": "nonce",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2."
                        },
                        {
                          "textRaw": "`parallelism` {number} REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be at least `1` and at most `2**24-1`.",
                          "name": "parallelism",
                          "type": "number",
                          "desc": "REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be at least `1` and at most `2**24-1`."
                        },
                        {
                          "textRaw": "`tagLength` {number} REQUIRED, the length of the key to generate. Must be at least `4` and at most `2**32-1`.",
                          "name": "tagLength",
                          "type": "number",
                          "desc": "REQUIRED, the length of the key to generate. Must be at least `4` and at most `2**32-1`."
                        },
                        {
                          "textRaw": "`memory` {number} REQUIRED, memory cost in 1KiB blocks. Must be at least `8 * parallelism` and at most `2**32-1`. The actual number of blocks is rounded down to the nearest multiple of `4 * parallelism`.",
                          "name": "memory",
                          "type": "number",
                          "desc": "REQUIRED, memory cost in 1KiB blocks. Must be at least `8 * parallelism` and at most `2**32-1`. The actual number of blocks is rounded down to the nearest multiple of `4 * parallelism`."
                        },
                        {
                          "textRaw": "`passes` {number} REQUIRED, number of passes (iterations). Must be at least `1` and at most `2**32-1`.",
                          "name": "passes",
                          "type": "number",
                          "desc": "REQUIRED, number of passes (iterations). Must be at least `1` and at most `2**32-1`."
                        },
                        {
                          "textRaw": "`secret` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Random additional input, similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2**32-1` bytes.",
                          "name": "secret",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|undefined",
                          "desc": "OPTIONAL, Random additional input, similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2**32-1` bytes."
                        },
                        {
                          "textRaw": "`associatedData` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Additional data to be added to the hash, functionally equivalent to salt or secret, but meant for non-random data. If used, must have a length not greater than `2**32-1` bytes.",
                          "name": "associatedData",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|undefined",
                          "desc": "OPTIONAL, Additional data to be added to the hash, functionally equivalent to salt or secret, but meant for non-random data. If used, must have a length not greater than `2**32-1` bytes."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`derivedKey` {Buffer}",
                          "name": "derivedKey",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Provides an asynchronous <a href=\"https://www.rfc-editor.org/rfc/rfc9106.html\">Argon2</a> implementation. Argon2 is a password-based\nkey derivation function that is designed to be expensive computationally and\nmemory-wise in order to make brute-force attacks unrewarding.</p>\n<p>The <code>nonce</code> should be as unique as possible. It is recommended that a nonce is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>message</code>, <code>nonce</code>, <code>secret</code> or <code>associatedData</code>, please\nconsider <a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>The <code>callback</code> function is called with two arguments: <code>err</code> and <code>derivedKey</code>.\n<code>err</code> is an exception object when key derivation fails, otherwise <code>err</code> is\n<code>null</code>. <code>derivedKey</code> is passed to the callback as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>An exception is thrown when any of the input arguments specify invalid values\nor types.</p>\n<pre><code class=\"language-mjs\">const { argon2, randomBytes } = await import('node:crypto');\n\nconst parameters = {\n  message: 'password',\n  nonce: randomBytes(16),\n  parallelism: 4,\n  tagLength: 64,\n  memory: 65536,\n  passes: 3,\n};\n\nargon2('argon2id', parameters, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // 'af91dad...9520f15'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { argon2, randomBytes } = require('node:crypto');\n\nconst parameters = {\n  message: 'password',\n  nonce: randomBytes(16),\n  parallelism: 4,\n  tagLength: 64,\n  memory: 65536,\n  passes: 3,\n};\n\nargon2('argon2id', parameters, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // 'af91dad...9520f15'\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.argon2Sync(algorithm, parameters)`",
              "name": "argon2Sync",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string} Variant of Argon2, one of `\"argon2d\"`, `\"argon2i\"` or `\"argon2id\"`.",
                      "name": "algorithm",
                      "type": "string",
                      "desc": "Variant of Argon2, one of `\"argon2d\"`, `\"argon2i\"` or `\"argon2id\"`."
                    },
                    {
                      "textRaw": "`parameters` {Object}",
                      "name": "parameters",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`message` {string|ArrayBuffer|Buffer|TypedArray|DataView} REQUIRED, this is the password for password hashing applications of Argon2.",
                          "name": "message",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "REQUIRED, this is the password for password hashing applications of Argon2."
                        },
                        {
                          "textRaw": "`nonce` {string|ArrayBuffer|Buffer|TypedArray|DataView} REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2.",
                          "name": "nonce",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "REQUIRED, must be at least 8 bytes long. This is the salt for password hashing applications of Argon2."
                        },
                        {
                          "textRaw": "`parallelism` {number} REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be at least 1 and at most `2**24-1`.",
                          "name": "parallelism",
                          "type": "number",
                          "desc": "REQUIRED, degree of parallelism determines how many computational chains (lanes) can be run. Must be at least 1 and at most `2**24-1`."
                        },
                        {
                          "textRaw": "`tagLength` {number} REQUIRED, the length of the key to generate. Must be at least `4` and at most `2**32-1`.",
                          "name": "tagLength",
                          "type": "number",
                          "desc": "REQUIRED, the length of the key to generate. Must be at least `4` and at most `2**32-1`."
                        },
                        {
                          "textRaw": "`memory` {number} REQUIRED, memory cost in 1KiB blocks. Must be at least `8 * parallelism` and at most `2**32-1`. The actual number of blocks is rounded down to the nearest multiple of `4 * parallelism`.",
                          "name": "memory",
                          "type": "number",
                          "desc": "REQUIRED, memory cost in 1KiB blocks. Must be at least `8 * parallelism` and at most `2**32-1`. The actual number of blocks is rounded down to the nearest multiple of `4 * parallelism`."
                        },
                        {
                          "textRaw": "`passes` {number} REQUIRED, number of passes (iterations). Must be at least `1` and at most `2**32-1`.",
                          "name": "passes",
                          "type": "number",
                          "desc": "REQUIRED, number of passes (iterations). Must be at least `1` and at most `2**32-1`."
                        },
                        {
                          "textRaw": "`secret` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Random additional input, similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2**32-1` bytes.",
                          "name": "secret",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|undefined",
                          "desc": "OPTIONAL, Random additional input, similar to the salt, that should **NOT** be stored with the derived key. This is known as pepper in password hashing applications. If used, must have a length not greater than `2**32-1` bytes."
                        },
                        {
                          "textRaw": "`associatedData` {string|ArrayBuffer|Buffer|TypedArray|DataView|undefined} OPTIONAL, Additional data to be added to the hash, functionally equivalent to salt or secret, but meant for non-random data. If used, must have a length not greater than `2**32-1` bytes.",
                          "name": "associatedData",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|undefined",
                          "desc": "OPTIONAL, Additional data to be added to the hash, functionally equivalent to salt or secret, but meant for non-random data. If used, must have a length not greater than `2**32-1` bytes."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Provides a synchronous <a href=\"https://www.rfc-editor.org/rfc/rfc9106.html\">Argon2</a> implementation. Argon2 is a password-based\nkey derivation function that is designed to be expensive computationally and\nmemory-wise in order to make brute-force attacks unrewarding.</p>\n<p>The <code>nonce</code> should be as unique as possible. It is recommended that a nonce is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>message</code>, <code>nonce</code>, <code>secret</code> or <code>associatedData</code>, please\nconsider <a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>An exception is thrown when key derivation fails, otherwise the derived key is\nreturned as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>An exception is thrown when any of the input arguments specify invalid values\nor types.</p>\n<pre><code class=\"language-mjs\">const { argon2Sync, randomBytes } = await import('node:crypto');\n\nconst parameters = {\n  message: 'password',\n  nonce: randomBytes(16),\n  parallelism: 4,\n  tagLength: 64,\n  memory: 65536,\n  passes: 3,\n};\n\nconst derivedKey = argon2Sync('argon2id', parameters);\nconsole.log(derivedKey.toString('hex'));  // 'af91dad...9520f15'\n</code></pre>\n<pre><code class=\"language-cjs\">const { argon2Sync, randomBytes } = require('node:crypto');\n\nconst parameters = {\n  message: 'password',\n  nonce: randomBytes(16),\n  parallelism: 4,\n  tagLength: 64,\n  memory: 65536,\n  passes: 3,\n};\n\nconst derivedKey = argon2Sync('argon2id', parameters);\nconsole.log(derivedKey.toString('hex'));  // 'af91dad...9520f15'\n</code></pre>"
            },
            {
              "textRaw": "`crypto.checkPrime(candidate[, options], callback)`",
              "name": "checkPrime",
              "type": "method",
              "meta": {
                "added": [
                  "v15.8.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`candidate` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint} A possible prime encoded as a sequence of big endian octets of arbitrary length.",
                      "name": "candidate",
                      "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint",
                      "desc": "A possible prime encoded as a sequence of big endian octets of arbitrary length."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`checks` {number} The number of Miller-Rabin probabilistic primality iterations to perform. When the value is `0` (zero), a number of checks is used that yields a false positive rate of at most 2<sup>-64</sup> for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the `BN_is_prime_ex` function `nchecks` options for more details. **Default:** `0`",
                          "name": "checks",
                          "type": "number",
                          "default": "`0`",
                          "desc": "The number of Miller-Rabin probabilistic primality iterations to perform. When the value is `0` (zero), a number of checks is used that yields a false positive rate of at most 2<sup>-64</sup> for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the `BN_is_prime_ex` function `nchecks` options for more details."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error} Set to an {Error} object if an error occurred during check.",
                          "name": "err",
                          "type": "Error",
                          "desc": "Set to an {Error} object if an error occurred during check."
                        },
                        {
                          "textRaw": "`result` {boolean} `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.",
                          "name": "result",
                          "type": "boolean",
                          "desc": "`true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Checks the primality of the <code>candidate</code>.</p>"
            },
            {
              "textRaw": "`crypto.checkPrimeSync(candidate[, options])`",
              "name": "checkPrimeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v15.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`candidate` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint} A possible prime encoded as a sequence of big endian octets of arbitrary length.",
                      "name": "candidate",
                      "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint",
                      "desc": "A possible prime encoded as a sequence of big endian octets of arbitrary length."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`checks` {number} The number of Miller-Rabin probabilistic primality iterations to perform. When the value is `0` (zero), a number of checks is used that yields a false positive rate of at most 2<sup>-64</sup> for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the `BN_is_prime_ex` function `nchecks` options for more details. **Default:** `0`",
                          "name": "checks",
                          "type": "number",
                          "default": "`0`",
                          "desc": "The number of Miller-Rabin probabilistic primality iterations to perform. When the value is `0` (zero), a number of checks is used that yields a false positive rate of at most 2<sup>-64</sup> for random input. Care must be used when selecting a number of checks. Refer to the OpenSSL documentation for the `BN_is_prime_ex` function `nchecks` options for more details."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if the candidate is a prime with an error probability less than `0.25 ** options.checks`."
                  }
                }
              ],
              "desc": "<p>Checks the primality of the <code>candidate</code>.</p>"
            },
            {
              "textRaw": "`crypto.createCipheriv(algorithm, key, iv[, options])`",
              "name": "createCipheriv",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": [
                      "v17.9.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42427",
                    "description": "The `authTagLength` option is now optional when using the `chacha20-poly1305` cipher and defaults to 16 bytes."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The password and iv arguments can be an ArrayBuffer and are each limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `key` argument can now be a `KeyObject`."
                  },
                  {
                    "version": [
                      "v11.2.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/24081",
                    "description": "The cipher `chacha20-poly1305` (the IETF variant of ChaCha20-Poly1305) is now supported."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21447",
                    "description": "Ciphers in OCB mode are now supported."
                  },
                  {
                    "version": "v10.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20235",
                    "description": "The `authTagLength` option can now be used to produce shorter authentication tags in GCM mode and defaults to 16 bytes."
                  },
                  {
                    "version": "v9.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18644",
                    "description": "The `iv` parameter may now be `null` for ciphers which do not need an initialization vector."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`iv` {string|ArrayBuffer|Buffer|TypedArray|DataView|null}",
                      "name": "iv",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|null"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Cipheriv}",
                    "name": "return",
                    "type": "Cipheriv"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Cipheriv</code> object, with the given <code>algorithm</code>, <code>key</code> and\ninitialization vector (<code>iv</code>).</p>\n<p>The <code>options</code> argument controls stream behavior and is optional except when a\ncipher in CCM or OCB mode (e.g. <code>'aes-128-ccm'</code>) is used. In that case, the\n<code>authTagLength</code> option is required and specifies the length of the\nauthentication tag in bytes, see <a href=\"#ccm-mode\">CCM mode</a>. In GCM mode, the <code>authTagLength</code>\noption is not required but can be used to set the length of the authentication\ntag that will be returned by <code>getAuthTag()</code> and defaults to 16 bytes.\nFor <code>chacha20-poly1305</code>, the <code>authTagLength</code> option defaults to 16 bytes.</p>\n<p>The <code>algorithm</code> is dependent on OpenSSL, examples are <code>'aes192'</code>, etc. On\nrecent OpenSSL releases, <code>openssl list -cipher-algorithms</code> will\ndisplay the available cipher algorithms.</p>\n<p>The <code>key</code> is the raw key used by the <code>algorithm</code> and <code>iv</code> is an\n<a href=\"https://en.wikipedia.org/wiki/Initialization_vector\">initialization vector</a>. Both arguments must be <code>'utf8'</code> encoded strings,\n<a href=\"buffer.html\">Buffers</a>, <code>TypedArray</code>, or <code>DataView</code>s. The <code>key</code> may optionally be\na <a href=\"#class-keyobject\"><code>KeyObject</code></a> of type <code>secret</code>. If the cipher does not need\nan initialization vector, <code>iv</code> may be <code>null</code>.</p>\n<p>When passing strings for <code>key</code> or <code>iv</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>Initialization vectors should be unpredictable and unique; ideally, they will be\ncryptographically random. They do not have to be secret: IVs are typically just\nadded to ciphertext messages unencrypted. It may sound contradictory that\nsomething has to be unpredictable and unique, but does not have to be secret;\nremember that an attacker must not be able to predict ahead of time what a\ngiven IV will be.</p>"
            },
            {
              "textRaw": "`crypto.createDecipheriv(algorithm, key, iv[, options])`",
              "name": "createDecipheriv",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": [
                      "v17.9.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42427",
                    "description": "The `authTagLength` option is now optional when using the `chacha20-poly1305` cipher and defaults to 16 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `key` argument can now be a `KeyObject`."
                  },
                  {
                    "version": [
                      "v11.2.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/24081",
                    "description": "The cipher `chacha20-poly1305` (the IETF variant of ChaCha20-Poly1305) is now supported."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21447",
                    "description": "Ciphers in OCB mode are now supported."
                  },
                  {
                    "version": "v10.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20039",
                    "description": "The `authTagLength` option can now be used to restrict accepted GCM authentication tag lengths."
                  },
                  {
                    "version": "v9.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18644",
                    "description": "The `iv` parameter may now be `null` for ciphers which do not need an initialization vector."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`iv` {string|ArrayBuffer|Buffer|TypedArray|DataView|null}",
                      "name": "iv",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|null"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Decipheriv}",
                    "name": "return",
                    "type": "Decipheriv"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Decipheriv</code> object that uses the given <code>algorithm</code>, <code>key</code>\nand initialization vector (<code>iv</code>).</p>\n<p>The <code>options</code> argument controls stream behavior and is optional except when a\ncipher in CCM or OCB mode (e.g. <code>'aes-128-ccm'</code>) is used. In that case, the\n<code>authTagLength</code> option is required and specifies the length of the\nauthentication tag in bytes, see <a href=\"#ccm-mode\">CCM mode</a>.\nFor AES-GCM and <code>chacha20-poly1305</code>, the <code>authTagLength</code> option defaults to 16\nbytes and must be set to a different value if a different length is used.</p>\n<p>The <code>algorithm</code> is dependent on OpenSSL, examples are <code>'aes192'</code>, etc. On\nrecent OpenSSL releases, <code>openssl list -cipher-algorithms</code> will\ndisplay the available cipher algorithms.</p>\n<p>The <code>key</code> is the raw key used by the <code>algorithm</code> and <code>iv</code> is an\n<a href=\"https://en.wikipedia.org/wiki/Initialization_vector\">initialization vector</a>. Both arguments must be <code>'utf8'</code> encoded strings,\n<a href=\"buffer.html\">Buffers</a>, <code>TypedArray</code>, or <code>DataView</code>s. The <code>key</code> may optionally be\na <a href=\"#class-keyobject\"><code>KeyObject</code></a> of type <code>secret</code>. If the cipher does not need\nan initialization vector, <code>iv</code> may be <code>null</code>.</p>\n<p>When passing strings for <code>key</code> or <code>iv</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>Initialization vectors should be unpredictable and unique; ideally, they will be\ncryptographically random. They do not have to be secret: IVs are typically just\nadded to ciphertext messages unencrypted. It may sound contradictory that\nsomething has to be unpredictable and unique, but does not have to be secret;\nremember that an attacker must not be able to predict ahead of time what a given\nIV will be.</p>"
            },
            {
              "textRaw": "`crypto.createDiffieHellman(prime[, primeEncoding][, generator][, generatorEncoding])`",
              "name": "createDiffieHellman",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `prime` argument can be any `TypedArray` or `DataView` now."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11983",
                    "description": "The `prime` argument can be a `Uint8Array` now."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default for the encoding parameters changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prime` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "prime",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`primeEncoding` {string} The encoding of the `prime` string.",
                      "name": "primeEncoding",
                      "type": "string",
                      "desc": "The encoding of the `prime` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`generator` {number|string|ArrayBuffer|Buffer|TypedArray|DataView} **Default:** `2`",
                      "name": "generator",
                      "type": "number|string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "default": "`2`",
                      "optional": true
                    },
                    {
                      "textRaw": "`generatorEncoding` {string} The encoding of the `generator` string.",
                      "name": "generatorEncoding",
                      "type": "string",
                      "desc": "The encoding of the `generator` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {DiffieHellman}",
                    "name": "return",
                    "type": "DiffieHellman"
                  }
                }
              ],
              "desc": "<p>Creates a <code>DiffieHellman</code> key exchange object using the supplied <code>prime</code> and an\noptional specific <code>generator</code>.</p>\n<p>The <code>generator</code> argument can be a number, string, or <a href=\"buffer.html\"><code>Buffer</code></a>. If\n<code>generator</code> is not specified, the value <code>2</code> is used.</p>\n<p>If <code>primeEncoding</code> is specified, <code>prime</code> is expected to be a string; otherwise\na <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code> is expected.</p>\n<p>If <code>generatorEncoding</code> is specified, <code>generator</code> is expected to be a string;\notherwise a number, <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code> is expected.</p>"
            },
            {
              "textRaw": "`crypto.createDiffieHellman(primeLength[, generator])`",
              "name": "createDiffieHellman",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`primeLength` {number}",
                      "name": "primeLength",
                      "type": "number"
                    },
                    {
                      "textRaw": "`generator` {number} **Default:** `2`",
                      "name": "generator",
                      "type": "number",
                      "default": "`2`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {DiffieHellman}",
                    "name": "return",
                    "type": "DiffieHellman"
                  }
                }
              ],
              "desc": "<p>Creates a <code>DiffieHellman</code> key exchange object and generates a prime of\n<code>primeLength</code> bits using an optional specific numeric <code>generator</code>.\nIf <code>generator</code> is not specified, the value <code>2</code> is used.</p>"
            },
            {
              "textRaw": "`crypto.createDiffieHellmanGroup(name)`",
              "name": "createDiffieHellmanGroup",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {DiffieHellmanGroup}",
                    "name": "return",
                    "type": "DiffieHellmanGroup"
                  }
                }
              ],
              "desc": "<p>An alias for <a href=\"#cryptogetdiffiehellmangroupname\"><code>crypto.getDiffieHellman()</code></a></p>"
            },
            {
              "textRaw": "`crypto.createECDH(curveName)`",
              "name": "createECDH",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`curveName` {string}",
                      "name": "curveName",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ECDH}",
                    "name": "return",
                    "type": "ECDH"
                  }
                }
              ],
              "desc": "<p>Creates an Elliptic Curve Diffie-Hellman (<code>ECDH</code>) key exchange object using a\npredefined curve specified by the <code>curveName</code> string. Use\n<a href=\"#cryptogetcurves\"><code>crypto.getCurves()</code></a> to obtain a list of available curve names. On recent\nOpenSSL releases, <code>openssl ecparam -list_curves</code> will also display the name\nand description of each available elliptic curve.</p>"
            },
            {
              "textRaw": "`crypto.createHash(algorithm[, options])`",
              "name": "createHash",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v12.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28805",
                    "description": "The `outputLength` option was added for XOF hash functions."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Hash}",
                    "name": "return",
                    "type": "Hash"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Hash</code> object that can be used to generate hash digests\nusing the given <code>algorithm</code>. Optional <code>options</code> argument controls stream\nbehavior. For XOF hash functions such as <code>'shake256'</code>, the <code>outputLength</code> option\ncan be used to specify the desired output length in bytes.</p>\n<p>The <code>algorithm</code> is dependent on the available algorithms supported by the\nversion of OpenSSL on the platform. Examples are <code>'sha256'</code>, <code>'sha512'</code>, etc.\nOn recent releases of OpenSSL, <code>openssl list -digest-algorithms</code> will\ndisplay the available digest algorithms.</p>\n<p>Example: generating the sha256 sum of a file</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n} from 'node:fs';\nimport { argv } from 'node:process';\nconst {\n  createHash,\n} = await import('node:crypto');\n\nconst filename = argv[2];\n\nconst hash = createHash('sha256');\n\nconst input = createReadStream(filename);\ninput.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = input.read();\n  if (data)\n    hash.update(data);\n  else {\n    console.log(`${hash.digest('hex')} ${filename}`);\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n} = require('node:fs');\nconst {\n  createHash,\n} = require('node:crypto');\nconst { argv } = require('node:process');\n\nconst filename = argv[2];\n\nconst hash = createHash('sha256');\n\nconst input = createReadStream(filename);\ninput.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = input.read();\n  if (data)\n    hash.update(data);\n  else {\n    console.log(`${hash.digest('hex')} ${filename}`);\n  }\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.createHmac(algorithm, key[, options])`",
              "name": "createHmac",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer or CryptoKey. The encoding option was added. The key cannot contain more than 2 ** 32 - 1 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `key` argument can now be a `KeyObject`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `key` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `key` is a string."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Hmac}",
                    "name": "return",
                    "type": "Hmac"
                  }
                }
              ],
              "desc": "<p>Creates and returns an <code>Hmac</code> object that uses the given <code>algorithm</code> and <code>key</code>.\nOptional <code>options</code> argument controls stream behavior.</p>\n<p>The <code>algorithm</code> is dependent on the available algorithms supported by the\nversion of OpenSSL on the platform. Examples are <code>'sha256'</code>, <code>'sha512'</code>, etc.\nOn recent releases of OpenSSL, <code>openssl list -digest-algorithms</code> will\ndisplay the available digest algorithms.</p>\n<p>The <code>key</code> is the HMAC key used to generate the cryptographic HMAC hash. If it is\na <a href=\"#class-keyobject\"><code>KeyObject</code></a>, its type must be <code>secret</code>. If it is a string, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>. If it was\nobtained from a cryptographically secure source of entropy, such as\n<a href=\"#cryptorandombytessize-callback\"><code>crypto.randomBytes()</code></a> or <a href=\"#cryptogeneratekeytype-options-callback\"><code>crypto.generateKey()</code></a>, its length should not\nexceed the block size of <code>algorithm</code> (e.g., 512 bits for SHA-256).</p>\n<p>Example: generating the sha256 HMAC of a file</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n} from 'node:fs';\nimport { argv } from 'node:process';\nconst {\n  createHmac,\n} = await import('node:crypto');\n\nconst filename = argv[2];\n\nconst hmac = createHmac('sha256', 'a secret');\n\nconst input = createReadStream(filename);\ninput.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = input.read();\n  if (data)\n    hmac.update(data);\n  else {\n    console.log(`${hmac.digest('hex')} ${filename}`);\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n} = require('node:fs');\nconst {\n  createHmac,\n} = require('node:crypto');\nconst { argv } = require('node:process');\n\nconst filename = argv[2];\n\nconst hmac = createHmac('sha256', 'a secret');\n\nconst input = createReadStream(filename);\ninput.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = input.read();\n  if (data)\n    hmac.update(data);\n  else {\n    console.log(`${hmac.digest('hex')} ${filename}`);\n  }\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.createPrivateKey(key)`",
              "name": "createPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62706",
                    "description": "Added JWK format support for ML-KEM and SLH-DSA key types."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62240",
                    "description": "Added support for `'raw-private'` and `'raw-seed'` formats."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA keys."
                  },
                  {
                    "version": "v15.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37254",
                    "description": "The key can also be a JWK object."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer. The encoding option was added. The key cannot contain more than 2 ** 32 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "options": [
                        {
                          "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|Object} The key material, either in PEM, DER, JWK, or raw format.",
                          "name": "key",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|Object",
                          "desc": "The key material, either in PEM, DER, JWK, or raw format."
                        },
                        {
                          "textRaw": "`format` {string} Must be `'pem'`, `'der'`, `'jwk'`, `'raw-private'`, or `'raw-seed'`. **Default:** `'pem'`.",
                          "name": "format",
                          "type": "string",
                          "default": "`'pem'`",
                          "desc": "Must be `'pem'`, `'der'`, `'jwk'`, `'raw-private'`, or `'raw-seed'`."
                        },
                        {
                          "textRaw": "`type` {string} Must be `'pkcs1'`, `'pkcs8'` or `'sec1'`. This option is required only if the `format` is `'der'` and ignored otherwise.",
                          "name": "type",
                          "type": "string",
                          "desc": "Must be `'pkcs1'`, `'pkcs8'` or `'sec1'`. This option is required only if the `format` is `'der'` and ignored otherwise."
                        },
                        {
                          "textRaw": "`passphrase` {string|Buffer} The passphrase to use for decryption.",
                          "name": "passphrase",
                          "type": "string|Buffer",
                          "desc": "The passphrase to use for decryption."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `key` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `key` is a string."
                        },
                        {
                          "textRaw": "`asymmetricKeyType` {string} Required when `format` is `'raw-private'` or `'raw-seed'` and ignored otherwise. Must be a supported key type.",
                          "name": "asymmetricKeyType",
                          "type": "string",
                          "desc": "Required when `format` is `'raw-private'` or `'raw-seed'` and ignored otherwise. Must be a supported key type."
                        },
                        {
                          "textRaw": "`namedCurve` {string} Name of the curve to use. Required when `asymmetricKeyType` is `'ec'` and ignored otherwise.",
                          "name": "namedCurve",
                          "type": "string",
                          "desc": "Name of the curve to use. Required when `asymmetricKeyType` is `'ec'` and ignored otherwise."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Creates and returns a new key object containing a private key. If <code>key</code> is a\nstring or <code>Buffer</code>, <code>format</code> is assumed to be <code>'pem'</code>; otherwise, <code>key</code>\nmust be an object with the properties described above.</p>\n<p>If the private key is encrypted, a <code>passphrase</code> must be specified. The length\nof the passphrase is limited to 1024 bytes.</p>"
            },
            {
              "textRaw": "`crypto.createPublicKey(key)`",
              "name": "createPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62706",
                    "description": "Added JWK format support for ML-KEM and SLH-DSA key types."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a CryptoKey as `key` is deprecated."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62240",
                    "description": "Added support for `'raw-public'` format."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA keys."
                  },
                  {
                    "version": "v15.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37254",
                    "description": "The key can also be a JWK object."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer. The encoding option was added. The key cannot contain more than 2 ** 32 - 1 bytes."
                  },
                  {
                    "version": "v11.13.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26278",
                    "description": "The `key` argument can now be a `KeyObject` with type `private`."
                  },
                  {
                    "version": "v11.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25217",
                    "description": "The `key` argument can now be a private key."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "options": [
                        {
                          "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|Object} The key material, either in PEM, DER, JWK, or raw format.",
                          "name": "key",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|Object",
                          "desc": "The key material, either in PEM, DER, JWK, or raw format."
                        },
                        {
                          "textRaw": "`format` {string} Must be `'pem'`, `'der'`, `'jwk'`, or `'raw-public'`. **Default:** `'pem'`.",
                          "name": "format",
                          "type": "string",
                          "default": "`'pem'`",
                          "desc": "Must be `'pem'`, `'der'`, `'jwk'`, or `'raw-public'`."
                        },
                        {
                          "textRaw": "`type` {string} Must be `'pkcs1'` or `'spki'`. This option is required only if the `format` is `'der'` and ignored otherwise.",
                          "name": "type",
                          "type": "string",
                          "desc": "Must be `'pkcs1'` or `'spki'`. This option is required only if the `format` is `'der'` and ignored otherwise."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `key` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `key` is a string."
                        },
                        {
                          "textRaw": "`asymmetricKeyType` {string} Required when `format` is `'raw-public'` and ignored otherwise. Must be a supported key type.",
                          "name": "asymmetricKeyType",
                          "type": "string",
                          "desc": "Required when `format` is `'raw-public'` and ignored otherwise. Must be a supported key type."
                        },
                        {
                          "textRaw": "`namedCurve` {string} Name of the curve to use. Required when `asymmetricKeyType` is `'ec'` and ignored otherwise.",
                          "name": "namedCurve",
                          "type": "string",
                          "desc": "Name of the curve to use. Required when `asymmetricKeyType` is `'ec'` and ignored otherwise."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Creates and returns a new key object containing a public key. If <code>key</code> is a\nstring or <code>Buffer</code>, <code>format</code> is assumed to be <code>'pem'</code>; if <code>key</code> is a <code>KeyObject</code>\nwith type <code>'private'</code>, the public key is derived from the given private key;\notherwise, <code>key</code> must be an object with the properties described above.</p>\n<p>If the format is <code>'pem'</code>, the <code>'key'</code> may also be an X.509 certificate.</p>\n<p>Because public keys can be derived from private keys, a private key may be\npassed instead of a public key. In that case, this function behaves as if\n<a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a> had been called, except that the type of the\nreturned <code>KeyObject</code> will be <code>'public'</code> and that the private key cannot be\nextracted from the returned <code>KeyObject</code>. Similarly, if a <code>KeyObject</code> with type\n<code>'private'</code> is given, a new <code>KeyObject</code> with type <code>'public'</code> will be returned\nand it will be impossible to extract the private key from the returned object.</p>"
            },
            {
              "textRaw": "`crypto.createSecretKey(key[, encoding])`",
              "name": "createSecretKey",
              "type": "method",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44201",
                    "description": "The key can now be zero-length."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer or string. The encoding argument was added. The key cannot contain more than 2 ** 32 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The string encoding when `key` is a string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The string encoding when `key` is a string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Creates and returns a new key object containing a secret key for symmetric\nencryption or <code>Hmac</code>.</p>"
            },
            {
              "textRaw": "`crypto.createSign(algorithm[, options])`",
              "name": "createSign",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.Writable` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.Writable` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Sign}",
                    "name": "return",
                    "type": "Sign"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Sign</code> object that uses the given <code>algorithm</code>. Use\n<a href=\"#cryptogethashes\"><code>crypto.getHashes()</code></a> to obtain the names of the available digest algorithms.\nOptional <code>options</code> argument controls the <code>stream.Writable</code> behavior.</p>\n<p>In some cases, a <code>Sign</code> instance can be created using the name of a signature\nalgorithm, such as <code>'RSA-SHA256'</code>, instead of a digest algorithm. This will use\nthe corresponding digest algorithm. This does not work for all signature\nalgorithms, such as <code>'ecdsa-with-SHA256'</code>, so it is best to always use digest\nalgorithm names.</p>"
            },
            {
              "textRaw": "`crypto.createVerify(algorithm[, options])`",
              "name": "createVerify",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string}",
                      "name": "algorithm",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.Writable` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.Writable` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Verify}",
                    "name": "return",
                    "type": "Verify"
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Verify</code> object that uses the given algorithm.\nUse <a href=\"#cryptogethashes\"><code>crypto.getHashes()</code></a> to obtain an array of names of the available\nsigning algorithms. Optional <code>options</code> argument controls the\n<code>stream.Writable</code> behavior.</p>\n<p>In some cases, a <code>Verify</code> instance can be created using the name of a signature\nalgorithm, such as <code>'RSA-SHA256'</code>, instead of a digest algorithm. This will use\nthe corresponding digest algorithm. This does not work for all signature\nalgorithms, such as <code>'ecdsa-with-SHA256'</code>, so it is best to always use digest\nalgorithm names.</p>"
            },
            {
              "textRaw": "`crypto.decapsulate(key, ciphertext[, callback])`",
              "name": "decapsulate",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} Private Key",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject",
                      "desc": "Private Key"
                    },
                    {
                      "textRaw": "`ciphertext` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "ciphertext",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`sharedKey` {Buffer}",
                          "name": "sharedKey",
                          "type": "Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Key decapsulation using a KEM algorithm with a private key.</p>\n<p>Supported key types and their KEM algorithms are:</p>\n<ul>\n<li><code>'rsa'</code><sup><a href=\"#user-content-fn-openssl30\" id=\"user-content-fnref-openssl30\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup> RSA Secret Value Encapsulation</li>\n<li><code>'ec'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)</li>\n<li><code>'x25519'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(X25519, HKDF-SHA256)</li>\n<li><code>'x448'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(X448, HKDF-SHA512)</li>\n<li><code>'ml-kem-512'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n<li><code>'ml-kem-768'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-2\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n<li><code>'ml-kem-1024'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-3\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n</ul>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>.</p>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            },
            {
              "textRaw": "`crypto.diffieHellman(options[, callback])`",
              "name": "diffieHellman",
              "type": "method",
              "meta": {
                "added": [
                  "v13.9.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62527",
                    "description": "Accept key data in addition to KeyObject instances."
                  },
                  {
                    "version": "v23.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/57274",
                    "description": "Optional callback argument added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`privateKey` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject}",
                          "name": "privateKey",
                          "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject"
                        },
                        {
                          "textRaw": "`publicKey` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject}",
                          "name": "publicKey",
                          "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject"
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`secret` {Buffer}",
                          "name": "secret",
                          "type": "Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Computes the Diffie-Hellman shared secret based on a <code>privateKey</code> and a <code>publicKey</code>.\nBoth keys must represent the same asymmetric key type and must support either the DH or\nECDH operation.</p>\n<p>If <code>options.privateKey</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>options.privateKey</code> had been passed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>.</p>\n<p>If <code>options.publicKey</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>options.publicKey</code> had been passed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>.</p>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            },
            {
              "textRaw": "`crypto.encapsulate(key[, callback])`",
              "name": "encapsulate",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} Public Key",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject",
                      "desc": "Public Key"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`result` {Object}",
                          "name": "result",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`sharedKey` {Buffer}",
                              "name": "sharedKey",
                              "type": "Buffer"
                            },
                            {
                              "textRaw": "`ciphertext` {Buffer}",
                              "name": "ciphertext",
                              "type": "Buffer"
                            }
                          ]
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Object",
                    "desc": "if the `callback` function is not provided.",
                    "options": [
                      {
                        "textRaw": "`sharedKey` {Buffer}",
                        "name": "sharedKey",
                        "type": "Buffer"
                      },
                      {
                        "textRaw": "`ciphertext` {Buffer}",
                        "name": "ciphertext",
                        "type": "Buffer"
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Key encapsulation using a KEM algorithm with a public key.</p>\n<p>Supported key types and their KEM algorithms are:</p>\n<ul>\n<li><code>'rsa'</code><sup><a href=\"#user-content-fn-openssl30\" id=\"user-content-fnref-openssl30\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup> RSA Secret Value Encapsulation</li>\n<li><code>'ec'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(P-256, HKDF-SHA256), DHKEM(P-384, HKDF-SHA256), DHKEM(P-521, HKDF-SHA256)</li>\n<li><code>'x25519'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(X25519, HKDF-SHA256)</li>\n<li><code>'x448'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup> DHKEM(X448, HKDF-SHA512)</li>\n<li><code>'ml-kem-512'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n<li><code>'ml-kem-768'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-2\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n<li><code>'ml-kem-1024'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-3\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup> ML-KEM</li>\n</ul>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>.</p>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            },
            {
              "textRaw": "`crypto.generateKey(type, options, callback)`",
              "name": "generateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`length` {number} The bit length of the key to generate. This must be a value greater than 0.If `type` is `'hmac'`, the minimum is 8, and the maximum length is 2<sup>31</sup>-1. If the value is not a multiple of 8, the generated key will be truncated to `Math.floor(length / 8)`.If `type` is `'aes'`, the length must be one of `128`, `192`, or `256`.",
                          "name": "length",
                          "type": "number",
                          "desc": "The bit length of the key to generate. This must be a value greater than 0.If `type` is `'hmac'`, the minimum is 8, and the maximum length is 2<sup>31</sup>-1. If the value is not a multiple of 8, the generated key will be truncated to `Math.floor(length / 8)`.If `type` is `'aes'`, the length must be one of `128`, `192`, or `256`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`key` {KeyObject}",
                          "name": "key",
                          "type": "KeyObject"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously generates a new random secret key of the given <code>length</code>. The\n<code>type</code> will determine which validations will be performed on the <code>length</code>.</p>\n<pre><code class=\"language-mjs\">const {\n  generateKey,\n} = await import('node:crypto');\n\ngenerateKey('hmac', { length: 512 }, (err, key) => {\n  if (err) throw err;\n  console.log(key.export().toString('hex'));  // 46e..........620\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKey,\n} = require('node:crypto');\n\ngenerateKey('hmac', { length: 512 }, (err, key) => {\n  if (err) throw err;\n  console.log(key.export().toString('hex'));  // 46e..........620\n});\n</code></pre>\n<p>The size of a generated HMAC key should not exceed the block size of the\nunderlying hash function. See <a href=\"#cryptocreatehmacalgorithm-key-options\"><code>crypto.createHmac()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`crypto.generateKeyPair(type, options, callback)`",
              "name": "generateKeyPair",
              "type": "method",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA key pairs."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59461",
                    "description": "Add support for ML-KEM key pairs."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA key pairs."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39927",
                    "description": "Add ability to define `RSASSA-PSS-params` sequence parameters for RSA-PSS keys pairs."
                  },
                  {
                    "version": [
                      "v13.9.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31178",
                    "description": "Add support for Diffie-Hellman."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "Add support for RSA-PSS key pairs."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26774",
                    "description": "Add ability to generate X25519 and X448 key pairs."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26554",
                    "description": "Add ability to generate Ed25519 and Ed448 key pairs."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `generateKeyPair` and `generateKeyPairSync` functions now produce key objects if no encoding was specified."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} The asymmetric key type to generate. See the supported asymmetric key types.",
                      "name": "type",
                      "type": "string",
                      "desc": "The asymmetric key type to generate. See the supported asymmetric key types."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`modulusLength` {number} Key size in bits (RSA, DSA).",
                          "name": "modulusLength",
                          "type": "number",
                          "desc": "Key size in bits (RSA, DSA)."
                        },
                        {
                          "textRaw": "`publicExponent` {number} Public exponent (RSA). **Default:** `0x10001`.",
                          "name": "publicExponent",
                          "type": "number",
                          "default": "`0x10001`",
                          "desc": "Public exponent (RSA)."
                        },
                        {
                          "textRaw": "`hashAlgorithm` {string} Name of the message digest (RSA-PSS).",
                          "name": "hashAlgorithm",
                          "type": "string",
                          "desc": "Name of the message digest (RSA-PSS)."
                        },
                        {
                          "textRaw": "`mgf1HashAlgorithm` {string} Name of the message digest used by MGF1 (RSA-PSS).",
                          "name": "mgf1HashAlgorithm",
                          "type": "string",
                          "desc": "Name of the message digest used by MGF1 (RSA-PSS)."
                        },
                        {
                          "textRaw": "`saltLength` {number} Minimal salt length in bytes (RSA-PSS).",
                          "name": "saltLength",
                          "type": "number",
                          "desc": "Minimal salt length in bytes (RSA-PSS)."
                        },
                        {
                          "textRaw": "`divisorLength` {number} Size of `q` in bits (DSA).",
                          "name": "divisorLength",
                          "type": "number",
                          "desc": "Size of `q` in bits (DSA)."
                        },
                        {
                          "textRaw": "`namedCurve` {string} Name of the curve to use (EC).",
                          "name": "namedCurve",
                          "type": "string",
                          "desc": "Name of the curve to use (EC)."
                        },
                        {
                          "textRaw": "`prime` {Buffer} The prime parameter (DH).",
                          "name": "prime",
                          "type": "Buffer",
                          "desc": "The prime parameter (DH)."
                        },
                        {
                          "textRaw": "`primeLength` {number} Prime length in bits (DH).",
                          "name": "primeLength",
                          "type": "number",
                          "desc": "Prime length in bits (DH)."
                        },
                        {
                          "textRaw": "`generator` {number} Custom generator (DH). **Default:** `2`.",
                          "name": "generator",
                          "type": "number",
                          "default": "`2`",
                          "desc": "Custom generator (DH)."
                        },
                        {
                          "textRaw": "`groupName` {string} Diffie-Hellman group name (DH). See `crypto.getDiffieHellman()`.",
                          "name": "groupName",
                          "type": "string",
                          "desc": "Diffie-Hellman group name (DH). See `crypto.getDiffieHellman()`."
                        },
                        {
                          "textRaw": "`paramEncoding` {string} Must be `'named'` or `'explicit'` (EC). **Default:** `'named'`.",
                          "name": "paramEncoding",
                          "type": "string",
                          "default": "`'named'`",
                          "desc": "Must be `'named'` or `'explicit'` (EC)."
                        },
                        {
                          "textRaw": "`publicKeyEncoding` {Object} See `keyObject.export()`.",
                          "name": "publicKeyEncoding",
                          "type": "Object",
                          "desc": "See `keyObject.export()`."
                        },
                        {
                          "textRaw": "`privateKeyEncoding` {Object} See `keyObject.export()`.",
                          "name": "privateKeyEncoding",
                          "type": "Object",
                          "desc": "See `keyObject.export()`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`publicKey` {string|Buffer|KeyObject}",
                          "name": "publicKey",
                          "type": "string|Buffer|KeyObject"
                        },
                        {
                          "textRaw": "`privateKey` {string|Buffer|KeyObject}",
                          "name": "privateKey",
                          "type": "string|Buffer|KeyObject"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Generates a new asymmetric key pair of the given <code>type</code>. See the\nsupported <a href=\"#asymmetric-key-types\">asymmetric key types</a>.</p>\n<p>If a <code>publicKeyEncoding</code> or <code>privateKeyEncoding</code> was specified, this function\nbehaves as if <a href=\"#keyobjectexportoptions\"><code>keyObject.export()</code></a> had been called on its result. Otherwise,\nthe respective part of the key is returned as a <a href=\"#class-keyobject\"><code>KeyObject</code></a>.</p>\n<p>It is recommended to encode public keys as <code>'spki'</code> and private keys as\n<code>'pkcs8'</code> with encryption for long-term storage:</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeyPair,\n} = await import('node:crypto');\n\ngenerateKeyPair('rsa', {\n  modulusLength: 4096,\n  publicKeyEncoding: {\n    type: 'spki',\n    format: 'pem',\n  },\n  privateKeyEncoding: {\n    type: 'pkcs8',\n    format: 'pem',\n    cipher: 'aes-256-cbc',\n    passphrase: 'top secret',\n  },\n}, (err, publicKey, privateKey) => {\n  // Handle errors and use the generated key pair.\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeyPair,\n} = require('node:crypto');\n\ngenerateKeyPair('rsa', {\n  modulusLength: 4096,\n  publicKeyEncoding: {\n    type: 'spki',\n    format: 'pem',\n  },\n  privateKeyEncoding: {\n    type: 'pkcs8',\n    format: 'pem',\n    cipher: 'aes-256-cbc',\n    passphrase: 'top secret',\n  },\n}, (err, publicKey, privateKey) => {\n  // Handle errors and use the generated key pair.\n});\n</code></pre>\n<p>On completion, <code>callback</code> will be called with <code>err</code> set to <code>undefined</code> and\n<code>publicKey</code> / <code>privateKey</code> representing the generated key pair.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na <code>Promise</code> for an <code>Object</code> with <code>publicKey</code> and <code>privateKey</code> properties.</p>"
            },
            {
              "textRaw": "`crypto.generateKeyPairSync(type, options)`",
              "name": "generateKeyPairSync",
              "type": "method",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA key pairs."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59461",
                    "description": "Add support for ML-KEM key pairs."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA key pairs."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39927",
                    "description": "Add ability to define `RSASSA-PSS-params` sequence parameters for RSA-PSS keys pairs."
                  },
                  {
                    "version": [
                      "v13.9.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31178",
                    "description": "Add support for Diffie-Hellman."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "Add support for RSA-PSS key pairs."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26774",
                    "description": "Add ability to generate X25519 and X448 key pairs."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26554",
                    "description": "Add ability to generate Ed25519 and Ed448 key pairs."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "The `generateKeyPair` and `generateKeyPairSync` functions now produce key objects if no encoding was specified."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} The asymmetric key type to generate. See the supported asymmetric key types.",
                      "name": "type",
                      "type": "string",
                      "desc": "The asymmetric key type to generate. See the supported asymmetric key types."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`modulusLength` {number} Key size in bits (RSA, DSA).",
                          "name": "modulusLength",
                          "type": "number",
                          "desc": "Key size in bits (RSA, DSA)."
                        },
                        {
                          "textRaw": "`publicExponent` {number} Public exponent (RSA). **Default:** `0x10001`.",
                          "name": "publicExponent",
                          "type": "number",
                          "default": "`0x10001`",
                          "desc": "Public exponent (RSA)."
                        },
                        {
                          "textRaw": "`hashAlgorithm` {string} Name of the message digest (RSA-PSS).",
                          "name": "hashAlgorithm",
                          "type": "string",
                          "desc": "Name of the message digest (RSA-PSS)."
                        },
                        {
                          "textRaw": "`mgf1HashAlgorithm` {string} Name of the message digest used by MGF1 (RSA-PSS).",
                          "name": "mgf1HashAlgorithm",
                          "type": "string",
                          "desc": "Name of the message digest used by MGF1 (RSA-PSS)."
                        },
                        {
                          "textRaw": "`saltLength` {number} Minimal salt length in bytes (RSA-PSS).",
                          "name": "saltLength",
                          "type": "number",
                          "desc": "Minimal salt length in bytes (RSA-PSS)."
                        },
                        {
                          "textRaw": "`divisorLength` {number} Size of `q` in bits (DSA).",
                          "name": "divisorLength",
                          "type": "number",
                          "desc": "Size of `q` in bits (DSA)."
                        },
                        {
                          "textRaw": "`namedCurve` {string} Name of the curve to use (EC).",
                          "name": "namedCurve",
                          "type": "string",
                          "desc": "Name of the curve to use (EC)."
                        },
                        {
                          "textRaw": "`prime` {Buffer} The prime parameter (DH).",
                          "name": "prime",
                          "type": "Buffer",
                          "desc": "The prime parameter (DH)."
                        },
                        {
                          "textRaw": "`primeLength` {number} Prime length in bits (DH).",
                          "name": "primeLength",
                          "type": "number",
                          "desc": "Prime length in bits (DH)."
                        },
                        {
                          "textRaw": "`generator` {number} Custom generator (DH). **Default:** `2`.",
                          "name": "generator",
                          "type": "number",
                          "default": "`2`",
                          "desc": "Custom generator (DH)."
                        },
                        {
                          "textRaw": "`groupName` {string} Diffie-Hellman group name (DH). See `crypto.getDiffieHellman()`.",
                          "name": "groupName",
                          "type": "string",
                          "desc": "Diffie-Hellman group name (DH). See `crypto.getDiffieHellman()`."
                        },
                        {
                          "textRaw": "`paramEncoding` {string} Must be `'named'` or `'explicit'` (EC). **Default:** `'named'`.",
                          "name": "paramEncoding",
                          "type": "string",
                          "default": "`'named'`",
                          "desc": "Must be `'named'` or `'explicit'` (EC)."
                        },
                        {
                          "textRaw": "`publicKeyEncoding` {Object} See `keyObject.export()`.",
                          "name": "publicKeyEncoding",
                          "type": "Object",
                          "desc": "See `keyObject.export()`."
                        },
                        {
                          "textRaw": "`privateKeyEncoding` {Object} See `keyObject.export()`.",
                          "name": "privateKeyEncoding",
                          "type": "Object",
                          "desc": "See `keyObject.export()`."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`publicKey` {string|Buffer|KeyObject}",
                        "name": "publicKey",
                        "type": "string|Buffer|KeyObject"
                      },
                      {
                        "textRaw": "`privateKey` {string|Buffer|KeyObject}",
                        "name": "privateKey",
                        "type": "string|Buffer|KeyObject"
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Generates a new asymmetric key pair of the given <code>type</code>. See the\nsupported <a href=\"#asymmetric-key-types\">asymmetric key types</a>.</p>\n<p>If a <code>publicKeyEncoding</code> or <code>privateKeyEncoding</code> was specified, this function\nbehaves as if <a href=\"#keyobjectexportoptions\"><code>keyObject.export()</code></a> had been called on its result. Otherwise,\nthe respective part of the key is returned as a <a href=\"#class-keyobject\"><code>KeyObject</code></a>.</p>\n<p>When encoding public keys, it is recommended to use <code>'spki'</code>. When encoding\nprivate keys, it is recommended to use <code>'pkcs8'</code> with a strong passphrase,\nand to keep the passphrase confidential.</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeyPairSync,\n} = await import('node:crypto');\n\nconst {\n  publicKey,\n  privateKey,\n} = generateKeyPairSync('rsa', {\n  modulusLength: 4096,\n  publicKeyEncoding: {\n    type: 'spki',\n    format: 'pem',\n  },\n  privateKeyEncoding: {\n    type: 'pkcs8',\n    format: 'pem',\n    cipher: 'aes-256-cbc',\n    passphrase: 'top secret',\n  },\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeyPairSync,\n} = require('node:crypto');\n\nconst {\n  publicKey,\n  privateKey,\n} = generateKeyPairSync('rsa', {\n  modulusLength: 4096,\n  publicKeyEncoding: {\n    type: 'spki',\n    format: 'pem',\n  },\n  privateKeyEncoding: {\n    type: 'pkcs8',\n    format: 'pem',\n    cipher: 'aes-256-cbc',\n    passphrase: 'top secret',\n  },\n});\n</code></pre>\n<p>The return value <code>{ publicKey, privateKey }</code> represents the generated key pair.\nWhen PEM encoding was selected, the respective key will be a string, otherwise\nit will be a buffer containing the data encoded as DER.</p>"
            },
            {
              "textRaw": "`crypto.generateKeySync(type, options)`",
              "name": "generateKeySync",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "The intended use of the generated secret key. Currently accepted values are `'hmac'` and `'aes'`."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`length` {number} The bit length of the key to generate.If `type` is `'hmac'`, the minimum is 8, and the maximum length is 2<sup>31</sup>-1. If the value is not a multiple of 8, the generated key will be truncated to `Math.floor(length / 8)`.If `type` is `'aes'`, the length must be one of `128`, `192`, or `256`.",
                          "name": "length",
                          "type": "number",
                          "desc": "The bit length of the key to generate.If `type` is `'hmac'`, the minimum is 8, and the maximum length is 2<sup>31</sup>-1. If the value is not a multiple of 8, the generated key will be truncated to `Math.floor(length / 8)`.If `type` is `'aes'`, the length must be one of `128`, `192`, or `256`."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Synchronously generates a new random secret key of the given <code>length</code>. The\n<code>type</code> will determine which validations will be performed on the <code>length</code>.</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeySync,\n} = await import('node:crypto');\n\nconst key = generateKeySync('hmac', { length: 512 });\nconsole.log(key.export().toString('hex'));  // e89..........41e\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeySync,\n} = require('node:crypto');\n\nconst key = generateKeySync('hmac', { length: 512 });\nconsole.log(key.export().toString('hex'));  // e89..........41e\n</code></pre>\n<p>The size of a generated HMAC key should not exceed the block size of the\nunderlying hash function. See <a href=\"#cryptocreatehmacalgorithm-key-options\"><code>crypto.createHmac()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`crypto.generatePrime(size[, options], callback)`",
              "name": "generatePrime",
              "type": "method",
              "meta": {
                "added": [
                  "v15.8.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {number} The size (in bits) of the prime to generate.",
                      "name": "size",
                      "type": "number",
                      "desc": "The size (in bits) of the prime to generate."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`add` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}",
                          "name": "add",
                          "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint"
                        },
                        {
                          "textRaw": "`rem` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}",
                          "name": "rem",
                          "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint"
                        },
                        {
                          "textRaw": "`safe` {boolean} **Default:** `false`.",
                          "name": "safe",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`bigint` {boolean} When `true`, the generated prime is returned as a `bigint`.",
                          "name": "bigint",
                          "type": "boolean",
                          "desc": "When `true`, the generated prime is returned as a `bigint`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`prime` {ArrayBuffer|bigint}",
                          "name": "prime",
                          "type": "ArrayBuffer|bigint"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Generates a pseudorandom prime of <code>size</code> bits.</p>\n<p>If <code>options.safe</code> is <code>true</code>, the prime will be a safe prime -- that is,\n<code>(prime - 1) / 2</code> will also be a prime.</p>\n<p>The <code>options.add</code> and <code>options.rem</code> parameters can be used to enforce additional\nrequirements, e.g., for Diffie-Hellman:</p>\n<ul>\n<li>If <code>options.add</code> and <code>options.rem</code> are both set, the prime will satisfy the\ncondition that <code>prime % add = rem</code>.</li>\n<li>If only <code>options.add</code> is set and <code>options.safe</code> is not <code>true</code>, the prime will\nsatisfy the condition that <code>prime % add = 1</code>.</li>\n<li>If only <code>options.add</code> is set and <code>options.safe</code> is set to <code>true</code>, the prime\nwill instead satisfy the condition that <code>prime % add = 3</code>. This is necessary\nbecause <code>prime % add = 1</code> for <code>options.add > 2</code> would contradict the condition\nenforced by <code>options.safe</code>.</li>\n<li><code>options.rem</code> is ignored if <code>options.add</code> is not given.</li>\n</ul>\n<p>Both <code>options.add</code> and <code>options.rem</code> must be encoded as big-endian sequences\nif given as an <code>ArrayBuffer</code>, <code>SharedArrayBuffer</code>, <code>TypedArray</code>, <code>Buffer</code>, or\n<code>DataView</code>.</p>\n<p>By default, the prime is encoded as a big-endian sequence of octets\nin an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>. If the <code>bigint</code> option is <code>true</code>, then a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a>\nis provided.</p>\n<p>The <code>size</code> of the prime will have a direct impact on how long it takes to\ngenerate the prime. The larger the size, the longer it will take. Because\nwe use OpenSSL's <code>BN_generate_prime_ex</code> function, which provides only\nminimal control over our ability to interrupt the generation process,\nit is not recommended to generate overly large primes, as doing so may make\nthe process unresponsive.</p>"
            },
            {
              "textRaw": "`crypto.generatePrimeSync(size[, options])`",
              "name": "generatePrimeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v15.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {number} The size (in bits) of the prime to generate.",
                      "name": "size",
                      "type": "number",
                      "desc": "The size (in bits) of the prime to generate."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`add` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}",
                          "name": "add",
                          "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint"
                        },
                        {
                          "textRaw": "`rem` {ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint}",
                          "name": "rem",
                          "type": "ArrayBuffer|SharedArrayBuffer|TypedArray|Buffer|DataView|bigint"
                        },
                        {
                          "textRaw": "`safe` {boolean} **Default:** `false`.",
                          "name": "safe",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`bigint` {boolean} When `true`, the generated prime is returned as a `bigint`.",
                          "name": "bigint",
                          "type": "boolean",
                          "desc": "When `true`, the generated prime is returned as a `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ArrayBuffer|bigint}",
                    "name": "return",
                    "type": "ArrayBuffer|bigint"
                  }
                }
              ],
              "desc": "<p>Generates a pseudorandom prime of <code>size</code> bits.</p>\n<p>If <code>options.safe</code> is <code>true</code>, the prime will be a safe prime -- that is,\n<code>(prime - 1) / 2</code> will also be a prime.</p>\n<p>The <code>options.add</code> and <code>options.rem</code> parameters can be used to enforce additional\nrequirements, e.g., for Diffie-Hellman:</p>\n<ul>\n<li>If <code>options.add</code> and <code>options.rem</code> are both set, the prime will satisfy the\ncondition that <code>prime % add = rem</code>.</li>\n<li>If only <code>options.add</code> is set and <code>options.safe</code> is not <code>true</code>, the prime will\nsatisfy the condition that <code>prime % add = 1</code>.</li>\n<li>If only <code>options.add</code> is set and <code>options.safe</code> is set to <code>true</code>, the prime\nwill instead satisfy the condition that <code>prime % add = 3</code>. This is necessary\nbecause <code>prime % add = 1</code> for <code>options.add > 2</code> would contradict the condition\nenforced by <code>options.safe</code>.</li>\n<li><code>options.rem</code> is ignored if <code>options.add</code> is not given.</li>\n</ul>\n<p>Both <code>options.add</code> and <code>options.rem</code> must be encoded as big-endian sequences\nif given as an <code>ArrayBuffer</code>, <code>SharedArrayBuffer</code>, <code>TypedArray</code>, <code>Buffer</code>, or\n<code>DataView</code>.</p>\n<p>By default, the prime is encoded as a big-endian sequence of octets\nin an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>. If the <code>bigint</code> option is <code>true</code>, then a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a>\nis provided.</p>\n<p>The <code>size</code> of the prime will have a direct impact on how long it takes to\ngenerate the prime. The larger the size, the longer it will take. Because\nwe use OpenSSL's <code>BN_generate_prime_ex</code> function, which provides only\nminimal control over our ability to interrupt the generation process,\nit is not recommended to generate overly large primes, as doing so may make\nthe process unresponsive.</p>"
            },
            {
              "textRaw": "`crypto.getCipherInfo(nameOrNid[, options])`",
              "name": "getCipherInfo",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`nameOrNid` {string|number} The name or nid of the cipher to query.",
                      "name": "nameOrNid",
                      "type": "string|number",
                      "desc": "The name or nid of the cipher to query."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`keyLength` {number} A test key length.",
                          "name": "keyLength",
                          "type": "number",
                          "desc": "A test key length."
                        },
                        {
                          "textRaw": "`ivLength` {number} A test IV length.",
                          "name": "ivLength",
                          "type": "number",
                          "desc": "A test IV length."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`name` {string} The name of the cipher",
                        "name": "name",
                        "type": "string",
                        "desc": "The name of the cipher"
                      },
                      {
                        "textRaw": "`nid` {number} The nid of the cipher",
                        "name": "nid",
                        "type": "number",
                        "desc": "The nid of the cipher"
                      },
                      {
                        "textRaw": "`blockSize` {number} The block size of the cipher in bytes. This property is omitted when `mode` is `'stream'`.",
                        "name": "blockSize",
                        "type": "number",
                        "desc": "The block size of the cipher in bytes. This property is omitted when `mode` is `'stream'`."
                      },
                      {
                        "textRaw": "`ivLength` {number} The expected or default initialization vector length in bytes. This property is omitted if the cipher does not use an initialization vector.",
                        "name": "ivLength",
                        "type": "number",
                        "desc": "The expected or default initialization vector length in bytes. This property is omitted if the cipher does not use an initialization vector."
                      },
                      {
                        "textRaw": "`keyLength` {number} The expected or default key length in bytes.",
                        "name": "keyLength",
                        "type": "number",
                        "desc": "The expected or default key length in bytes."
                      },
                      {
                        "textRaw": "`mode` {string} The cipher mode. One of `'cbc'`, `'ccm'`, `'cfb'`, `'ctr'`, `'ecb'`, `'gcm'`, `'ocb'`, `'ofb'`, `'stream'`, `'wrap'`, `'xts'`.",
                        "name": "mode",
                        "type": "string",
                        "desc": "The cipher mode. One of `'cbc'`, `'ccm'`, `'cfb'`, `'ctr'`, `'ecb'`, `'gcm'`, `'ocb'`, `'ofb'`, `'stream'`, `'wrap'`, `'xts'`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Returns information about a given cipher.</p>\n<p>Some ciphers accept variable length keys and initialization vectors. By default,\nthe <code>crypto.getCipherInfo()</code> method will return the default values for these\nciphers. To test if a given key length or iv length is acceptable for given\ncipher, use the <code>keyLength</code> and <code>ivLength</code> options. If the given values are\nunacceptable, <code>undefined</code> will be returned.</p>"
            },
            {
              "textRaw": "`crypto.getCiphers()`",
              "name": "getCiphers",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]} An array with the names of the supported cipher algorithms.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "An array with the names of the supported cipher algorithms."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const {\n  getCiphers,\n} = await import('node:crypto');\n\nconsole.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  getCiphers,\n} = require('node:crypto');\n\nconsole.log(getCiphers()); // ['aes-128-cbc', 'aes-128-ccm', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getCurves()`",
              "name": "getCurves",
              "type": "method",
              "meta": {
                "added": [
                  "v2.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]} An array with the names of the supported elliptic curves.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "An array with the names of the supported elliptic curves."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const {\n  getCurves,\n} = await import('node:crypto');\n\nconsole.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  getCurves,\n} = require('node:crypto');\n\nconsole.log(getCurves()); // ['Oakley-EC2N-3', 'Oakley-EC2N-4', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getDiffieHellman(groupName)`",
              "name": "getDiffieHellman",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`groupName` {string}",
                      "name": "groupName",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {DiffieHellmanGroup}",
                    "name": "return",
                    "type": "DiffieHellmanGroup"
                  }
                }
              ],
              "desc": "<p>Creates a predefined <code>DiffieHellmanGroup</code> key exchange object. The\nsupported groups are listed in the documentation for <a href=\"#class-diffiehellmangroup\"><code>DiffieHellmanGroup</code></a>.</p>\n<p>The returned object mimics the interface of objects created by\n<a href=\"#cryptocreatediffiehellmanprime-primeencoding-generator-generatorencoding\"><code>crypto.createDiffieHellman()</code></a>, but will not allow changing\nthe keys (with <a href=\"#diffiehellmansetpublickeypublickey-encoding\"><code>diffieHellman.setPublicKey()</code></a>, for example). The\nadvantage of using this method is that the parties do not have to\ngenerate nor exchange a group modulus beforehand, saving both processor\nand communication time.</p>\n<p>Example (obtaining a shared secret):</p>\n<pre><code class=\"language-mjs\">const {\n  getDiffieHellman,\n} = await import('node:crypto');\nconst alice = getDiffieHellman('modp14');\nconst bob = getDiffieHellman('modp14');\n\nalice.generateKeys();\nbob.generateKeys();\n\nconst aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');\nconst bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');\n\n/* aliceSecret and bobSecret should be the same */\nconsole.log(aliceSecret === bobSecret);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  getDiffieHellman,\n} = require('node:crypto');\n\nconst alice = getDiffieHellman('modp14');\nconst bob = getDiffieHellman('modp14');\n\nalice.generateKeys();\nbob.generateKeys();\n\nconst aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');\nconst bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');\n\n/* aliceSecret and bobSecret should be the same */\nconsole.log(aliceSecret === bobSecret);\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getFips()`",
              "name": "getFips",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} `1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}.",
                    "name": "return",
                    "type": "number",
                    "desc": "`1` if and only if a FIPS compliant crypto provider is currently in use, `0` otherwise. A future semver-major release may change the return type of this API to a {boolean}."
                  }
                }
              ]
            },
            {
              "textRaw": "`crypto.getHashes()`",
              "name": "getHashes",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]} An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called \"digest\" algorithms.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "An array of the names of the supported hash algorithms, such as `'RSA-SHA256'`. Hash algorithms are also called \"digest\" algorithms."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const {\n  getHashes,\n} = await import('node:crypto');\n\nconsole.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  getHashes,\n} = require('node:crypto');\n\nconsole.log(getHashes()); // ['DSA', 'DSA-SHA', 'DSA-SHA1', ...]\n</code></pre>"
            },
            {
              "textRaw": "`crypto.getRandomValues(typedArray)`",
              "name": "getRandomValues",
              "type": "method",
              "meta": {
                "added": [
                  "v17.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`typedArray` {Buffer|TypedArray|DataView|ArrayBuffer}",
                      "name": "typedArray",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|TypedArray|DataView|ArrayBuffer} Returns `typedArray`.",
                    "name": "return",
                    "type": "Buffer|TypedArray|DataView|ArrayBuffer",
                    "desc": "Returns `typedArray`."
                  }
                }
              ],
              "desc": "<p>A convenient alias for <a href=\"webcrypto.html#cryptogetrandomvaluestypedarray\"><code>crypto.webcrypto.getRandomValues()</code></a>. This\nimplementation is not compliant with the Web Crypto spec, to write\nweb-compatible code use <a href=\"webcrypto.html#cryptogetrandomvaluestypedarray\"><code>crypto.webcrypto.getRandomValues()</code></a> instead.</p>"
            },
            {
              "textRaw": "`crypto.hash(algorithm, data[, options])`",
              "name": "hash",
              "type": "method",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60994",
                    "description": "This API is no longer experimental."
                  },
                  {
                    "version": "v24.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58121",
                    "description": "The `outputLength` option was added for XOF hash functions."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|undefined}",
                      "name": "algorithm",
                      "type": "string|undefined"
                    },
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView} When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead.",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView",
                      "desc": "When `data` is a string, it will be encoded as UTF-8 before being hashed. If a different input encoding is desired for a string input, user could encode the string into a `TypedArray` using either `TextEncoder` or `Buffer.from()` and passing the encoded `TypedArray` into this API instead."
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`outputEncoding` {string} Encoding used to encode the returned digest. **Default:** `'hex'`.",
                          "name": "outputEncoding",
                          "type": "string",
                          "default": "`'hex'`",
                          "desc": "Encoding used to encode the returned digest."
                        },
                        {
                          "textRaw": "`outputLength` {number} For XOF hash functions such as 'shake256', the outputLength option can be used to specify the desired output length in bytes.",
                          "name": "outputLength",
                          "type": "number",
                          "desc": "For XOF hash functions such as 'shake256', the outputLength option can be used to specify the desired output length in bytes."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>A utility for creating one-shot hash digests of data. It can be faster than\nthe object-based <code>crypto.createHash()</code> when hashing a smaller amount of data\n(&#x3C;= 5MB) that's readily available. If the data can be big or if it is streamed,\nit's still recommended to use <code>crypto.createHash()</code> instead.</p>\n<p>The <code>algorithm</code> is dependent on the available algorithms supported by the\nversion of OpenSSL on the platform. Examples are <code>'sha256'</code>, <code>'sha512'</code>, etc.\nOn recent releases of OpenSSL, <code>openssl list -digest-algorithms</code> will\ndisplay the available digest algorithms.</p>\n<p>If <code>options</code> is a string, then it specifies the <code>outputEncoding</code>.</p>\n<p>Example:</p>\n<pre><code class=\"language-cjs\">const crypto = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\n// Hashing a string and return the result as a hex-encoded string.\nconst string = 'Node.js';\n// 10b3493287f831e81a438811a1ffba01f8cec4b7\nconsole.log(crypto.hash('sha1', string));\n\n// Encode a base64-encoded string into a Buffer, hash it and return\n// the result as a buffer.\nconst base64 = 'Tm9kZS5qcw==';\n// &#x3C;Buffer 10 b3 49 32 87 f8 31 e8 1a 43 88 11 a1 ff ba 01 f8 ce c4 b7>\nconsole.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer'));\n</code></pre>\n<pre><code class=\"language-mjs\">import crypto from 'node:crypto';\nimport { Buffer } from 'node:buffer';\n\n// Hashing a string and return the result as a hex-encoded string.\nconst string = 'Node.js';\n// 10b3493287f831e81a438811a1ffba01f8cec4b7\nconsole.log(crypto.hash('sha1', string));\n\n// Encode a base64-encoded string into a Buffer, hash it and return\n// the result as a buffer.\nconst base64 = 'Tm9kZS5qcw==';\n// &#x3C;Buffer 10 b3 49 32 87 f8 31 e8 1a 43 88 11 a1 ff ba 01 f8 ce c4 b7>\nconsole.log(crypto.hash('sha1', Buffer.from(base64, 'base64'), 'buffer'));\n</code></pre>"
            },
            {
              "textRaw": "`crypto.hkdf(digest, ikm, salt, info, keylen, callback)`",
              "name": "hkdf",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44201",
                    "description": "The input keying material can now be zero-length."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`digest` {string} The digest algorithm to use.",
                      "name": "digest",
                      "type": "string",
                      "desc": "The digest algorithm to use."
                    },
                    {
                      "textRaw": "`ikm` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} The input keying material. Must be provided but can be zero-length.",
                      "name": "ikm",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject",
                      "desc": "The input keying material. Must be provided but can be zero-length."
                    },
                    {
                      "textRaw": "`salt` {string|ArrayBuffer|Buffer|TypedArray|DataView} The salt value. Must be provided but can be zero-length.",
                      "name": "salt",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "The salt value. Must be provided but can be zero-length."
                    },
                    {
                      "textRaw": "`info` {string|ArrayBuffer|Buffer|TypedArray|DataView} Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.",
                      "name": "info",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes."
                    },
                    {
                      "textRaw": "`keylen` {number} The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` generates 64-byte hashes, making the maximum HKDF output 16320 bytes).",
                      "name": "keylen",
                      "type": "number",
                      "desc": "The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` generates 64-byte hashes, making the maximum HKDF output 16320 bytes)."
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`derivedKey` {ArrayBuffer}",
                          "name": "derivedKey",
                          "type": "ArrayBuffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>HKDF is a simple key derivation function defined in RFC 5869. The given <code>ikm</code>,\n<code>salt</code> and <code>info</code> are used with the <code>digest</code> to derive a key of <code>keylen</code> bytes.</p>\n<p>The supplied <code>callback</code> function is called with two arguments: <code>err</code> and\n<code>derivedKey</code>. If an errors occurs while deriving the key, <code>err</code> will be set;\notherwise <code>err</code> will be <code>null</code>. The successfully generated <code>derivedKey</code> will\nbe passed to the callback as an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>. An error will be thrown if any\nof the input arguments specify invalid values or types.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  hkdf,\n} = await import('node:crypto');\n\nhkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(Buffer.from(derivedKey).toString('hex'));  // '24156e2...5391653'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  hkdf,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nhkdf('sha512', 'key', 'salt', 'info', 64, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(Buffer.from(derivedKey).toString('hex'));  // '24156e2...5391653'\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.hkdfSync(digest, ikm, salt, info, keylen)`",
              "name": "hkdfSync",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44201",
                    "description": "The input keying material can now be zero-length."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`digest` {string} The digest algorithm to use.",
                      "name": "digest",
                      "type": "string",
                      "desc": "The digest algorithm to use."
                    },
                    {
                      "textRaw": "`ikm` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject} The input keying material. Must be provided but can be zero-length.",
                      "name": "ikm",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject",
                      "desc": "The input keying material. Must be provided but can be zero-length."
                    },
                    {
                      "textRaw": "`salt` {string|ArrayBuffer|Buffer|TypedArray|DataView} The salt value. Must be provided but can be zero-length.",
                      "name": "salt",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "The salt value. Must be provided but can be zero-length."
                    },
                    {
                      "textRaw": "`info` {string|ArrayBuffer|Buffer|TypedArray|DataView} Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes.",
                      "name": "info",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "Additional info value. Must be provided but can be zero-length, and cannot be more than 1024 bytes."
                    },
                    {
                      "textRaw": "`keylen` {number} The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` generates 64-byte hashes, making the maximum HKDF output 16320 bytes).",
                      "name": "keylen",
                      "type": "number",
                      "desc": "The length of the key to generate. Must be greater than 0. The maximum allowable value is `255` times the number of bytes produced by the selected digest function (e.g. `sha512` generates 64-byte hashes, making the maximum HKDF output 16320 bytes)."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ArrayBuffer}",
                    "name": "return",
                    "type": "ArrayBuffer"
                  }
                }
              ],
              "desc": "<p>Provides a synchronous HKDF key derivation function as defined in RFC 5869. The\ngiven <code>ikm</code>, <code>salt</code> and <code>info</code> are used with the <code>digest</code> to derive a key of\n<code>keylen</code> bytes.</p>\n<p>The successfully generated <code>derivedKey</code> will be returned as an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>.</p>\n<p>An error will be thrown if any of the input arguments specify invalid values or\ntypes, or if the derived key cannot be generated.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  hkdfSync,\n} = await import('node:crypto');\n\nconst derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64);\nconsole.log(Buffer.from(derivedKey).toString('hex'));  // '24156e2...5391653'\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  hkdfSync,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst derivedKey = hkdfSync('sha512', 'key', 'salt', 'info', 64);\nconsole.log(Buffer.from(derivedKey).toString('hex'));  // '24156e2...5391653'\n</code></pre>"
            },
            {
              "textRaw": "`crypto.pbkdf2(password, salt, iterations, keylen, digest, callback)`",
              "name": "pbkdf2",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.5"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The password and salt arguments can also be ArrayBuffer instances."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30578",
                    "description": "The `iterations` parameter is now restricted to positive values. Earlier releases treated other values as one."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11305",
                    "description": "The `digest` parameter is always required now."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4047",
                    "description": "Calling this function without passing the `digest` parameter is deprecated now and will emit a warning."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default encoding for `password` if it is a string changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`password` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "password",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`salt` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "salt",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`iterations` {number}",
                      "name": "iterations",
                      "type": "number"
                    },
                    {
                      "textRaw": "`keylen` {number}",
                      "name": "keylen",
                      "type": "number"
                    },
                    {
                      "textRaw": "`digest` {string}",
                      "name": "digest",
                      "type": "string"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`derivedKey` {Buffer}",
                          "name": "derivedKey",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Provides an asynchronous Password-Based Key Derivation Function 2 (PBKDF2)\nimplementation. A selected HMAC digest algorithm specified by <code>digest</code> is\napplied to derive a key of the requested byte length (<code>keylen</code>) from the\n<code>password</code>, <code>salt</code> and <code>iterations</code>.</p>\n<p>The supplied <code>callback</code> function is called with two arguments: <code>err</code> and\n<code>derivedKey</code>. If an error occurs while deriving the key, <code>err</code> will be set;\notherwise <code>err</code> will be <code>null</code>. By default, the successfully generated\n<code>derivedKey</code> will be passed to the callback as a <a href=\"buffer.html\"><code>Buffer</code></a>. An error will be\nthrown if any of the input arguments specify invalid values or types.</p>\n<p>The <code>iterations</code> argument must be a number set as high as possible. The\nhigher the number of iterations, the more secure the derived key will be,\nbut will take a longer amount of time to complete.</p>\n<p>The <code>salt</code> should be as unique as possible. It is recommended that a salt is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>password</code> or <code>salt</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<pre><code class=\"language-mjs\">const {\n  pbkdf2,\n} = await import('node:crypto');\n\npbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...08d59ae'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  pbkdf2,\n} = require('node:crypto');\n\npbkdf2('secret', 'salt', 100000, 64, 'sha512', (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...08d59ae'\n});\n</code></pre>\n<p>An array of supported digest functions can be retrieved using\n<a href=\"#cryptogethashes\"><code>crypto.getHashes()</code></a>.</p>\n<p>This API uses libuv's threadpool, which can have surprising and\nnegative performance implications for some applications; see the\n<a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>"
            },
            {
              "textRaw": "`crypto.pbkdf2Sync(password, salt, iterations, keylen, digest)`",
              "name": "pbkdf2Sync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/30578",
                    "description": "The `iterations` parameter is now restricted to positive values. Earlier releases treated other values as one."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4047",
                    "description": "Calling this function without passing the `digest` parameter is deprecated now and will emit a warning."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default encoding for `password` if it is a string changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`password` {string|Buffer|TypedArray|DataView}",
                      "name": "password",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`salt` {string|Buffer|TypedArray|DataView}",
                      "name": "salt",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`iterations` {number}",
                      "name": "iterations",
                      "type": "number"
                    },
                    {
                      "textRaw": "`keylen` {number}",
                      "name": "keylen",
                      "type": "number"
                    },
                    {
                      "textRaw": "`digest` {string}",
                      "name": "digest",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Provides a synchronous Password-Based Key Derivation Function 2 (PBKDF2)\nimplementation. A selected HMAC digest algorithm specified by <code>digest</code> is\napplied to derive a key of the requested byte length (<code>keylen</code>) from the\n<code>password</code>, <code>salt</code> and <code>iterations</code>.</p>\n<p>If an error occurs an <code>Error</code> will be thrown, otherwise the derived key will be\nreturned as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>The <code>iterations</code> argument must be a number set as high as possible. The\nhigher the number of iterations, the more secure the derived key will be,\nbut will take a longer amount of time to complete.</p>\n<p>The <code>salt</code> should be as unique as possible. It is recommended that a salt is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>password</code> or <code>salt</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<pre><code class=\"language-mjs\">const {\n  pbkdf2Sync,\n} = await import('node:crypto');\n\nconst key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');\nconsole.log(key.toString('hex'));  // '3745e48...08d59ae'\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  pbkdf2Sync,\n} = require('node:crypto');\n\nconst key = pbkdf2Sync('secret', 'salt', 100000, 64, 'sha512');\nconsole.log(key.toString('hex'));  // '3745e48...08d59ae'\n</code></pre>\n<p>An array of supported digest functions can be retrieved using\n<a href=\"#cryptogethashes\"><code>crypto.getHashes()</code></a>.</p>"
            },
            {
              "textRaw": "`crypto.privateDecrypt(privateKey, buffer)`",
              "name": "privateDecrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.6.2",
                      "v20.11.1",
                      "v18.19.1"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/515",
                    "description": "The `RSA_PKCS1_PADDING` padding was disabled unless the OpenSSL build supports implicit rejection."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added string, ArrayBuffer, and CryptoKey as allowable key types. The oaepLabel can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v12.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29489",
                    "description": "The `oaepLabel` option was added."
                  },
                  {
                    "version": "v12.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28335",
                    "description": "The `oaepHash` option was added."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "privateKey",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`oaepHash` {string} The hash function to use for OAEP padding and MGF1. **Default:** `'sha1'`",
                          "name": "oaepHash",
                          "type": "string",
                          "default": "`'sha1'`",
                          "desc": "The hash function to use for OAEP padding and MGF1."
                        },
                        {
                          "textRaw": "`oaepLabel` {string|ArrayBuffer|Buffer|TypedArray|DataView} The label to use for OAEP padding. If not specified, no label is used.",
                          "name": "oaepLabel",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "The label to use for OAEP padding. If not specified, no label is used."
                        },
                        {
                          "textRaw": "`padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.",
                          "name": "padding",
                          "type": "crypto.constants",
                          "desc": "An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the decrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the decrypted content."
                  }
                }
              ],
              "desc": "<p>Decrypts <code>buffer</code> with <code>privateKey</code>. <code>buffer</code> was previously encrypted using\nthe corresponding public key, for example using <a href=\"#cryptopublicencryptkey-buffer\"><code>crypto.publicEncrypt()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>. If it is an\nobject, the <code>padding</code> property can be passed. Otherwise, this function uses\n<code>RSA_PKCS1_OAEP_PADDING</code>.</p>\n<p>Using <code>crypto.constants.RSA_PKCS1_PADDING</code> in <a href=\"#cryptoprivatedecryptprivatekey-buffer\"><code>crypto.privateDecrypt()</code></a>\nrequires OpenSSL to support implicit rejection (<code>rsa_pkcs1_implicit_rejection</code>).\nIf the version of OpenSSL used by Node.js does not support this feature,\nattempting to use <code>RSA_PKCS1_PADDING</code> will fail.</p>"
            },
            {
              "textRaw": "`crypto.privateEncrypt(privateKey, buffer)`",
              "name": "privateEncrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added string, ArrayBuffer, and CryptoKey as allowable key types. The passphrase can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "privateKey",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey} A PEM encoded private key.",
                          "name": "key",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                          "desc": "A PEM encoded private key."
                        },
                        {
                          "textRaw": "`passphrase` {string|ArrayBuffer|Buffer|TypedArray|DataView} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "An optional passphrase for the private key."
                        },
                        {
                          "textRaw": "`padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants.RSA_PKCS1_PADDING`.",
                          "name": "padding",
                          "type": "crypto.constants",
                          "desc": "An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants.RSA_PKCS1_PADDING`."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `buffer`, `key`, or `passphrase` are strings.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `buffer`, `key`, or `passphrase` are strings."
                        }
                      ]
                    },
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the encrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the encrypted content."
                  }
                }
              ],
              "desc": "<p>Encrypts <code>buffer</code> with <code>privateKey</code>. The returned data can be decrypted using\nthe corresponding public key, for example using <a href=\"#cryptopublicdecryptkey-buffer\"><code>crypto.publicDecrypt()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>. If it is an\nobject, the <code>padding</code> property can be passed. Otherwise, this function uses\n<code>RSA_PKCS1_PADDING</code>.</p>"
            },
            {
              "textRaw": "`crypto.publicDecrypt(key, buffer)`",
              "name": "publicDecrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v1.1.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added string, ArrayBuffer, and CryptoKey as allowable key types. The passphrase can be an ArrayBuffer. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`passphrase` {string|ArrayBuffer|Buffer|TypedArray|DataView} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "An optional passphrase for the private key."
                        },
                        {
                          "textRaw": "`padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants.RSA_PKCS1_PADDING`.",
                          "name": "padding",
                          "type": "crypto.constants",
                          "desc": "An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `crypto.constants.RSA_PKCS1_PADDING`."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `buffer`, `key`, or `passphrase` are strings.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `buffer`, `key`, or `passphrase` are strings."
                        }
                      ]
                    },
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the decrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the decrypted content."
                  }
                }
              ],
              "desc": "<p>Decrypts <code>buffer</code> with <code>key</code>. <code>buffer</code> was previously encrypted using\nthe corresponding private key, for example using <a href=\"#cryptoprivateencryptprivatekey-buffer\"><code>crypto.privateEncrypt()</code></a>.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>key</code> had been passed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>. If it is an\nobject, the <code>padding</code> property can be passed. Otherwise, this function uses\n<code>RSA_PKCS1_PADDING</code>.</p>\n<p>Because RSA public keys can be derived from private keys, a private key may\nbe passed instead of a public key.</p>"
            },
            {
              "textRaw": "`crypto.publicEncrypt(key, buffer)`",
              "name": "publicEncrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added string, ArrayBuffer, and CryptoKey as allowable key types. The oaepLabel and passphrase can be ArrayBuffers. The buffer can be a string or ArrayBuffer. All types that accept buffers are limited to a maximum of 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v12.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29489",
                    "description": "The `oaepLabel` option was added."
                  },
                  {
                    "version": "v12.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28335",
                    "description": "The `oaepHash` option was added."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey} A PEM encoded public or private key, {KeyObject}, or {CryptoKey}.",
                          "name": "key",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                          "desc": "A PEM encoded public or private key, {KeyObject}, or {CryptoKey}."
                        },
                        {
                          "textRaw": "`oaepHash` {string} The hash function to use for OAEP padding and MGF1. **Default:** `'sha1'`",
                          "name": "oaepHash",
                          "type": "string",
                          "default": "`'sha1'`",
                          "desc": "The hash function to use for OAEP padding and MGF1."
                        },
                        {
                          "textRaw": "`oaepLabel` {string|ArrayBuffer|Buffer|TypedArray|DataView} The label to use for OAEP padding. If not specified, no label is used.",
                          "name": "oaepLabel",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "The label to use for OAEP padding. If not specified, no label is used."
                        },
                        {
                          "textRaw": "`passphrase` {string|ArrayBuffer|Buffer|TypedArray|DataView} An optional passphrase for the private key.",
                          "name": "passphrase",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView",
                          "desc": "An optional passphrase for the private key."
                        },
                        {
                          "textRaw": "`padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.",
                          "name": "padding",
                          "type": "crypto.constants",
                          "desc": "An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `crypto.constants.RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`."
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `buffer`, `key`, `oaepLabel`, or `passphrase` are strings.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `buffer`, `key`, `oaepLabel`, or `passphrase` are strings."
                        }
                      ]
                    },
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} A new `Buffer` with the encrypted content.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A new `Buffer` with the encrypted content."
                  }
                }
              ],
              "desc": "<p>Encrypts the content of <code>buffer</code> with <code>key</code> and returns a new\n<a href=\"buffer.html\"><code>Buffer</code></a> with encrypted content. The returned data can be decrypted using\nthe corresponding private key, for example using <a href=\"#cryptoprivatedecryptprivatekey-buffer\"><code>crypto.privateDecrypt()</code></a>.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>key</code> had been passed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>. If it is an\nobject, the <code>padding</code> property can be passed. Otherwise, this function uses\n<code>RSA_PKCS1_OAEP_PADDING</code>.</p>\n<p>Because RSA public keys can be derived from private keys, a private key may\nbe passed instead of a public key.</p>"
            },
            {
              "textRaw": "`crypto.randomBytes(size[, callback])`",
              "name": "randomBytes",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16454",
                    "description": "Passing `null` as the `callback` argument now throws `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {number} The number of bytes to generate. The `size` must not be larger than `2**31 - 1`.",
                      "name": "size",
                      "type": "number",
                      "desc": "The number of bytes to generate. The `size` must not be larger than `2**31 - 1`."
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`buf` {Buffer}",
                          "name": "buf",
                          "type": "Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Generates cryptographically strong pseudorandom data. The <code>size</code> argument\nis a number indicating the number of bytes to generate.</p>\n<p>If a <code>callback</code> function is provided, the bytes are generated asynchronously\nand the <code>callback</code> function is invoked with two arguments: <code>err</code> and <code>buf</code>.\nIf an error occurs, <code>err</code> will be an <code>Error</code> object; otherwise it is <code>null</code>. The\n<code>buf</code> argument is a <a href=\"buffer.html\"><code>Buffer</code></a> containing the generated bytes.</p>\n<pre><code class=\"language-mjs\">// Asynchronous\nconst {\n  randomBytes,\n} = await import('node:crypto');\n\nrandomBytes(256, (err, buf) => {\n  if (err) throw err;\n  console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Asynchronous\nconst {\n  randomBytes,\n} = require('node:crypto');\n\nrandomBytes(256, (err, buf) => {\n  if (err) throw err;\n  console.log(`${buf.length} bytes of random data: ${buf.toString('hex')}`);\n});\n</code></pre>\n<p>If the <code>callback</code> function is not provided, the random bytes are generated\nsynchronously and returned as a <a href=\"buffer.html\"><code>Buffer</code></a>. An error will be thrown if\nthere is a problem generating the bytes.</p>\n<pre><code class=\"language-mjs\">// Synchronous\nconst {\n  randomBytes,\n} = await import('node:crypto');\n\nconst buf = randomBytes(256);\nconsole.log(\n  `${buf.length} bytes of random data: ${buf.toString('hex')}`);\n</code></pre>\n<pre><code class=\"language-cjs\">// Synchronous\nconst {\n  randomBytes,\n} = require('node:crypto');\n\nconst buf = randomBytes(256);\nconsole.log(\n  `${buf.length} bytes of random data: ${buf.toString('hex')}`);\n</code></pre>\n<p>The <code>crypto.randomBytes()</code> method will not complete until there is\nsufficient entropy available.\nThis should normally never take longer than a few milliseconds. The only time\nwhen generating the random bytes may conceivably block for a longer period of\ntime is right after boot, when the whole system is still low on entropy.</p>\n<p>This API uses libuv's threadpool, which can have surprising and\nnegative performance implications for some applications; see the\n<a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>\n<p>The asynchronous version of <code>crypto.randomBytes()</code> is carried out in a single\nthreadpool request. To minimize threadpool task length variation, partition\nlarge <code>randomBytes</code> requests when doing so as part of fulfilling a client\nrequest.</p>"
            },
            {
              "textRaw": "`crypto.randomFill(buffer[, offset][, size], callback)`",
              "name": "randomFill",
              "type": "method",
              "meta": {
                "added": [
                  "v7.10.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15231",
                    "description": "The `buffer` argument may be any `TypedArray` or `DataView`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {ArrayBuffer|Buffer|TypedArray|DataView} Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.",
                      "name": "buffer",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`."
                    },
                    {
                      "textRaw": "`offset` {number} **Default:** `0`",
                      "name": "offset",
                      "type": "number",
                      "default": "`0`",
                      "optional": true
                    },
                    {
                      "textRaw": "`size` {number} **Default:** `buffer.length - offset`. The `size` must not be larger than `2**31 - 1`.",
                      "name": "size",
                      "type": "number",
                      "default": "`buffer.length - offset`. The `size` must not be larger than `2**31 - 1`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} `function(err, buf) {}`.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "`function(err, buf) {}`."
                    }
                  ]
                }
              ],
              "desc": "<p>This function is similar to <a href=\"#cryptorandombytessize-callback\"><code>crypto.randomBytes()</code></a> but requires the first\nargument to be a <a href=\"buffer.html\"><code>Buffer</code></a> that will be filled. It also\nrequires that a callback is passed in.</p>\n<p>If the <code>callback</code> function is not provided, an error will be thrown.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { randomFill } = await import('node:crypto');\n\nconst buf = Buffer.alloc(10);\nrandomFill(buf, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\nrandomFill(buf, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\n// The above is equivalent to the following:\nrandomFill(buf, 5, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { randomFill } = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst buf = Buffer.alloc(10);\nrandomFill(buf, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\nrandomFill(buf, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n\n// The above is equivalent to the following:\nrandomFill(buf, 5, 5, (err, buf) => {\n  if (err) throw err;\n  console.log(buf.toString('hex'));\n});\n</code></pre>\n<p>Any <code>ArrayBuffer</code>, <code>TypedArray</code>, or <code>DataView</code> instance may be passed as\n<code>buffer</code>.</p>\n<p>While this includes instances of <code>Float32Array</code> and <code>Float64Array</code>, this\nfunction should not be used to generate random floating-point numbers. The\nresult may contain <code>+Infinity</code>, <code>-Infinity</code>, and <code>NaN</code>, and even if the array\ncontains finite numbers only, they are not drawn from a uniform random\ndistribution and have no meaningful lower or upper bounds.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { randomFill } = await import('node:crypto');\n\nconst a = new Uint32Array(10);\nrandomFill(a, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .toString('hex'));\n});\n\nconst b = new DataView(new ArrayBuffer(10));\nrandomFill(b, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .toString('hex'));\n});\n\nconst c = new ArrayBuffer(10);\nrandomFill(c, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf).toString('hex'));\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { randomFill } = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst a = new Uint32Array(10);\nrandomFill(a, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .toString('hex'));\n});\n\nconst b = new DataView(new ArrayBuffer(10));\nrandomFill(b, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength)\n    .toString('hex'));\n});\n\nconst c = new ArrayBuffer(10);\nrandomFill(c, (err, buf) => {\n  if (err) throw err;\n  console.log(Buffer.from(buf).toString('hex'));\n});\n</code></pre>\n<p>This API uses libuv's threadpool, which can have surprising and\nnegative performance implications for some applications; see the\n<a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>\n<p>The asynchronous version of <code>crypto.randomFill()</code> is carried out in a single\nthreadpool request. To minimize threadpool task length variation, partition\nlarge <code>randomFill</code> requests when doing so as part of fulfilling a client\nrequest.</p>"
            },
            {
              "textRaw": "`crypto.randomFillSync(buffer[, offset][, size])`",
              "name": "randomFillSync",
              "type": "method",
              "meta": {
                "added": [
                  "v7.10.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15231",
                    "description": "The `buffer` argument may be any `TypedArray` or `DataView`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {ArrayBuffer|Buffer|TypedArray|DataView} Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`.",
                      "name": "buffer",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView",
                      "desc": "Must be supplied. The size of the provided `buffer` must not be larger than `2**31 - 1`."
                    },
                    {
                      "textRaw": "`offset` {number} **Default:** `0`",
                      "name": "offset",
                      "type": "number",
                      "default": "`0`",
                      "optional": true
                    },
                    {
                      "textRaw": "`size` {number} **Default:** `buffer.length - offset`. The `size` must not be larger than `2**31 - 1`.",
                      "name": "size",
                      "type": "number",
                      "default": "`buffer.length - offset`. The `size` must not be larger than `2**31 - 1`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ArrayBuffer|Buffer|TypedArray|DataView} The object passed as `buffer` argument.",
                    "name": "return",
                    "type": "ArrayBuffer|Buffer|TypedArray|DataView",
                    "desc": "The object passed as `buffer` argument."
                  }
                }
              ],
              "desc": "<p>Synchronous version of <a href=\"#cryptorandomfillbuffer-offset-size-callback\"><code>crypto.randomFill()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { randomFillSync } = await import('node:crypto');\n\nconst buf = Buffer.alloc(10);\nconsole.log(randomFillSync(buf).toString('hex'));\n\nrandomFillSync(buf, 5);\nconsole.log(buf.toString('hex'));\n\n// The above is equivalent to the following:\nrandomFillSync(buf, 5, 5);\nconsole.log(buf.toString('hex'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { randomFillSync } = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst buf = Buffer.alloc(10);\nconsole.log(randomFillSync(buf).toString('hex'));\n\nrandomFillSync(buf, 5);\nconsole.log(buf.toString('hex'));\n\n// The above is equivalent to the following:\nrandomFillSync(buf, 5, 5);\nconsole.log(buf.toString('hex'));\n</code></pre>\n<p>Any <code>ArrayBuffer</code>, <code>TypedArray</code> or <code>DataView</code> instance may be passed as\n<code>buffer</code>.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { randomFillSync } = await import('node:crypto');\n\nconst a = new Uint32Array(10);\nconsole.log(Buffer.from(randomFillSync(a).buffer,\n                        a.byteOffset, a.byteLength).toString('hex'));\n\nconst b = new DataView(new ArrayBuffer(10));\nconsole.log(Buffer.from(randomFillSync(b).buffer,\n                        b.byteOffset, b.byteLength).toString('hex'));\n\nconst c = new ArrayBuffer(10);\nconsole.log(Buffer.from(randomFillSync(c)).toString('hex'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { randomFillSync } = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst a = new Uint32Array(10);\nconsole.log(Buffer.from(randomFillSync(a).buffer,\n                        a.byteOffset, a.byteLength).toString('hex'));\n\nconst b = new DataView(new ArrayBuffer(10));\nconsole.log(Buffer.from(randomFillSync(b).buffer,\n                        b.byteOffset, b.byteLength).toString('hex'));\n\nconst c = new ArrayBuffer(10);\nconsole.log(Buffer.from(randomFillSync(c)).toString('hex'));\n</code></pre>"
            },
            {
              "textRaw": "`crypto.randomInt([min, ]max[, callback])`",
              "name": "randomInt",
              "type": "method",
              "meta": {
                "added": [
                  "v14.10.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`min` {integer} Start of random range (inclusive). **Default:** `0`.",
                      "name": "min",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Start of random range (inclusive).",
                      "optional": true
                    },
                    {
                      "textRaw": "`max` {integer} End of random range (exclusive).",
                      "name": "max",
                      "type": "integer",
                      "desc": "End of random range (exclusive)."
                    },
                    {
                      "textRaw": "`callback` {Function} `function(err, n) {}`.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "`function(err, n) {}`.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Return a random integer <code>n</code> such that <code>min &#x3C;= n &#x3C; max</code>.  This\nimplementation avoids <a href=\"https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#Modulo_bias\">modulo bias</a>.</p>\n<p>The range (<code>max - min</code>) must be less than 2<sup>48</sup>. <code>min</code> and <code>max</code> must\nbe <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger\">safe integers</a>.</p>\n<p>If the <code>callback</code> function is not provided, the random integer is\ngenerated synchronously.</p>\n<pre><code class=\"language-mjs\">// Asynchronous\nconst {\n  randomInt,\n} = await import('node:crypto');\n\nrandomInt(3, (err, n) => {\n  if (err) throw err;\n  console.log(`Random number chosen from (0, 1, 2): ${n}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Asynchronous\nconst {\n  randomInt,\n} = require('node:crypto');\n\nrandomInt(3, (err, n) => {\n  if (err) throw err;\n  console.log(`Random number chosen from (0, 1, 2): ${n}`);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">// Synchronous\nconst {\n  randomInt,\n} = await import('node:crypto');\n\nconst n = randomInt(3);\nconsole.log(`Random number chosen from (0, 1, 2): ${n}`);\n</code></pre>\n<pre><code class=\"language-cjs\">// Synchronous\nconst {\n  randomInt,\n} = require('node:crypto');\n\nconst n = randomInt(3);\nconsole.log(`Random number chosen from (0, 1, 2): ${n}`);\n</code></pre>\n<pre><code class=\"language-mjs\">// With `min` argument\nconst {\n  randomInt,\n} = await import('node:crypto');\n\nconst n = randomInt(1, 7);\nconsole.log(`The dice rolled: ${n}`);\n</code></pre>\n<pre><code class=\"language-cjs\">// With `min` argument\nconst {\n  randomInt,\n} = require('node:crypto');\n\nconst n = randomInt(1, 7);\nconsole.log(`The dice rolled: ${n}`);\n</code></pre>"
            },
            {
              "textRaw": "`crypto.randomUUID([options])`",
              "name": "randomUUID",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`disableEntropyCache` {boolean} By default, to improve performance, Node.js generates and caches enough random data to generate up to 128 random UUIDs. To generate a UUID without using the cache, set `disableEntropyCache` to `true`. **Default:** `false`.",
                          "name": "disableEntropyCache",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "By default, to improve performance, Node.js generates and caches enough random data to generate up to 128 random UUIDs. To generate a UUID without using the cache, set `disableEntropyCache` to `true`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Generates a random <a href=\"https://www.rfc-editor.org/rfc/rfc4122.txt\">RFC 4122</a> version 4 UUID. The UUID is generated using a\ncryptographic pseudorandom number generator.</p>"
            },
            {
              "textRaw": "`crypto.randomUUIDv7([options])`",
              "name": "randomUUIDv7",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`disableEntropyCache` {boolean} By default, to improve performance, Node.js generates and caches enough random data to generate up to 128 random UUIDs. To generate a UUID without using the cache, set `disableEntropyCache` to `true`. **Default:** `false`.",
                          "name": "disableEntropyCache",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "By default, to improve performance, Node.js generates and caches enough random data to generate up to 128 random UUIDs. To generate a UUID without using the cache, set `disableEntropyCache` to `true`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Generates a random <a href=\"https://www.rfc-editor.org/rfc/rfc9562.txt\">RFC 9562</a> version 7 UUID. The UUID contains a millisecond\nprecision Unix timestamp in the most significant 48 bits, followed by\ncryptographically secure random bits for the remaining fields, making it\nsuitable for use as a database key with time-based sorting. The embedded\ntimestamp relies on a non-monotonic clock and is not guaranteed to be strictly\nincreasing.</p>"
            },
            {
              "textRaw": "`crypto.scrypt(password, salt, keylen[, options], callback)`",
              "name": "scrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The password and salt arguments can also be ArrayBuffer instances."
                  },
                  {
                    "version": [
                      "v12.8.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/28799",
                    "description": "The `maxmem` value can now be any safe integer."
                  },
                  {
                    "version": "v10.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21525",
                    "description": "The `cost`, `blockSize` and `parallelization` option names have been added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`password` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "password",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`salt` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "salt",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`keylen` {number}",
                      "name": "keylen",
                      "type": "number"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cost` {number} CPU/memory cost parameter. Must be a power of two greater than one. **Default:** `16384`.",
                          "name": "cost",
                          "type": "number",
                          "default": "`16384`",
                          "desc": "CPU/memory cost parameter. Must be a power of two greater than one."
                        },
                        {
                          "textRaw": "`blockSize` {number} Block size parameter. **Default:** `8`.",
                          "name": "blockSize",
                          "type": "number",
                          "default": "`8`",
                          "desc": "Block size parameter."
                        },
                        {
                          "textRaw": "`parallelization` {number} Parallelization parameter. **Default:** `1`.",
                          "name": "parallelization",
                          "type": "number",
                          "default": "`1`",
                          "desc": "Parallelization parameter."
                        },
                        {
                          "textRaw": "`N` {number} Alias for `cost`. Only one of both may be specified.",
                          "name": "N",
                          "type": "number",
                          "desc": "Alias for `cost`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`r` {number} Alias for `blockSize`. Only one of both may be specified.",
                          "name": "r",
                          "type": "number",
                          "desc": "Alias for `blockSize`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`p` {number} Alias for `parallelization`. Only one of both may be specified.",
                          "name": "p",
                          "type": "number",
                          "desc": "Alias for `parallelization`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`maxmem` {number} Memory upper bound. It is an error when (approximately) `128 * N * r > maxmem`. **Default:** `32 * 1024 * 1024`.",
                          "name": "maxmem",
                          "type": "number",
                          "default": "`32 * 1024 * 1024`",
                          "desc": "Memory upper bound. It is an error when (approximately) `128 * N * r > maxmem`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`derivedKey` {Buffer}",
                          "name": "derivedKey",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Provides an asynchronous <a href=\"https://en.wikipedia.org/wiki/Scrypt\">scrypt</a> implementation. Scrypt is a password-based\nkey derivation function that is designed to be expensive computationally and\nmemory-wise in order to make brute-force attacks unrewarding.</p>\n<p>The <code>salt</code> should be as unique as possible. It is recommended that a salt is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>password</code> or <code>salt</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>The <code>callback</code> function is called with two arguments: <code>err</code> and <code>derivedKey</code>.\n<code>err</code> is an exception object when key derivation fails, otherwise <code>err</code> is\n<code>null</code>. <code>derivedKey</code> is passed to the callback as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>An exception is thrown when any of the input arguments specify invalid values\nor types.</p>\n<pre><code class=\"language-mjs\">const {\n  scrypt,\n} = await import('node:crypto');\n\n// Using the factory defaults.\nscrypt('password', 'salt', 64, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...08d59ae'\n});\n// Using a custom N parameter. Must be a power of two.\nscrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...aa39b34'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scrypt,\n} = require('node:crypto');\n\n// Using the factory defaults.\nscrypt('password', 'salt', 64, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...08d59ae'\n});\n// Using a custom N parameter. Must be a power of two.\nscrypt('password', 'salt', 64, { N: 1024 }, (err, derivedKey) => {\n  if (err) throw err;\n  console.log(derivedKey.toString('hex'));  // '3745e48...aa39b34'\n});\n</code></pre>"
            },
            {
              "textRaw": "`crypto.scryptSync(password, salt, keylen[, options])`",
              "name": "scryptSync",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v12.8.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/28799",
                    "description": "The `maxmem` value can now be any safe integer."
                  },
                  {
                    "version": "v10.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21525",
                    "description": "The `cost`, `blockSize` and `parallelization` option names have been added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`password` {string|Buffer|TypedArray|DataView}",
                      "name": "password",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`salt` {string|Buffer|TypedArray|DataView}",
                      "name": "salt",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`keylen` {number}",
                      "name": "keylen",
                      "type": "number"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cost` {number} CPU/memory cost parameter. Must be a power of two greater than one. **Default:** `16384`.",
                          "name": "cost",
                          "type": "number",
                          "default": "`16384`",
                          "desc": "CPU/memory cost parameter. Must be a power of two greater than one."
                        },
                        {
                          "textRaw": "`blockSize` {number} Block size parameter. **Default:** `8`.",
                          "name": "blockSize",
                          "type": "number",
                          "default": "`8`",
                          "desc": "Block size parameter."
                        },
                        {
                          "textRaw": "`parallelization` {number} Parallelization parameter. **Default:** `1`.",
                          "name": "parallelization",
                          "type": "number",
                          "default": "`1`",
                          "desc": "Parallelization parameter."
                        },
                        {
                          "textRaw": "`N` {number} Alias for `cost`. Only one of both may be specified.",
                          "name": "N",
                          "type": "number",
                          "desc": "Alias for `cost`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`r` {number} Alias for `blockSize`. Only one of both may be specified.",
                          "name": "r",
                          "type": "number",
                          "desc": "Alias for `blockSize`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`p` {number} Alias for `parallelization`. Only one of both may be specified.",
                          "name": "p",
                          "type": "number",
                          "desc": "Alias for `parallelization`. Only one of both may be specified."
                        },
                        {
                          "textRaw": "`maxmem` {number} Memory upper bound. It is an error when (approximately) `128 * N * r > maxmem`. **Default:** `32 * 1024 * 1024`.",
                          "name": "maxmem",
                          "type": "number",
                          "default": "`32 * 1024 * 1024`",
                          "desc": "Memory upper bound. It is an error when (approximately) `128 * N * r > maxmem`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Provides a synchronous <a href=\"https://en.wikipedia.org/wiki/Scrypt\">scrypt</a> implementation. Scrypt is a password-based\nkey derivation function that is designed to be expensive computationally and\nmemory-wise in order to make brute-force attacks unrewarding.</p>\n<p>The <code>salt</code> should be as unique as possible. It is recommended that a salt is\nrandom and at least 16 bytes long. See <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf\">NIST SP 800-132</a> for details.</p>\n<p>When passing strings for <code>password</code> or <code>salt</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>\n<p>An exception is thrown when key derivation fails, otherwise the derived key is\nreturned as a <a href=\"buffer.html\"><code>Buffer</code></a>.</p>\n<p>An exception is thrown when any of the input arguments specify invalid values\nor types.</p>\n<pre><code class=\"language-mjs\">const {\n  scryptSync,\n} = await import('node:crypto');\n// Using the factory defaults.\n\nconst key1 = scryptSync('password', 'salt', 64);\nconsole.log(key1.toString('hex'));  // '3745e48...08d59ae'\n// Using a custom N parameter. Must be a power of two.\nconst key2 = scryptSync('password', 'salt', 64, { N: 1024 });\nconsole.log(key2.toString('hex'));  // '3745e48...aa39b34'\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scryptSync,\n} = require('node:crypto');\n// Using the factory defaults.\n\nconst key1 = scryptSync('password', 'salt', 64);\nconsole.log(key1.toString('hex'));  // '3745e48...08d59ae'\n// Using a custom N parameter. Must be a power of two.\nconst key2 = scryptSync('password', 'salt', 64, { N: 1024 });\nconsole.log(key2.toString('hex'));  // '3745e48...aa39b34'\n</code></pre>"
            },
            {
              "textRaw": "`crypto.secureHeapUsed()`",
              "name": "secureHeapUsed",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`total` {number} The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag.",
                        "name": "total",
                        "type": "number",
                        "desc": "The total allocated secure heap size as specified using the `--secure-heap=n` command-line flag."
                      },
                      {
                        "textRaw": "`min` {number} The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag.",
                        "name": "min",
                        "type": "number",
                        "desc": "The minimum allocation from the secure heap as specified using the `--secure-heap-min` command-line flag."
                      },
                      {
                        "textRaw": "`used` {number} The total number of bytes currently allocated from the secure heap.",
                        "name": "used",
                        "type": "number",
                        "desc": "The total number of bytes currently allocated from the secure heap."
                      },
                      {
                        "textRaw": "`utilization` {number} The calculated ratio of `used` to `total` allocated bytes.",
                        "name": "utilization",
                        "type": "number",
                        "desc": "The calculated ratio of `used` to `total` allocated bytes."
                      }
                    ]
                  }
                }
              ]
            },
            {
              "textRaw": "`crypto.setEngine(engine[, flags])`",
              "name": "setEngine",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.11"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.4.0",
                      "v20.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53329",
                    "description": "Custom engine support in OpenSSL 3 is deprecated."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`engine` {string}",
                      "name": "engine",
                      "type": "string"
                    },
                    {
                      "textRaw": "`flags` {crypto.constants} **Default:** `crypto.constants.ENGINE_METHOD_ALL`",
                      "name": "flags",
                      "type": "crypto.constants",
                      "default": "`crypto.constants.ENGINE_METHOD_ALL`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Load and set the <code>engine</code> for some or all OpenSSL functions (selected by flags).\nSupport for custom engines in OpenSSL is deprecated from OpenSSL 3.</p>\n<p><code>engine</code> could be either an id or a path to the engine's shared library.</p>\n<p>The optional <code>flags</code> argument uses <code>ENGINE_METHOD_ALL</code> by default. The <code>flags</code>\nis a bit field taking one of or a mix of the following flags (defined in\n<code>crypto.constants</code>):</p>\n<ul>\n<li><code>crypto.constants.ENGINE_METHOD_RSA</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_DSA</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_DH</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_RAND</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_EC</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_CIPHERS</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_DIGESTS</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_PKEY_METHS</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_PKEY_ASN1_METHS</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_ALL</code></li>\n<li><code>crypto.constants.ENGINE_METHOD_NONE</code></li>\n</ul>"
            },
            {
              "textRaw": "`crypto.setFips(bool)`",
              "name": "setFips",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`bool` {boolean} `true` to enable FIPS mode.",
                      "name": "bool",
                      "type": "boolean",
                      "desc": "`true` to enable FIPS mode."
                    }
                  ]
                }
              ],
              "desc": "<p>Enables the FIPS compliant crypto provider in a FIPS-enabled Node.js build.\nThrows an error if FIPS mode is not available.</p>"
            },
            {
              "textRaw": "`crypto.sign(algorithm, data, key[, callback])`",
              "name": "sign",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62474",
                    "description": "Add support for Ed25519 context parameter."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59570",
                    "description": "Add support for ML-DSA, Ed448, and SLH-DSA context parameter."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA signing."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA signing."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v15.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37500",
                    "description": "Optional callback argument added."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29292",
                    "description": "This function now supports IEEE-P1363 DSA and ECDSA signatures."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|null|undefined}",
                      "name": "algorithm",
                      "type": "string|null|undefined"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView|string}",
                      "name": "data",
                      "type": "ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView|string"
                    },
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`signature` {Buffer}",
                          "name": "signature",
                          "type": "Buffer"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} if the `callback` function is not provided.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Calculates and returns the signature for <code>data</code> using the given private key and\nalgorithm. If <code>algorithm</code> is <code>null</code> or <code>undefined</code>, then the algorithm is\ndependent upon the key type.</p>\n<p><code>algorithm</code> is required to be <code>null</code> or <code>undefined</code> for Ed25519, Ed448, and\nML-DSA.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>. If it is an object, the following\nadditional properties can be passed:</p>\n<ul>\n<li>\n<p><code>dsaEncoding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> For DSA and ECDSA, this option specifies the\nformat of the generated signature. It can be one of the following:</p>\n<ul>\n<li><code>'der'</code> (default): DER-encoded ASN.1 signature structure encoding <code>(r, s)</code>.</li>\n<li><code>'ieee-p1363'</code>: Signature format <code>r || s</code> as proposed in IEEE-P1363.</li>\n</ul>\n</li>\n<li>\n<p><code>padding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Optional padding value for RSA, one of the following:</p>\n<ul>\n<li><code>crypto.constants.RSA_PKCS1_PADDING</code> (default)</li>\n<li><code>crypto.constants.RSA_PKCS1_PSS_PADDING</code></li>\n</ul>\n<p><code>RSA_PKCS1_PSS_PADDING</code> will use MGF1 with the same hash function\nused to sign the message as specified in section 3.1 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>.</p>\n</li>\n<li>\n<p><code>saltLength</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Salt length for when padding is <code>RSA_PKCS1_PSS_PADDING</code>. The special value\n<code>crypto.constants.RSA_PSS_SALTLEN_DIGEST</code> sets the salt length to the digest\nsize, <code>crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN</code> (default) sets it to the\nmaximum permissible value.</p>\n</li>\n<li>\n<p><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> For Ed25519<sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup>\n(using Ed25519ctx from <a href=\"https://www.rfc-editor.org/rfc/rfc8032.txt\">RFC 8032</a>), Ed448, ML-DSA, and SLH-DSA,\nthis option specifies the optional context to differentiate signatures\ngenerated for different purposes with the same key.</p>\n</li>\n</ul>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            },
            {
              "textRaw": "`crypto.timingSafeEqual(a, b)`",
              "name": "timingSafeEqual",
              "type": "method",
              "meta": {
                "added": [
                  "v6.6.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The a and b arguments can also be ArrayBuffer."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`a` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "a",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`b` {ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "b",
                      "type": "ArrayBuffer|Buffer|TypedArray|DataView"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>This function compares the underlying bytes that represent the given\n<code>ArrayBuffer</code>, <code>TypedArray</code>, or <code>DataView</code> instances using a constant-time\nalgorithm.</p>\n<p>This function does not leak timing information that\nwould allow an attacker to guess one of the values. This is suitable for\ncomparing HMAC digests or secret values like authentication cookies or\n<a href=\"https://www.w3.org/TR/capability-urls/\">capability urls</a>.</p>\n<p><code>a</code> and <code>b</code> must both be <code>Buffer</code>s, <code>TypedArray</code>s, or <code>DataView</code>s, and they\nmust have the same byte length. An error is thrown if <code>a</code> and <code>b</code> have\ndifferent byte lengths.</p>\n<p>If at least one of <code>a</code> and <code>b</code> is a <code>TypedArray</code> with more than one byte per\nentry, such as <code>Uint16Array</code>, the result will be computed using the platform\nbyte order.</p>\n<p><strong class=\"critical\">When both of the inputs are <code>Float32Array</code>s or\n<code>Float64Array</code>s, this function might return unexpected results due to IEEE 754\nencoding of floating-point numbers. In particular, neither <code>x === y</code> nor\n<code>Object.is(x, y)</code> implies that the byte representations of two floating-point\nnumbers <code>x</code> and <code>y</code> are equal.</strong></p>\n<p>Use of <code>crypto.timingSafeEqual</code> does not guarantee that the <em>surrounding</em> code\nis timing-safe. Care should be taken to ensure that the surrounding code does\nnot introduce timing vulnerabilities.</p>"
            },
            {
              "textRaw": "`crypto.verify(algorithm, data, key, signature[, callback])`",
              "name": "verify",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62474",
                    "description": "Add support for Ed25519 context parameter."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59570",
                    "description": "Add support for ML-DSA, Ed448, and SLH-DSA context parameter."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA signature verification."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA signature verification."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v15.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37500",
                    "description": "Optional callback argument added."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The data, key, and signature arguments can also be ArrayBuffer."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29292",
                    "description": "This function now supports IEEE-P1363 DSA and ECDSA signatures."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|null|undefined}",
                      "name": "algorithm",
                      "type": "string|null|undefined"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView|string}",
                      "name": "data",
                      "type": "ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView|string"
                    },
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey"
                    },
                    {
                      "textRaw": "`signature` {ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView}",
                      "name": "signature",
                      "type": "ArrayBuffer|Buffer|SharedArrayBuffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`result` {boolean}",
                          "name": "result",
                          "type": "boolean"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` or `false` depending on the validity of the signature for the data and public key if the `callback` function is not provided.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` or `false` depending on the validity of the signature for the data and public key if the `callback` function is not provided."
                  }
                }
              ],
              "desc": "<p>Verifies the given signature for <code>data</code> using the given key and algorithm. If\n<code>algorithm</code> is <code>null</code> or <code>undefined</code>, then the algorithm is dependent upon the\nkey type.</p>\n<p><code>algorithm</code> is required to be <code>null</code> or <code>undefined</code> for Ed25519, Ed448, and\nML-DSA.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if <code>key</code> had been\npassed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>. If it is an object, the following\nadditional properties can be passed:</p>\n<ul>\n<li>\n<p><code>dsaEncoding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> For DSA and ECDSA, this option specifies the\nformat of the signature. It can be one of the following:</p>\n<ul>\n<li><code>'der'</code> (default): DER-encoded ASN.1 signature structure encoding <code>(r, s)</code>.</li>\n<li><code>'ieee-p1363'</code>: Signature format <code>r || s</code> as proposed in IEEE-P1363.</li>\n</ul>\n</li>\n<li>\n<p><code>padding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Optional padding value for RSA, one of the following:</p>\n<ul>\n<li><code>crypto.constants.RSA_PKCS1_PADDING</code> (default)</li>\n<li><code>crypto.constants.RSA_PKCS1_PSS_PADDING</code></li>\n</ul>\n<p><code>RSA_PKCS1_PSS_PADDING</code> will use MGF1 with the same hash function\nused to sign the message as specified in section 3.1 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>.</p>\n</li>\n<li>\n<p><code>saltLength</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Salt length for when padding is <code>RSA_PKCS1_PSS_PADDING</code>. The special value\n<code>crypto.constants.RSA_PSS_SALTLEN_DIGEST</code> sets the salt length to the digest\nsize, <code>crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN</code> (default) sets it to the\nmaximum permissible value.</p>\n</li>\n<li>\n<p><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> For Ed25519<sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup>\n(using Ed25519ctx from <a href=\"https://www.rfc-editor.org/rfc/rfc8032.txt\">RFC 8032</a>), Ed448, ML-DSA, and SLH-DSA,\nthis option specifies the optional context to differentiate signatures\ngenerated for different purposes with the same key.</p>\n</li>\n</ul>\n<p>The <code>signature</code> argument is the previously calculated signature for the <code>data</code>.</p>\n<p>Because public keys can be derived from private keys, a private key or a public\nkey may be passed for <code>key</code>.</p>\n<p>If the <code>callback</code> function is provided this function uses libuv's threadpool.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "constants",
              "type": "Object",
              "meta": {
                "added": [
                  "v6.3.0"
                ],
                "changes": []
              },
              "desc": "<p>An object containing commonly used constants for crypto and security related\noperations. The specific constants currently defined are described in\n<a href=\"#crypto-constants\">Crypto constants</a>.</p>"
            },
            {
              "textRaw": "`crypto.fips`",
              "name": "fips",
              "type": "property",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": [],
                "deprecated": [
                  "v10.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "desc": "<p>Property for checking and controlling whether a FIPS compliant crypto provider\nis currently in use. Setting to true requires a FIPS build of Node.js.</p>\n<p>This property is deprecated. Please use <code>crypto.setFips()</code> and\n<code>crypto.getFips()</code> instead.</p>"
            },
            {
              "textRaw": "Type: {SubtleCrypto}",
              "name": "subtle",
              "type": "SubtleCrypto",
              "meta": {
                "added": [
                  "v17.4.0"
                ],
                "changes": []
              },
              "desc": "<p>A convenient alias for <a href=\"webcrypto.html#class-subtlecrypto\"><code>crypto.webcrypto.subtle</code></a>.</p>"
            },
            {
              "textRaw": "`crypto.webcrypto`",
              "name": "webcrypto",
              "type": "property",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Type: <a href=\"webcrypto.html#class-crypto\"><code>&#x3C;Crypto></code></a> An implementation of the Web Crypto API standard.</p>\n<p>See the <a href=\"webcrypto.html\">Web Crypto API documentation</a> for details.</p>"
            }
          ],
          "displayName": "`node:crypto` module methods and properties"
        },
        {
          "textRaw": "Notes",
          "name": "notes",
          "type": "module",
          "modules": [
            {
              "textRaw": "Using strings as inputs to cryptographic APIs",
              "name": "using_strings_as_inputs_to_cryptographic_apis",
              "type": "module",
              "desc": "<p>For historical reasons, many cryptographic APIs provided by Node.js accept\nstrings as inputs where the underlying cryptographic algorithm works on byte\nsequences. These instances include plaintexts, ciphertexts, symmetric keys,\ninitialization vectors, passphrases, salts, authentication tags,\nand additional authenticated data.</p>\n<p>When passing strings to cryptographic APIs, consider the following factors.</p>\n<ul>\n<li>\n<p>Not all byte sequences are valid UTF-8 strings. Therefore, when a byte\nsequence of length <code>n</code> is derived from a string, its entropy is generally\nlower than the entropy of a random or pseudorandom <code>n</code> byte sequence.\nFor example, no UTF-8 string will result in the byte sequence <code>c0 af</code>. Secret\nkeys should almost exclusively be random or pseudorandom byte sequences.</p>\n</li>\n<li>\n<p>Similarly, when converting random or pseudorandom byte sequences to UTF-8\nstrings, subsequences that do not represent valid code points may be replaced\nby the Unicode replacement character (<code>U+FFFD</code>). The byte representation of\nthe resulting Unicode string may, therefore, not be equal to the byte sequence\nthat the string was created from.</p>\n<pre><code class=\"language-js\">const original = [0xc0, 0xaf];\nconst bytesAsString = Buffer.from(original).toString('utf8');\nconst stringAsBytes = Buffer.from(bytesAsString, 'utf8');\nconsole.log(stringAsBytes);\n// Prints '&#x3C;Buffer ef bf bd ef bf bd>'.\n</code></pre>\n<p>The outputs of ciphers, hash functions, signature algorithms, and key\nderivation functions are pseudorandom byte sequences and should not be\nused as Unicode strings.</p>\n</li>\n<li>\n<p>When strings are obtained from user input, some Unicode characters can be\nrepresented in multiple equivalent ways that result in different byte\nsequences. For example, when passing a user passphrase to a key derivation\nfunction, such as PBKDF2 or scrypt, the result of the key derivation function\ndepends on whether the string uses composed or decomposed characters. Node.js\ndoes not normalize character representations. Developers should consider using\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize\"><code>String.prototype.normalize()</code></a> on user inputs before passing them to\ncryptographic APIs.</p>\n</li>\n</ul>",
              "displayName": "Using strings as inputs to cryptographic APIs"
            },
            {
              "textRaw": "Legacy streams API (prior to Node.js 0.10)",
              "name": "legacy_streams_api_(prior_to_node.js_0.10)",
              "type": "module",
              "desc": "<p>The Crypto module was added to Node.js before there was the concept of a\nunified Stream API, and before there were <a href=\"buffer.html\"><code>Buffer</code></a> objects for handling\nbinary data. As such, many <code>crypto</code> classes have methods not\ntypically found on other Node.js classes that implement the <a href=\"stream.html\">streams</a>\nAPI (e.g. <code>update()</code>, <code>final()</code>, or <code>digest()</code>). Also, many methods accepted\nand returned <code>'latin1'</code> encoded strings by default rather than <code>Buffer</code>s. This\ndefault was changed in Node.js 0.9.3 to use <a href=\"buffer.html\"><code>Buffer</code></a> objects by default\ninstead.</p>",
              "displayName": "Legacy streams API (prior to Node.js 0.10)"
            },
            {
              "textRaw": "Support for weak or compromised algorithms",
              "name": "support_for_weak_or_compromised_algorithms",
              "type": "module",
              "desc": "<p>The <code>node:crypto</code> module still supports some algorithms which are already\ncompromised and are not recommended for use. The API also allows\nthe use of ciphers and hashes with a small key size that are too weak for safe\nuse.</p>\n<p>Users should take full responsibility for selecting the crypto\nalgorithm and key size according to their security requirements.</p>\n<p>Based on the recommendations of <a href=\"https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-131Ar2.pdf\">NIST SP 800-131A</a>:</p>\n<ul>\n<li>MD5 and SHA-1 are no longer acceptable where collision resistance is\nrequired such as digital signatures.</li>\n<li>The key used with RSA, DSA, and DH algorithms is recommended to have\nat least 2048 bits and that of the curve of ECDSA and ECDH at least\n224 bits, to be safe to use for several years.</li>\n<li>The DH groups of <code>modp1</code>, <code>modp2</code> and <code>modp5</code> have a key size\nsmaller than 2048 bits and are not recommended.</li>\n</ul>\n<p>See the reference for other recommendations and details.</p>\n<p>Some algorithms that have known weaknesses and are of little relevance in\npractice are only available through the <a href=\"cli.html#--openssl-legacy-provider\">legacy provider</a>, which is not\nenabled by default.</p>",
              "displayName": "Support for weak or compromised algorithms"
            },
            {
              "textRaw": "CCM mode",
              "name": "ccm_mode",
              "type": "module",
              "desc": "<p>CCM is one of the supported <a href=\"https://en.wikipedia.org/wiki/Authenticated_encryption\">AEAD algorithms</a>. Applications which use this\nmode must adhere to certain restrictions when using the cipher API:</p>\n<ul>\n<li>The authentication tag length must be specified during cipher creation by\nsetting the <code>authTagLength</code> option and must be one of 4, 6, 8, 10, 12, 14 or\n16 bytes.</li>\n<li>The length of the initialization vector (nonce) <code>N</code> must be between 7 and 13\nbytes (<code>7 ≤ N ≤ 13</code>).</li>\n<li>The length of the plaintext is limited to <code>2 ** (8 * (15 - N))</code> bytes.</li>\n<li>When decrypting, the authentication tag must be set via <code>setAuthTag()</code> before\ncalling <code>update()</code>.\nOtherwise, decryption will fail and <code>final()</code> will throw an error in\ncompliance with section 2.6 of <a href=\"https://www.rfc-editor.org/rfc/rfc3610.txt\">RFC 3610</a>.</li>\n<li>Using stream methods such as <code>write(data)</code>, <code>end(data)</code> or <code>pipe()</code> in CCM\nmode might fail as CCM cannot handle more than one chunk of data per instance.</li>\n<li>When passing additional authenticated data (AAD), the length of the actual\nmessage in bytes must be passed to <code>setAAD()</code> via the <code>plaintextLength</code>\noption.\nMany crypto libraries include the authentication tag in the ciphertext,\nwhich means that they produce ciphertexts of the length\n<code>plaintextLength + authTagLength</code>. Node.js does not include the authentication\ntag, so the ciphertext length is always <code>plaintextLength</code>.\nThis is not necessary if no AAD is used.</li>\n<li>As CCM processes the whole message at once, <code>update()</code> must be called exactly\nonce.</li>\n<li>Even though calling <code>update()</code> is sufficient to encrypt/decrypt the message,\napplications <em>must</em> call <code>final()</code> to compute or verify the\nauthentication tag.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  createCipheriv,\n  createDecipheriv,\n  randomBytes,\n} = await import('node:crypto');\n\nconst key = 'keykeykeykeykeykeykeykey';\nconst nonce = randomBytes(12);\n\nconst aad = Buffer.from('0123456789', 'hex');\n\nconst cipher = createCipheriv('aes-192-ccm', key, nonce, {\n  authTagLength: 16,\n});\nconst plaintext = 'Hello world';\ncipher.setAAD(aad, {\n  plaintextLength: Buffer.byteLength(plaintext),\n});\nconst ciphertext = cipher.update(plaintext, 'utf8');\ncipher.final();\nconst tag = cipher.getAuthTag();\n\n// Now transmit { ciphertext, nonce, tag }.\n\nconst decipher = createDecipheriv('aes-192-ccm', key, nonce, {\n  authTagLength: 16,\n});\ndecipher.setAuthTag(tag);\ndecipher.setAAD(aad, {\n  plaintextLength: ciphertext.length,\n});\nconst receivedPlaintext = decipher.update(ciphertext, null, 'utf8');\n\ntry {\n  decipher.final();\n} catch (err) {\n  throw new Error('Authentication failed!', { cause: err });\n}\n\nconsole.log(receivedPlaintext);\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\nconst {\n  createCipheriv,\n  createDecipheriv,\n  randomBytes,\n} = require('node:crypto');\n\nconst key = 'keykeykeykeykeykeykeykey';\nconst nonce = randomBytes(12);\n\nconst aad = Buffer.from('0123456789', 'hex');\n\nconst cipher = createCipheriv('aes-192-ccm', key, nonce, {\n  authTagLength: 16,\n});\nconst plaintext = 'Hello world';\ncipher.setAAD(aad, {\n  plaintextLength: Buffer.byteLength(plaintext),\n});\nconst ciphertext = cipher.update(plaintext, 'utf8');\ncipher.final();\nconst tag = cipher.getAuthTag();\n\n// Now transmit { ciphertext, nonce, tag }.\n\nconst decipher = createDecipheriv('aes-192-ccm', key, nonce, {\n  authTagLength: 16,\n});\ndecipher.setAuthTag(tag);\ndecipher.setAAD(aad, {\n  plaintextLength: ciphertext.length,\n});\nconst receivedPlaintext = decipher.update(ciphertext, null, 'utf8');\n\ntry {\n  decipher.final();\n} catch (err) {\n  throw new Error('Authentication failed!', { cause: err });\n}\n\nconsole.log(receivedPlaintext);\n</code></pre>",
              "displayName": "CCM mode"
            },
            {
              "textRaw": "FIPS mode",
              "name": "fips_mode",
              "type": "module",
              "desc": "<p>When using OpenSSL 3, Node.js supports FIPS 140-2 when used with an appropriate\nOpenSSL 3 provider, such as the <a href=\"https://www.openssl.org/docs/man3.0/man7/crypto.html#FIPS-provider\">FIPS provider from OpenSSL 3</a> which can be\ninstalled by following the instructions in <a href=\"https://github.com/openssl/openssl/blob/openssl-3.0/README-FIPS.md\">OpenSSL's FIPS README file</a>.</p>\n<p>For FIPS support in Node.js you will need:</p>\n<ul>\n<li>A correctly installed OpenSSL 3 FIPS provider.</li>\n<li>An OpenSSL 3 <a href=\"https://www.openssl.org/docs/man3.0/man5/fips_config.html\">FIPS module configuration file</a>.</li>\n<li>An OpenSSL 3 configuration file that references the FIPS module\nconfiguration file.</li>\n</ul>\n<p>Node.js will need to be configured with an OpenSSL configuration file that\npoints to the FIPS provider. An example configuration file looks like this:</p>\n<pre><code class=\"language-text\">nodejs_conf = nodejs_init\n\n.include /&#x3C;absolute path>/fipsmodule.cnf\n\n[nodejs_init]\nproviders = provider_sect\n\n[provider_sect]\ndefault = default_sect\n# The fips section name should match the section name inside the\n# included fipsmodule.cnf.\nfips = fips_sect\n\n[default_sect]\nactivate = 1\n</code></pre>\n<p>where <code>fipsmodule.cnf</code> is the FIPS module configuration file generated from the\nFIPS provider installation step:</p>\n<pre><code class=\"language-bash\">openssl fipsinstall\n</code></pre>\n<p>Set the <code>OPENSSL_CONF</code> environment variable to point to\nyour configuration file and <code>OPENSSL_MODULES</code> to the location of the FIPS\nprovider dynamic library. e.g.</p>\n<pre><code class=\"language-bash\">export OPENSSL_CONF=/&#x3C;path to configuration file>/nodejs.cnf\nexport OPENSSL_MODULES=/&#x3C;path to openssl lib>/ossl-modules\n</code></pre>\n<p>FIPS mode can then be enabled in Node.js either by:</p>\n<ul>\n<li>Starting Node.js with <code>--enable-fips</code> or <code>--force-fips</code> command line flags.</li>\n<li>Programmatically calling <code>crypto.setFips(true)</code>.</li>\n</ul>\n<p>Optionally FIPS mode can be enabled in Node.js via the OpenSSL configuration\nfile. e.g.</p>\n<pre><code class=\"language-text\">nodejs_conf = nodejs_init\n\n.include /&#x3C;absolute path>/fipsmodule.cnf\n\n[nodejs_init]\nproviders = provider_sect\nalg_section = algorithm_sect\n\n[provider_sect]\ndefault = default_sect\n# The fips section name should match the section name inside the\n# included fipsmodule.cnf.\nfips = fips_sect\n\n[default_sect]\nactivate = 1\n\n[algorithm_sect]\ndefault_properties = fips=yes\n</code></pre>",
              "displayName": "FIPS mode"
            }
          ],
          "displayName": "Notes"
        },
        {
          "textRaw": "Crypto constants",
          "name": "crypto_constants",
          "type": "module",
          "desc": "<p>The following constants exported by <code>crypto.constants</code> apply to various uses of\nthe <code>node:crypto</code>, <code>node:tls</code>, and <code>node:https</code> modules and are generally\nspecific to OpenSSL.</p>",
          "modules": [
            {
              "textRaw": "OpenSSL options",
              "name": "openssl_options",
              "type": "module",
              "desc": "<p>See the <a href=\"https://wiki.openssl.org/index.php/List_of_SSL_OP_Flags#Table_of_Options\">list of SSL OP Flags</a> for details.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_ALL</code></td>\n    <td>Applies multiple bug workarounds within OpenSSL. See\n    <a href=\"https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html</a>\n    for detail.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_ALLOW_NO_DHE_KEX</code></td>\n    <td>Instructs OpenSSL to allow a non-[EC]DHE-based key exchange mode\n    for TLS v1.3</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION</code></td>\n    <td>Allows legacy insecure renegotiation between OpenSSL and unpatched\n    clients or servers. See\n    <a href=\"https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html</a>.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_CIPHER_SERVER_PREFERENCE</code></td>\n    <td>Attempts to use the server's preferences instead of the client's when\n    selecting a cipher. Behavior depends on protocol version. See\n    <a href=\"https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html\">https://www.openssl.org/docs/man3.0/man3/SSL_CTX_set_options.html</a>.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_CISCO_ANYCONNECT</code></td>\n    <td>Instructs OpenSSL to use Cisco's version identifier of DTLS_BAD_VER.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_COOKIE_EXCHANGE</code></td>\n    <td>Instructs OpenSSL to turn on cookie exchange.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_CRYPTOPRO_TLSEXT_BUG</code></td>\n    <td>Instructs OpenSSL to add server-hello extension from an early version\n    of the cryptopro draft.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS</code></td>\n    <td>Instructs OpenSSL to disable an SSL 3.0/TLS 1.0 vulnerability\n    workaround added in OpenSSL 0.9.6d.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_LEGACY_SERVER_CONNECT</code></td>\n    <td>Allows initial connection to servers that do not support RI.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_COMPRESSION</code></td>\n    <td>Instructs OpenSSL to disable support for SSL/TLS compression.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_ENCRYPT_THEN_MAC</code></td>\n    <td>Instructs OpenSSL to disable encrypt-then-MAC.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_QUERY_MTU</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_RENEGOTIATION</code></td>\n    <td>Instructs OpenSSL to disable renegotiation.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION</code></td>\n    <td>Instructs OpenSSL to always start a new session when performing\n    renegotiation.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_SSLv2</code></td>\n    <td>Instructs OpenSSL to turn off SSL v2</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_SSLv3</code></td>\n    <td>Instructs OpenSSL to turn off SSL v3</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TICKET</code></td>\n    <td>Instructs OpenSSL to disable use of RFC4507bis tickets.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TLSv1</code></td>\n    <td>Instructs OpenSSL to turn off TLS v1</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TLSv1_1</code></td>\n    <td>Instructs OpenSSL to turn off TLS v1.1</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TLSv1_2</code></td>\n    <td>Instructs OpenSSL to turn off TLS v1.2</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_NO_TLSv1_3</code></td>\n    <td>Instructs OpenSSL to turn off TLS v1.3</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_PRIORITIZE_CHACHA</code></td>\n    <td>Instructs OpenSSL server to prioritize ChaCha20-Poly1305\n    when the client does.\n    This option has no effect if\n    <code>SSL_OP_CIPHER_SERVER_PREFERENCE</code>\n    is not enabled.</td>\n  </tr>\n  <tr>\n    <td><code>SSL_OP_TLS_ROLLBACK_BUG</code></td>\n    <td>Instructs OpenSSL to disable version rollback attack detection.</td>\n  </tr>\n</table>",
              "displayName": "OpenSSL options"
            },
            {
              "textRaw": "OpenSSL engine constants",
              "name": "openssl_engine_constants",
              "type": "module",
              "desc": "<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_RSA</code></td>\n    <td>Limit engine usage to RSA</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_DSA</code></td>\n    <td>Limit engine usage to DSA</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_DH</code></td>\n    <td>Limit engine usage to DH</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_RAND</code></td>\n    <td>Limit engine usage to RAND</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_EC</code></td>\n    <td>Limit engine usage to EC</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_CIPHERS</code></td>\n    <td>Limit engine usage to CIPHERS</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_DIGESTS</code></td>\n    <td>Limit engine usage to DIGESTS</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_PKEY_METHS</code></td>\n    <td>Limit engine usage to PKEY_METHS</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_PKEY_ASN1_METHS</code></td>\n    <td>Limit engine usage to PKEY_ASN1_METHS</td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_ALL</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>ENGINE_METHOD_NONE</code></td>\n    <td></td>\n  </tr>\n</table>",
              "displayName": "OpenSSL engine constants"
            },
            {
              "textRaw": "Other OpenSSL constants",
              "name": "other_openssl_constants",
              "type": "module",
              "desc": "<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>DH_CHECK_P_NOT_SAFE_PRIME</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>DH_CHECK_P_NOT_PRIME</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>DH_UNABLE_TO_CHECK_GENERATOR</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>DH_NOT_SUITABLE_GENERATOR</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_PKCS1_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_SSLV23_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_NO_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_PKCS1_OAEP_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_X931_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_PKCS1_PSS_PADDING</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>RSA_PSS_SALTLEN_DIGEST</code></td>\n    <td>Sets the salt length for <code>RSA_PKCS1_PSS_PADDING</code> to the\n        digest size when signing or verifying.</td>\n  </tr>\n  <tr>\n    <td><code>RSA_PSS_SALTLEN_MAX_SIGN</code></td>\n    <td>Sets the salt length for <code>RSA_PKCS1_PSS_PADDING</code> to the\n        maximum permissible value when signing data.</td>\n  </tr>\n  <tr>\n    <td><code>RSA_PSS_SALTLEN_AUTO</code></td>\n    <td>Causes the salt length for <code>RSA_PKCS1_PSS_PADDING</code> to be\n        determined automatically when verifying a signature.</td>\n  </tr>\n  <tr>\n    <td><code>POINT_CONVERSION_COMPRESSED</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>POINT_CONVERSION_UNCOMPRESSED</code></td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><code>POINT_CONVERSION_HYBRID</code></td>\n    <td></td>\n  </tr>\n</table>",
              "displayName": "Other OpenSSL constants"
            },
            {
              "textRaw": "Node.js crypto constants",
              "name": "node.js_crypto_constants",
              "type": "module",
              "desc": "<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>defaultCoreCipherList</code></td>\n    <td>Specifies the built-in default cipher list used by Node.js.</td>\n  </tr>\n  <tr>\n    <td><code>defaultCipherList</code></td>\n    <td>Specifies the active default cipher list used by the current Node.js\n    process.</td>\n  </tr>\n</table>",
              "displayName": "Node.js crypto constants"
            }
          ],
          "displayName": "Crypto constants"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Certificate`",
          "name": "Certificate",
          "type": "class",
          "meta": {
            "added": [
              "v0.11.8"
            ],
            "changes": []
          },
          "desc": "<p>SPKAC is a Certificate Signing Request mechanism originally implemented by\nNetscape and was specified formally as part of HTML5's <code>keygen</code> element.</p>\n<p><code>&#x3C;keygen></code> is deprecated since <a href=\"https://www.w3.org/TR/html52/changes.html#features-removed\">HTML 5.2</a> and new projects\nshould not use this element anymore.</p>\n<p>The <code>node:crypto</code> module provides the <code>Certificate</code> class for working with SPKAC\ndata. The most common usage is handling output generated by the HTML5\n<code>&#x3C;keygen></code> element. Node.js uses <a href=\"https://www.openssl.org/docs/man3.0/man1/openssl-spkac.html\">OpenSSL's SPKAC implementation</a> internally.</p>",
          "classMethods": [
            {
              "textRaw": "Static method: `Certificate.exportChallenge(spkac[, encoding])`",
              "name": "exportChallenge",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The spkac argument can be an ArrayBuffer. Limited the size of the spkac argument to a maximum of 2**31 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "spkac",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `spkac` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} The challenge component of the `spkac` data structure, which includes a public key and a challenge.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "The challenge component of the `spkac` data structure, which includes a public key and a challenge."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\nconst spkac = getSpkacSomehow();\nconst challenge = Certificate.exportChallenge(spkac);\nconsole.log(challenge.toString('utf8'));\n// Prints: the challenge as a UTF8 string\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\nconst spkac = getSpkacSomehow();\nconst challenge = Certificate.exportChallenge(spkac);\nconsole.log(challenge.toString('utf8'));\n// Prints: the challenge as a UTF8 string\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Certificate.exportPublicKey(spkac[, encoding])`",
              "name": "exportPublicKey",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The spkac argument can be an ArrayBuffer. Limited the size of the spkac argument to a maximum of 2**31 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "spkac",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `spkac` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} The public key component of the `spkac` data structure, which includes a public key and a challenge.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "The public key component of the `spkac` data structure, which includes a public key and a challenge."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\nconst spkac = getSpkacSomehow();\nconst publicKey = Certificate.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\nconst spkac = getSpkacSomehow();\nconst publicKey = Certificate.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>"
            },
            {
              "textRaw": "Static method: `Certificate.verifySpkac(spkac[, encoding])`",
              "name": "verifySpkac",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The spkac argument can be an ArrayBuffer. Added encoding. Limited the size of the spkac argument to a maximum of 2**31 - 1 bytes."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "spkac",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `spkac` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if the given `spkac` data structure is valid, `false` otherwise.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if the given `spkac` data structure is valid, `false` otherwise."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { Certificate } = await import('node:crypto');\n\nconst spkac = getSpkacSomehow();\nconsole.log(Certificate.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\nconst { Certificate } = require('node:crypto');\n\nconst spkac = getSpkacSomehow();\nconsole.log(Certificate.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>"
            }
          ],
          "modules": [
            {
              "textRaw": "Legacy API",
              "name": "legacy_api",
              "type": "module",
              "stability": 0,
              "stabilityText": "Deprecated",
              "desc": "<p>As a legacy interface, it is possible to create new instances of\nthe <code>crypto.Certificate</code> class as illustrated in the examples below.</p>",
              "signatures": [
                {
                  "textRaw": "`new crypto.Certificate()`",
                  "name": "crypto.Certificate",
                  "type": "ctor",
                  "params": [],
                  "desc": "<p>Instances of the <code>Certificate</code> class can be created using the <code>new</code> keyword\nor by calling <code>crypto.Certificate()</code> as a function:</p>\n<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\n\nconst cert1 = new Certificate();\nconst cert2 = Certificate();\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\n\nconst cert1 = new Certificate();\nconst cert2 = Certificate();\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`certificate.exportChallenge(spkac[, encoding])`",
                  "name": "exportChallenge",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                          "name": "spkac",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The encoding of the `spkac` string.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Buffer} The challenge component of the `spkac` data structure, which includes a public key and a challenge.",
                        "name": "return",
                        "type": "Buffer",
                        "desc": "The challenge component of the `spkac` data structure, which includes a public key and a challenge."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconst challenge = cert.exportChallenge(spkac);\nconsole.log(challenge.toString('utf8'));\n// Prints: the challenge as a UTF8 string\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconst challenge = cert.exportChallenge(spkac);\nconsole.log(challenge.toString('utf8'));\n// Prints: the challenge as a UTF8 string\n</code></pre>"
                },
                {
                  "textRaw": "`certificate.exportPublicKey(spkac[, encoding])`",
                  "name": "exportPublicKey",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                          "name": "spkac",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The encoding of the `spkac` string.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Buffer} The public key component of the `spkac` data structure, which includes a public key and a challenge.",
                        "name": "return",
                        "type": "Buffer",
                        "desc": "The public key component of the `spkac` data structure, which includes a public key and a challenge."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">const { Certificate } = await import('node:crypto');\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconst publicKey = cert.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>\n<pre><code class=\"language-cjs\">const { Certificate } = require('node:crypto');\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconst publicKey = cert.exportPublicKey(spkac);\nconsole.log(publicKey);\n// Prints: the public key as &#x3C;Buffer ...>\n</code></pre>"
                },
                {
                  "textRaw": "`certificate.verifySpkac(spkac[, encoding])`",
                  "name": "verifySpkac",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.11.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`spkac` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                          "name": "spkac",
                          "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`encoding` {string} The encoding of the `spkac` string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The encoding of the `spkac` string.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if the given `spkac` data structure is valid, `false` otherwise.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if the given `spkac` data structure is valid, `false` otherwise."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst { Certificate } = await import('node:crypto');\n\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconsole.log(cert.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\nconst { Certificate } = require('node:crypto');\n\nconst cert = Certificate();\nconst spkac = getSpkacSomehow();\nconsole.log(cert.verifySpkac(Buffer.from(spkac)));\n// Prints: true or false\n</code></pre>"
                }
              ],
              "displayName": "Legacy API"
            }
          ]
        },
        {
          "textRaw": "Class: `Cipheriv`",
          "name": "Cipheriv",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a></li>\n</ul>\n<p>Instances of the <code>Cipheriv</code> class are used to encrypt data. The class can be\nused in one of two ways:</p>\n<ul>\n<li>As a <a href=\"stream.html\">stream</a> that is both readable and writable, where plain unencrypted\ndata is written to produce encrypted data on the readable side, or</li>\n<li>Using the <a href=\"#cipherupdatedata-inputencoding-outputencoding\"><code>cipher.update()</code></a> and <a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> methods to produce\nthe encrypted data.</li>\n</ul>\n<p>The <a href=\"#cryptocreatecipherivalgorithm-key-iv-options\"><code>crypto.createCipheriv()</code></a> method is\nused to create <code>Cipheriv</code> instances. <code>Cipheriv</code> objects are not to be created\ndirectly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Cipheriv</code> objects as streams:</p>\n<pre><code class=\"language-mjs\">const {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    // Once we have the key and iv, we can create and use the cipher...\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    let encrypted = '';\n    cipher.setEncoding('hex');\n\n    cipher.on('data', (chunk) => encrypted += chunk);\n    cipher.on('end', () => console.log(encrypted));\n\n    cipher.write('some clear text data');\n    cipher.end();\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = require('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    // Once we have the key and iv, we can create and use the cipher...\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    let encrypted = '';\n    cipher.setEncoding('hex');\n\n    cipher.on('data', (chunk) => encrypted += chunk);\n    cipher.on('end', () => console.log(encrypted));\n\n    cipher.write('some clear text data');\n    cipher.end();\n  });\n});\n</code></pre>\n<p>Example: Using <code>Cipheriv</code> and piped streams:</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n  createWriteStream,\n} from 'node:fs';\n\nimport {\n  pipeline,\n} from 'node:stream';\n\nconst {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    const input = createReadStream('test.js');\n    const output = createWriteStream('test.enc');\n\n    pipeline(input, cipher, output, (err) => {\n      if (err) throw err;\n    });\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n  createWriteStream,\n} = require('node:fs');\n\nconst {\n  pipeline,\n} = require('node:stream');\n\nconst {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = require('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    const input = createReadStream('test.js');\n    const output = createWriteStream('test.enc');\n\n    pipeline(input, cipher, output, (err) => {\n      if (err) throw err;\n    });\n  });\n});\n</code></pre>\n<p>Example: Using the <a href=\"#cipherupdatedata-inputencoding-outputencoding\"><code>cipher.update()</code></a> and <a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">const {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    let encrypted = cipher.update('some clear text data', 'utf8', 'hex');\n    encrypted += cipher.final('hex');\n    console.log(encrypted);\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scrypt,\n  randomFill,\n  createCipheriv,\n} = require('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n\n// First, we'll generate the key. The key length is dependent on the algorithm.\n// In this case for aes192, it is 24 bytes (192 bits).\nscrypt(password, 'salt', 24, (err, key) => {\n  if (err) throw err;\n  // Then, we'll generate a random initialization vector\n  randomFill(new Uint8Array(16), (err, iv) => {\n    if (err) throw err;\n\n    const cipher = createCipheriv(algorithm, key, iv);\n\n    let encrypted = cipher.update('some clear text data', 'utf8', 'hex');\n    encrypted += cipher.final('hex');\n    console.log(encrypted);\n  });\n});\n</code></pre>",
          "methods": [
            {
              "textRaw": "`cipher.final([outputEncoding])`",
              "name": "final",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a `Buffer` is returned.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "Any remaining enciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a `Buffer` is returned."
                  }
                }
              ],
              "desc": "<p>Once the <code>cipher.final()</code> method has been called, the <code>Cipheriv</code> object can no\nlonger be used to encrypt data. Attempts to call <code>cipher.final()</code> more than\nonce will result in an error being thrown.</p>"
            },
            {
              "textRaw": "`cipher.getAuthTag()`",
              "name": "getAuthTag",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer} When using an authenticated encryption mode (`GCM`, `CCM`, `OCB`, and `chacha20-poly1305` are currently supported), the `cipher.getAuthTag()` method returns a `Buffer` containing the _authentication tag_ that has been computed from the given data.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "When using an authenticated encryption mode (`GCM`, `CCM`, `OCB`, and `chacha20-poly1305` are currently supported), the `cipher.getAuthTag()` method returns a `Buffer` containing the _authentication tag_ that has been computed from the given data."
                  }
                }
              ],
              "desc": "<p>The <code>cipher.getAuthTag()</code> method should only be called after encryption has\nbeen completed using the <a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> method.</p>\n<p>If the <code>authTagLength</code> option was set during the <code>cipher</code> instance's creation,\nthis function will return exactly <code>authTagLength</code> bytes.</p>"
            },
            {
              "textRaw": "`cipher.setAAD(buffer[, options])`",
              "name": "setAAD",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "options": [
                        {
                          "textRaw": "`plaintextLength` {number}",
                          "name": "plaintextLength",
                          "type": "number"
                        },
                        {
                          "textRaw": "`encoding` {string} The string encoding to use when `buffer` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "The string encoding to use when `buffer` is a string."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Cipheriv} The same `Cipheriv` instance for method chaining.",
                    "name": "return",
                    "type": "Cipheriv",
                    "desc": "The same `Cipheriv` instance for method chaining."
                  }
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code>, <code>OCB</code>, and\n<code>chacha20-poly1305</code> are\ncurrently supported), the <code>cipher.setAAD()</code> method sets the value used for the\n<em>additional authenticated data</em> (AAD) input parameter.</p>\n<p>The <code>plaintextLength</code> option is optional for <code>GCM</code> and <code>OCB</code>. When using <code>CCM</code>,\nthe <code>plaintextLength</code> option must be specified and its value must match the\nlength of the plaintext in bytes. See <a href=\"#ccm-mode\">CCM mode</a>.</p>\n<p>The <code>cipher.setAAD()</code> method must be called before <a href=\"#cipherupdatedata-inputencoding-outputencoding\"><code>cipher.update()</code></a>.</p>"
            },
            {
              "textRaw": "`cipher.setAutoPadding([autoPadding])`",
              "name": "setAutoPadding",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`autoPadding` {boolean} **Default:** `true`",
                      "name": "autoPadding",
                      "type": "boolean",
                      "default": "`true`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Cipheriv} The same `Cipheriv` instance for method chaining.",
                    "name": "return",
                    "type": "Cipheriv",
                    "desc": "The same `Cipheriv` instance for method chaining."
                  }
                }
              ],
              "desc": "<p>When using block encryption algorithms, the <code>Cipheriv</code> class will automatically\nadd padding to the input data to the appropriate block size. To disable the\ndefault padding call <code>cipher.setAutoPadding(false)</code>.</p>\n<p>When <code>autoPadding</code> is <code>false</code>, the length of the entire input data must be a\nmultiple of the cipher's block size or <a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> will throw an error.\nDisabling automatic padding is useful for non-standard padding, for instance\nusing <code>0x0</code> instead of PKCS padding.</p>\n<p>The <code>cipher.setAutoPadding()</code> method must be called before\n<a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a>.</p>"
            },
            {
              "textRaw": "`cipher.update(data[, inputEncoding][, outputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the data.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the data.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Updates the cipher with <code>data</code>. If the <code>inputEncoding</code> argument is given,\nthe <code>data</code>\nargument is a string using the specified encoding. If the <code>inputEncoding</code>\nargument is not given, <code>data</code> must be a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code>, then\n<code>inputEncoding</code> is ignored.</p>\n<p>The <code>outputEncoding</code> specifies the output format of the enciphered\ndata. If the <code>outputEncoding</code>\nis specified, a string using the specified encoding is returned. If no\n<code>outputEncoding</code> is provided, a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p>The <code>cipher.update()</code> method can be called multiple times with new data until\n<a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> is called. Calling <code>cipher.update()</code> after\n<a href=\"#cipherfinaloutputencoding\"><code>cipher.final()</code></a> will result in an error being thrown.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Decipheriv`",
          "name": "Decipheriv",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a></li>\n</ul>\n<p>Instances of the <code>Decipheriv</code> class are used to decrypt data. The class can be\nused in one of two ways:</p>\n<ul>\n<li>As a <a href=\"stream.html\">stream</a> that is both readable and writable, where plain encrypted\ndata is written to produce unencrypted data on the readable side, or</li>\n<li>Using the <a href=\"#decipherupdatedata-inputencoding-outputencoding\"><code>decipher.update()</code></a> and <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> methods to\nproduce the unencrypted data.</li>\n</ul>\n<p>The <a href=\"#cryptocreatedecipherivalgorithm-key-iv-options\"><code>crypto.createDecipheriv()</code></a> method is\nused to create <code>Decipheriv</code> instances. <code>Decipheriv</code> objects are not to be created\ndirectly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Decipheriv</code> objects as streams:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  scryptSync,\n  createDecipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Key length is dependent on the algorithm. In this case for aes192, it is\n// 24 bytes (192 bits).\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\nlet decrypted = '';\ndecipher.on('readable', () => {\n  let chunk;\n  while (null !== (chunk = decipher.read())) {\n    decrypted += chunk.toString('utf8');\n  }\n});\ndecipher.on('end', () => {\n  console.log(decrypted);\n  // Prints: some clear text data\n});\n\n// Encrypted with same algorithm, key and iv.\nconst encrypted =\n  'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';\ndecipher.write(encrypted, 'hex');\ndecipher.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scryptSync,\n  createDecipheriv,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Key length is dependent on the algorithm. In this case for aes192, it is\n// 24 bytes (192 bits).\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\nlet decrypted = '';\ndecipher.on('readable', () => {\n  let chunk;\n  while (null !== (chunk = decipher.read())) {\n    decrypted += chunk.toString('utf8');\n  }\n});\ndecipher.on('end', () => {\n  console.log(decrypted);\n  // Prints: some clear text data\n});\n\n// Encrypted with same algorithm, key and iv.\nconst encrypted =\n  'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';\ndecipher.write(encrypted, 'hex');\ndecipher.end();\n</code></pre>\n<p>Example: Using <code>Decipheriv</code> and piped streams:</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n  createWriteStream,\n} from 'node:fs';\nimport { Buffer } from 'node:buffer';\nconst {\n  scryptSync,\n  createDecipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\nconst input = createReadStream('test.enc');\nconst output = createWriteStream('test.js');\n\ninput.pipe(decipher).pipe(output);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n  createWriteStream,\n} = require('node:fs');\nconst {\n  scryptSync,\n  createDecipheriv,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\nconst input = createReadStream('test.enc');\nconst output = createWriteStream('test.js');\n\ninput.pipe(decipher).pipe(output);\n</code></pre>\n<p>Example: Using the <a href=\"#decipherupdatedata-inputencoding-outputencoding\"><code>decipher.update()</code></a> and <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nconst {\n  scryptSync,\n  createDecipheriv,\n} = await import('node:crypto');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\n// Encrypted using same algorithm, key and iv.\nconst encrypted =\n  'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';\nlet decrypted = decipher.update(encrypted, 'hex', 'utf8');\ndecrypted += decipher.final('utf8');\nconsole.log(decrypted);\n// Prints: some clear text data\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  scryptSync,\n  createDecipheriv,\n} = require('node:crypto');\nconst { Buffer } = require('node:buffer');\n\nconst algorithm = 'aes-192-cbc';\nconst password = 'Password used to generate key';\n// Use the async `crypto.scrypt()` instead.\nconst key = scryptSync(password, 'salt', 24);\n// The IV is usually passed along with the ciphertext.\nconst iv = Buffer.alloc(16, 0); // Initialization vector.\n\nconst decipher = createDecipheriv(algorithm, key, iv);\n\n// Encrypted using same algorithm, key and iv.\nconst encrypted =\n  'e5f79c5915c02171eec6b212d5520d44480993d7d622a7c4c2da32f6efda0ffa';\nlet decrypted = decipher.update(encrypted, 'hex', 'utf8');\ndecrypted += decipher.final('utf8');\nconsole.log(decrypted);\n// Prints: some clear text data\n</code></pre>",
          "methods": [
            {
              "textRaw": "`decipher.final([outputEncoding])`",
              "name": "final",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a `Buffer` is returned.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "Any remaining deciphered contents. If `outputEncoding` is specified, a string is returned. If an `outputEncoding` is not provided, a `Buffer` is returned."
                  }
                }
              ],
              "desc": "<p>Once the <code>decipher.final()</code> method has been called, the <code>Decipheriv</code> object can\nno longer be used to decrypt data. Attempts to call <code>decipher.final()</code> more\nthan once will result in an error being thrown.</p>"
            },
            {
              "textRaw": "`decipher.setAAD(buffer[, options])`",
              "name": "setAAD",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The buffer argument can be a string or ArrayBuffer and is limited to no more than 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9398",
                    "description": "This method now returns a reference to `decipher`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "options": [
                        {
                          "textRaw": "`plaintextLength` {number}",
                          "name": "plaintextLength",
                          "type": "number"
                        },
                        {
                          "textRaw": "`encoding` {string} String encoding to use when `buffer` is a string.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "String encoding to use when `buffer` is a string."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Decipheriv} The same `Decipheriv` instance for method chaining.",
                    "name": "return",
                    "type": "Decipheriv",
                    "desc": "The same `Decipheriv` instance for method chaining."
                  }
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code>, <code>OCB</code>, and\n<code>chacha20-poly1305</code> are\ncurrently supported), the <code>decipher.setAAD()</code> method sets the value used for the\n<em>additional authenticated data</em> (AAD) input parameter.</p>\n<p>The <code>options</code> argument is optional for <code>GCM</code>. When using <code>CCM</code>, the\n<code>plaintextLength</code> option must be specified and its value must match the length\nof the ciphertext in bytes. See <a href=\"#ccm-mode\">CCM mode</a>.</p>\n<p>The <code>decipher.setAAD()</code> method must be called before <a href=\"#decipherupdatedata-inputencoding-outputencoding\"><code>decipher.update()</code></a>.</p>\n<p>When passing a string as the <code>buffer</code>, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>"
            },
            {
              "textRaw": "`decipher.setAuthTag(buffer[, encoding])`",
              "name": "setAuthTag",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61084",
                    "description": "Using GCM tag lengths other than 128 bits without specifying the `authTagLength` option when creating `decipher` is not allowed anymore."
                  },
                  {
                    "version": [
                      "v22.0.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52345",
                    "description": "Using GCM tag lengths other than 128 bits without specifying the `authTagLength` option when creating `decipher` is deprecated."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The buffer argument can be a string or ArrayBuffer and is limited to no more than 2 ** 31 - 1 bytes."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17825",
                    "description": "This method now throws if the GCM tag length is invalid."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9398",
                    "description": "This method now returns a reference to `decipher`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {string|Buffer|ArrayBuffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "string|Buffer|ArrayBuffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} String encoding to use when `buffer` is a string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "String encoding to use when `buffer` is a string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Decipheriv} The same `Decipheriv` instance for method chaining.",
                    "name": "return",
                    "type": "Decipheriv",
                    "desc": "The same `Decipheriv` instance for method chaining."
                  }
                }
              ],
              "desc": "<p>When using an authenticated encryption mode (<code>GCM</code>, <code>CCM</code>, <code>OCB</code>, and\n<code>chacha20-poly1305</code> are\ncurrently supported), the <code>decipher.setAuthTag()</code> method is used to pass in the\nreceived <em>authentication tag</em>. If no tag is provided, or if the cipher text\nhas been tampered with, <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> will throw, indicating that the\ncipher text should be discarded due to failed authentication. If the tag length\nis invalid according to <a href=\"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf\">NIST SP 800-38D</a> or does not match the value of the\n<code>authTagLength</code> option, <code>decipher.setAuthTag()</code> will throw an error.</p>\n<p>The <code>decipher.setAuthTag()</code> method must be called before <a href=\"#decipherupdatedata-inputencoding-outputencoding\"><code>decipher.update()</code></a>\nfor <code>CCM</code> mode or before <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> for <code>GCM</code> and <code>OCB</code> modes and\n<code>chacha20-poly1305</code>.\n<code>decipher.setAuthTag()</code> can only be called once.</p>\n<p>When passing a string as the authentication tag, please consider\n<a href=\"#using-strings-as-inputs-to-cryptographic-apis\">caveats when using strings as inputs to cryptographic APIs</a>.</p>"
            },
            {
              "textRaw": "`decipher.setAutoPadding([autoPadding])`",
              "name": "setAutoPadding",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`autoPadding` {boolean} **Default:** `true`",
                      "name": "autoPadding",
                      "type": "boolean",
                      "default": "`true`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Decipheriv} The same `Decipheriv` instance for method chaining.",
                    "name": "return",
                    "type": "Decipheriv",
                    "desc": "The same `Decipheriv` instance for method chaining."
                  }
                }
              ],
              "desc": "<p>When data has been encrypted without standard block padding, calling\n<code>decipher.setAutoPadding(false)</code> will disable automatic padding to prevent\n<a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> from checking for and removing padding.</p>\n<p>Turning auto padding off will only work if the input data's length is a\nmultiple of the ciphers block size.</p>\n<p>The <code>decipher.setAutoPadding()</code> method must be called before\n<a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a>.</p>"
            },
            {
              "textRaw": "`decipher.update(data[, inputEncoding][, outputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Updates the decipher with <code>data</code>. If the <code>inputEncoding</code> argument is given,\nthe <code>data</code>\nargument is a string using the specified encoding. If the <code>inputEncoding</code>\nargument is not given, <code>data</code> must be a <a href=\"buffer.html\"><code>Buffer</code></a>. If <code>data</code> is a\n<a href=\"buffer.html\"><code>Buffer</code></a> then <code>inputEncoding</code> is ignored.</p>\n<p>The <code>outputEncoding</code> specifies the output format of the enciphered\ndata. If the <code>outputEncoding</code>\nis specified, a string using the specified encoding is returned. If no\n<code>outputEncoding</code> is provided, a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p>The <code>decipher.update()</code> method can be called multiple times with new data until\n<a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> is called. Calling <code>decipher.update()</code> after\n<a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a> will result in an error being thrown.</p>\n<p>Even if the underlying cipher implements authentication, the authenticity and\nintegrity of the plaintext returned from this function may be uncertain at this\ntime. For authenticated encryption algorithms, authenticity is generally only\nestablished when the application calls <a href=\"#decipherfinaloutputencoding\"><code>decipher.final()</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `DiffieHellman`",
          "name": "DiffieHellman",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>DiffieHellman</code> class is a utility for creating Diffie-Hellman key\nexchanges.</p>\n<p>Instances of the <code>DiffieHellman</code> class can be created using the\n<a href=\"#cryptocreatediffiehellmanprime-primeencoding-generator-generatorencoding\"><code>crypto.createDiffieHellman()</code></a> function.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nconst {\n  createDiffieHellman,\n} = await import('node:crypto');\n\n// Generate Alice's keys...\nconst alice = createDiffieHellman(2048);\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = createDiffieHellman(alice.getPrime(), alice.getGenerator());\nconst bobKey = bob.generateKeys();\n\n// Exchange and generate the secret...\nconst aliceSecret = alice.computeSecret(bobKey);\nconst bobSecret = bob.computeSecret(aliceKey);\n\n// OK\nassert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nconst {\n  createDiffieHellman,\n} = require('node:crypto');\n\n// Generate Alice's keys...\nconst alice = createDiffieHellman(2048);\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = createDiffieHellman(alice.getPrime(), alice.getGenerator());\nconst bobKey = bob.generateKeys();\n\n// Exchange and generate the secret...\nconst aliceSecret = alice.computeSecret(bobKey);\nconst bobSecret = bob.computeSecret(aliceKey);\n\n// OK\nassert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));\n</code></pre>",
          "methods": [
            {
              "textRaw": "`diffieHellman.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])`",
              "name": "computeSecret",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherPublicKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "otherPublicKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of an `otherPublicKey` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of an `otherPublicKey` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Computes the shared secret using <code>otherPublicKey</code> as the other\nparty's public key and returns the computed shared secret. The supplied\nkey is interpreted using the specified <code>inputEncoding</code>, and secret is\nencoded using specified <code>outputEncoding</code>.\nIf the <code>inputEncoding</code> is not\nprovided, <code>otherPublicKey</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>,\n<code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>If <code>outputEncoding</code> is given a string is returned; otherwise, a\n<a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.generateKeys([encoding])`",
              "name": "generateKeys",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Generates private and public Diffie-Hellman key values unless they have been\ngenerated or computed already, and returns\nthe public key in the specified <code>encoding</code>. This key should be\ntransferred to the other party.\nIf <code>encoding</code> is provided a string is returned; otherwise a\n<a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p>This function is a thin wrapper around <a href=\"https://www.openssl.org/docs/man3.0/man3/DH_generate_key.html\"><code>DH_generate_key()</code></a>. In particular,\nonce a private key has been generated or set, calling this function only\nrecomputes the public key from the existing private key. Since the public key is\ndetermined by the private key, the result will be the same unless the private key\nhas been changed via <a href=\"#diffiehellmansetprivatekeyprivatekey-encoding\"><code>diffieHellman.setPrivateKey()</code></a>.</p>"
            },
            {
              "textRaw": "`diffieHellman.getGenerator([encoding])`",
              "name": "getGenerator",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Returns the Diffie-Hellman generator in the specified <code>encoding</code>.\nIf <code>encoding</code> is provided a string is\nreturned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.getPrime([encoding])`",
              "name": "getPrime",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Returns the Diffie-Hellman prime in the specified <code>encoding</code>.\nIf <code>encoding</code> is provided a string is\nreturned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.getPrivateKey([encoding])`",
              "name": "getPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Returns the Diffie-Hellman private key in the specified <code>encoding</code>.\nIf <code>encoding</code> is provided a\nstring is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.getPublicKey([encoding])`",
              "name": "getPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Returns the Diffie-Hellman public key in the specified <code>encoding</code>.\nIf <code>encoding</code> is provided a\nstring is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>"
            },
            {
              "textRaw": "`diffieHellman.setPrivateKey(privateKey[, encoding])`",
              "name": "setPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "privateKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `privateKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `privateKey` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the Diffie-Hellman private key. If the <code>encoding</code> argument is provided,\n<code>privateKey</code> is expected\nto be a string. If no <code>encoding</code> is provided, <code>privateKey</code> is expected\nto be a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>This function does not automatically compute the associated public key. Either\n<a href=\"#diffiehellmansetpublickeypublickey-encoding\"><code>diffieHellman.setPublicKey()</code></a> or <a href=\"#diffiehellmangeneratekeysencoding\"><code>diffieHellman.generateKeys()</code></a> can be\nused to manually provide the public key or to automatically derive it.</p>"
            },
            {
              "textRaw": "`diffieHellman.setPublicKey(publicKey[, encoding])`",
              "name": "setPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`publicKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "publicKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `publicKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `publicKey` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the Diffie-Hellman public key. If the <code>encoding</code> argument is provided,\n<code>publicKey</code> is expected\nto be a string. If no <code>encoding</code> is provided, <code>publicKey</code> is expected\nto be a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`diffieHellman.verifyError`",
              "name": "verifyError",
              "type": "property",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": []
              },
              "desc": "<p>A bit field containing any warnings and/or errors resulting from a check\nperformed during initialization of the <code>DiffieHellman</code> object.</p>\n<p>The following values are valid for this property (as defined in <code>node:constants</code> module):</p>\n<ul>\n<li><code>DH_CHECK_P_NOT_SAFE_PRIME</code></li>\n<li><code>DH_CHECK_P_NOT_PRIME</code></li>\n<li><code>DH_UNABLE_TO_CHECK_GENERATOR</code></li>\n<li><code>DH_NOT_SUITABLE_GENERATOR</code></li>\n</ul>"
            }
          ]
        },
        {
          "textRaw": "Class: `DiffieHellmanGroup`",
          "name": "DiffieHellmanGroup",
          "type": "class",
          "meta": {
            "added": [
              "v0.7.5"
            ],
            "changes": []
          },
          "desc": "<p>The <code>DiffieHellmanGroup</code> class takes a well-known modp group as its argument.\nIt works the same as <code>DiffieHellman</code>, except that it does not allow changing\nits keys after creation. In other words, it does not implement <code>setPublicKey()</code>\nor <code>setPrivateKey()</code> methods.</p>\n<pre><code class=\"language-mjs\">const { createDiffieHellmanGroup } = await import('node:crypto');\nconst dh = createDiffieHellmanGroup('modp16');\n</code></pre>\n<pre><code class=\"language-cjs\">const { createDiffieHellmanGroup } = require('node:crypto');\nconst dh = createDiffieHellmanGroup('modp16');\n</code></pre>\n<p>The following groups are supported:</p>\n<ul>\n<li><code>'modp14'</code> (2048 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 3)</li>\n<li><code>'modp15'</code> (3072 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 4)</li>\n<li><code>'modp16'</code> (4096 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 5)</li>\n<li><code>'modp17'</code> (6144 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 6)</li>\n<li><code>'modp18'</code> (8192 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 7)</li>\n</ul>\n<p>The following groups are still supported but deprecated (see <a href=\"#support-for-weak-or-compromised-algorithms\">Caveats</a>):</p>\n<ul>\n<li><code>'modp1'</code> (768 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc2409.txt\">RFC 2409</a> Section 6.1) <span class=\"deprecated-inline\"></span></li>\n<li><code>'modp2'</code> (1024 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc2409.txt\">RFC 2409</a> Section 6.2) <span class=\"deprecated-inline\"></span></li>\n<li><code>'modp5'</code> (1536 bits, <a href=\"https://www.rfc-editor.org/rfc/rfc3526.txt\">RFC 3526</a> Section 2) <span class=\"deprecated-inline\"></span></li>\n</ul>\n<p>These deprecated groups might be removed in future versions of Node.js.</p>"
        },
        {
          "textRaw": "Class: `ECDH`",
          "name": "ECDH",
          "type": "class",
          "meta": {
            "added": [
              "v0.11.14"
            ],
            "changes": []
          },
          "desc": "<p>The <code>ECDH</code> class is a utility for creating Elliptic Curve Diffie-Hellman (ECDH)\nkey exchanges.</p>\n<p>Instances of the <code>ECDH</code> class can be created using the\n<a href=\"#cryptocreateecdhcurvename\"><code>crypto.createECDH()</code></a> function.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\n\nconst {\n  createECDH,\n} = await import('node:crypto');\n\n// Generate Alice's keys...\nconst alice = createECDH('secp521r1');\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = createECDH('secp521r1');\nconst bobKey = bob.generateKeys();\n\n// Exchange and generate the secret...\nconst aliceSecret = alice.computeSecret(bobKey);\nconst bobSecret = bob.computeSecret(aliceKey);\n\nassert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));\n// OK\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\n\nconst {\n  createECDH,\n} = require('node:crypto');\n\n// Generate Alice's keys...\nconst alice = createECDH('secp521r1');\nconst aliceKey = alice.generateKeys();\n\n// Generate Bob's keys...\nconst bob = createECDH('secp521r1');\nconst bobKey = bob.generateKeys();\n\n// Exchange and generate the secret...\nconst aliceSecret = alice.computeSecret(bobKey);\nconst bobSecret = bob.computeSecret(aliceKey);\n\nassert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex'));\n// OK\n</code></pre>",
          "classMethods": [
            {
              "textRaw": "Static method: `ECDH.convertKey(key, curve[, inputEncoding[, outputEncoding[, format]]])`",
              "name": "convertKey",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "key",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`curve` {string}",
                      "name": "curve",
                      "type": "string"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `key` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `key` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Converts the EC Diffie-Hellman public key specified by <code>key</code> and <code>curve</code> to the\nformat specified by <code>format</code>. The <code>format</code> argument specifies point encoding\nand can be <code>'compressed'</code>, <code>'uncompressed'</code> or <code>'hybrid'</code>. The supplied key is\ninterpreted using the specified <code>inputEncoding</code>, and the returned key is encoded\nusing the specified <code>outputEncoding</code>.</p>\n<p>Use <a href=\"#cryptogetcurves\"><code>crypto.getCurves()</code></a> to obtain a list of available curve names.\nOn recent OpenSSL releases, <code>openssl ecparam -list_curves</code> will also display\nthe name and description of each available elliptic curve.</p>\n<p>If <code>format</code> is not specified the point will be returned in <code>'uncompressed'</code>\nformat.</p>\n<p>If the <code>inputEncoding</code> is not provided, <code>key</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>,\n<code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>Example (uncompressing a key):</p>\n<pre><code class=\"language-mjs\">const {\n  createECDH,\n  ECDH,\n} = await import('node:crypto');\n\nconst ecdh = createECDH('secp256k1');\necdh.generateKeys();\n\nconst compressedKey = ecdh.getPublicKey('hex', 'compressed');\n\nconst uncompressedKey = ECDH.convertKey(compressedKey,\n                                        'secp256k1',\n                                        'hex',\n                                        'hex',\n                                        'uncompressed');\n\n// The converted key and the uncompressed public key should be the same\nconsole.log(uncompressedKey === ecdh.getPublicKey('hex'));\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createECDH,\n  ECDH,\n} = require('node:crypto');\n\nconst ecdh = createECDH('secp256k1');\necdh.generateKeys();\n\nconst compressedKey = ecdh.getPublicKey('hex', 'compressed');\n\nconst uncompressedKey = ECDH.convertKey(compressedKey,\n                                        'secp256k1',\n                                        'hex',\n                                        'hex',\n                                        'uncompressed');\n\n// The converted key and the uncompressed public key should be the same\nconsole.log(uncompressedKey === ecdh.getPublicKey('hex'));\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`ecdh.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])`",
              "name": "computeSecret",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16849",
                    "description": "Changed error format to better support invalid public key error."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherPublicKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "otherPublicKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `otherPublicKey` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `otherPublicKey` string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Computes the shared secret using <code>otherPublicKey</code> as the other\nparty's public key and returns the computed shared secret. The supplied\nkey is interpreted using specified <code>inputEncoding</code>, and the returned secret\nis encoded using the specified <code>outputEncoding</code>.\nIf the <code>inputEncoding</code> is not\nprovided, <code>otherPublicKey</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>.</p>\n<p>If <code>outputEncoding</code> is given a string will be returned; otherwise a\n<a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p><code>ecdh.computeSecret</code> will throw an\n<code>ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY</code> error when <code>otherPublicKey</code>\nlies outside of the elliptic curve. Since <code>otherPublicKey</code> is\nusually supplied from a remote user over an insecure network,\nbe sure to handle this exception accordingly.</p>"
            },
            {
              "textRaw": "`ecdh.generateKeys([encoding[, format]])`",
              "name": "generateKeys",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Generates private and public EC Diffie-Hellman key values, and returns\nthe public key in the specified <code>format</code> and <code>encoding</code>. This key should be\ntransferred to the other party.</p>\n<p>The <code>format</code> argument specifies point encoding and can be <code>'compressed'</code> or\n<code>'uncompressed'</code>. If <code>format</code> is not specified, the point will be returned in\n<code>'uncompressed'</code> format.</p>\n<p>If <code>encoding</code> is provided a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a>\nis returned.</p>"
            },
            {
              "textRaw": "`ecdh.getPrivateKey([encoding])`",
              "name": "getPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} The EC Diffie-Hellman in the specified `encoding`.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "The EC Diffie-Hellman in the specified `encoding`."
                  }
                }
              ],
              "desc": "<p>If <code>encoding</code> is specified, a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is\nreturned.</p>"
            },
            {
              "textRaw": "`ecdh.getPublicKey([encoding][, format])`",
              "name": "getPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    },
                    {
                      "textRaw": "`format` {string} **Default:** `'uncompressed'`",
                      "name": "format",
                      "type": "string",
                      "default": "`'uncompressed'`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string} The EC Diffie-Hellman public key in the specified `encoding` and `format`.",
                    "name": "return",
                    "type": "Buffer|string",
                    "desc": "The EC Diffie-Hellman public key in the specified `encoding` and `format`."
                  }
                }
              ],
              "desc": "<p>The <code>format</code> argument specifies point encoding and can be <code>'compressed'</code> or\n<code>'uncompressed'</code>. If <code>format</code> is not specified the point will be returned in\n<code>'uncompressed'</code> format.</p>\n<p>If <code>encoding</code> is specified, a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is\nreturned.</p>"
            },
            {
              "textRaw": "`ecdh.setPrivateKey(privateKey[, encoding])`",
              "name": "setPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "privateKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `privateKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `privateKey` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the EC Diffie-Hellman private key.\nIf <code>encoding</code> is provided, <code>privateKey</code> is expected\nto be a string; otherwise <code>privateKey</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>,\n<code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>If <code>privateKey</code> is not valid for the curve specified when the <code>ECDH</code> object was\ncreated, an error is thrown. Upon setting the private key, the associated\npublic point (key) is also generated and set in the <code>ECDH</code> object.</p>"
            },
            {
              "textRaw": "`ecdh.setPublicKey(publicKey[, encoding])`",
              "name": "setPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [],
                "deprecated": [
                  "v5.2.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`publicKey` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "publicKey",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`encoding` {string} The encoding of the `publicKey` string.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the `publicKey` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the EC Diffie-Hellman public key.\nIf <code>encoding</code> is provided <code>publicKey</code> is expected to\nbe a string; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or <code>DataView</code> is expected.</p>\n<p>There is not normally a reason to call this method because <code>ECDH</code>\nonly requires a private key and the other party's public key to compute the\nshared secret. Typically either <a href=\"#ecdhgeneratekeysencoding-format\"><code>ecdh.generateKeys()</code></a> or\n<a href=\"#ecdhsetprivatekeyprivatekey-encoding\"><code>ecdh.setPrivateKey()</code></a> will be called. The <a href=\"#ecdhsetprivatekeyprivatekey-encoding\"><code>ecdh.setPrivateKey()</code></a> method\nattempts to generate the public point/key associated with the private key being\nset.</p>\n<p>Example (obtaining a shared secret):</p>\n<pre><code class=\"language-mjs\">const {\n  createECDH,\n  createHash,\n} = await import('node:crypto');\n\nconst alice = createECDH('secp256k1');\nconst bob = createECDH('secp256k1');\n\n// This is a shortcut way of specifying one of Alice's previous private\n// keys. It would be unwise to use such a predictable private key in a real\n// application.\nalice.setPrivateKey(\n  createHash('sha256').update('alice', 'utf8').digest(),\n);\n\n// Bob uses a newly generated cryptographically strong\n// pseudorandom key pair\nbob.generateKeys();\n\nconst aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');\nconst bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');\n\n// aliceSecret and bobSecret should be the same shared secret value\nconsole.log(aliceSecret === bobSecret);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createECDH,\n  createHash,\n} = require('node:crypto');\n\nconst alice = createECDH('secp256k1');\nconst bob = createECDH('secp256k1');\n\n// This is a shortcut way of specifying one of Alice's previous private\n// keys. It would be unwise to use such a predictable private key in a real\n// application.\nalice.setPrivateKey(\n  createHash('sha256').update('alice', 'utf8').digest(),\n);\n\n// Bob uses a newly generated cryptographically strong\n// pseudorandom key pair\nbob.generateKeys();\n\nconst aliceSecret = alice.computeSecret(bob.getPublicKey(), null, 'hex');\nconst bobSecret = bob.computeSecret(alice.getPublicKey(), null, 'hex');\n\n// aliceSecret and bobSecret should be the same shared secret value\nconsole.log(aliceSecret === bobSecret);\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `Hash`",
          "name": "Hash",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a></li>\n</ul>\n<p>The <code>Hash</code> class is a utility for creating hash digests of data. It can be\nused in one of two ways:</p>\n<ul>\n<li>As a <a href=\"stream.html\">stream</a> that is both readable and writable, where data is written\nto produce a computed hash digest on the readable side, or</li>\n<li>Using the <a href=\"#hashupdatedata-inputencoding\"><code>hash.update()</code></a> and <a href=\"#hashdigestencoding\"><code>hash.digest()</code></a> methods to produce the\ncomputed hash.</li>\n</ul>\n<p>The <a href=\"#cryptocreatehashalgorithm-options\"><code>crypto.createHash()</code></a> method is used to create <code>Hash</code> instances. <code>Hash</code>\nobjects are not to be created directly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Hash</code> objects as streams:</p>\n<pre><code class=\"language-mjs\">const {\n  createHash,\n} = await import('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = hash.read();\n  if (data) {\n    console.log(data.toString('hex'));\n    // Prints:\n    //   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\n  }\n});\n\nhash.write('some data to hash');\nhash.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createHash,\n} = require('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = hash.read();\n  if (data) {\n    console.log(data.toString('hex'));\n    // Prints:\n    //   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\n  }\n});\n\nhash.write('some data to hash');\nhash.end();\n</code></pre>\n<p>Example: Using <code>Hash</code> and piped streams:</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\nimport { stdout } from 'node:process';\nconst { createHash } = await import('node:crypto');\n\nconst hash = createHash('sha256');\n\nconst input = createReadStream('test.js');\ninput.pipe(hash).setEncoding('hex').pipe(stdout);\n</code></pre>\n<pre><code class=\"language-cjs\">const { createReadStream } = require('node:fs');\nconst { createHash } = require('node:crypto');\nconst { stdout } = require('node:process');\n\nconst hash = createHash('sha256');\n\nconst input = createReadStream('test.js');\ninput.pipe(hash).setEncoding('hex').pipe(stdout);\n</code></pre>\n<p>Example: Using the <a href=\"#hashupdatedata-inputencoding\"><code>hash.update()</code></a> and <a href=\"#hashdigestencoding\"><code>hash.digest()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">const {\n  createHash,\n} = await import('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.update('some data to hash');\nconsole.log(hash.digest('hex'));\n// Prints:\n//   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createHash,\n} = require('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.update('some data to hash');\nconsole.log(hash.digest('hex'));\n// Prints:\n//   6a2da20943931e9834fc12cfe5bb47bbd9ae43489a30726962b576f4e3993e50\n</code></pre>",
          "methods": [
            {
              "textRaw": "`hash.copy([options])`",
              "name": "copy",
              "type": "method",
              "meta": {
                "added": [
                  "v13.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} `stream.transform` options",
                      "name": "options",
                      "type": "Object",
                      "desc": "`stream.transform` options",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Hash}",
                    "name": "return",
                    "type": "Hash"
                  }
                }
              ],
              "desc": "<p>Creates a new <code>Hash</code> object that contains a deep copy of the internal state\nof the current <code>Hash</code> object.</p>\n<p>The optional <code>options</code> argument controls stream behavior. For XOF hash\nfunctions such as <code>'shake256'</code>, the <code>outputLength</code> option can be used to\nspecify the desired output length in bytes.</p>\n<p>An error is thrown when an attempt is made to copy the <code>Hash</code> object after\nits <a href=\"#hashdigestencoding\"><code>hash.digest()</code></a> method has been called.</p>\n<pre><code class=\"language-mjs\">// Calculate a rolling hash.\nconst {\n  createHash,\n} = await import('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.update('one');\nconsole.log(hash.copy().digest('hex'));\n\nhash.update('two');\nconsole.log(hash.copy().digest('hex'));\n\nhash.update('three');\nconsole.log(hash.copy().digest('hex'));\n\n// Etc.\n</code></pre>\n<pre><code class=\"language-cjs\">// Calculate a rolling hash.\nconst {\n  createHash,\n} = require('node:crypto');\n\nconst hash = createHash('sha256');\n\nhash.update('one');\nconsole.log(hash.copy().digest('hex'));\n\nhash.update('two');\nconsole.log(hash.copy().digest('hex'));\n\nhash.update('three');\nconsole.log(hash.copy().digest('hex'));\n\n// Etc.\n</code></pre>"
            },
            {
              "textRaw": "`hash.digest([encoding])`",
              "name": "digest",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Calculates the digest of all of the data passed to be hashed (using the\n<a href=\"#hashupdatedata-inputencoding\"><code>hash.update()</code></a> method).\nIf <code>encoding</code> is provided a string will be returned; otherwise\na <a href=\"buffer.html\"><code>Buffer</code></a> is returned.</p>\n<p>The <code>Hash</code> object can not be used again after <code>hash.digest()</code> method has been\ncalled. Multiple calls will cause an error to be thrown.</p>"
            },
            {
              "textRaw": "`hash.update(data[, inputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Updates the hash content with the given <code>data</code>, the encoding of which\nis given in <code>inputEncoding</code>.\nIf <code>encoding</code> is not provided, and the <code>data</code> is a string, an\nencoding of <code>'utf8'</code> is enforced. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>, then <code>inputEncoding</code> is ignored.</p>\n<p>This can be called many times with new data as it is streamed.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Hmac`",
          "name": "Hmac",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.94"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a></li>\n</ul>\n<p>The <code>Hmac</code> class is a utility for creating cryptographic HMAC digests. It can\nbe used in one of two ways:</p>\n<ul>\n<li>As a <a href=\"stream.html\">stream</a> that is both readable and writable, where data is written\nto produce a computed HMAC digest on the readable side, or</li>\n<li>Using the <a href=\"#hmacupdatedata-inputencoding\"><code>hmac.update()</code></a> and <a href=\"#hmacdigestencoding\"><code>hmac.digest()</code></a> methods to produce the\ncomputed HMAC digest.</li>\n</ul>\n<p>The <a href=\"#cryptocreatehmacalgorithm-key-options\"><code>crypto.createHmac()</code></a> method is used to create <code>Hmac</code> instances. <code>Hmac</code>\nobjects are not to be created directly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Hmac</code> objects as streams:</p>\n<pre><code class=\"language-mjs\">const {\n  createHmac,\n} = await import('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nhmac.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = hmac.read();\n  if (data) {\n    console.log(data.toString('hex'));\n    // Prints:\n    //   7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e\n  }\n});\n\nhmac.write('some data to hash');\nhmac.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createHmac,\n} = require('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nhmac.on('readable', () => {\n  // Only one element is going to be produced by the\n  // hash stream.\n  const data = hmac.read();\n  if (data) {\n    console.log(data.toString('hex'));\n    // Prints:\n    //   7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e\n  }\n});\n\nhmac.write('some data to hash');\nhmac.end();\n</code></pre>\n<p>Example: Using <code>Hmac</code> and piped streams:</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\nimport { stdout } from 'node:process';\nconst {\n  createHmac,\n} = await import('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nconst input = createReadStream('test.js');\ninput.pipe(hmac).pipe(stdout);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n} = require('node:fs');\nconst {\n  createHmac,\n} = require('node:crypto');\nconst { stdout } = require('node:process');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nconst input = createReadStream('test.js');\ninput.pipe(hmac).pipe(stdout);\n</code></pre>\n<p>Example: Using the <a href=\"#hmacupdatedata-inputencoding\"><code>hmac.update()</code></a> and <a href=\"#hmacdigestencoding\"><code>hmac.digest()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">const {\n  createHmac,\n} = await import('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nhmac.update('some data to hash');\nconsole.log(hmac.digest('hex'));\n// Prints:\n//   7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createHmac,\n} = require('node:crypto');\n\nconst hmac = createHmac('sha256', 'a secret');\n\nhmac.update('some data to hash');\nconsole.log(hmac.digest('hex'));\n// Prints:\n//   7fd04df92f636fd450bc841c9418e5825c17f33ad9c87c518115a45971f7f77e\n</code></pre>",
          "methods": [
            {
              "textRaw": "`hmac.digest([encoding])`",
              "name": "digest",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string} The encoding of the return value.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Calculates the HMAC digest of all of the data passed using <a href=\"#hmacupdatedata-inputencoding\"><code>hmac.update()</code></a>.\nIf <code>encoding</code> is\nprovided a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a> is returned;</p>\n<p>The <code>Hmac</code> object can not be used again after <code>hmac.digest()</code> has been\ncalled. Multiple calls to <code>hmac.digest()</code> will result in an error being thrown.</p>"
            },
            {
              "textRaw": "`hmac.update(data[, inputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Updates the <code>Hmac</code> content with the given <code>data</code>, the encoding of which\nis given in <code>inputEncoding</code>.\nIf <code>encoding</code> is not provided, and the <code>data</code> is a string, an\nencoding of <code>'utf8'</code> is enforced. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>, then <code>inputEncoding</code> is ignored.</p>\n<p>This can be called many times with new data as it is streamed.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `KeyObject`",
          "name": "KeyObject",
          "type": "class",
          "meta": {
            "added": [
              "v11.6.0"
            ],
            "changes": [
              {
                "version": "v24.6.0",
                "pr-url": "https://github.com/nodejs/node/pull/59259",
                "description": "Add support for ML-DSA keys."
              },
              {
                "version": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/33360",
                "description": "Instances of this class can now be passed to worker threads using `postMessage`."
              },
              {
                "version": "v11.13.0",
                "pr-url": "https://github.com/nodejs/node/pull/26438",
                "description": "This class is now exported."
              }
            ]
          },
          "desc": "<p>Node.js uses a <code>KeyObject</code> class to represent a symmetric or asymmetric key,\nand each kind of key exposes different functions. The\n<a href=\"#cryptocreatesecretkeykey-encoding\"><code>crypto.createSecretKey()</code></a>, <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a> and\n<a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a> methods are used to create <code>KeyObject</code>\ninstances. <code>KeyObject</code> objects are not to be created directly using the <code>new</code>\nkeyword.</p>\n<p>Most applications should consider using the new <code>KeyObject</code> API instead of\npassing keys as strings or <code>Buffer</code>s due to improved security features.</p>\n<p><code>KeyObject</code> instances can be passed to other threads via <a href=\"worker_threads.html#portpostmessagevalue-transferlist\"><code>postMessage()</code></a>.\nThe receiver obtains a cloned <code>KeyObject</code>, and the <code>KeyObject</code> does not need to\nbe listed in the <code>transferList</code> argument.</p>",
          "classMethods": [
            {
              "textRaw": "Static method: `KeyObject.from(key)`",
              "name": "from",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62453",
                    "description": "Passing a non-extractable CryptoKey as `key` is deprecated."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CryptoKey}",
                      "name": "key",
                      "type": "CryptoKey"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {KeyObject}",
                    "name": "return",
                    "type": "KeyObject"
                  }
                }
              ],
              "desc": "<p>Returns the underlying <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a> of a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>. The returned <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a>\ndoes not retain any of the restrictions imposed by the Web Crypto API on the\noriginal <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>, such as the allowed key usages, the algorithm or hash\nalgorithm bindings, and the extractability flag. In particular, the underlying\nkey material of the returned <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a> can always be exported.</p>\n<pre><code class=\"language-mjs\">const { KeyObject } = await import('node:crypto');\nconst { subtle } = globalThis.crypto;\n\nconst key = await subtle.generateKey({\n  name: 'HMAC',\n  hash: 'SHA-256',\n  length: 256,\n}, true, ['sign', 'verify']);\n\nconst keyObject = KeyObject.from(key);\nconsole.log(keyObject.symmetricKeySize);\n// Prints: 32 (symmetric key size in bytes)\n</code></pre>\n<pre><code class=\"language-cjs\">const { KeyObject } = require('node:crypto');\nconst { subtle } = globalThis.crypto;\n\n(async function() {\n  const key = await subtle.generateKey({\n    name: 'HMAC',\n    hash: 'SHA-256',\n    length: 256,\n  }, true, ['sign', 'verify']);\n\n  const keyObject = KeyObject.from(key);\n  console.log(keyObject.symmetricKeySize);\n  // Prints: 32 (symmetric key size in bytes)\n})();\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "asymmetricKeyDetails",
              "type": "Object",
              "meta": {
                "added": [
                  "v15.7.0"
                ],
                "changes": [
                  {
                    "version": "v16.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39851",
                    "description": "Expose `RSASSA-PSS-params` sequence parameters for RSA-PSS keys."
                  }
                ]
              },
              "desc": "<p>This property exists only on asymmetric keys. Depending on the type of the key,\nthis object contains information about the key. None of the information obtained\nthrough this property can be used to uniquely identify a key or to compromise\nthe security of the key.</p>\n<p>For RSA-PSS keys, if the key material contains a <code>RSASSA-PSS-params</code> sequence,\nthe <code>hashAlgorithm</code>, <code>mgf1HashAlgorithm</code>, and <code>saltLength</code> properties will be\nset.</p>\n<p>Other key details might be exposed via this API using additional attributes.</p>",
              "options": [
                {
                  "textRaw": "`modulusLength` {number} Key size in bits (RSA, DSA).",
                  "name": "modulusLength",
                  "type": "number",
                  "desc": "Key size in bits (RSA, DSA)."
                },
                {
                  "textRaw": "`publicExponent` {bigint} Public exponent (RSA).",
                  "name": "publicExponent",
                  "type": "bigint",
                  "desc": "Public exponent (RSA)."
                },
                {
                  "textRaw": "`hashAlgorithm` {string} Name of the message digest (RSA-PSS).",
                  "name": "hashAlgorithm",
                  "type": "string",
                  "desc": "Name of the message digest (RSA-PSS)."
                },
                {
                  "textRaw": "`mgf1HashAlgorithm` {string} Name of the message digest used by MGF1 (RSA-PSS).",
                  "name": "mgf1HashAlgorithm",
                  "type": "string",
                  "desc": "Name of the message digest used by MGF1 (RSA-PSS)."
                },
                {
                  "textRaw": "`saltLength` {number} Minimal salt length in bytes (RSA-PSS).",
                  "name": "saltLength",
                  "type": "number",
                  "desc": "Minimal salt length in bytes (RSA-PSS)."
                },
                {
                  "textRaw": "`divisorLength` {number} Size of `q` in bits (DSA).",
                  "name": "divisorLength",
                  "type": "number",
                  "desc": "Size of `q` in bits (DSA)."
                },
                {
                  "textRaw": "`namedCurve` {string} Name of the curve (EC).",
                  "name": "namedCurve",
                  "type": "string",
                  "desc": "Name of the curve (EC)."
                }
              ]
            },
            {
              "textRaw": "Type: {string}",
              "name": "asymmetricKeyType",
              "type": "string",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59537",
                    "description": "Add support for SLH-DSA keys."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59461",
                    "description": "Add support for ML-KEM keys."
                  },
                  {
                    "version": "v24.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59259",
                    "description": "Add support for ML-DSA keys."
                  },
                  {
                    "version": [
                      "v13.9.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31178",
                    "description": "Added support for `'dh'`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "Added support for `'rsa-pss'`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26786",
                    "description": "This property now returns `undefined` for KeyObject instances of unrecognized type instead of aborting."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26774",
                    "description": "Added support for `'x25519'` and `'x448'`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26319",
                    "description": "Added support for `'ed25519'` and `'ed448'`."
                  }
                ]
              },
              "desc": "<p>For asymmetric keys, this property represents the type of the key. See the\nsupported <a href=\"#asymmetric-key-types\">asymmetric key types</a>.</p>\n<p>This property is <code>undefined</code> for unrecognized <code>KeyObject</code> types and symmetric\nkeys.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "symmetricKeySize",
              "type": "number",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": []
              },
              "desc": "<p>For secret keys, this property represents the size of the key in bytes. This\nproperty is <code>undefined</code> for asymmetric keys.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "type",
              "type": "string",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": []
              },
              "desc": "<p>Depending on the type of this <code>KeyObject</code>, this property is either\n<code>'secret'</code> for secret (symmetric) keys, <code>'public'</code> for public (asymmetric) keys\nor <code>'private'</code> for private (asymmetric) keys.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`keyObject.equals(otherKeyObject)`",
              "name": "equals",
              "type": "method",
              "meta": {
                "added": [
                  "v17.7.0",
                  "v16.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherKeyObject` {KeyObject} A `KeyObject` with which to compare `keyObject`.",
                      "name": "otherKeyObject",
                      "type": "KeyObject",
                      "desc": "A `KeyObject` with which to compare `keyObject`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> or <code>false</code> depending on whether the keys have exactly the same\ntype, value, and parameters. This method is not\n<a href=\"https://en.wikipedia.org/wiki/Timing_attack\">constant time</a>.</p>"
            },
            {
              "textRaw": "`keyObject.export([options])`",
              "name": "export",
              "type": "method",
              "meta": {
                "added": [
                  "v11.6.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62706",
                    "description": "Added JWK format support for ML-KEM and SLH-DSA key types."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62240",
                    "description": "Added support for `'raw-public'`, `'raw-private'`, and `'raw-seed'` formats."
                  },
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62178",
                    "description": "ML-KEM and ML-DSA private key `'pkcs8'` export now uses seed-only format by default when a seed is available."
                  },
                  {
                    "version": "v15.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37081",
                    "description": "Added support for `'jwk'` format."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer|Object}",
                    "name": "return",
                    "type": "string|Buffer|Object"
                  }
                }
              ],
              "desc": "<p>For symmetric keys, the following encoding options can be used:</p>\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Must be <code>'buffer'</code> (default) or <code>'jwk'</code>.</li>\n</ul>\n<p>For public keys, the following encoding options can be used:</p>\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Must be <code>'pem'</code>, <code>'der'</code>, <code>'jwk'</code>, or <code>'raw-public'</code>.\nSee <a href=\"#asymmetric-key-types\">asymmetric key types</a> for format support.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> When <code>format</code> is <code>'pem'</code> or <code>'der'</code>, must be <code>'pkcs1'</code>\n(RSA only) or <code>'spki'</code>. For EC keys with <code>'raw-public'</code> format, may be\n<code>'uncompressed'</code> (default) or <code>'compressed'</code>. Ignored when <code>format</code> is\n<code>'jwk'</code>.</li>\n</ul>\n<p>For private keys, the following encoding options can be used:</p>\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Must be <code>'pem'</code>, <code>'der'</code>, <code>'jwk'</code>, <code>'raw-private'</code>,\nor <code>'raw-seed'</code>. See <a href=\"#asymmetric-key-types\">asymmetric key types</a> for format support.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> When <code>format</code> is <code>'pem'</code> or <code>'der'</code>, must be <code>'pkcs1'</code>\n(RSA only), <code>'pkcs8'</code>, or <code>'sec1'</code> (EC only). Ignored when <code>format</code> is\n<code>'jwk'</code>, <code>'raw-private'</code>, or <code>'raw-seed'</code>.</li>\n<li><code>cipher</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If specified, the private key will be encrypted with\nthe given <code>cipher</code> and <code>passphrase</code> using PKCS#5 v2.0 password based\nencryption. Ignored when <code>format</code> is <code>'jwk'</code>, <code>'raw-private'</code>, or\n<code>'raw-seed'</code>.</li>\n<li><code>passphrase</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> The passphrase to use for encryption.\nRequired when <code>cipher</code> is specified.</li>\n</ul>\n<p>The result type depends on the selected encoding format, when PEM the\nresult is a string, when DER it will be a buffer containing the data\nencoded as DER, when <a href=\"https://tools.ietf.org/html/rfc7517\">JWK</a> it will be an object. Raw formats return a\n<a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> containing the raw key material.</p>\n<p>Private keys can be encrypted by specifying a <code>cipher</code> and <code>passphrase</code>.\nThe PKCS#8 <code>type</code> supports encryption with both PEM and DER <code>format</code> for any\nkey algorithm. PKCS#1 and SEC1 can only be encrypted when the PEM <code>format</code> is\nused. For maximum compatibility, use PKCS#8 for encrypted private keys. Since\nPKCS#8 defines its own encryption mechanism, PEM-level encryption is not\nsupported when encrypting a PKCS#8 key. See <a href=\"https://www.rfc-editor.org/rfc/rfc5208.txt\">RFC 5208</a> for PKCS#8 encryption\nand <a href=\"https://www.rfc-editor.org/rfc/rfc1421.txt\">RFC 1421</a> for PKCS#1 and SEC1 encryption.</p>"
            },
            {
              "textRaw": "`keyObject.toCryptoKey(algorithm, extractable, keyUsages)`",
              "name": "toCryptoKey",
              "type": "method",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|Algorithm|RsaHashedImportParams|EcKeyImportParams|HmacImportParams}",
                      "name": "algorithm",
                      "type": "string|Algorithm|RsaHashedImportParams|EcKeyImportParams|HmacImportParams"
                    },
                    {
                      "name": "extractable"
                    },
                    {
                      "name": "keyUsages"
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>extractable</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>keyUsages</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> See <a href=\"webcrypto.html#cryptokeyusages\">Key usages</a>.</li>\n<li>Returns: <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a></li>\n</ul>\n<p>Converts a <code>KeyObject</code> instance to a <code>CryptoKey</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Sign`",
          "name": "Sign",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamwritable\"><code>&#x3C;stream.Writable></code></a></li>\n</ul>\n<p>The <code>Sign</code> class is a utility for generating signatures. It can be used in one\nof two ways:</p>\n<ul>\n<li>As a writable <a href=\"stream.html\">stream</a>, where data to be signed is written and the\n<a href=\"#signsignprivatekey-outputencoding\"><code>sign.sign()</code></a> method is used to generate and return the signature, or</li>\n<li>Using the <a href=\"#signupdatedata-inputencoding\"><code>sign.update()</code></a> and <a href=\"#signsignprivatekey-outputencoding\"><code>sign.sign()</code></a> methods to produce the\nsignature.</li>\n</ul>\n<p>The <a href=\"#cryptocreatesignalgorithm-options\"><code>crypto.createSign()</code></a> method is used to create <code>Sign</code> instances. The\nargument is the string name of the hash function to use. <code>Sign</code> objects are not\nto be created directly using the <code>new</code> keyword.</p>\n<p>Example: Using <code>Sign</code> and <a href=\"#class-verify\"><code>Verify</code></a> objects as streams:</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeyPairSync,\n  createSign,\n  createVerify,\n} = await import('node:crypto');\n\nconst { privateKey, publicKey } = generateKeyPairSync('ec', {\n  namedCurve: 'sect239k1',\n});\n\nconst sign = createSign('SHA256');\nsign.write('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey, 'hex');\n\nconst verify = createVerify('SHA256');\nverify.write('some data to sign');\nverify.end();\nconsole.log(verify.verify(publicKey, signature, 'hex'));\n// Prints: true\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeyPairSync,\n  createSign,\n  createVerify,\n} = require('node:crypto');\n\nconst { privateKey, publicKey } = generateKeyPairSync('ec', {\n  namedCurve: 'sect239k1',\n});\n\nconst sign = createSign('SHA256');\nsign.write('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey, 'hex');\n\nconst verify = createVerify('SHA256');\nverify.write('some data to sign');\nverify.end();\nconsole.log(verify.verify(publicKey, signature, 'hex'));\n// Prints: true\n</code></pre>\n<p>Example: Using the <a href=\"#signupdatedata-inputencoding\"><code>sign.update()</code></a> and <a href=\"#verifyupdatedata-inputencoding\"><code>verify.update()</code></a> methods:</p>\n<pre><code class=\"language-mjs\">const {\n  generateKeyPairSync,\n  createSign,\n  createVerify,\n} = await import('node:crypto');\n\nconst { privateKey, publicKey } = generateKeyPairSync('rsa', {\n  modulusLength: 2048,\n});\n\nconst sign = createSign('SHA256');\nsign.update('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey);\n\nconst verify = createVerify('SHA256');\nverify.update('some data to sign');\nverify.end();\nconsole.log(verify.verify(publicKey, signature));\n// Prints: true\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  generateKeyPairSync,\n  createSign,\n  createVerify,\n} = require('node:crypto');\n\nconst { privateKey, publicKey } = generateKeyPairSync('rsa', {\n  modulusLength: 2048,\n});\n\nconst sign = createSign('SHA256');\nsign.update('some data to sign');\nsign.end();\nconst signature = sign.sign(privateKey);\n\nconst verify = createVerify('SHA256');\nverify.update('some data to sign');\nverify.end();\nconsole.log(verify.verify(publicKey, signature));\n// Prints: true\n</code></pre>",
          "methods": [
            {
              "textRaw": "`sign.sign(privateKey[, outputEncoding])`",
              "name": "sign",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The privateKey can also be an ArrayBuffer and CryptoKey."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29292",
                    "description": "This function now supports IEEE-P1363 DSA and ECDSA signatures."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "This function now supports RSA-PSS keys."
                  },
                  {
                    "version": "v11.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/24234",
                    "description": "This function now supports key objects."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11705",
                    "description": "Support for RSASSA-PSS and additional options was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "privateKey",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`dsaEncoding` {string}",
                          "name": "dsaEncoding",
                          "type": "string"
                        },
                        {
                          "textRaw": "`padding` {integer}",
                          "name": "padding",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`saltLength` {integer}",
                          "name": "saltLength",
                          "type": "integer"
                        }
                      ]
                    },
                    {
                      "textRaw": "`outputEncoding` {string} The encoding of the return value.",
                      "name": "outputEncoding",
                      "type": "string",
                      "desc": "The encoding of the return value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|string}",
                    "name": "return",
                    "type": "Buffer|string"
                  }
                }
              ],
              "desc": "<p>Calculates the signature on all the data passed through using either\n<a href=\"#signupdatedata-inputencoding\"><code>sign.update()</code></a> or <a href=\"stream.html#writablewritechunk-encoding-callback\"><code>sign.write()</code></a>.</p>\n<p>If <code>privateKey</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>privateKey</code> had been passed to <a href=\"#cryptocreateprivatekeykey\"><code>crypto.createPrivateKey()</code></a>. If it is an\nobject, the following additional properties can be passed:</p>\n<ul>\n<li>\n<p><code>dsaEncoding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> For DSA and ECDSA, this option specifies the\nformat of the generated signature. It can be one of the following:</p>\n<ul>\n<li><code>'der'</code> (default): DER-encoded ASN.1 signature structure encoding <code>(r, s)</code>.</li>\n<li><code>'ieee-p1363'</code>: Signature format <code>r || s</code> as proposed in IEEE-P1363.</li>\n</ul>\n</li>\n<li>\n<p><code>padding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Optional padding value for RSA, one of the following:</p>\n<ul>\n<li><code>crypto.constants.RSA_PKCS1_PADDING</code> (default)</li>\n<li><code>crypto.constants.RSA_PKCS1_PSS_PADDING</code></li>\n</ul>\n<p><code>RSA_PKCS1_PSS_PADDING</code> will use MGF1 with the same hash function\nused to sign the message as specified in section 3.1 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>, unless\nan MGF1 hash function has been specified as part of the key in compliance with\nsection 3.3 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>.</p>\n</li>\n<li>\n<p><code>saltLength</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Salt length for when padding is <code>RSA_PKCS1_PSS_PADDING</code>. The special value\n<code>crypto.constants.RSA_PSS_SALTLEN_DIGEST</code> sets the salt length to the digest\nsize, <code>crypto.constants.RSA_PSS_SALTLEN_MAX_SIGN</code> (default) sets it to the\nmaximum permissible value.</p>\n</li>\n</ul>\n<p>If <code>outputEncoding</code> is provided a string is returned; otherwise a <a href=\"buffer.html\"><code>Buffer</code></a>\nis returned.</p>\n<p>The <code>Sign</code> object can not be again used after <code>sign.sign()</code> method has been\ncalled. Multiple calls to <code>sign.sign()</code> will result in an error being thrown.</p>"
            },
            {
              "textRaw": "`sign.update(data[, inputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Updates the <code>Sign</code> content with the given <code>data</code>, the encoding of which\nis given in <code>inputEncoding</code>.\nIf <code>encoding</code> is not provided, and the <code>data</code> is a string, an\nencoding of <code>'utf8'</code> is enforced. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>, then <code>inputEncoding</code> is ignored.</p>\n<p>This can be called many times with new data as it is streamed.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Verify`",
          "name": "Verify",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.92"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamwritable\"><code>&#x3C;stream.Writable></code></a></li>\n</ul>\n<p>The <code>Verify</code> class is a utility for verifying signatures. It can be used in one\nof two ways:</p>\n<ul>\n<li>As a writable <a href=\"stream.html\">stream</a> where written data is used to validate against the\nsupplied signature, or</li>\n<li>Using the <a href=\"#verifyupdatedata-inputencoding\"><code>verify.update()</code></a> and <a href=\"#verifyverifykey-signature-signatureencoding\"><code>verify.verify()</code></a> methods to verify\nthe signature.</li>\n</ul>\n<p>The <a href=\"#cryptocreateverifyalgorithm-options\"><code>crypto.createVerify()</code></a> method is used to create <code>Verify</code> instances.\n<code>Verify</code> objects are not to be created directly using the <code>new</code> keyword.</p>\n<p>See <a href=\"#class-sign\"><code>Sign</code></a> for examples.</p>",
          "methods": [
            {
              "textRaw": "`verify.update(data[, inputEncoding])`",
              "name": "update",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5522",
                    "description": "The default `inputEncoding` changed from `binary` to `utf8`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`inputEncoding` {string} The encoding of the `data` string.",
                      "name": "inputEncoding",
                      "type": "string",
                      "desc": "The encoding of the `data` string.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Updates the <code>Verify</code> content with the given <code>data</code>, the encoding of which\nis given in <code>inputEncoding</code>.\nIf <code>inputEncoding</code> is not provided, and the <code>data</code> is a string, an\nencoding of <code>'utf8'</code> is enforced. If <code>data</code> is a <a href=\"buffer.html\"><code>Buffer</code></a>, <code>TypedArray</code>, or\n<code>DataView</code>, then <code>inputEncoding</code> is ignored.</p>\n<p>This can be called many times with new data as it is streamed.</p>"
            },
            {
              "textRaw": "`verify.verify(key, signature[, signatureEncoding])`",
              "name": "verify",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "The key can also be an ArrayBuffer and CryptoKey."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29292",
                    "description": "This function now supports IEEE-P1363 DSA and ECDSA signatures."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26960",
                    "description": "This function now supports RSA-PSS keys."
                  },
                  {
                    "version": "v11.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25217",
                    "description": "The key can now be a private key."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11705",
                    "description": "Support for RSASSA-PSS and additional options was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey}",
                      "name": "key",
                      "type": "Object|string|ArrayBuffer|Buffer|TypedArray|DataView|KeyObject|CryptoKey",
                      "options": [
                        {
                          "textRaw": "`dsaEncoding` {string}",
                          "name": "dsaEncoding",
                          "type": "string"
                        },
                        {
                          "textRaw": "`padding` {integer}",
                          "name": "padding",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`saltLength` {integer}",
                          "name": "saltLength",
                          "type": "integer"
                        }
                      ]
                    },
                    {
                      "textRaw": "`signature` {string|ArrayBuffer|Buffer|TypedArray|DataView}",
                      "name": "signature",
                      "type": "string|ArrayBuffer|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`signatureEncoding` {string} The encoding of the `signature` string.",
                      "name": "signatureEncoding",
                      "type": "string",
                      "desc": "The encoding of the `signature` string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` or `false` depending on the validity of the signature for the data and public key.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` or `false` depending on the validity of the signature for the data and public key."
                  }
                }
              ],
              "desc": "<p>Verifies the provided data using the given <code>key</code> and <code>signature</code>.</p>\n<p>If <code>key</code> is not a <a href=\"#class-keyobject\"><code>KeyObject</code></a>, this function behaves as if\n<code>key</code> had been passed to <a href=\"#cryptocreatepublickeykey\"><code>crypto.createPublicKey()</code></a>. If it is an\nobject, the following additional properties can be passed:</p>\n<ul>\n<li>\n<p><code>dsaEncoding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> For DSA and ECDSA, this option specifies the\nformat of the signature. It can be one of the following:</p>\n<ul>\n<li><code>'der'</code> (default): DER-encoded ASN.1 signature structure encoding <code>(r, s)</code>.</li>\n<li><code>'ieee-p1363'</code>: Signature format <code>r || s</code> as proposed in IEEE-P1363.</li>\n</ul>\n</li>\n<li>\n<p><code>padding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Optional padding value for RSA, one of the following:</p>\n<ul>\n<li><code>crypto.constants.RSA_PKCS1_PADDING</code> (default)</li>\n<li><code>crypto.constants.RSA_PKCS1_PSS_PADDING</code></li>\n</ul>\n<p><code>RSA_PKCS1_PSS_PADDING</code> will use MGF1 with the same hash function\nused to verify the message as specified in section 3.1 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>, unless\nan MGF1 hash function has been specified as part of the key in compliance with\nsection 3.3 of <a href=\"https://www.rfc-editor.org/rfc/rfc4055.txt\">RFC 4055</a>.</p>\n</li>\n<li>\n<p><code>saltLength</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Salt length for when padding is <code>RSA_PKCS1_PSS_PADDING</code>. The special value\n<code>crypto.constants.RSA_PSS_SALTLEN_DIGEST</code> sets the salt length to the digest\nsize, <code>crypto.constants.RSA_PSS_SALTLEN_AUTO</code> (default) causes it to be\ndetermined automatically.</p>\n</li>\n</ul>\n<p>The <code>signature</code> argument is the previously calculated signature for the data, in\nthe <code>signatureEncoding</code>.\nIf a <code>signatureEncoding</code> is specified, the <code>signature</code> is expected to be a\nstring; otherwise <code>signature</code> is expected to be a <a href=\"buffer.html\"><code>Buffer</code></a>,\n<code>TypedArray</code>, or <code>DataView</code>.</p>\n<p>The <code>verify</code> object can not be used again after <code>verify.verify()</code> has been\ncalled. Multiple calls to <code>verify.verify()</code> will result in an error being\nthrown.</p>\n<p>Because public keys can be derived from private keys, a private key may\nbe passed instead of a public key.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `X509Certificate`",
          "name": "X509Certificate",
          "type": "class",
          "meta": {
            "added": [
              "v15.6.0"
            ],
            "changes": []
          },
          "desc": "<p>Encapsulates an X509 certificate and provides read-only access to\nits information.</p>\n<pre><code class=\"language-mjs\">const { X509Certificate } = await import('node:crypto');\n\nconst x509 = new X509Certificate('{... pem encoded cert ...}');\n\nconsole.log(x509.subject);\n</code></pre>\n<pre><code class=\"language-cjs\">const { X509Certificate } = require('node:crypto');\n\nconst x509 = new X509Certificate('{... pem encoded cert ...}');\n\nconsole.log(x509.subject);\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new X509Certificate(buffer)`",
              "name": "X509Certificate",
              "type": "ctor",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`buffer` {string|TypedArray|Buffer|DataView} A PEM or DER encoded X509 Certificate.",
                  "name": "buffer",
                  "type": "string|TypedArray|Buffer|DataView",
                  "desc": "A PEM or DER encoded X509 Certificate."
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean} Will be `true` if this is a Certificate Authority (CA) certificate.",
              "name": "ca",
              "type": "boolean",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "Will be `true` if this is a Certificate Authority (CA) certificate."
            },
            {
              "textRaw": "Type: {string}",
              "name": "fingerprint",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The SHA-1 fingerprint of this certificate.</p>\n<p>Because SHA-1 is cryptographically broken and because the security of SHA-1 is\nsignificantly worse than that of algorithms that are commonly used to sign\ncertificates, consider using <a href=\"#x509fingerprint256\"><code>x509.fingerprint256</code></a> instead.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "fingerprint256",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The SHA-256 fingerprint of this certificate.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "fingerprint512",
              "type": "string",
              "meta": {
                "added": [
                  "v17.2.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The SHA-512 fingerprint of this certificate.</p>\n<p>Because computing the SHA-256 fingerprint is usually faster and because it is\nonly half the size of the SHA-512 fingerprint, <a href=\"#x509fingerprint256\"><code>x509.fingerprint256</code></a> may be\na better choice. While SHA-512 presumably provides a higher level of security in\ngeneral, the security of SHA-256 matches that of most algorithms that are\ncommonly used to sign certificates.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "infoAccess",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.1",
                      "v16.13.2"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/300",
                    "description": "Parts of this string may be encoded as JSON string literals in response to CVE-2021-44532."
                  }
                ]
              },
              "desc": "<p>A textual representation of the certificate's authority information access\nextension.</p>\n<p>This is a line feed separated list of access descriptions. Each line begins with\nthe access method and the kind of the access location, followed by a colon and\nthe value associated with the access location.</p>\n<p>After the prefix denoting the access method and the kind of the access location,\nthe remainder of each line might be enclosed in quotes to indicate that the\nvalue is a JSON string literal. For backward compatibility, Node.js only uses\nJSON string literals within this property when necessary to avoid ambiguity.\nThird-party code should be prepared to handle both possible entry formats.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "issuer",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The issuer identification included in this certificate.</p>"
            },
            {
              "textRaw": "Type: {X509Certificate}",
              "name": "issuerCertificate",
              "type": "X509Certificate",
              "meta": {
                "added": [
                  "v15.9.0"
                ],
                "changes": []
              },
              "desc": "<p>The issuer certificate or <code>undefined</code> if the issuer certificate is not\navailable.</p>"
            },
            {
              "textRaw": "Type: {string[]}",
              "name": "keyUsage",
              "type": "string[]",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>An array detailing the key extended usages for this certificate.</p>"
            },
            {
              "textRaw": "Type: {KeyObject}",
              "name": "publicKey",
              "type": "KeyObject",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The public key <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a> for this certificate.</p>"
            },
            {
              "textRaw": "Type: {Buffer}",
              "name": "raw",
              "type": "Buffer",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>A <code>Buffer</code> containing the DER encoding of this certificate.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "serialNumber",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The serial number of this certificate.</p>\n<p>Serial numbers are assigned by certificate authorities and do not uniquely\nidentify certificates. Consider using <a href=\"#x509fingerprint256\"><code>x509.fingerprint256</code></a> as a unique\nidentifier instead.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "subject",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The complete subject of this certificate.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "subjectAltName",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.1",
                      "v16.13.2"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/300",
                    "description": "Parts of this string may be encoded as JSON string literals in response to CVE-2021-44532."
                  }
                ]
              },
              "desc": "<p>The subject alternative name specified for this certificate.</p>\n<p>This is a comma-separated list of subject alternative names. Each entry begins\nwith a string identifying the kind of the subject alternative name followed by\na colon and the value associated with the entry.</p>\n<p>Earlier versions of Node.js incorrectly assumed that it is safe to split this\nproperty at the two-character sequence <code>', '</code> (see <a href=\"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44532\">CVE-2021-44532</a>). However,\nboth malicious and legitimate certificates can contain subject alternative names\nthat include this sequence when represented as a string.</p>\n<p>After the prefix denoting the type of the entry, the remainder of each entry\nmight be enclosed in quotes to indicate that the value is a JSON string literal.\nFor backward compatibility, Node.js only uses JSON string literals within this\nproperty when necessary to avoid ambiguity. Third-party code should be prepared\nto handle both possible entry formats.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "validFrom",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The date/time from which this certificate is valid.</p>"
            },
            {
              "textRaw": "Type: {Date}",
              "name": "validFromDate",
              "type": "Date",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The date/time from which this certificate is valid, encapsulated in a <code>Date</code> object.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "validTo",
              "type": "string",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The date/time until which this certificate is valid.</p>"
            },
            {
              "textRaw": "Type: {Date}",
              "name": "validToDate",
              "type": "Date",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The date/time until which this certificate is valid, encapsulated in a <code>Date</code> object.</p>"
            },
            {
              "textRaw": "Type: {string|undefined}",
              "name": "signatureAlgorithm",
              "type": "string|undefined",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "desc": "<p>The algorithm used to sign the certificate or <code>undefined</code> if the signature algorithm is unknown by OpenSSL.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "signatureAlgorithmOid",
              "type": "string",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "desc": "<p>The OID of the algorithm used to sign the certificate.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`x509.checkEmail(email[, options])`",
              "name": "checkEmail",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41600",
                    "description": "The subject option now defaults to `'default'`."
                  },
                  {
                    "version": [
                      "v17.5.0",
                      "v16.14.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41599",
                    "description": "The `wildcards`, `partialWildcards`, `multiLabelWildcards`, and `singleLabelSubdomains` options have been removed since they had no effect."
                  },
                  {
                    "version": [
                      "v17.5.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41569",
                    "description": "The subject option can now be set to `'default'`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`email` {string}",
                      "name": "email",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`subject` {string} `'default'`, `'always'`, or `'never'`. **Default:** `'default'`.",
                          "name": "subject",
                          "type": "string",
                          "default": "`'default'`",
                          "desc": "`'default'`, `'always'`, or `'never'`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined} Returns `email` if the certificate matches, `undefined` if it does not.",
                    "name": "return",
                    "type": "string|undefined",
                    "desc": "Returns `email` if the certificate matches, `undefined` if it does not."
                  }
                }
              ],
              "desc": "<p>Checks whether the certificate matches the given email address.</p>\n<p>If the <code>'subject'</code> option is undefined or set to <code>'default'</code>, the certificate\nsubject is only considered if the subject alternative name extension either does\nnot exist or does not contain any email addresses.</p>\n<p>If the <code>'subject'</code> option is set to <code>'always'</code> and if the subject alternative\nname extension either does not exist or does not contain a matching email\naddress, the certificate subject is considered.</p>\n<p>If the <code>'subject'</code> option is set to <code>'never'</code>, the certificate subject is never\nconsidered, even if the certificate contains no subject alternative names.</p>"
            },
            {
              "textRaw": "`x509.checkHost(name[, options])`",
              "name": "checkHost",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41600",
                    "description": "The subject option now defaults to `'default'`."
                  },
                  {
                    "version": [
                      "v17.5.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41569",
                    "description": "The subject option can now be set to `'default'`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`subject` {string} `'default'`, `'always'`, or `'never'`. **Default:** `'default'`.",
                          "name": "subject",
                          "type": "string",
                          "default": "`'default'`",
                          "desc": "`'default'`, `'always'`, or `'never'`."
                        },
                        {
                          "textRaw": "`wildcards` {boolean} **Default:** `true`.",
                          "name": "wildcards",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`partialWildcards` {boolean} **Default:** `true`.",
                          "name": "partialWildcards",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`multiLabelWildcards` {boolean} **Default:** `false`.",
                          "name": "multiLabelWildcards",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`singleLabelSubdomains` {boolean} **Default:** `false`.",
                          "name": "singleLabelSubdomains",
                          "type": "boolean",
                          "default": "`false`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined} Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`.",
                    "name": "return",
                    "type": "string|undefined",
                    "desc": "Returns a subject name that matches `name`, or `undefined` if no subject name matches `name`."
                  }
                }
              ],
              "desc": "<p>Checks whether the certificate matches the given host name.</p>\n<p>If the certificate matches the given host name, the matching subject name is\nreturned. The returned name might be an exact match (e.g., <code>foo.example.com</code>)\nor it might contain wildcards (e.g., <code>*.example.com</code>). Because host name\ncomparisons are case-insensitive, the returned subject name might also differ\nfrom the given <code>name</code> in capitalization.</p>\n<p>If the <code>'subject'</code> option is undefined or set to <code>'default'</code>, the certificate\nsubject is only considered if the subject alternative name extension either does\nnot exist or does not contain any DNS names. This behavior is consistent with\n<a href=\"https://www.rfc-editor.org/rfc/rfc2818.txt\">RFC 2818</a> (\"HTTP Over TLS\").</p>\n<p>If the <code>'subject'</code> option is set to <code>'always'</code> and if the subject alternative\nname extension either does not exist or does not contain a matching DNS name,\nthe certificate subject is considered.</p>\n<p>If the <code>'subject'</code> option is set to <code>'never'</code>, the certificate subject is never\nconsidered, even if the certificate contains no subject alternative names.</p>"
            },
            {
              "textRaw": "`x509.checkIP(ip)`",
              "name": "checkIP",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.5.0",
                      "v16.14.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41571",
                    "description": "The `options` argument has been removed since it had no effect."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`ip` {string}",
                      "name": "ip",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined} Returns `ip` if the certificate matches, `undefined` if it does not.",
                    "name": "return",
                    "type": "string|undefined",
                    "desc": "Returns `ip` if the certificate matches, `undefined` if it does not."
                  }
                }
              ],
              "desc": "<p>Checks whether the certificate matches the given IP address (IPv4 or IPv6).</p>\n<p>Only <a href=\"https://www.rfc-editor.org/rfc/rfc5280.txt\">RFC 5280</a> <code>iPAddress</code> subject alternative names are considered, and they\nmust match the given <code>ip</code> address exactly. Other subject alternative names as\nwell as the subject field of the certificate are ignored.</p>"
            },
            {
              "textRaw": "`x509.checkIssued(otherCert)`",
              "name": "checkIssued",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`otherCert` {X509Certificate}",
                      "name": "otherCert",
                      "type": "X509Certificate"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Checks whether this certificate was potentially issued by the given <code>otherCert</code>\nby comparing the certificate metadata.</p>\n<p>This is useful for pruning a list of possible issuer certificates which have been\nselected using a more rudimentary filtering routine, i.e. just based on subject\nand issuer names.</p>\n<p>Finally, to verify that this certificate's signature was produced by a private key\ncorresponding to <code>otherCert</code>'s public key use <a href=\"#x509verifypublickey\"><code>x509.verify(publicKey)</code></a>\nwith <code>otherCert</code>'s public key represented as a <a href=\"#class-keyobject\"><code>KeyObject</code></a>\nlike so</p>\n<pre><code class=\"language-js\">if (!x509.verify(otherCert.publicKey)) {\n  throw new Error('otherCert did not issue x509');\n}\n</code></pre>"
            },
            {
              "textRaw": "`x509.checkPrivateKey(privateKey)`",
              "name": "checkPrivateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`privateKey` {KeyObject} A private key.",
                      "name": "privateKey",
                      "type": "KeyObject",
                      "desc": "A private key."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Checks whether the public key for this certificate is consistent with\nthe given private key.</p>"
            },
            {
              "textRaw": "`x509.toJSON()`",
              "name": "toJSON",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>There is no standard JSON encoding for X509 certificates. The\n<code>toJSON()</code> method returns a string containing the PEM encoded\ncertificate.</p>"
            },
            {
              "textRaw": "`x509.toLegacyObject()`",
              "name": "toLegacyObject",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Returns information about this certificate using the legacy\n<a href=\"tls.html#certificate-object\">certificate object</a> encoding.</p>"
            },
            {
              "textRaw": "`x509.toString()`",
              "name": "toString",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Returns the PEM-encoded certificate.</p>"
            },
            {
              "textRaw": "`x509.verify(publicKey)`",
              "name": "verify",
              "type": "method",
              "meta": {
                "added": [
                  "v15.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`publicKey` {KeyObject} A public key.",
                      "name": "publicKey",
                      "type": "KeyObject",
                      "desc": "A public key."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Verifies that this certificate was signed by the given public key.\nDoes not perform any other validation checks on the certificate.</p>"
            }
          ]
        }
      ],
      "displayName": "Crypto",
      "source": "doc/api/crypto.md"
    },
    {
      "textRaw": "Diagnostics Channel",
      "name": "diagnostics_channel",
      "introduced_in": "v15.1.0",
      "type": "module",
      "meta": {
        "added": [
          "v15.1.0",
          "v14.17.0"
        ],
        "changes": [
          {
            "version": [
              "v19.2.0",
              "v18.13.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/45290",
            "description": "diagnostics_channel is now Stable."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:diagnostics_channel</code> module provides an API to create named channels\nto report arbitrary message data for diagnostics purposes.</p>\n<p>It can be accessed using:</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n</code></pre>\n<p>It is intended that a module writer wanting to report diagnostics messages\nwill create one or many top-level channels to report messages through.\nChannels may also be acquired at runtime but it is not encouraged\ndue to the additional overhead of doing so. Channels may be exported for\nconvenience, but as long as the name is known it can be acquired anywhere.</p>\n<p>If you intend for your module to produce diagnostics data for others to\nconsume it is recommended that you include documentation of what named\nchannels are used along with the shape of the message data. Channel names\nshould generally include the module name to avoid collisions with data from\nother modules.</p>",
      "modules": [
        {
          "textRaw": "Public API",
          "name": "public_api",
          "type": "module",
          "modules": [
            {
              "textRaw": "Overview",
              "name": "overview",
              "type": "module",
              "desc": "<p>Following is a simple overview of the public API.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\n// Get a reusable channel object\nconst channel = diagnostics_channel.channel('my-channel');\n\nfunction onMessage(message, name) {\n  // Received data\n}\n\n// Subscribe to the channel\ndiagnostics_channel.subscribe('my-channel', onMessage);\n\n// Check if the channel has an active subscriber\nif (channel.hasSubscribers) {\n  // Publish data to the channel\n  channel.publish({\n    some: 'data',\n  });\n}\n\n// Unsubscribe from the channel\ndiagnostics_channel.unsubscribe('my-channel', onMessage);\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\n// Get a reusable channel object\nconst channel = diagnostics_channel.channel('my-channel');\n\nfunction onMessage(message, name) {\n  // Received data\n}\n\n// Subscribe to the channel\ndiagnostics_channel.subscribe('my-channel', onMessage);\n\n// Check if the channel has an active subscriber\nif (channel.hasSubscribers) {\n  // Publish data to the channel\n  channel.publish({\n    some: 'data',\n  });\n}\n\n// Unsubscribe from the channel\ndiagnostics_channel.unsubscribe('my-channel', onMessage);\n</code></pre>",
              "methods": [
                {
                  "textRaw": "`diagnostics_channel.hasSubscribers(name)`",
                  "name": "hasSubscribers",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string|symbol} The channel name",
                          "name": "name",
                          "type": "string|symbol",
                          "desc": "The channel name"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} If there are active subscribers",
                        "name": "return",
                        "type": "boolean",
                        "desc": "If there are active subscribers"
                      }
                    }
                  ],
                  "desc": "<p>Check if there are active subscribers to the named channel. This is helpful if\nthe message you want to send might be expensive to prepare.</p>\n<p>This API is optional but helpful when trying to publish messages from very\nperformance-sensitive code.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nif (diagnostics_channel.hasSubscribers('my-channel')) {\n  // There are subscribers, prepare and publish message\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nif (diagnostics_channel.hasSubscribers('my-channel')) {\n  // There are subscribers, prepare and publish message\n}\n</code></pre>"
                },
                {
                  "textRaw": "`diagnostics_channel.channel(name)`",
                  "name": "channel",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string|symbol} The channel name",
                          "name": "name",
                          "type": "string|symbol",
                          "desc": "The channel name"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Channel} The named channel object",
                        "name": "return",
                        "type": "Channel",
                        "desc": "The named channel object"
                      }
                    }
                  ],
                  "desc": "<p>This is the primary entry-point for anyone wanting to publish to a named\nchannel. It produces a channel object which is optimized to reduce overhead at\npublish time as much as possible.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channel = diagnostics_channel.channel('my-channel');\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channel = diagnostics_channel.channel('my-channel');\n</code></pre>"
                },
                {
                  "textRaw": "`diagnostics_channel.subscribe(name, onMessage)`",
                  "name": "subscribe",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.7.0",
                      "v16.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string|symbol} The channel name",
                          "name": "name",
                          "type": "string|symbol",
                          "desc": "The channel name"
                        },
                        {
                          "textRaw": "`onMessage` {Function} The handler to receive channel messages",
                          "name": "onMessage",
                          "type": "Function",
                          "desc": "The handler to receive channel messages",
                          "options": [
                            {
                              "textRaw": "`message` {any} The message data",
                              "name": "message",
                              "type": "any",
                              "desc": "The message data"
                            },
                            {
                              "textRaw": "`name` {string|symbol} The name of the channel",
                              "name": "name",
                              "type": "string|symbol",
                              "desc": "The name of the channel"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Register a message handler to subscribe to this channel. This message handler\nwill be run synchronously whenever a message is published to the channel. Any\nerrors thrown in the message handler will trigger an <a href=\"process.html#event-uncaughtexception\"><code>'uncaughtException'</code></a>.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\ndiagnostics_channel.subscribe('my-channel', (message, name) => {\n  // Received data\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\ndiagnostics_channel.subscribe('my-channel', (message, name) => {\n  // Received data\n});\n</code></pre>"
                },
                {
                  "textRaw": "`diagnostics_channel.unsubscribe(name, onMessage)`",
                  "name": "unsubscribe",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.7.0",
                      "v16.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string|symbol} The channel name",
                          "name": "name",
                          "type": "string|symbol",
                          "desc": "The channel name"
                        },
                        {
                          "textRaw": "`onMessage` {Function} The previous subscribed handler to remove",
                          "name": "onMessage",
                          "type": "Function",
                          "desc": "The previous subscribed handler to remove"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if the handler was found, `false` otherwise.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if the handler was found, `false` otherwise."
                      }
                    }
                  ],
                  "desc": "<p>Remove a message handler previously registered to this channel with\n<a href=\"#diagnostics_channelsubscribename-onmessage\"><code>diagnostics_channel.subscribe(name, onMessage)</code></a>.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nfunction onMessage(message, name) {\n  // Received data\n}\n\ndiagnostics_channel.subscribe('my-channel', onMessage);\n\ndiagnostics_channel.unsubscribe('my-channel', onMessage);\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nfunction onMessage(message, name) {\n  // Received data\n}\n\ndiagnostics_channel.subscribe('my-channel', onMessage);\n\ndiagnostics_channel.unsubscribe('my-channel', onMessage);\n</code></pre>"
                },
                {
                  "textRaw": "`diagnostics_channel.tracingChannel(nameOrChannels)`",
                  "name": "tracingChannel",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`nameOrChannels` {string|TracingChannel} Channel name or object containing all the TracingChannel Channels",
                          "name": "nameOrChannels",
                          "type": "string|TracingChannel",
                          "desc": "Channel name or object containing all the TracingChannel Channels"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {TracingChannel} Collection of channels to trace with",
                        "name": "return",
                        "type": "TracingChannel",
                        "desc": "Collection of channels to trace with"
                      }
                    }
                  ],
                  "desc": "<p>Creates a <a href=\"#class-tracingchannel\"><code>TracingChannel</code></a> wrapper for the given\n<a href=\"#tracingchannel-channels\">TracingChannel Channels</a>. If a name is given, the corresponding tracing\nchannels will be created in the form of <code>tracing:${name}:${eventType}</code> where\n<code>eventType</code> corresponds to the types of <a href=\"#tracingchannel-channels\">TracingChannel Channels</a>.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channelsByName = diagnostics_channel.tracingChannel('my-channel');\n\n// or...\n\nconst channelsByCollection = diagnostics_channel.tracingChannel({\n  start: diagnostics_channel.channel('tracing:my-channel:start'),\n  end: diagnostics_channel.channel('tracing:my-channel:end'),\n  asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'),\n  asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'),\n  error: diagnostics_channel.channel('tracing:my-channel:error'),\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channelsByName = diagnostics_channel.tracingChannel('my-channel');\n\n// or...\n\nconst channelsByCollection = diagnostics_channel.tracingChannel({\n  start: diagnostics_channel.channel('tracing:my-channel:start'),\n  end: diagnostics_channel.channel('tracing:my-channel:end'),\n  asyncStart: diagnostics_channel.channel('tracing:my-channel:asyncStart'),\n  asyncEnd: diagnostics_channel.channel('tracing:my-channel:asyncEnd'),\n  error: diagnostics_channel.channel('tracing:my-channel:error'),\n});\n</code></pre>"
                },
                {
                  "textRaw": "`diagnostics_channel.boundedChannel(nameOrChannels)`",
                  "name": "boundedChannel",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`nameOrChannels` {string} Channel name or object containing all the BoundedChannel Channels",
                          "name": "nameOrChannels",
                          "type": "string",
                          "desc": "Channel name or object containing all the BoundedChannel Channels"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {BoundedChannel} Collection of channels to trace with",
                        "name": "return",
                        "type": "BoundedChannel",
                        "desc": "Collection of channels to trace with"
                      }
                    }
                  ],
                  "desc": "<p>Creates a <a href=\"#class-boundedchannel\"><code>BoundedChannel</code></a> wrapper for the given channels. If a name is\ngiven, the corresponding channels will be created in the form of\n<code>tracing:${name}:${eventType}</code> where <code>eventType</code> is <code>start</code> or <code>end</code>.</p>\n<p>A <code>BoundedChannel</code> is a simplified version of <a href=\"#class-tracingchannel\"><code>TracingChannel</code></a> that only\ntraces synchronous operations. It only has <code>start</code> and <code>end</code> events, without\n<code>asyncStart</code>, <code>asyncEnd</code>, or <code>error</code> events, making it suitable for tracing\noperations that don't involve asynchronous continuations or error handling.</p>\n<pre><code class=\"language-mjs\">import { boundedChannel, channel } from 'node:diagnostics_channel';\n\nconst wc = boundedChannel('my-operation');\n\n// or...\n\nconst wc2 = boundedChannel({\n  start: channel('tracing:my-operation:start'),\n  end: channel('tracing:my-operation:end'),\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { boundedChannel, channel } = require('node:diagnostics_channel');\n\nconst wc = boundedChannel('my-operation');\n\n// or...\n\nconst wc2 = boundedChannel({\n  start: channel('tracing:my-operation:start'),\n  end: channel('tracing:my-operation:end'),\n});\n</code></pre>"
                }
              ],
              "displayName": "Overview"
            },
            {
              "textRaw": "BoundedChannel Channels",
              "name": "boundedchannel_channels",
              "type": "module",
              "desc": "<p>A <code>BoundedChannel</code> consists of two diagnostics channels representing the\nlifecycle of a scope created with the <code>using</code> syntax:</p>\n<ul>\n<li><code>tracing:${name}:start</code> - Published when the <code>using</code> statement executes (scope creation)</li>\n<li><code>tracing:${name}:end</code> - Published when exiting the block (scope disposal)</li>\n</ul>\n<p>When using the <code>using</code> syntax with [<code>boundedChannel.withScope([context])</code>][], the <code>start</code>\nevent is published immediately when the statement executes, and the <code>end</code> event\nis automatically published when disposal occurs at the end of the block. All\nevents share the same context object, which can be extended with additional\nproperties like <code>result</code> during scope execution.</p>",
              "displayName": "BoundedChannel Channels"
            },
            {
              "textRaw": "TracingChannel Channels",
              "name": "tracingchannel_channels",
              "type": "module",
              "desc": "<p>A TracingChannel is a collection of several diagnostics_channels representing\nspecific points in the execution lifecycle of a single traceable action. The\nbehavior is split into five diagnostics_channels consisting of <code>start</code>,\n<code>end</code>, <code>asyncStart</code>, <code>asyncEnd</code>, and <code>error</code>. A single traceable action will\nshare the same event object between all events, this can be helpful for\nmanaging correlation through a weakmap.</p>\n<p>These event objects will be extended with <code>result</code> or <code>error</code> values when\nthe task \"completes\". In the case of a synchronous task the <code>result</code> will be\nthe return value and the <code>error</code> will be anything thrown from the function.\nWith callback-based async functions the <code>result</code> will be the second argument\nof the callback while the <code>error</code> will either be a thrown error visible in the\n<code>end</code> event or the first callback argument in either of the <code>asyncStart</code> or\n<code>asyncEnd</code> events.</p>\n<p>To ensure only correct trace graphs are formed, events should only be published\nif subscribers are present prior to starting the trace. Subscriptions which are\nadded after the trace begins should not receive future events from that trace,\nonly future traces will be seen.</p>\n<p>Tracing channels should follow a naming pattern of:</p>\n<ul>\n<li><code>tracing:module.class.method:start</code> or <code>tracing:module.function:start</code></li>\n<li><code>tracing:module.class.method:end</code> or <code>tracing:module.function:end</code></li>\n<li><code>tracing:module.class.method:asyncStart</code> or <code>tracing:module.function:asyncStart</code></li>\n<li><code>tracing:module.class.method:asyncEnd</code> or <code>tracing:module.function:asyncEnd</code></li>\n<li><code>tracing:module.class.method:error</code> or <code>tracing:module.function:error</code></li>\n</ul>",
              "methods": [
                {
                  "textRaw": "`start(event)`",
                  "name": "start",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "event"
                        }
                      ]
                    }
                  ],
                  "desc": "<ul>\n<li>Name: <code>tracing:${name}:start</code></li>\n</ul>\n<p>The <code>start</code> event represents the point at which a function is called. At this\npoint the event data may contain function arguments or anything else available\nat the very start of the execution of the function.</p>"
                },
                {
                  "textRaw": "`end(event)`",
                  "name": "end",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "event"
                        }
                      ]
                    }
                  ],
                  "desc": "<ul>\n<li>Name: <code>tracing:${name}:end</code></li>\n</ul>\n<p>The <code>end</code> event represents the point at which a function call returns a value.\nIn the case of an async function this is when the promise returned not when the\nfunction itself makes a return statement internally. At this point, if the\ntraced function was synchronous the <code>result</code> field will be set to the return\nvalue of the function. Alternatively, the <code>error</code> field may be present to\nrepresent any thrown errors.</p>\n<p>It is recommended to listen specifically to the <code>error</code> event to track errors\nas it may be possible for a traceable action to produce multiple errors. For\nexample, an async task which fails may be started internally before the sync\npart of the task then throws an error.</p>"
                },
                {
                  "textRaw": "`asyncStart(event)`",
                  "name": "asyncStart",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "event"
                        }
                      ]
                    }
                  ],
                  "desc": "<ul>\n<li>Name: <code>tracing:${name}:asyncStart</code></li>\n</ul>\n<p>The <code>asyncStart</code> event represents the callback or continuation of a traceable\nfunction being reached. At this point things like callback arguments may be\navailable, or anything else expressing the \"result\" of the action.</p>\n<p>For callbacks-based functions, the first argument of the callback will be\nassigned to the <code>error</code> field, if not <code>undefined</code> or <code>null</code>, and the second\nargument will be assigned to the <code>result</code> field.</p>\n<p>For promises, the argument to the <code>resolve</code> path will be assigned to <code>result</code>\nor the argument to the <code>reject</code> path will be assign to <code>error</code>.</p>\n<p>It is recommended to listen specifically to the <code>error</code> event to track errors\nas it may be possible for a traceable action to produce multiple errors. For\nexample, an async task which fails may be started internally before the sync\npart of the task then throws an error.</p>"
                },
                {
                  "textRaw": "`asyncEnd(event)`",
                  "name": "asyncEnd",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "event"
                        }
                      ]
                    }
                  ],
                  "desc": "<ul>\n<li>Name: <code>tracing:${name}:asyncEnd</code></li>\n</ul>\n<p>The <code>asyncEnd</code> event represents the callback of an asynchronous function\nreturning. It's not likely event data will change after the <code>asyncStart</code> event,\nhowever it may be useful to see the point where the callback completes.</p>"
                },
                {
                  "textRaw": "`error(event)`",
                  "name": "error",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "event"
                        }
                      ]
                    }
                  ],
                  "desc": "<ul>\n<li>Name: <code>tracing:${name}:error</code></li>\n</ul>\n<p>The <code>error</code> event represents any error produced by the traceable function\neither synchronously or asynchronously. If an error is thrown in the\nsynchronous portion of the traced function the error will be assigned to the\n<code>error</code> field of the event and the <code>error</code> event will be triggered. If an error\nis received asynchronously through a callback or promise rejection it will also\nbe assigned to the <code>error</code> field of the event and trigger the <code>error</code> event.</p>\n<p>It is possible for a single traceable function call to produce errors multiple\ntimes so this should be considered when consuming this event. For example, if\nanother async task is triggered internally which fails and then the sync part\nof the function then throws and error two <code>error</code> events will be emitted, one\nfor the sync error and one for the async error.</p>"
                }
              ],
              "displayName": "TracingChannel Channels"
            },
            {
              "textRaw": "Built-in Channels",
              "name": "built-in_channels",
              "type": "module",
              "modules": [
                {
                  "textRaw": "Console",
                  "name": "console",
                  "type": "module",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "events": [
                    {
                      "textRaw": "Event: `'console.log'`",
                      "name": "console.log",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`args` {any[]}",
                          "name": "args",
                          "type": "any[]"
                        }
                      ],
                      "desc": "<p>Emitted when <code>console.log()</code> is called. Receives and array of the arguments\npassed to <code>console.log()</code>.</p>"
                    },
                    {
                      "textRaw": "Event: `'console.info'`",
                      "name": "console.info",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`args` {any[]}",
                          "name": "args",
                          "type": "any[]"
                        }
                      ],
                      "desc": "<p>Emitted when <code>console.info()</code> is called. Receives and array of the arguments\npassed to <code>console.info()</code>.</p>"
                    },
                    {
                      "textRaw": "Event: `'console.debug'`",
                      "name": "console.debug",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`args` {any[]}",
                          "name": "args",
                          "type": "any[]"
                        }
                      ],
                      "desc": "<p>Emitted when <code>console.debug()</code> is called. Receives and array of the arguments\npassed to <code>console.debug()</code>.</p>"
                    },
                    {
                      "textRaw": "Event: `'console.warn'`",
                      "name": "console.warn",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`args` {any[]}",
                          "name": "args",
                          "type": "any[]"
                        }
                      ],
                      "desc": "<p>Emitted when <code>console.warn()</code> is called. Receives and array of the arguments\npassed to <code>console.warn()</code>.</p>"
                    },
                    {
                      "textRaw": "Event: `'console.error'`",
                      "name": "console.error",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`args` {any[]}",
                          "name": "args",
                          "type": "any[]"
                        }
                      ],
                      "desc": "<p>Emitted when <code>console.error()</code> is called. Receives and array of the arguments\npassed to <code>console.error()</code>.</p>"
                    }
                  ],
                  "displayName": "Console"
                },
                {
                  "textRaw": "HTTP",
                  "name": "http",
                  "type": "module",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "events": [
                    {
                      "textRaw": "Event: `'http.client.request.created'`",
                      "name": "http.client.request.created",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`request` {http.ClientRequest}",
                          "name": "request",
                          "type": "http.ClientRequest"
                        }
                      ],
                      "desc": "<p>Emitted when client creates a request object.\nUnlike <code>http.client.request.start</code>, this event is emitted before the request has been sent.</p>"
                    },
                    {
                      "textRaw": "Event: `'http.client.request.start'`",
                      "name": "http.client.request.start",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`request` {http.ClientRequest}",
                          "name": "request",
                          "type": "http.ClientRequest"
                        }
                      ],
                      "desc": "<p>Emitted when client starts a request.</p>"
                    },
                    {
                      "textRaw": "Event: `'http.client.request.error'`",
                      "name": "http.client.request.error",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`request` {http.ClientRequest}",
                          "name": "request",
                          "type": "http.ClientRequest"
                        },
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        }
                      ],
                      "desc": "<p>Emitted when an error occurs during a client request.</p>"
                    },
                    {
                      "textRaw": "Event: `'http.client.response.finish'`",
                      "name": "http.client.response.finish",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`request` {http.ClientRequest}",
                          "name": "request",
                          "type": "http.ClientRequest"
                        },
                        {
                          "textRaw": "`response` {http.IncomingMessage}",
                          "name": "response",
                          "type": "http.IncomingMessage"
                        }
                      ],
                      "desc": "<p>Emitted when client receives a response.</p>"
                    },
                    {
                      "textRaw": "Event: `'http.server.request.start'`",
                      "name": "http.server.request.start",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`request` {http.IncomingMessage}",
                          "name": "request",
                          "type": "http.IncomingMessage"
                        },
                        {
                          "textRaw": "`response` {http.ServerResponse}",
                          "name": "response",
                          "type": "http.ServerResponse"
                        },
                        {
                          "textRaw": "`socket` {net.Socket}",
                          "name": "socket",
                          "type": "net.Socket"
                        },
                        {
                          "textRaw": "`server` {http.Server}",
                          "name": "server",
                          "type": "http.Server"
                        }
                      ],
                      "desc": "<p>Emitted when server receives a request.</p>"
                    },
                    {
                      "textRaw": "Event: `'http.server.response.created'`",
                      "name": "http.server.response.created",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`request` {http.IncomingMessage}",
                          "name": "request",
                          "type": "http.IncomingMessage"
                        },
                        {
                          "textRaw": "`response` {http.ServerResponse}",
                          "name": "response",
                          "type": "http.ServerResponse"
                        }
                      ],
                      "desc": "<p>Emitted when server creates a response.\nThe event is emitted before the response is sent.</p>"
                    },
                    {
                      "textRaw": "Event: `'http.server.response.finish'`",
                      "name": "http.server.response.finish",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`request` {http.IncomingMessage}",
                          "name": "request",
                          "type": "http.IncomingMessage"
                        },
                        {
                          "textRaw": "`response` {http.ServerResponse}",
                          "name": "response",
                          "type": "http.ServerResponse"
                        },
                        {
                          "textRaw": "`socket` {net.Socket}",
                          "name": "socket",
                          "type": "net.Socket"
                        },
                        {
                          "textRaw": "`server` {http.Server}",
                          "name": "server",
                          "type": "http.Server"
                        }
                      ],
                      "desc": "<p>Emitted when server sends a response.</p>"
                    }
                  ],
                  "displayName": "HTTP"
                },
                {
                  "textRaw": "HTTP/2",
                  "name": "http/2",
                  "type": "module",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "events": [
                    {
                      "textRaw": "Event: `'http2.client.stream.created'`",
                      "name": "http2.client.stream.created",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ClientHttp2Stream}",
                          "name": "stream",
                          "type": "ClientHttp2Stream"
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        }
                      ],
                      "desc": "<p>Emitted when a stream is created on the client.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.client.stream.start'`",
                      "name": "http2.client.stream.start",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ClientHttp2Stream}",
                          "name": "stream",
                          "type": "ClientHttp2Stream"
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        }
                      ],
                      "desc": "<p>Emitted when a stream is started on the client.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.client.stream.error'`",
                      "name": "http2.client.stream.error",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ClientHttp2Stream}",
                          "name": "stream",
                          "type": "ClientHttp2Stream"
                        },
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        }
                      ],
                      "desc": "<p>Emitted when an error occurs during the processing of a stream on the client.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.client.stream.finish'`",
                      "name": "http2.client.stream.finish",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ClientHttp2Stream}",
                          "name": "stream",
                          "type": "ClientHttp2Stream"
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        },
                        {
                          "textRaw": "`flags` {number}",
                          "name": "flags",
                          "type": "number"
                        }
                      ],
                      "desc": "<p>Emitted when a stream is received on the client.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.client.stream.bodyChunkSent'`",
                      "name": "http2.client.stream.bodyChunkSent",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ClientHttp2Stream}",
                          "name": "stream",
                          "type": "ClientHttp2Stream"
                        },
                        {
                          "textRaw": "`writev` {boolean}",
                          "name": "writev",
                          "type": "boolean"
                        },
                        {
                          "textRaw": "`data` {Buffer|string|Buffer[]|Object[]}",
                          "name": "data",
                          "type": "Buffer|string|Buffer[]|Object[]",
                          "options": [
                            {
                              "textRaw": "`chunk` {Buffer|string}",
                              "name": "chunk",
                              "type": "Buffer|string"
                            },
                            {
                              "textRaw": "`encoding` {string}",
                              "name": "encoding",
                              "type": "string"
                            }
                          ]
                        },
                        {
                          "textRaw": "`encoding` {string}",
                          "name": "encoding",
                          "type": "string"
                        }
                      ],
                      "desc": "<p>Emitted when a chunk of the client stream body is being sent.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.client.stream.bodySent'`",
                      "name": "http2.client.stream.bodySent",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ClientHttp2Stream}",
                          "name": "stream",
                          "type": "ClientHttp2Stream"
                        }
                      ],
                      "desc": "<p>Emitted after the client stream body has been fully sent.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.client.stream.close'`",
                      "name": "http2.client.stream.close",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ClientHttp2Stream}",
                          "name": "stream",
                          "type": "ClientHttp2Stream"
                        }
                      ],
                      "desc": "<p>Emitted when a stream is closed on the client. The HTTP/2 error code used when\nclosing the stream can be retrieved using the <code>stream.rstCode</code> property.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.server.stream.created'`",
                      "name": "http2.server.stream.created",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ServerHttp2Stream}",
                          "name": "stream",
                          "type": "ServerHttp2Stream"
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        }
                      ],
                      "desc": "<p>Emitted when a stream is created on the server.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.server.stream.start'`",
                      "name": "http2.server.stream.start",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ServerHttp2Stream}",
                          "name": "stream",
                          "type": "ServerHttp2Stream"
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        }
                      ],
                      "desc": "<p>Emitted when a stream is started on the server.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.server.stream.error'`",
                      "name": "http2.server.stream.error",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ServerHttp2Stream}",
                          "name": "stream",
                          "type": "ServerHttp2Stream"
                        },
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        }
                      ],
                      "desc": "<p>Emitted when an error occurs during the processing of a stream on the server.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.server.stream.finish'`",
                      "name": "http2.server.stream.finish",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ServerHttp2Stream}",
                          "name": "stream",
                          "type": "ServerHttp2Stream"
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        },
                        {
                          "textRaw": "`flags` {number}",
                          "name": "flags",
                          "type": "number"
                        }
                      ],
                      "desc": "<p>Emitted when a stream is sent on the server.</p>"
                    },
                    {
                      "textRaw": "Event: `'http2.server.stream.close'`",
                      "name": "http2.server.stream.close",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`stream` {ServerHttp2Stream}",
                          "name": "stream",
                          "type": "ServerHttp2Stream"
                        }
                      ],
                      "desc": "<p>Emitted when a stream is closed on the server. The HTTP/2 error code used when\nclosing the stream can be retrieved using the <code>stream.rstCode</code> property.</p>"
                    }
                  ],
                  "displayName": "HTTP/2"
                },
                {
                  "textRaw": "Modules",
                  "name": "modules",
                  "type": "module",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "events": [
                    {
                      "textRaw": "Event: `'tracing:module.require:start'`",
                      "name": "tracing:module.require:start",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`event` {Object} containing the following properties",
                          "name": "event",
                          "type": "Object",
                          "desc": "containing the following properties",
                          "options": [
                            {
                              "textRaw": "`id` Argument passed to `require()`. Module name.",
                              "name": "id",
                              "desc": "Argument passed to `require()`. Module name."
                            },
                            {
                              "textRaw": "`parentFilename` Name of the module that attempted to require(id).",
                              "name": "parentFilename",
                              "desc": "Name of the module that attempted to require(id)."
                            }
                          ]
                        }
                      ],
                      "desc": "<p>Emitted when <code>require()</code> is executed. See <a href=\"#startevent\"><code>start</code> event</a>.</p>"
                    },
                    {
                      "textRaw": "Event: `'tracing:module.require:end'`",
                      "name": "tracing:module.require:end",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`event` {Object} containing the following properties",
                          "name": "event",
                          "type": "Object",
                          "desc": "containing the following properties",
                          "options": [
                            {
                              "textRaw": "`id` Argument passed to `require()`. Module name.",
                              "name": "id",
                              "desc": "Argument passed to `require()`. Module name."
                            },
                            {
                              "textRaw": "`parentFilename` Name of the module that attempted to require(id).",
                              "name": "parentFilename",
                              "desc": "Name of the module that attempted to require(id)."
                            }
                          ]
                        }
                      ],
                      "desc": "<p>Emitted when a <code>require()</code> call returns. See <a href=\"#endevent\"><code>end</code> event</a>.</p>"
                    },
                    {
                      "textRaw": "Event: `'tracing:module.require:error'`",
                      "name": "tracing:module.require:error",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`event` {Object} containing the following properties",
                          "name": "event",
                          "type": "Object",
                          "desc": "containing the following properties",
                          "options": [
                            {
                              "textRaw": "`id` Argument passed to `require()`. Module name.",
                              "name": "id",
                              "desc": "Argument passed to `require()`. Module name."
                            },
                            {
                              "textRaw": "`parentFilename` Name of the module that attempted to require(id).",
                              "name": "parentFilename",
                              "desc": "Name of the module that attempted to require(id)."
                            }
                          ]
                        },
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        }
                      ],
                      "desc": "<p>Emitted when a <code>require()</code> throws an error. See <a href=\"#errorevent\"><code>error</code> event</a>.</p>"
                    },
                    {
                      "textRaw": "Event: `'tracing:module.import:asyncStart'`",
                      "name": "tracing:module.import:asyncStart",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`event` {Object} containing the following properties",
                          "name": "event",
                          "type": "Object",
                          "desc": "containing the following properties",
                          "options": [
                            {
                              "textRaw": "`id` Argument passed to `import()`. Module name.",
                              "name": "id",
                              "desc": "Argument passed to `import()`. Module name."
                            },
                            {
                              "textRaw": "`parentURL` URL object of the module that attempted to import(id).",
                              "name": "parentURL",
                              "desc": "URL object of the module that attempted to import(id)."
                            }
                          ]
                        }
                      ],
                      "desc": "<p>Emitted when <code>import()</code> is invoked. See <a href=\"#asyncstartevent\"><code>asyncStart</code> event</a>.</p>"
                    },
                    {
                      "textRaw": "Event: `'tracing:module.import:asyncEnd'`",
                      "name": "tracing:module.import:asyncEnd",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`event` {Object} containing the following properties",
                          "name": "event",
                          "type": "Object",
                          "desc": "containing the following properties",
                          "options": [
                            {
                              "textRaw": "`id` Argument passed to `import()`. Module name.",
                              "name": "id",
                              "desc": "Argument passed to `import()`. Module name."
                            },
                            {
                              "textRaw": "`parentURL` URL object of the module that attempted to import(id).",
                              "name": "parentURL",
                              "desc": "URL object of the module that attempted to import(id)."
                            }
                          ]
                        }
                      ],
                      "desc": "<p>Emitted when <code>import()</code> has completed. See <a href=\"#asyncendevent\"><code>asyncEnd</code> event</a>.</p>"
                    },
                    {
                      "textRaw": "Event: `'tracing:module.import:error'`",
                      "name": "tracing:module.import:error",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`event` {Object} containing the following properties",
                          "name": "event",
                          "type": "Object",
                          "desc": "containing the following properties",
                          "options": [
                            {
                              "textRaw": "`id` Argument passed to `import()`. Module name.",
                              "name": "id",
                              "desc": "Argument passed to `import()`. Module name."
                            },
                            {
                              "textRaw": "`parentURL` URL object of the module that attempted to import(id).",
                              "name": "parentURL",
                              "desc": "URL object of the module that attempted to import(id)."
                            }
                          ]
                        },
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        }
                      ],
                      "desc": "<p>Emitted when a <code>import()</code> throws an error. See <a href=\"#errorevent\"><code>error</code> event</a>.</p>"
                    }
                  ],
                  "displayName": "Modules"
                },
                {
                  "textRaw": "NET",
                  "name": "net",
                  "type": "module",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "events": [
                    {
                      "textRaw": "Event: `'net.client.socket'`",
                      "name": "net.client.socket",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`socket` {net.Socket|tls.TLSSocket}",
                          "name": "socket",
                          "type": "net.Socket|tls.TLSSocket"
                        }
                      ],
                      "desc": "<p>Emitted when a new TCP or pipe client socket connection is created.</p>"
                    },
                    {
                      "textRaw": "Event: `'net.server.socket'`",
                      "name": "net.server.socket",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`socket` {net.Socket}",
                          "name": "socket",
                          "type": "net.Socket"
                        }
                      ],
                      "desc": "<p>Emitted when a new TCP or pipe connection is received.</p>"
                    },
                    {
                      "textRaw": "Event: `'tracing:net.server.listen:asyncStart'`",
                      "name": "tracing:net.server.listen:asyncStart",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`server` {net.Server}",
                          "name": "server",
                          "type": "net.Server"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object"
                        }
                      ],
                      "desc": "<p>Emitted when <a href=\"net.html#serverlisten\"><code>net.Server.listen()</code></a> is invoked, before the port or pipe is actually setup.</p>"
                    },
                    {
                      "textRaw": "Event: `'tracing:net.server.listen:asyncEnd'`",
                      "name": "tracing:net.server.listen:asyncEnd",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`server` {net.Server}",
                          "name": "server",
                          "type": "net.Server"
                        }
                      ],
                      "desc": "<p>Emitted when <a href=\"net.html#serverlisten\"><code>net.Server.listen()</code></a> has completed and thus the server is ready to accept connection.</p>"
                    },
                    {
                      "textRaw": "Event: `'tracing:net.server.listen:error'`",
                      "name": "tracing:net.server.listen:error",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`server` {net.Server}",
                          "name": "server",
                          "type": "net.Server"
                        },
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error"
                        }
                      ],
                      "desc": "<p>Emitted when <a href=\"net.html#serverlisten\"><code>net.Server.listen()</code></a> is returning an error.</p>"
                    }
                  ],
                  "displayName": "NET"
                },
                {
                  "textRaw": "UDP",
                  "name": "udp",
                  "type": "module",
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "events": [
                    {
                      "textRaw": "Event: `'udp.socket'`",
                      "name": "udp.socket",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`socket` {dgram.Socket}",
                          "name": "socket",
                          "type": "dgram.Socket"
                        }
                      ],
                      "desc": "<p>Emitted when a new UDP socket is created.</p>"
                    }
                  ],
                  "displayName": "UDP"
                },
                {
                  "textRaw": "Process",
                  "name": "process",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v16.18.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "events": [
                    {
                      "textRaw": "Event: `'child_process'`",
                      "name": "child_process",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`process` {ChildProcess}",
                          "name": "process",
                          "type": "ChildProcess"
                        }
                      ],
                      "desc": "<p>Emitted when a new process is created.</p>\n<p><code>tracing:child_process.spawn:start</code></p>\n<ul>\n<li><code>process</code> <a href=\"child_process.html#class-childprocess\"><code>&#x3C;ChildProcess></code></a></li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>Emitted when <a href=\"child_process.html#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> is invoked, before the process is\nactually spawned.</p>\n<p><code>tracing:child_process.spawn:end</code></p>\n<ul>\n<li><code>process</code> <a href=\"child_process.html#class-childprocess\"><code>&#x3C;ChildProcess></code></a></li>\n</ul>\n<p>Emitted when <a href=\"child_process.html#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> has completed successfully and the\nprocess has been created.</p>\n<p><code>tracing:child_process.spawn:error</code></p>\n<ul>\n<li><code>process</code> <a href=\"child_process.html#class-childprocess\"><code>&#x3C;ChildProcess></code></a></li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a></li>\n</ul>\n<p>Emitted when <a href=\"child_process.html#child_processspawncommand-args-options\"><code>child_process.spawn()</code></a> encounters an error.</p>"
                    },
                    {
                      "textRaw": "Event: `'process.execve'`",
                      "name": "process.execve",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`execPath` {string}",
                          "name": "execPath",
                          "type": "string"
                        },
                        {
                          "textRaw": "`args` {string[]}",
                          "name": "args",
                          "type": "string[]"
                        },
                        {
                          "textRaw": "`env` {string[]}",
                          "name": "env",
                          "type": "string[]"
                        }
                      ],
                      "desc": "<p>Emitted when <a href=\"process.html#processexecvefile-args-env\"><code>process.execve()</code></a> is invoked.</p>"
                    }
                  ],
                  "displayName": "Process"
                },
                {
                  "textRaw": "Web Locks",
                  "name": "web_locks",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "desc": "<p>These channels are emitted for each <a href=\"worker_threads.html#locksrequestname-options-callback\"><code>locks.request()</code></a> call. See\n<a href=\"worker_threads.html#worker_threadslocks\"><code>worker_threads.locks</code></a> for details on Web Locks.</p>",
                  "events": [
                    {
                      "textRaw": "Event: `'locks.request.start'`",
                      "name": "locks.request.start",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`name` {string} The name of the requested lock resource.",
                          "name": "name",
                          "type": "string",
                          "desc": "The name of the requested lock resource."
                        },
                        {
                          "textRaw": "`mode` {string} The lock mode: `'exclusive'` or `'shared'`.",
                          "name": "mode",
                          "type": "string",
                          "desc": "The lock mode: `'exclusive'` or `'shared'`."
                        }
                      ],
                      "desc": "<p>Emitted when a lock request is initiated, before the lock is granted.</p>"
                    },
                    {
                      "textRaw": "Event: `'locks.request.grant'`",
                      "name": "locks.request.grant",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`name` {string} The name of the requested lock resource.",
                          "name": "name",
                          "type": "string",
                          "desc": "The name of the requested lock resource."
                        },
                        {
                          "textRaw": "`mode` {string} The lock mode: `'exclusive'` or `'shared'`.",
                          "name": "mode",
                          "type": "string",
                          "desc": "The lock mode: `'exclusive'` or `'shared'`."
                        }
                      ],
                      "desc": "<p>Emitted when a lock is successfully granted and the callback is about to run.</p>"
                    },
                    {
                      "textRaw": "Event: `'locks.request.miss'`",
                      "name": "locks.request.miss",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`name` {string} The name of the requested lock resource.",
                          "name": "name",
                          "type": "string",
                          "desc": "The name of the requested lock resource."
                        },
                        {
                          "textRaw": "`mode` {string} The lock mode: `'exclusive'` or `'shared'`.",
                          "name": "mode",
                          "type": "string",
                          "desc": "The lock mode: `'exclusive'` or `'shared'`."
                        }
                      ],
                      "desc": "<p>Emitted when <code>ifAvailable</code> is <code>true</code> and the lock is not immediately available,\nand the request callback is invoked with <code>null</code> instead of a <code>Lock</code> object.</p>"
                    },
                    {
                      "textRaw": "Event: `'locks.request.end'`",
                      "name": "locks.request.end",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`name` {string} The name of the requested lock resource.",
                          "name": "name",
                          "type": "string",
                          "desc": "The name of the requested lock resource."
                        },
                        {
                          "textRaw": "`mode` {string} The lock mode: `'exclusive'` or `'shared'`.",
                          "name": "mode",
                          "type": "string",
                          "desc": "The lock mode: `'exclusive'` or `'shared'`."
                        },
                        {
                          "textRaw": "`steal` {boolean} Whether the request uses steal semantics.",
                          "name": "steal",
                          "type": "boolean",
                          "desc": "Whether the request uses steal semantics."
                        },
                        {
                          "textRaw": "`ifAvailable` {boolean} Whether the request uses ifAvailable semantics.",
                          "name": "ifAvailable",
                          "type": "boolean",
                          "desc": "Whether the request uses ifAvailable semantics."
                        },
                        {
                          "textRaw": "`error` {Error|undefined} The error thrown by the callback, if any.",
                          "name": "error",
                          "type": "Error|undefined",
                          "desc": "The error thrown by the callback, if any."
                        }
                      ],
                      "desc": "<p>Emitted when a lock request has finished, whether the callback succeeded,\nthrew an error, or the lock was stolen.</p>"
                    }
                  ],
                  "displayName": "Web Locks"
                },
                {
                  "textRaw": "Worker Thread",
                  "name": "worker_thread",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v16.18.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "events": [
                    {
                      "textRaw": "Event: `'worker_threads'`",
                      "name": "worker_threads",
                      "type": "event",
                      "params": [
                        {
                          "textRaw": "`worker` {Worker}",
                          "name": "worker",
                          "type": "Worker"
                        }
                      ],
                      "desc": "<p>Emitted when a new thread is created.</p>"
                    }
                  ],
                  "displayName": "Worker Thread"
                }
              ],
              "displayName": "Built-in Channels"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `Channel`",
              "name": "Channel",
              "type": "class",
              "meta": {
                "added": [
                  "v15.1.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "desc": "<p>The class <code>Channel</code> represents an individual named channel within the data\npipeline. It is used to track subscribers and to publish messages when there\nare subscribers present. It exists as a separate object to avoid channel\nlookups at publish time, enabling very fast publish speeds and allowing\nfor heavy use while incurring very minimal cost. Channels are created with\n<a href=\"#diagnostics_channelchannelname\"><code>diagnostics_channel.channel(name)</code></a>, constructing a channel directly\nwith <code>new Channel(name)</code> is not supported.</p>",
              "properties": [
                {
                  "textRaw": "Returns: {boolean} If there are active subscribers",
                  "name": "hasSubscribers",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Check if there are active subscribers to this channel. This is helpful if\nthe message you want to send might be expensive to prepare.</p>\n<p>This API is optional but helpful when trying to publish messages from very\nperformance-sensitive code.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nif (channel.hasSubscribers) {\n  // There are subscribers, prepare and publish message\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nif (channel.hasSubscribers) {\n  // There are subscribers, prepare and publish message\n}\n</code></pre>",
                  "shortDesc": "If there are active subscribers"
                }
              ],
              "methods": [
                {
                  "textRaw": "`channel.publish(message)`",
                  "name": "publish",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`message` {any} The message to send to the channel subscribers",
                          "name": "message",
                          "type": "any",
                          "desc": "The message to send to the channel subscribers"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Publish a message to any subscribers to the channel. This will trigger\nmessage handlers synchronously so they will execute within the same context.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.publish({\n  some: 'message',\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.publish({\n  some: 'message',\n});\n</code></pre>"
                },
                {
                  "textRaw": "`channel.subscribe(onMessage)`",
                  "name": "subscribe",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.8.0",
                          "v22.20.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/59758",
                        "description": "Deprecation revoked."
                      },
                      {
                        "version": [
                          "v18.7.0",
                          "v16.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/44943",
                        "description": "Documentation-only deprecation."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`onMessage` {Function} The handler to receive channel messages",
                          "name": "onMessage",
                          "type": "Function",
                          "desc": "The handler to receive channel messages",
                          "options": [
                            {
                              "textRaw": "`message` {any} The message data",
                              "name": "message",
                              "type": "any",
                              "desc": "The message data"
                            },
                            {
                              "textRaw": "`name` {string|symbol} The name of the channel",
                              "name": "name",
                              "type": "string|symbol",
                              "desc": "The name of the channel"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Register a message handler to subscribe to this channel. This message handler\nwill be run synchronously whenever a message is published to the channel. Any\nerrors thrown in the message handler will trigger an <a href=\"process.html#event-uncaughtexception\"><code>'uncaughtException'</code></a>.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.subscribe((message, name) => {\n  // Received data\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.subscribe((message, name) => {\n  // Received data\n});\n</code></pre>"
                },
                {
                  "textRaw": "`channel.unsubscribe(onMessage)`",
                  "name": "unsubscribe",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.8.0",
                          "v22.20.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/59758",
                        "description": "Deprecation revoked."
                      },
                      {
                        "version": [
                          "v18.7.0",
                          "v16.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/44943",
                        "description": "Documentation-only deprecation."
                      },
                      {
                        "version": [
                          "v17.1.0",
                          "v16.14.0",
                          "v14.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/40433",
                        "description": "Added return value. Added to channels without subscribers."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`onMessage` {Function} The previous subscribed handler to remove",
                          "name": "onMessage",
                          "type": "Function",
                          "desc": "The previous subscribed handler to remove"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if the handler was found, `false` otherwise.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if the handler was found, `false` otherwise."
                      }
                    }
                  ],
                  "desc": "<p>Remove a message handler previously registered to this channel with\n<a href=\"#channelsubscribeonmessage\"><code>channel.subscribe(onMessage)</code></a>.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nfunction onMessage(message, name) {\n  // Received data\n}\n\nchannel.subscribe(onMessage);\n\nchannel.unsubscribe(onMessage);\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nfunction onMessage(message, name) {\n  // Received data\n}\n\nchannel.subscribe(onMessage);\n\nchannel.unsubscribe(onMessage);\n</code></pre>"
                },
                {
                  "textRaw": "`channel.bindStore(store[, transform])`",
                  "name": "bindStore",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`store` {AsyncLocalStorage} The store to which to bind the context data",
                          "name": "store",
                          "type": "AsyncLocalStorage",
                          "desc": "The store to which to bind the context data"
                        },
                        {
                          "textRaw": "`transform` {Function} Transform context data before setting the store context",
                          "name": "transform",
                          "type": "Function",
                          "desc": "Transform context data before setting the store context",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>When <a href=\"#channelrunstorescontext-fn-thisarg-args\"><code>channel.runStores(context, ...)</code></a> is called, the given context data\nwill be applied to any store bound to the channel. If the store has already been\nbound the previous <code>transform</code> function will be replaced with the new one.\nThe <code>transform</code> function may be omitted to set the given context data as the\ncontext directly.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nconst store = new AsyncLocalStorage();\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.bindStore(store, (data) => {\n  return { data };\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\nconst { AsyncLocalStorage } = require('node:async_hooks');\n\nconst store = new AsyncLocalStorage();\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.bindStore(store, (data) => {\n  return { data };\n});\n</code></pre>"
                },
                {
                  "textRaw": "`channel.unbindStore(store)`",
                  "name": "unbindStore",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`store` {AsyncLocalStorage} The store to unbind from the channel.",
                          "name": "store",
                          "type": "AsyncLocalStorage",
                          "desc": "The store to unbind from the channel."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if the store was found, `false` otherwise.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if the store was found, `false` otherwise."
                      }
                    }
                  ],
                  "desc": "<p>Remove a message handler previously registered to this channel with\n<a href=\"#channelbindstorestore-transform\"><code>channel.bindStore(store)</code></a>.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nconst store = new AsyncLocalStorage();\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.bindStore(store);\nchannel.unbindStore(store);\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\nconst { AsyncLocalStorage } = require('node:async_hooks');\n\nconst store = new AsyncLocalStorage();\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.bindStore(store);\nchannel.unbindStore(store);\n</code></pre>"
                },
                {
                  "textRaw": "`channel.runStores(context, fn[, thisArg[, ...args]])`",
                  "name": "runStores",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`context` {any} Message to send to subscribers and bind to stores",
                          "name": "context",
                          "type": "any",
                          "desc": "Message to send to subscribers and bind to stores"
                        },
                        {
                          "textRaw": "`fn` {Function} Handler to run within the entered storage context",
                          "name": "fn",
                          "type": "Function",
                          "desc": "Handler to run within the entered storage context"
                        },
                        {
                          "textRaw": "`thisArg` {any} The receiver to be used for the function call.",
                          "name": "thisArg",
                          "type": "any",
                          "desc": "The receiver to be used for the function call.",
                          "optional": true
                        },
                        {
                          "textRaw": "`...args` {any} Optional arguments to pass to the function.",
                          "name": "...args",
                          "type": "any",
                          "desc": "Optional arguments to pass to the function.",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Applies the given data to any AsyncLocalStorage instances bound to the channel\nfor the duration of the given function, then publishes to the channel within\nthe scope of that data is applied to the stores.</p>\n<p>If a transform function was given to <a href=\"#channelbindstorestore-transform\"><code>channel.bindStore(store)</code></a> it will be\napplied to transform the message data before it becomes the context value for\nthe store. The prior storage context is accessible from within the transform\nfunction in cases where context linking is required.</p>\n<p>The context applied to the store should be accessible in any async code which\ncontinues from execution which began during the given function, however\nthere are some situations in which <a href=\"async_context.html#troubleshooting-context-loss\">context loss</a> may occur.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nconst store = new AsyncLocalStorage();\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.bindStore(store, (message) => {\n  const parent = store.getStore();\n  return new Span(message, parent);\n});\nchannel.runStores({ some: 'message' }, () => {\n  store.getStore(); // Span({ some: 'message' })\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\nconst { AsyncLocalStorage } = require('node:async_hooks');\n\nconst store = new AsyncLocalStorage();\n\nconst channel = diagnostics_channel.channel('my-channel');\n\nchannel.bindStore(store, (message) => {\n  const parent = store.getStore();\n  return new Span(message, parent);\n});\nchannel.runStores({ some: 'message' }, () => {\n  store.getStore(); // Span({ some: 'message' })\n});\n</code></pre>"
                },
                {
                  "textRaw": "`channel.withStoreScope(data)`",
                  "name": "withStoreScope",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`data` {any} Message to bind to stores",
                          "name": "data",
                          "type": "any",
                          "desc": "Message to bind to stores"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {RunStoresScope} Disposable scope object",
                        "name": "return",
                        "type": "RunStoresScope",
                        "desc": "Disposable scope object"
                      }
                    }
                  ],
                  "desc": "<p>Creates a disposable scope that binds the given data to any AsyncLocalStorage\ninstances bound to the channel and publishes it to subscribers. The scope\nautomatically restores the previous storage contexts when disposed.</p>\n<p>This method enables the use of JavaScript's explicit resource management\n(<code>using</code> syntax with <code>Symbol.dispose</code>) to manage store contexts without\nclosure wrapping.</p>\n<pre><code class=\"language-mjs\">import { channel } from 'node:diagnostics_channel';\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nconst store = new AsyncLocalStorage();\nconst ch = channel('my-channel');\n\nch.bindStore(store, (message) => {\n  return { ...message, timestamp: Date.now() };\n});\n\n{\n  using scope = ch.withStoreScope({ request: 'data' });\n  // Store is entered, data is published\n  console.log(store.getStore()); // { request: 'data', timestamp: ... }\n}\n// Store is automatically restored on scope exit\n</code></pre>\n<pre><code class=\"language-cjs\">const { channel } = require('node:diagnostics_channel');\nconst { AsyncLocalStorage } = require('node:async_hooks');\n\nconst store = new AsyncLocalStorage();\nconst ch = channel('my-channel');\n\nch.bindStore(store, (message) => {\n  return { ...message, timestamp: Date.now() };\n});\n\n{\n  using scope = ch.withStoreScope({ request: 'data' });\n  // Store is entered, data is published\n  console.log(store.getStore()); // { request: 'data', timestamp: ... }\n}\n// Store is automatically restored on scope exit\n</code></pre>"
                }
              ]
            },
            {
              "textRaw": "Class: `RunStoresScope`",
              "name": "RunStoresScope",
              "type": "class",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>The class <code>RunStoresScope</code> represents a disposable scope created by\n<a href=\"#channelwithstorescopedata\"><code>channel.withStoreScope(data)</code></a>. It manages the lifecycle of store\ncontexts and ensures they are properly restored when the scope exits.</p>\n<p>The scope must be used with the <code>using</code> syntax to ensure proper disposal.</p>"
            },
            {
              "textRaw": "Class: `TracingChannel`",
              "name": "TracingChannel",
              "type": "class",
              "meta": {
                "added": [
                  "v19.9.0",
                  "v18.19.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>The class <code>TracingChannel</code> is a collection of <a href=\"#tracingchannel-channels\">TracingChannel Channels</a> which\ntogether express a single traceable action. It is used to formalize and\nsimplify the process of producing events for tracing application flow.\n<a href=\"#diagnostics_channeltracingchannelnameorchannels\"><code>diagnostics_channel.tracingChannel()</code></a> is used to construct a\n<code>TracingChannel</code>. As with <code>Channel</code> it is recommended to create and reuse a\nsingle <code>TracingChannel</code> at the top-level of the file rather than creating them\ndynamically.</p>",
              "methods": [
                {
                  "textRaw": "`tracingChannel.subscribe(subscribers)`",
                  "name": "subscribe",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`subscribers` {Object} Set of TracingChannel Channels subscribers",
                          "name": "subscribers",
                          "type": "Object",
                          "desc": "Set of TracingChannel Channels subscribers",
                          "options": [
                            {
                              "textRaw": "`start` {Function} The `start` event subscriber",
                              "name": "start",
                              "type": "Function",
                              "desc": "The `start` event subscriber"
                            },
                            {
                              "textRaw": "`end` {Function} The `end` event subscriber",
                              "name": "end",
                              "type": "Function",
                              "desc": "The `end` event subscriber"
                            },
                            {
                              "textRaw": "`asyncStart` {Function} The `asyncStart` event subscriber",
                              "name": "asyncStart",
                              "type": "Function",
                              "desc": "The `asyncStart` event subscriber"
                            },
                            {
                              "textRaw": "`asyncEnd` {Function} The `asyncEnd` event subscriber",
                              "name": "asyncEnd",
                              "type": "Function",
                              "desc": "The `asyncEnd` event subscriber"
                            },
                            {
                              "textRaw": "`error` {Function} The `error` event subscriber",
                              "name": "error",
                              "type": "Function",
                              "desc": "The `error` event subscriber"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Helper to subscribe a collection of functions to the corresponding channels.\nThis is the same as calling <a href=\"#channelsubscribeonmessage\"><code>channel.subscribe(onMessage)</code></a> on each channel\nindividually.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.subscribe({\n  start(message) {\n    // Handle start message\n  },\n  end(message) {\n    // Handle end message\n  },\n  asyncStart(message) {\n    // Handle asyncStart message\n  },\n  asyncEnd(message) {\n    // Handle asyncEnd message\n  },\n  error(message) {\n    // Handle error message\n  },\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.subscribe({\n  start(message) {\n    // Handle start message\n  },\n  end(message) {\n    // Handle end message\n  },\n  asyncStart(message) {\n    // Handle asyncStart message\n  },\n  asyncEnd(message) {\n    // Handle asyncEnd message\n  },\n  error(message) {\n    // Handle error message\n  },\n});\n</code></pre>"
                },
                {
                  "textRaw": "`tracingChannel.unsubscribe(subscribers)`",
                  "name": "unsubscribe",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`subscribers` {Object} Set of TracingChannel Channels subscribers",
                          "name": "subscribers",
                          "type": "Object",
                          "desc": "Set of TracingChannel Channels subscribers",
                          "options": [
                            {
                              "textRaw": "`start` {Function} The `start` event subscriber",
                              "name": "start",
                              "type": "Function",
                              "desc": "The `start` event subscriber"
                            },
                            {
                              "textRaw": "`end` {Function} The `end` event subscriber",
                              "name": "end",
                              "type": "Function",
                              "desc": "The `end` event subscriber"
                            },
                            {
                              "textRaw": "`asyncStart` {Function} The `asyncStart` event subscriber",
                              "name": "asyncStart",
                              "type": "Function",
                              "desc": "The `asyncStart` event subscriber"
                            },
                            {
                              "textRaw": "`asyncEnd` {Function} The `asyncEnd` event subscriber",
                              "name": "asyncEnd",
                              "type": "Function",
                              "desc": "The `asyncEnd` event subscriber"
                            },
                            {
                              "textRaw": "`error` {Function} The `error` event subscriber",
                              "name": "error",
                              "type": "Function",
                              "desc": "The `error` event subscriber"
                            }
                          ]
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if all handlers were successfully unsubscribed, and `false` otherwise.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if all handlers were successfully unsubscribed, and `false` otherwise."
                      }
                    }
                  ],
                  "desc": "<p>Helper to unsubscribe a collection of functions from the corresponding channels.\nThis is the same as calling <a href=\"#channelunsubscribeonmessage\"><code>channel.unsubscribe(onMessage)</code></a> on each channel\nindividually.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.unsubscribe({\n  start(message) {\n    // Handle start message\n  },\n  end(message) {\n    // Handle end message\n  },\n  asyncStart(message) {\n    // Handle asyncStart message\n  },\n  asyncEnd(message) {\n    // Handle asyncEnd message\n  },\n  error(message) {\n    // Handle error message\n  },\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.unsubscribe({\n  start(message) {\n    // Handle start message\n  },\n  end(message) {\n    // Handle end message\n  },\n  asyncStart(message) {\n    // Handle asyncStart message\n  },\n  asyncEnd(message) {\n    // Handle asyncEnd message\n  },\n  error(message) {\n    // Handle error message\n  },\n});\n</code></pre>"
                },
                {
                  "textRaw": "`tracingChannel.traceSync(fn[, context[, thisArg[, ...args]]])`",
                  "name": "traceSync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`fn` {Function} Function to wrap a trace around",
                          "name": "fn",
                          "type": "Function",
                          "desc": "Function to wrap a trace around"
                        },
                        {
                          "textRaw": "`context` {Object} Shared object to correlate events through",
                          "name": "context",
                          "type": "Object",
                          "desc": "Shared object to correlate events through",
                          "optional": true
                        },
                        {
                          "textRaw": "`thisArg` {any} The receiver to be used for the function call",
                          "name": "thisArg",
                          "type": "any",
                          "desc": "The receiver to be used for the function call",
                          "optional": true
                        },
                        {
                          "textRaw": "`...args` {any} Optional arguments to pass to the function",
                          "name": "...args",
                          "type": "any",
                          "desc": "Optional arguments to pass to the function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {any} The return value of the given function",
                        "name": "return",
                        "type": "any",
                        "desc": "The return value of the given function"
                      }
                    }
                  ],
                  "desc": "<p>Trace a synchronous function call. This will always produce a <a href=\"#startevent\"><code>start</code> event</a>\nand <a href=\"#endevent\"><code>end</code> event</a> around the execution and may produce an <a href=\"#errorevent\"><code>error</code> event</a>\nif the given function throws an error. This will run the given function using\n<a href=\"#channelrunstorescontext-fn-thisarg-args\"><code>channel.runStores(context, ...)</code></a> on the <code>start</code> channel which ensures all\nevents should have any bound stores set to match this trace context.</p>\n<p>To ensure only correct trace graphs are formed, events will only be published\nif subscribers are present prior to starting the trace. Subscriptions which are\nadded after the trace begins will not receive future events from that trace,\nonly future traces will be seen.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.traceSync(() => {\n  // Do something\n}, {\n  some: 'thing',\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.traceSync(() => {\n  // Do something\n}, {\n  some: 'thing',\n});\n</code></pre>"
                },
                {
                  "textRaw": "`tracingChannel.tracePromise(fn[, context[, thisArg[, ...args]]])`",
                  "name": "tracePromise",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": [
                      {
                        "version": "v26.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/61766",
                        "description": "Custom thenables will no longer be wrapped in native Promises. Non-thenables will be returned with a warning."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`fn` {Function} Function to wrap a trace around",
                          "name": "fn",
                          "type": "Function",
                          "desc": "Function to wrap a trace around"
                        },
                        {
                          "textRaw": "`context` {Object} Shared object to correlate trace events through",
                          "name": "context",
                          "type": "Object",
                          "desc": "Shared object to correlate trace events through",
                          "optional": true
                        },
                        {
                          "textRaw": "`thisArg` {any} The receiver to be used for the function call",
                          "name": "thisArg",
                          "type": "any",
                          "desc": "The receiver to be used for the function call",
                          "optional": true
                        },
                        {
                          "textRaw": "`...args` {any} Optional arguments to pass to the function",
                          "name": "...args",
                          "type": "any",
                          "desc": "Optional arguments to pass to the function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {any} The return value of the given function, or the result of calling `.then(...)` on the return value if the tracing channel has active subscribers. If the return value is not a Promise or thenable, then it is returned as-is and a warning is emitted.",
                        "name": "return",
                        "type": "any",
                        "desc": "The return value of the given function, or the result of calling `.then(...)` on the return value if the tracing channel has active subscribers. If the return value is not a Promise or thenable, then it is returned as-is and a warning is emitted."
                      }
                    }
                  ],
                  "desc": "<p>Trace an asynchronous function call which returns a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> or <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#thenables\">thenable object</a>. This will always produce a <a href=\"#startevent\"><code>start</code> event</a> and\n<a href=\"#endevent\"><code>end</code> event</a> around the synchronous portion of the function execution, and\nwill produce an <a href=\"#asyncstartevent\"><code>asyncStart</code> event</a> and <a href=\"#asyncendevent\"><code>asyncEnd</code> event</a> when the\nreturned promise is resolved or rejected. It may also produce an\n<a href=\"#errorevent\"><code>error</code> event</a> if the given function throws an error or the returned promise\nis rejected. This will run the given function using\n<a href=\"#channelrunstorescontext-fn-thisarg-args\"><code>channel.runStores(context, ...)</code></a> on the <code>start</code> channel which ensures all\nevents should have any bound stores set to match this trace context.</p>\n<p>If the value returned by <code>fn</code> is not a Promise or thenable, then it will be\nreturned with a warning, and no <code>asyncStart</code> or <code>asyncEnd</code> events will be\nproduced.</p>\n<p>To ensure only correct trace graphs are formed, events will only be published\nif subscribers are present prior to starting the trace. Subscriptions which are\nadded after the trace begins will not receive future events from that trace,\nonly future traces will be seen.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.tracePromise(async () => {\n  // Do something\n}, {\n  some: 'thing',\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.tracePromise(async () => {\n  // Do something\n}, {\n  some: 'thing',\n});\n</code></pre>"
                },
                {
                  "textRaw": "`tracingChannel.traceCallback(fn[, position[, context[, thisArg[, ...args]]]])`",
                  "name": "traceCallback",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`fn` {Function} callback using function to wrap a trace around",
                          "name": "fn",
                          "type": "Function",
                          "desc": "callback using function to wrap a trace around"
                        },
                        {
                          "textRaw": "`position` {number} Zero-indexed argument position of expected callback (defaults to last argument if `undefined` is passed)",
                          "name": "position",
                          "type": "number",
                          "desc": "Zero-indexed argument position of expected callback (defaults to last argument if `undefined` is passed)",
                          "optional": true
                        },
                        {
                          "textRaw": "`context` {Object} Shared object to correlate trace events through (defaults to `{}` if `undefined` is passed)",
                          "name": "context",
                          "type": "Object",
                          "desc": "Shared object to correlate trace events through (defaults to `{}` if `undefined` is passed)",
                          "optional": true
                        },
                        {
                          "textRaw": "`thisArg` {any} The receiver to be used for the function call",
                          "name": "thisArg",
                          "type": "any",
                          "desc": "The receiver to be used for the function call",
                          "optional": true
                        },
                        {
                          "textRaw": "`...args` {any} arguments to pass to the function (must include the callback)",
                          "name": "...args",
                          "type": "any",
                          "desc": "arguments to pass to the function (must include the callback)",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {any} The return value of the given function",
                        "name": "return",
                        "type": "any",
                        "desc": "The return value of the given function"
                      }
                    }
                  ],
                  "desc": "<p>Trace a callback-receiving function call. The callback is expected to follow\nthe error as first arg convention typically used. This will always produce a\n<a href=\"#startevent\"><code>start</code> event</a> and <a href=\"#endevent\"><code>end</code> event</a> around the synchronous portion of the\nfunction execution, and will produce a <a href=\"#asyncstartevent\"><code>asyncStart</code> event</a> and\n<a href=\"#asyncendevent\"><code>asyncEnd</code> event</a> around the callback execution. It may also produce an\n<a href=\"#errorevent\"><code>error</code> event</a> if the given function throws or the first argument passed to\nthe callback is set. This will run the given function using\n<a href=\"#channelrunstorescontext-fn-thisarg-args\"><code>channel.runStores(context, ...)</code></a> on the <code>start</code> channel which ensures all\nevents should have any bound stores set to match this trace context.</p>\n<p>To ensure only correct trace graphs are formed, events will only be published\nif subscribers are present prior to starting the trace. Subscriptions which are\nadded after the trace begins will not receive future events from that trace,\nonly future traces will be seen.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.traceCallback((arg1, callback) => {\n  // Do something\n  callback(null, 'result');\n}, 1, {\n  some: 'thing',\n}, thisArg, arg1, callback);\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nchannels.traceCallback((arg1, callback) => {\n  // Do something\n  callback(null, 'result');\n}, 1, {\n  some: 'thing',\n}, thisArg, arg1, callback);\n</code></pre>\n<p>The callback will also be run with <a href=\"#channelrunstorescontext-fn-thisarg-args\"><code>channel.runStores(context, ...)</code></a> which\nenables context loss recovery in some cases.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\nconst myStore = new AsyncLocalStorage();\n\n// The start channel sets the initial store data to something\n// and stores that store data value on the trace context object\nchannels.start.bindStore(myStore, (data) => {\n  const span = new Span(data);\n  data.span = span;\n  return span;\n});\n\n// Then asyncStart can restore from that data it stored previously\nchannels.asyncStart.bindStore(myStore, (data) => {\n  return data.span;\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\nconst { AsyncLocalStorage } = require('node:async_hooks');\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\nconst myStore = new AsyncLocalStorage();\n\n// The start channel sets the initial store data to something\n// and stores that store data value on the trace context object\nchannels.start.bindStore(myStore, (data) => {\n  const span = new Span(data);\n  data.span = span;\n  return span;\n});\n\n// Then asyncStart can restore from that data it stored previously\nchannels.asyncStart.bindStore(myStore, (data) => {\n  return data.span;\n});\n</code></pre>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Returns: {boolean} `true` if any of the individual channels has a subscriber, `false` if not.",
                  "name": "hasSubscribers",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v22.0.0",
                      "v20.13.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This is a helper method available on a <a href=\"#class-tracingchannel\"><code>TracingChannel</code></a> instance to check if\nany of the <a href=\"#tracingchannel-channels\">TracingChannel Channels</a> have subscribers. A <code>true</code> is returned if\nany of them have at least one subscriber, a <code>false</code> is returned otherwise.</p>\n<pre><code class=\"language-mjs\">import diagnostics_channel from 'node:diagnostics_channel';\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nif (channels.hasSubscribers) {\n  // Do something\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const diagnostics_channel = require('node:diagnostics_channel');\n\nconst channels = diagnostics_channel.tracingChannel('my-channel');\n\nif (channels.hasSubscribers) {\n  // Do something\n}\n</code></pre>",
                  "shortDesc": "`true` if any of the individual channels has a subscriber, `false` if not."
                }
              ]
            },
            {
              "textRaw": "Class: `BoundedChannel`",
              "name": "BoundedChannel",
              "type": "class",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>The class <code>BoundedChannel</code> is a simplified version of <a href=\"#class-tracingchannel\"><code>TracingChannel</code></a> that\nonly traces synchronous operations. It consists of two channels (<code>start</code> and\n<code>end</code>) instead of five, omitting the <code>asyncStart</code>, <code>asyncEnd</code>, and <code>error</code>\nevents. This makes it suitable for tracing operations that don't involve\nasynchronous continuations or error handling.</p>\n<p>Like <code>TracingChannel</code>, it is recommended to create and reuse a single\n<code>BoundedChannel</code> at the top-level of the file rather than creating them\ndynamically.</p>",
              "properties": [
                {
                  "textRaw": "Returns: {boolean} `true` if any of the individual channels has a subscriber, `false` if not.",
                  "name": "hasSubscribers",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Check if any of the <code>start</code> or <code>end</code> channels have subscribers.</p>\n<pre><code class=\"language-mjs\">import { boundedChannel } from 'node:diagnostics_channel';\n\nconst wc = boundedChannel('my-operation');\n\nif (wc.hasSubscribers) {\n  // There are subscribers, perform traced operation\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { boundedChannel } = require('node:diagnostics_channel');\n\nconst wc = boundedChannel('my-operation');\n\nif (wc.hasSubscribers) {\n  // There are subscribers, perform traced operation\n}\n</code></pre>",
                  "shortDesc": "`true` if any of the individual channels has a subscriber, `false` if not."
                }
              ],
              "methods": [
                {
                  "textRaw": "`boundedChannel.subscribe(handlers)`",
                  "name": "subscribe",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`handlers` {Object} Set of channel subscribers",
                          "name": "handlers",
                          "type": "Object",
                          "desc": "Set of channel subscribers",
                          "options": [
                            {
                              "textRaw": "`start` {Function} The start event subscriber",
                              "name": "start",
                              "type": "Function",
                              "desc": "The start event subscriber"
                            },
                            {
                              "textRaw": "`end` {Function} The end event subscriber",
                              "name": "end",
                              "type": "Function",
                              "desc": "The end event subscriber"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Subscribe to the bounded channel events. This is equivalent to calling\n<a href=\"#channelsubscribeonmessage\"><code>channel.subscribe(onMessage)</code></a> on each channel individually.</p>\n<pre><code class=\"language-mjs\">import { boundedChannel } from 'node:diagnostics_channel';\n\nconst wc = boundedChannel('my-operation');\n\nwc.subscribe({\n  start(message) {\n    // Handle start\n  },\n  end(message) {\n    // Handle end\n  },\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { boundedChannel } = require('node:diagnostics_channel');\n\nconst wc = boundedChannel('my-operation');\n\nwc.subscribe({\n  start(message) {\n    // Handle start\n  },\n  end(message) {\n    // Handle end\n  },\n});\n</code></pre>"
                },
                {
                  "textRaw": "`boundedChannel.unsubscribe(handlers)`",
                  "name": "unsubscribe",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`handlers` {Object} Set of channel subscribers",
                          "name": "handlers",
                          "type": "Object",
                          "desc": "Set of channel subscribers",
                          "options": [
                            {
                              "textRaw": "`start` {Function} The start event subscriber",
                              "name": "start",
                              "type": "Function",
                              "desc": "The start event subscriber"
                            },
                            {
                              "textRaw": "`end` {Function} The end event subscriber",
                              "name": "end",
                              "type": "Function",
                              "desc": "The end event subscriber"
                            }
                          ]
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if all handlers were successfully unsubscribed, `false` otherwise.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if all handlers were successfully unsubscribed, `false` otherwise."
                      }
                    }
                  ],
                  "desc": "<p>Unsubscribe from the bounded channel events. This is equivalent to calling\n<a href=\"#channelunsubscribeonmessage\"><code>channel.unsubscribe(onMessage)</code></a> on each channel individually.</p>\n<pre><code class=\"language-mjs\">import { boundedChannel } from 'node:diagnostics_channel';\n\nconst wc = boundedChannel('my-operation');\n\nconst handlers = {\n  start(message) {},\n  end(message) {},\n};\n\nwc.subscribe(handlers);\nwc.unsubscribe(handlers);\n</code></pre>\n<pre><code class=\"language-cjs\">const { boundedChannel } = require('node:diagnostics_channel');\n\nconst wc = boundedChannel('my-operation');\n\nconst handlers = {\n  start(message) {},\n  end(message) {},\n};\n\nwc.subscribe(handlers);\nwc.unsubscribe(handlers);\n</code></pre>"
                },
                {
                  "textRaw": "`boundedChannel.run(context, fn[, thisArg[, ...args]])`",
                  "name": "run",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`context` {Object} Shared object to correlate events through",
                          "name": "context",
                          "type": "Object",
                          "desc": "Shared object to correlate events through"
                        },
                        {
                          "textRaw": "`fn` {Function} Function to wrap a trace around",
                          "name": "fn",
                          "type": "Function",
                          "desc": "Function to wrap a trace around"
                        },
                        {
                          "textRaw": "`thisArg` {any} The receiver to be used for the function call",
                          "name": "thisArg",
                          "type": "any",
                          "desc": "The receiver to be used for the function call",
                          "optional": true
                        },
                        {
                          "textRaw": "`...args` {any} Optional arguments to pass to the function",
                          "name": "...args",
                          "type": "any",
                          "desc": "Optional arguments to pass to the function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {any} The return value of the given function",
                        "name": "return",
                        "type": "any",
                        "desc": "The return value of the given function"
                      }
                    }
                  ],
                  "desc": "<p>Trace a synchronous function call. This will produce a <code>start</code> event and <code>end</code>\nevent around the execution. This runs the given function using\n<a href=\"#channelrunstorescontext-fn-thisarg-args\"><code>channel.runStores(context, ...)</code></a> on the <code>start</code> channel which ensures all\nevents have any bound stores set to match this trace context.</p>\n<pre><code class=\"language-mjs\">import { boundedChannel } from 'node:diagnostics_channel';\n\nconst wc = boundedChannel('my-operation');\n\nconst result = wc.run({ operationId: '123' }, () => {\n  // Perform operation\n  return 42;\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { boundedChannel } = require('node:diagnostics_channel');\n\nconst wc = boundedChannel('my-operation');\n\nconst result = wc.run({ operationId: '123' }, () => {\n  // Perform operation\n  return 42;\n});\n</code></pre>"
                },
                {
                  "textRaw": "`boundedChannel.withScope([context])`",
                  "name": "withScope",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`context` {Object} Shared object to correlate events through",
                          "name": "context",
                          "type": "Object",
                          "desc": "Shared object to correlate events through",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {BoundedChannelScope} Disposable scope object",
                        "name": "return",
                        "type": "BoundedChannelScope",
                        "desc": "Disposable scope object"
                      }
                    }
                  ],
                  "desc": "<p>Create a disposable scope for tracing a synchronous operation using JavaScript's\nexplicit resource management (<code>using</code> syntax). The scope automatically publishes\n<code>start</code> and <code>end</code> events, enters bound stores, and handles cleanup when disposed.</p>\n<pre><code class=\"language-mjs\">import { boundedChannel } from 'node:diagnostics_channel';\n\nconst wc = boundedChannel('my-operation');\n\nconst context = { operationId: '123' };\n{\n  using scope = wc.withScope(context);\n  // Stores are entered, start event is published\n\n  // Perform work and set result on context\n  context.result = 42;\n}\n// End event is published, stores are restored automatically\n</code></pre>\n<pre><code class=\"language-cjs\">const { boundedChannel } = require('node:diagnostics_channel');\n\nconst wc = boundedChannel('my-operation');\n\nconst context = { operationId: '123' };\n{\n  using scope = wc.withScope(context);\n  // Stores are entered, start event is published\n\n  // Perform work and set result on context\n  context.result = 42;\n}\n// End event is published, stores are restored automatically\n</code></pre>"
                }
              ]
            },
            {
              "textRaw": "Class: `BoundedChannelScope`",
              "name": "BoundedChannelScope",
              "type": "class",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>The class <code>BoundedChannelScope</code> represents a disposable scope created by\n<a href=\"#boundedchannelwithscopecontext\"><code>boundedChannel.withScope(context)</code></a>. It manages the lifecycle of a traced\noperation, automatically publishing events and managing store contexts.</p>\n<p>The scope must be used with the <code>using</code> syntax to ensure proper disposal.</p>\n<pre><code class=\"language-mjs\">import { boundedChannel } from 'node:diagnostics_channel';\n\nconst wc = boundedChannel('my-operation');\n\nconst context = {};\n{\n  using scope = wc.withScope(context);\n  // Start event is published, stores are entered\n  context.result = performOperation();\n  // End event is automatically published at end of block\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { boundedChannel } = require('node:diagnostics_channel');\n\nconst wc = boundedChannel('my-operation');\n\nconst context = {};\n{\n  using scope = wc.withScope(context);\n  // Start event is published, stores are entered\n  context.result = performOperation();\n  // End event is automatically published at end of block\n}\n</code></pre>"
            }
          ],
          "displayName": "Public API"
        }
      ],
      "displayName": "Diagnostics Channel",
      "source": "doc/api/diagnostics_channel.md"
    },
    {
      "textRaw": "DNS",
      "name": "dns",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:dns</code> module enables name resolution. For example, use it to look up IP\naddresses of host names.</p>\n<p>Although named for the <a href=\"https://en.wikipedia.org/wiki/Domain_Name_System\">Domain Name System (DNS)</a>, it does not always use the\nDNS protocol for lookups. <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> uses the operating system\nfacilities to perform name resolution. It may not need to perform any network\ncommunication. To perform name resolution the way other applications on the same\nsystem do, use <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>.</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\n\ndns.lookup('example.org', (err, address, family) => {\n  console.log('address: %j family: IPv%s', address, family);\n});\n// address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\n\ndns.lookup('example.org', (err, address, family) => {\n  console.log('address: %j family: IPv%s', address, family);\n});\n// address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n</code></pre>\n<p>All other functions in the <code>node:dns</code> module connect to an actual DNS server to\nperform name resolution. They will always use the network to perform DNS\nqueries. These functions do not use the same set of configuration files used by\n<a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> (e.g. <code>/etc/hosts</code>). Use these functions to always perform\nDNS queries, bypassing other name-resolution facilities.</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\n\ndns.resolve4('archive.org', (err, addresses) => {\n  if (err) throw err;\n\n  console.log(`addresses: ${JSON.stringify(addresses)}`);\n\n  addresses.forEach((a) => {\n    dns.reverse(a, (err, hostnames) => {\n      if (err) {\n        throw err;\n      }\n      console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);\n    });\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\n\ndns.resolve4('archive.org', (err, addresses) => {\n  if (err) throw err;\n\n  console.log(`addresses: ${JSON.stringify(addresses)}`);\n\n  addresses.forEach((a) => {\n    dns.reverse(a, (err, hostnames) => {\n      if (err) {\n        throw err;\n      }\n      console.log(`reverse for ${a}: ${JSON.stringify(hostnames)}`);\n    });\n  });\n});\n</code></pre>\n<p>See the <a href=\"#implementation-considerations\">Implementation considerations section</a> for more information.</p>",
      "classes": [
        {
          "textRaw": "Class: `dns.Resolver`",
          "name": "dns.Resolver",
          "type": "class",
          "meta": {
            "added": [
              "v8.3.0"
            ],
            "changes": []
          },
          "desc": "<p>An independent resolver for DNS requests.</p>\n<p>Creating a new resolver uses the default server settings. Setting\nthe servers used for a resolver using\n<a href=\"#dnssetserversservers\"><code>resolver.setServers()</code></a> does not affect\nother resolvers:</p>\n<pre><code class=\"language-mjs\">import { Resolver } from 'node:dns';\nconst resolver = new Resolver();\nresolver.setServers(['4.4.4.4']);\n\n// This request will use the server at 4.4.4.4, independent of global settings.\nresolver.resolve4('example.org', (err, addresses) => {\n  // ...\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { Resolver } = require('node:dns');\nconst resolver = new Resolver();\nresolver.setServers(['4.4.4.4']);\n\n// This request will use the server at 4.4.4.4, independent of global settings.\nresolver.resolve4('example.org', (err, addresses) => {\n  // ...\n});\n</code></pre>\n<p>The following methods from the <code>node:dns</code> module are available:</p>\n<ul>\n<li><a href=\"#dnsgetservers\"><code>resolver.getServers()</code></a></li>\n<li><a href=\"#dnsresolvehostname-rrtype-callback\"><code>resolver.resolve()</code></a></li>\n<li><a href=\"#dnsresolve4hostname-options-callback\"><code>resolver.resolve4()</code></a></li>\n<li><a href=\"#dnsresolve6hostname-options-callback\"><code>resolver.resolve6()</code></a></li>\n<li><a href=\"#dnsresolveanyhostname-callback\"><code>resolver.resolveAny()</code></a></li>\n<li><a href=\"#dnsresolvecaahostname-callback\"><code>resolver.resolveCaa()</code></a></li>\n<li><a href=\"#dnsresolvecnamehostname-callback\"><code>resolver.resolveCname()</code></a></li>\n<li><a href=\"#dnsresolvemxhostname-callback\"><code>resolver.resolveMx()</code></a></li>\n<li><a href=\"#dnsresolvenaptrhostname-callback\"><code>resolver.resolveNaptr()</code></a></li>\n<li><a href=\"#dnsresolvenshostname-callback\"><code>resolver.resolveNs()</code></a></li>\n<li><a href=\"#dnsresolveptrhostname-callback\"><code>resolver.resolvePtr()</code></a></li>\n<li><a href=\"#dnsresolvesoahostname-callback\"><code>resolver.resolveSoa()</code></a></li>\n<li><a href=\"#dnsresolvesrvhostname-callback\"><code>resolver.resolveSrv()</code></a></li>\n<li><a href=\"#dnsresolvetlsahostname-callback\"><code>resolver.resolveTlsa()</code></a></li>\n<li><a href=\"#dnsresolvetxthostname-callback\"><code>resolver.resolveTxt()</code></a></li>\n<li><a href=\"#dnsreverseip-callback\"><code>resolver.reverse()</code></a></li>\n<li><a href=\"#dnssetserversservers\"><code>resolver.setServers()</code></a></li>\n</ul>",
          "methods": [
            {
              "textRaw": "`Resolver([options])`",
              "name": "Resolver",
              "type": "method",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v16.7.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39610",
                    "description": "The `options` object now accepts a `tries` option."
                  },
                  {
                    "version": "v12.18.3",
                    "pr-url": "https://github.com/nodejs/node/pull/33472",
                    "description": "The constructor now accepts an `options` object. The single supported option is `timeout`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`timeout` {integer} Query timeout in milliseconds, or `-1` to use the default timeout.",
                          "name": "timeout",
                          "type": "integer",
                          "desc": "Query timeout in milliseconds, or `-1` to use the default timeout."
                        },
                        {
                          "textRaw": "`tries` {integer} The number of tries the resolver will try contacting each name server before giving up. **Default:** `4`",
                          "name": "tries",
                          "type": "integer",
                          "default": "`4`",
                          "desc": "The number of tries the resolver will try contacting each name server before giving up."
                        },
                        {
                          "textRaw": "`maxTimeout` {integer} The max retry timeout, in milliseconds. **Default:** `0`, disabled.",
                          "name": "maxTimeout",
                          "type": "integer",
                          "default": "`0`, disabled",
                          "desc": "The max retry timeout, in milliseconds."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Create a new resolver.</p>"
            },
            {
              "textRaw": "`resolver.cancel()`",
              "name": "cancel",
              "type": "method",
              "meta": {
                "added": [
                  "v8.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Cancel all outstanding DNS queries made by this resolver. The corresponding\ncallbacks will be called with an error with code <code>ECANCELLED</code>.</p>"
            },
            {
              "textRaw": "`resolver.setLocalAddress([ipv4][, ipv6])`",
              "name": "setLocalAddress",
              "type": "method",
              "meta": {
                "added": [
                  "v15.1.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`ipv4` {string} A string representation of an IPv4 address. **Default:** `'0.0.0.0'`",
                      "name": "ipv4",
                      "type": "string",
                      "default": "`'0.0.0.0'`",
                      "desc": "A string representation of an IPv4 address.",
                      "optional": true
                    },
                    {
                      "textRaw": "`ipv6` {string} A string representation of an IPv6 address. **Default:** `'::0'`",
                      "name": "ipv6",
                      "type": "string",
                      "default": "`'::0'`",
                      "desc": "A string representation of an IPv6 address.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The resolver instance will send its requests from the specified IP address.\nThis allows programs to specify outbound interfaces when used on multi-homed\nsystems.</p>\n<p>If a v4 or v6 address is not specified, it is set to the default and the\noperating system will choose a local address automatically.</p>\n<p>The resolver will use the v4 local address when making requests to IPv4 DNS\nservers, and the v6 local address when making requests to IPv6 DNS servers.\nThe <code>rrtype</code> of resolution requests has no impact on the local address used.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`dns.getServers()`",
          "name": "getServers",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string[]}",
                "name": "return",
                "type": "string[]"
              }
            }
          ],
          "desc": "<p>Returns an array of IP address strings, formatted according to <a href=\"https://tools.ietf.org/html/rfc5952#section-6\">RFC 5952</a>,\nthat are currently configured for DNS resolution. A string will include a port\nsection if a custom port is used.</p>\n<pre><code class=\"language-json\">[\n  \"8.8.8.8\",\n  \"2001:4860:4860::8888\",\n  \"8.8.8.8:1053\",\n  \"[2001:4860:4860::8888]:1053\",\n]\n</code></pre>"
        },
        {
          "textRaw": "`dns.lookup(hostname[, options], callback)`",
          "name": "lookup",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.90"
            ],
            "changes": [
              {
                "version": [
                  "v22.1.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52492",
                "description": "The `verbatim` option is now deprecated in favor of the new `order` option."
              },
              {
                "version": "v18.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/43054",
                "description": "For compatibility with `node:net`, when passing an option object the `family` option can be the string `'IPv4'` or the string `'IPv6'`."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              },
              {
                "version": "v17.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/39987",
                "description": "The `verbatim` options defaults to `true` now."
              },
              {
                "version": "v8.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/14731",
                "description": "The `verbatim` option is supported now."
              },
              {
                "version": "v1.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/744",
                "description": "The `all` option is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`options` {integer|Object}",
                  "name": "options",
                  "type": "integer|Object",
                  "options": [
                    {
                      "textRaw": "`family` {integer|string} The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted as `4` and `6` respectively. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver. **Default:** `0`.",
                      "name": "family",
                      "type": "integer|string",
                      "default": "`0`",
                      "desc": "The record family. Must be `4`, `6`, or `0`. For backward compatibility reasons,`'IPv4'` and `'IPv6'` are interpreted as `4` and `6` respectively. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver."
                    },
                    {
                      "textRaw": "`hints` {number} One or more supported `getaddrinfo` flags. Multiple flags may be passed by bitwise `OR`ing their values.",
                      "name": "hints",
                      "type": "number",
                      "desc": "One or more supported `getaddrinfo` flags. Multiple flags may be passed by bitwise `OR`ing their values."
                    },
                    {
                      "textRaw": "`all` {boolean} When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address. **Default:** `false`.",
                      "name": "all",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "When `true`, the callback returns all resolved addresses in an array. Otherwise, returns a single address."
                    },
                    {
                      "textRaw": "`order` {string} When `verbatim`, the resolved addresses are returned unsorted. When `ipv4first`, the resolved addresses are sorted by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 addresses before IPv4 addresses. **Default:** `verbatim` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`.",
                      "name": "order",
                      "type": "string",
                      "default": "`verbatim` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`",
                      "desc": "When `verbatim`, the resolved addresses are returned unsorted. When `ipv4first`, the resolved addresses are sorted by placing IPv4 addresses before IPv6 addresses. When `ipv6first`, the resolved addresses are sorted by placing IPv6 addresses before IPv4 addresses."
                    },
                    {
                      "textRaw": "`verbatim` {boolean} When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`. **Default:** `true` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`.",
                      "name": "verbatim",
                      "type": "boolean",
                      "default": "`true` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`",
                      "desc": "When `true`, the callback receives IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`address` {string} A string representation of an IPv4 or IPv6 address. Not provided when `options.all` is `true`.",
                      "name": "address",
                      "type": "string",
                      "desc": "A string representation of an IPv4 or IPv6 address. Not provided when `options.all` is `true`."
                    },
                    {
                      "textRaw": "`family` {integer} `4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a bug in the name resolution service used by the operating system. Not provided when `options.all` is `true`.",
                      "name": "family",
                      "type": "integer",
                      "desc": "`4` or `6`, denoting the family of `address`, or `0` if the address is not an IPv4 or IPv6 address. `0` is a likely indicator of a bug in the name resolution service used by the operating system. Not provided when `options.all` is `true`."
                    },
                    {
                      "textRaw": "`addresses` {Object[]} An array of address objects when `options.all` is `true`. Each object has the following properties:",
                      "name": "addresses",
                      "type": "Object[]",
                      "desc": "An array of address objects when `options.all` is `true`. Each object has the following properties:",
                      "options": [
                        {
                          "textRaw": "`address` {string} A string representation of an IPv4 or IPv6 address.",
                          "name": "address",
                          "type": "string",
                          "desc": "A string representation of an IPv4 or IPv6 address."
                        },
                        {
                          "textRaw": "`family` {integer} `4` or `6`, denoting the family of `address`.",
                          "name": "family",
                          "type": "integer",
                          "desc": "`4` or `6`, denoting the family of `address`."
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Resolves a host name (e.g. <code>'nodejs.org'</code>) into the first found A (IPv4) or\nAAAA (IPv6) record. All <code>option</code> properties are optional. If <code>options</code> is an\ninteger, then it must be <code>4</code> or <code>6</code> – if <code>options</code> is not provided, then\neither IPv4 or IPv6 addresses, or both, are returned if found.</p>\n<p>With the <code>all</code> option set to <code>true</code>, the arguments for <code>callback</code> change to\n<code>(err, addresses)</code>, with <code>addresses</code> being an array of objects with the\nproperties <code>address</code> and <code>family</code>.</p>\n<p>On error, <code>err</code> is an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code> is the error code.\nKeep in mind that <code>err.code</code> will be set to <code>'ENOTFOUND'</code> not only when\nthe host name does not exist but also when the lookup fails in other ways\nsuch as no available file descriptors.</p>\n<p><code>dns.lookup()</code> does not necessarily have anything to do with the DNS protocol.\nThe implementation uses an operating system facility that can associate names\nwith addresses and vice versa. This implementation can have subtle but\nimportant consequences on the behavior of any Node.js program. Please take some\ntime to consult the <a href=\"#implementation-considerations\">Implementation considerations section</a> before using\n<code>dns.lookup()</code>.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\ndns.lookup('example.org', options, (err, address, family) =>\n  console.log('address: %j family: IPv%s', address, family));\n// address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\ndns.lookup('example.org', options, (err, addresses) =>\n  console.log('addresses: %j', addresses));\n// addresses: [{\"address\":\"2606:2800:21f:cb07:6820:80da:af6b:8b2c\",\"family\":6}]\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\ndns.lookup('example.org', options, (err, address, family) =>\n  console.log('address: %j family: IPv%s', address, family));\n// address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\ndns.lookup('example.org', options, (err, addresses) =>\n  console.log('addresses: %j', addresses));\n// addresses: [{\"address\":\"2606:2800:21f:cb07:6820:80da:af6b:8b2c\",\"family\":6}]\n</code></pre>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, and <code>all</code>\nis not set to <code>true</code>, it returns a <code>Promise</code> for an <code>Object</code> with <code>address</code> and\n<code>family</code> properties.</p>",
          "modules": [
            {
              "textRaw": "Supported getaddrinfo flags",
              "name": "supported_getaddrinfo_flags",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v13.13.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32183",
                    "description": "Added support for the `dns.ALL` flag."
                  }
                ]
              },
              "desc": "<p>The following flags can be passed as hints to <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>.</p>\n<ul>\n<li><code>dns.ADDRCONFIG</code>: Limits returned address types to the types of non-loopback\naddresses configured on the system. For example, IPv4 addresses are only\nreturned if the current system has at least one IPv4 address configured.</li>\n<li><code>dns.V4MAPPED</code>: If the IPv6 family was specified, but no IPv6 addresses were\nfound, then return IPv4 mapped IPv6 addresses. It is not supported\non some operating systems (e.g. FreeBSD 10.1).</li>\n<li><code>dns.ALL</code>: If <code>dns.V4MAPPED</code> is specified, return resolved IPv6 addresses as\nwell as IPv4 mapped IPv6 addresses.</li>\n</ul>",
              "displayName": "Supported getaddrinfo flags"
            }
          ]
        },
        {
          "textRaw": "`dns.lookupService(address, port, callback)`",
          "name": "lookupService",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.14"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`address` {string}",
                  "name": "address",
                  "type": "string"
                },
                {
                  "textRaw": "`port` {number}",
                  "name": "port",
                  "type": "number"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`hostname` {string} e.g. `example.com`",
                      "name": "hostname",
                      "type": "string",
                      "desc": "e.g. `example.com`"
                    },
                    {
                      "textRaw": "`service` {string} e.g. `http`",
                      "name": "service",
                      "type": "string",
                      "desc": "e.g. `http`"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Resolves the given <code>address</code> and <code>port</code> into a host name and service using\nthe operating system's underlying <code>getnameinfo</code> implementation.</p>\n<p>If <code>address</code> is not a valid IP address, a <code>TypeError</code> will be thrown.\nThe <code>port</code> will be coerced to a number. If it is not a legal port, a <code>TypeError</code>\nwill be thrown.</p>\n<p>On an error, <code>err</code> is an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code> is the error code.</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\ndns.lookupService('127.0.0.1', 22, (err, hostname, service) => {\n  console.log(hostname, service);\n  // Prints: localhost ssh\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\ndns.lookupService('127.0.0.1', 22, (err, hostname, service) => {\n  console.log(hostname, service);\n  // Prints: localhost ssh\n});\n</code></pre>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns a\n<code>Promise</code> for an <code>Object</code> with <code>hostname</code> and <code>service</code> properties.</p>"
        },
        {
          "textRaw": "`dns.resolve(hostname[, rrtype], callback)`",
          "name": "resolve",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string} Host name to resolve.",
                  "name": "hostname",
                  "type": "string",
                  "desc": "Host name to resolve."
                },
                {
                  "textRaw": "`rrtype` {string} Resource record type. **Default:** `'A'`.",
                  "name": "rrtype",
                  "type": "string",
                  "default": "`'A'`",
                  "desc": "Resource record type.",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`records` {string[]|Object[]|Object}",
                      "name": "records",
                      "type": "string[]|Object[]|Object"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve a host name (e.g. <code>'nodejs.org'</code>) into an array\nof the resource records. The <code>callback</code> function has arguments\n<code>(err, records)</code>. When successful, <code>records</code> will be an array of resource\nrecords. The type and structure of individual results varies based on <code>rrtype</code>:</p>\n<table>\n<thead>\n<tr>\n<th><code>rrtype</code></th>\n<th><code>records</code> contains</th>\n<th>Result type</th>\n<th>Shorthand method</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'A'</code></td>\n<td>IPv4 addresses (default)</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolve4hostname-options-callback\"><code>dns.resolve4()</code></a></td>\n</tr>\n<tr>\n<td><code>'AAAA'</code></td>\n<td>IPv6 addresses</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolve6hostname-options-callback\"><code>dns.resolve6()</code></a></td>\n</tr>\n<tr>\n<td><code>'ANY'</code></td>\n<td>any records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolveanyhostname-callback\"><code>dns.resolveAny()</code></a></td>\n</tr>\n<tr>\n<td><code>'CAA'</code></td>\n<td>CA authorization records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvecaahostname-callback\"><code>dns.resolveCaa()</code></a></td>\n</tr>\n<tr>\n<td><code>'CNAME'</code></td>\n<td>canonical name records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolvecnamehostname-callback\"><code>dns.resolveCname()</code></a></td>\n</tr>\n<tr>\n<td><code>'MX'</code></td>\n<td>mail exchange records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvemxhostname-callback\"><code>dns.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>name authority pointer records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvenaptrhostname-callback\"><code>dns.resolveNaptr()</code></a></td>\n</tr>\n<tr>\n<td><code>'NS'</code></td>\n<td>name server records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolvenshostname-callback\"><code>dns.resolveNs()</code></a></td>\n</tr>\n<tr>\n<td><code>'PTR'</code></td>\n<td>pointer records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnsresolveptrhostname-callback\"><code>dns.resolvePtr()</code></a></td>\n</tr>\n<tr>\n<td><code>'SOA'</code></td>\n<td>start of authority records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvesoahostname-callback\"><code>dns.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>service records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvesrvhostname-callback\"><code>dns.resolveSrv()</code></a></td>\n</tr>\n<tr>\n<td><code>'TLSA'</code></td>\n<td>certificate associations</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnsresolvetlsahostname-callback\"><code>dns.resolveTlsa()</code></a></td>\n</tr>\n<tr>\n<td><code>'TXT'</code></td>\n<td>text records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a></td>\n<td><a href=\"#dnsresolvetxthostname-callback\"><code>dns.resolveTxt()</code></a></td>\n</tr>\n</tbody>\n</table>\n<p>On error, <code>err</code> is an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code> is one of the\n<a href=\"#error-codes\">DNS error codes</a>.</p>"
        },
        {
          "textRaw": "`dns.resolve4(hostname[, options], callback)`",
          "name": "resolve4",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              },
              {
                "version": "v7.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/9296",
                "description": "This method now supports passing `options`, specifically `options.ttl`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string} Host name to resolve.",
                  "name": "hostname",
                  "type": "string",
                  "desc": "Host name to resolve."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`ttl` {boolean} Retrieves the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds.",
                      "name": "ttl",
                      "type": "boolean",
                      "desc": "Retrieves the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]|Object[]}",
                      "name": "addresses",
                      "type": "string[]|Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve a IPv4 addresses (<code>A</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function\nwill contain an array of IPv4 addresses (e.g.\n<code>['74.125.79.104', '74.125.79.105', '74.125.79.106']</code>).</p>"
        },
        {
          "textRaw": "`dns.resolve6(hostname[, options], callback)`",
          "name": "resolve6",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              },
              {
                "version": "v7.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/9296",
                "description": "This method now supports passing `options`, specifically `options.ttl`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string} Host name to resolve.",
                  "name": "hostname",
                  "type": "string",
                  "desc": "Host name to resolve."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds.",
                      "name": "ttl",
                      "type": "boolean",
                      "desc": "Retrieve the Time-To-Live value (TTL) of each record. When `true`, the callback receives an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]|Object[]}",
                      "name": "addresses",
                      "type": "string[]|Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve IPv6 addresses (<code>AAAA</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function\nwill contain an array of IPv6 addresses.</p>"
        },
        {
          "textRaw": "`dns.resolveAny(hostname, callback)`",
          "name": "resolveAny",
          "type": "method",
          "meta": {
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`ret` {Object[]}",
                      "name": "ret",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve all records (also known as <code>ANY</code> or <code>*</code> query).\nThe <code>ret</code> argument passed to the <code>callback</code> function will be an array containing\nvarious types of records. Each object has a property <code>type</code> that indicates the\ntype of the current record. And depending on the <code>type</code>, additional properties\nwill be present on the object:</p>\n<table>\n<thead>\n<tr>\n<th>Type</th>\n<th>Properties</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'A'</code></td>\n<td><code>address</code>/<code>ttl</code></td>\n</tr>\n<tr>\n<td><code>'AAAA'</code></td>\n<td><code>address</code>/<code>ttl</code></td>\n</tr>\n<tr>\n<td><code>'CAA'</code></td>\n<td>Refer to <a href=\"#dnsresolvecaahostname-callback\"><code>dns.resolveCaa()</code></a></td>\n</tr>\n<tr>\n<td><code>'CNAME'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'MX'</code></td>\n<td>Refer to <a href=\"#dnsresolvemxhostname-callback\"><code>dns.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>Refer to <a href=\"#dnsresolvenaptrhostname-callback\"><code>dns.resolveNaptr()</code></a></td>\n</tr>\n<tr>\n<td><code>'NS'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'PTR'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'SOA'</code></td>\n<td>Refer to <a href=\"#dnsresolvesoahostname-callback\"><code>dns.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>Refer to <a href=\"#dnsresolvesrvhostname-callback\"><code>dns.resolveSrv()</code></a></td>\n</tr>\n<tr>\n<td><code>'TLSA'</code></td>\n<td>Refer to <a href=\"#dnsresolvetlsahostname-callback\"><code>dns.resolveTlsa()</code></a></td>\n</tr>\n<tr>\n<td><code>'TXT'</code></td>\n<td>This type of record contains an array property called <code>entries</code> which refers to <a href=\"#dnsresolvetxthostname-callback\"><code>dns.resolveTxt()</code></a>, e.g. <code>{ entries: ['...'], type: 'TXT' }</code></td>\n</tr>\n</tbody>\n</table>\n<p>Here is an example of the <code>ret</code> object passed to the callback:</p>\n<pre><code class=\"language-js\">[ { type: 'A', address: '127.0.0.1', ttl: 299 },\n  { type: 'CNAME', value: 'example.com' },\n  { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },\n  { type: 'NS', value: 'ns1.example.com' },\n  { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },\n  { type: 'SOA',\n    nsname: 'ns1.example.com',\n    hostmaster: 'admin.example.com',\n    serial: 156696742,\n    refresh: 900,\n    retry: 900,\n    expire: 1800,\n    minttl: 60 } ];\n</code></pre>\n<p>DNS server operators may choose not to respond to <code>ANY</code>\nqueries. It may be better to call individual methods like <a href=\"#dnsresolve4hostname-options-callback\"><code>dns.resolve4()</code></a>,\n<a href=\"#dnsresolvemxhostname-callback\"><code>dns.resolveMx()</code></a>, and so on. For more details, see <a href=\"https://tools.ietf.org/html/rfc8482\">RFC 8482</a>.</p>"
        },
        {
          "textRaw": "`dns.resolveCname(hostname, callback)`",
          "name": "resolveCname",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.2"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]}",
                      "name": "addresses",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve <code>CNAME</code> records for the <code>hostname</code>. The\n<code>addresses</code> argument passed to the <code>callback</code> function\nwill contain an array of canonical name records available for the <code>hostname</code>\n(e.g. <code>['bar.example.com']</code>).</p>"
        },
        {
          "textRaw": "`dns.resolveCaa(hostname, callback)`",
          "name": "resolveCaa",
          "type": "method",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`records` {Object[]}",
                      "name": "records",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve <code>CAA</code> records for the <code>hostname</code>. The\n<code>addresses</code> argument passed to the <code>callback</code> function\nwill contain an array of certification authority authorization records\navailable for the <code>hostname</code> (e.g. <code>[{critical: 0, iodef: 'mailto:pki@example.com'}, {critical: 128, issue: 'pki.example.com'}]</code>).</p>"
        },
        {
          "textRaw": "`dns.resolveMx(hostname, callback)`",
          "name": "resolveMx",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {Object[]}",
                      "name": "addresses",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve mail exchange records (<code>MX</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function will\ncontain an array of objects containing both a <code>priority</code> and <code>exchange</code>\nproperty (e.g. <code>[{priority: 10, exchange: 'mx.example.com'}, ...]</code>).</p>"
        },
        {
          "textRaw": "`dns.resolveNaptr(hostname, callback)`",
          "name": "resolveNaptr",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.12"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {Object[]}",
                      "name": "addresses",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve regular expression-based records (<code>NAPTR</code>\nrecords) for the <code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code>\nfunction will contain an array of objects with the following properties:</p>\n<ul>\n<li><code>flags</code></li>\n<li><code>service</code></li>\n<li><code>regexp</code></li>\n<li><code>replacement</code></li>\n<li><code>order</code></li>\n<li><code>preference</code></li>\n</ul>\n<pre><code class=\"language-js\">({\n  flags: 's',\n  service: 'SIP+D2U',\n  regexp: '',\n  replacement: '_sip._udp.example.com',\n  order: 30,\n  preference: 100,\n});\n</code></pre>"
        },
        {
          "textRaw": "`dns.resolveNs(hostname, callback)`",
          "name": "resolveNs",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.90"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]}",
                      "name": "addresses",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve name server records (<code>NS</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function will\ncontain an array of name server records available for <code>hostname</code>\n(e.g. <code>['ns1.example.com', 'ns2.example.com']</code>).</p>"
        },
        {
          "textRaw": "`dns.resolvePtr(hostname, callback)`",
          "name": "resolvePtr",
          "type": "method",
          "meta": {
            "added": [
              "v6.0.0"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {string[]}",
                      "name": "addresses",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve pointer records (<code>PTR</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function will\nbe an array of strings containing the reply records.</p>"
        },
        {
          "textRaw": "`dns.resolveSoa(hostname, callback)`",
          "name": "resolveSoa",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.10"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`address` {Object}",
                      "name": "address",
                      "type": "Object"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve a start of authority record (<code>SOA</code> record) for\nthe <code>hostname</code>. The <code>address</code> argument passed to the <code>callback</code> function will\nbe an object with the following properties:</p>\n<ul>\n<li><code>nsname</code></li>\n<li><code>hostmaster</code></li>\n<li><code>serial</code></li>\n<li><code>refresh</code></li>\n<li><code>retry</code></li>\n<li><code>expire</code></li>\n<li><code>minttl</code></li>\n</ul>\n<pre><code class=\"language-js\">({\n  nsname: 'ns.example.com',\n  hostmaster: 'root.example.com',\n  serial: 2013101809,\n  refresh: 10000,\n  retry: 2400,\n  expire: 604800,\n  minttl: 3600,\n});\n</code></pre>"
        },
        {
          "textRaw": "`dns.resolveSrv(hostname, callback)`",
          "name": "resolveSrv",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`addresses` {Object[]}",
                      "name": "addresses",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve service records (<code>SRV</code> records) for the\n<code>hostname</code>. The <code>addresses</code> argument passed to the <code>callback</code> function will\nbe an array of objects with the following properties:</p>\n<ul>\n<li><code>priority</code></li>\n<li><code>weight</code></li>\n<li><code>port</code></li>\n<li><code>name</code></li>\n</ul>\n<pre><code class=\"language-js\">({\n  priority: 10,\n  weight: 5,\n  port: 21223,\n  name: 'service.example.com',\n});\n</code></pre>"
        },
        {
          "textRaw": "`dns.resolveTlsa(hostname, callback)`",
          "name": "resolveTlsa",
          "type": "method",
          "meta": {
            "added": [
              "v23.9.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`records` {Object[]}",
                      "name": "records",
                      "type": "Object[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve certificate associations (<code>TLSA</code> records) for\nthe <code>hostname</code>. The <code>records</code> argument passed to the <code>callback</code> function is an\narray of objects with these properties:</p>\n<ul>\n<li><code>certUsage</code></li>\n<li><code>selector</code></li>\n<li><code>match</code></li>\n<li><code>data</code></li>\n</ul>\n<pre><code class=\"language-js\">({\n  certUsage: 3,\n  selector: 1,\n  match: 1,\n  data: [ArrayBuffer],\n});\n</code></pre>"
        },
        {
          "textRaw": "`dns.resolveTxt(hostname, callback)`",
          "name": "resolveTxt",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string}",
                  "name": "hostname",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`records` {string[]}",
                      "name": "records",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Uses the DNS protocol to resolve text queries (<code>TXT</code> records) for the\n<code>hostname</code>. The <code>records</code> argument passed to the <code>callback</code> function is a\ntwo-dimensional array of the text records available for <code>hostname</code> (e.g.\n<code>[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]</code>). Each sub-array contains TXT chunks of\none record. Depending on the use case, these could be either joined together or\ntreated separately.</p>"
        },
        {
          "textRaw": "`dns.reverse(ip, callback)`",
          "name": "reverse",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`ip` {string}",
                  "name": "ip",
                  "type": "string"
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`hostnames` {string[]}",
                      "name": "hostnames",
                      "type": "string[]"
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an\narray of host names.</p>\n<p>On error, <code>err</code> is an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code> is\none of the <a href=\"#error-codes\">DNS error codes</a>.</p>"
        },
        {
          "textRaw": "`dns.setDefaultResultOrder(order)`",
          "name": "setDefaultResultOrder",
          "type": "method",
          "meta": {
            "added": [
              "v16.4.0",
              "v14.18.0"
            ],
            "changes": [
              {
                "version": [
                  "v22.1.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52492",
                "description": "The `ipv6first` value is supported now."
              },
              {
                "version": "v17.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/39987",
                "description": "Changed default value to `verbatim`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`order` {string} must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.",
                  "name": "order",
                  "type": "string",
                  "desc": "must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`."
                }
              ]
            }
          ],
          "desc": "<p>Set the default value of <code>order</code> in <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and\n<a href=\"#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a>. The value could be:</p>\n<ul>\n<li><code>ipv4first</code>: sets default <code>order</code> to <code>ipv4first</code>.</li>\n<li><code>ipv6first</code>: sets default <code>order</code> to <code>ipv6first</code>.</li>\n<li><code>verbatim</code>: sets default <code>order</code> to <code>verbatim</code>.</li>\n</ul>\n<p>The default is <code>verbatim</code> and <a href=\"#dnssetdefaultresultorderorder\"><code>dns.setDefaultResultOrder()</code></a> have higher\npriority than <a href=\"cli.html#--dns-result-orderorder\"><code>--dns-result-order</code></a>. When using <a href=\"worker_threads.html\">worker threads</a>,\n<a href=\"#dnssetdefaultresultorderorder\"><code>dns.setDefaultResultOrder()</code></a> from the main thread won't affect the default\ndns orders in workers.</p>"
        },
        {
          "textRaw": "`dns.getDefaultResultOrder()`",
          "name": "getDefaultResultOrder",
          "type": "method",
          "meta": {
            "added": [
              "v20.1.0",
              "v18.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v22.1.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52492",
                "description": "The `ipv6first` value is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>Get the default value for <code>order</code> in <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and\n<a href=\"#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a>. The value could be:</p>\n<ul>\n<li><code>ipv4first</code>: for <code>order</code> defaulting to <code>ipv4first</code>.</li>\n<li><code>ipv6first</code>: for <code>order</code> defaulting to <code>ipv6first</code>.</li>\n<li><code>verbatim</code>: for <code>order</code> defaulting to <code>verbatim</code>.</li>\n</ul>"
        },
        {
          "textRaw": "`dns.setServers(servers)`",
          "name": "setServers",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`servers` {string[]} array of RFC 5952 formatted addresses",
                  "name": "servers",
                  "type": "string[]",
                  "desc": "array of RFC 5952 formatted addresses"
                }
              ]
            }
          ],
          "desc": "<p>Sets the IP address and port of servers to be used when performing DNS\nresolution. The <code>servers</code> argument is an array of <a href=\"https://tools.ietf.org/html/rfc5952#section-6\">RFC 5952</a> formatted\naddresses. If the port is the IANA default DNS port (53) it can be omitted.</p>\n<pre><code class=\"language-js\">dns.setServers([\n  '8.8.8.8',\n  '[2001:4860:4860::8888]',\n  '8.8.8.8:1053',\n  '[2001:4860:4860::8888]:1053',\n]);\n</code></pre>\n<p>An error will be thrown if an invalid address is provided.</p>\n<p>The <code>dns.setServers()</code> method must not be called while a DNS query is in\nprogress.</p>\n<p>The <a href=\"#dnssetserversservers\"><code>dns.setServers()</code></a> method affects only <a href=\"#dnsresolvehostname-rrtype-callback\"><code>dns.resolve()</code></a>,\n<code>dns.resolve*()</code> and <a href=\"#dnsreverseip-callback\"><code>dns.reverse()</code></a> (and specifically <em>not</em>\n<a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>).</p>\n<p>This method works much like\n<a href=\"https://man7.org/linux/man-pages/man5/resolv.conf.5.html\">resolve.conf</a>.\nThat is, if attempting to resolve with the first server provided results in a\n<code>NOTFOUND</code> error, the <code>resolve()</code> method will <em>not</em> attempt to resolve with\nsubsequent servers provided. Fallback DNS servers will only be used if the\nearlier ones time out or result in some other error.</p>"
        }
      ],
      "modules": [
        {
          "textRaw": "DNS promises API",
          "name": "dns_promises_api",
          "type": "module",
          "meta": {
            "added": [
              "v10.6.0"
            ],
            "changes": [
              {
                "version": "v15.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/32953",
                "description": "Exposed as `require('dns/promises')`."
              },
              {
                "version": [
                  "v11.14.0",
                  "v10.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/26592",
                "description": "This API is no longer experimental."
              }
            ]
          },
          "desc": "<p>The <code>dns.promises</code> API provides an alternative set of asynchronous DNS methods\nthat return <code>Promise</code> objects rather than using callbacks. The API is accessible\nvia <code>require('node:dns').promises</code> or <code>require('node:dns/promises')</code>.</p>",
          "classes": [
            {
              "textRaw": "Class: `dnsPromises.Resolver`",
              "name": "dnsPromises.Resolver",
              "type": "class",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "desc": "<p>An independent resolver for DNS requests.</p>\n<p>Creating a new resolver uses the default server settings. Setting\nthe servers used for a resolver using\n<a href=\"#dnspromisessetserversservers\"><code>resolver.setServers()</code></a> does not affect\nother resolvers:</p>\n<pre><code class=\"language-mjs\">import { Resolver } from 'node:dns/promises';\nconst resolver = new Resolver();\nresolver.setServers(['4.4.4.4']);\n\n// This request will use the server at 4.4.4.4, independent of global settings.\nconst addresses = await resolver.resolve4('example.org');\n</code></pre>\n<pre><code class=\"language-cjs\">const { Resolver } = require('node:dns').promises;\nconst resolver = new Resolver();\nresolver.setServers(['4.4.4.4']);\n\n// This request will use the server at 4.4.4.4, independent of global settings.\nresolver.resolve4('example.org').then((addresses) => {\n  // ...\n});\n\n// Alternatively, the same code can be written using async-await style.\n(async function() {\n  const addresses = await resolver.resolve4('example.org');\n})();\n</code></pre>\n<p>The following methods from the <code>dnsPromises</code> API are available:</p>\n<ul>\n<li><a href=\"#dnspromisesgetservers\"><code>resolver.getServers()</code></a></li>\n<li><a href=\"#dnspromisesresolvehostname-rrtype\"><code>resolver.resolve()</code></a></li>\n<li><a href=\"#dnspromisesresolve4hostname-options\"><code>resolver.resolve4()</code></a></li>\n<li><a href=\"#dnspromisesresolve6hostname-options\"><code>resolver.resolve6()</code></a></li>\n<li><a href=\"#dnspromisesresolveanyhostname\"><code>resolver.resolveAny()</code></a></li>\n<li><a href=\"#dnspromisesresolvecaahostname\"><code>resolver.resolveCaa()</code></a></li>\n<li><a href=\"#dnspromisesresolvecnamehostname\"><code>resolver.resolveCname()</code></a></li>\n<li><a href=\"#dnspromisesresolvemxhostname\"><code>resolver.resolveMx()</code></a></li>\n<li><a href=\"#dnspromisesresolvenaptrhostname\"><code>resolver.resolveNaptr()</code></a></li>\n<li><a href=\"#dnspromisesresolvenshostname\"><code>resolver.resolveNs()</code></a></li>\n<li><a href=\"#dnspromisesresolveptrhostname\"><code>resolver.resolvePtr()</code></a></li>\n<li><a href=\"#dnspromisesresolvesoahostname\"><code>resolver.resolveSoa()</code></a></li>\n<li><a href=\"#dnspromisesresolvesrvhostname\"><code>resolver.resolveSrv()</code></a></li>\n<li><a href=\"#dnspromisesresolvetlsahostname\"><code>resolver.resolveTlsa()</code></a></li>\n<li><a href=\"#dnspromisesresolvetxthostname\"><code>resolver.resolveTxt()</code></a></li>\n<li><a href=\"#dnspromisesreverseip\"><code>resolver.reverse()</code></a></li>\n<li><a href=\"#dnspromisessetserversservers\"><code>resolver.setServers()</code></a></li>\n</ul>"
            }
          ],
          "methods": [
            {
              "textRaw": "`resolver.cancel()`",
              "name": "cancel",
              "type": "method",
              "meta": {
                "added": [
                  "v15.3.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Cancel all outstanding DNS queries made by this resolver. The corresponding\npromises will be rejected with an error with the code <code>ECANCELLED</code>.</p>"
            },
            {
              "textRaw": "`dnsPromises.getServers()`",
              "name": "getServers",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]}",
                    "name": "return",
                    "type": "string[]"
                  }
                }
              ],
              "desc": "<p>Returns an array of IP address strings, formatted according to <a href=\"https://tools.ietf.org/html/rfc5952#section-6\">RFC 5952</a>,\nthat are currently configured for DNS resolution. A string will include a port\nsection if a custom port is used.</p>\n<pre><code class=\"language-json\">[\n  \"8.8.8.8\",\n  \"2001:4860:4860::8888\",\n  \"8.8.8.8:1053\",\n  \"[2001:4860:4860::8888]:1053\"\n]\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.lookup(hostname[, options])`",
              "name": "lookup",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.1.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52492",
                    "description": "The `verbatim` option is now deprecated in favor of the new `order` option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {integer|Object}",
                      "name": "options",
                      "type": "integer|Object",
                      "options": [
                        {
                          "textRaw": "`family` {integer} The record family. Must be `4`, `6`, or `0`. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver. **Default:** `0`.",
                          "name": "family",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "The record family. Must be `4`, `6`, or `0`. The value `0` indicates that either an IPv4 or IPv6 address is returned. If the value `0` is used with `{ all: true }` (see below), either one of or both IPv4 and IPv6 addresses are returned, depending on the system's DNS resolver."
                        },
                        {
                          "textRaw": "`hints` {number} One or more supported `getaddrinfo` flags. Multiple flags may be passed by bitwise `OR`ing their values.",
                          "name": "hints",
                          "type": "number",
                          "desc": "One or more supported `getaddrinfo` flags. Multiple flags may be passed by bitwise `OR`ing their values."
                        },
                        {
                          "textRaw": "`all` {boolean} When `true`, the `Promise` is resolved with all addresses in an array. Otherwise, returns a single address. **Default:** `false`.",
                          "name": "all",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, the `Promise` is resolved with all addresses in an array. Otherwise, returns a single address."
                        },
                        {
                          "textRaw": "`order` {string} When `verbatim`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `ipv4first`, IPv4 addresses are placed before IPv6 addresses. When `ipv6first`, IPv6 addresses are placed before IPv4 addresses. **Default:** `verbatim` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`. New code should use `{ order: 'verbatim' }`.",
                          "name": "order",
                          "type": "string",
                          "default": "`verbatim` (addresses are not reordered). Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`. New code should use `{ order: 'verbatim' }`",
                          "desc": "When `verbatim`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `ipv4first`, IPv4 addresses are placed before IPv6 addresses. When `ipv6first`, IPv6 addresses are placed before IPv4 addresses."
                        },
                        {
                          "textRaw": "`verbatim` {boolean} When `true`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`. **Default:** currently `false` (addresses are reordered) but this is expected to change in the not too distant future. Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`.",
                          "name": "verbatim",
                          "type": "boolean",
                          "default": "currently `false` (addresses are reordered) but this is expected to change in the not too distant future. Default value is configurable using `dns.setDefaultResultOrder()` or `--dns-result-order`",
                          "desc": "When `true`, the `Promise` is resolved with IPv4 and IPv6 addresses in the order the DNS resolver returned them. When `false`, IPv4 addresses are placed before IPv6 addresses. This option will be deprecated in favor of `order`. When both are specified, `order` has higher precedence. New code should only use `order`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Resolves a host name (e.g. <code>'nodejs.org'</code>) into the first found A (IPv4) or\nAAAA (IPv6) record. All <code>option</code> properties are optional. If <code>options</code> is an\ninteger, then it must be <code>4</code> or <code>6</code> – if <code>options</code> is not provided, then\neither IPv4 or IPv6 addresses, or both, are returned if found.</p>\n<p>With the <code>all</code> option set to <code>true</code>, the <code>Promise</code> is resolved with <code>addresses</code>\nbeing an array of objects with the properties <code>address</code> and <code>family</code>.</p>\n<p>On error, the <code>Promise</code> is rejected with an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code>\nis the error code.\nKeep in mind that <code>err.code</code> will be set to <code>'ENOTFOUND'</code> not only when\nthe host name does not exist but also when the lookup fails in other ways\nsuch as no available file descriptors.</p>\n<p><a href=\"#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a> does not necessarily have anything to do with the DNS\nprotocol. The implementation uses an operating system facility that can\nassociate names with addresses and vice versa. This implementation can have\nsubtle but important consequences on the behavior of any Node.js program. Please\ntake some time to consult the <a href=\"#implementation-considerations\">Implementation considerations section</a> before\nusing <code>dnsPromises.lookup()</code>.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-mjs\">import dns from 'node:dns';\nconst dnsPromises = dns.promises;\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\n\nawait dnsPromises.lookup('example.org', options).then((result) => {\n  console.log('address: %j family: IPv%s', result.address, result.family);\n  // address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n});\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\nawait dnsPromises.lookup('example.org', options).then((result) => {\n  console.log('addresses: %j', result);\n  // addresses: [{\"address\":\"2606:2800:21f:cb07:6820:80da:af6b:8b2c\",\"family\":6}]\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dns = require('node:dns');\nconst dnsPromises = dns.promises;\nconst options = {\n  family: 6,\n  hints: dns.ADDRCONFIG | dns.V4MAPPED,\n};\n\ndnsPromises.lookup('example.org', options).then((result) => {\n  console.log('address: %j family: IPv%s', result.address, result.family);\n  // address: \"2606:2800:21f:cb07:6820:80da:af6b:8b2c\" family: IPv6\n});\n\n// When options.all is true, the result will be an Array.\noptions.all = true;\ndnsPromises.lookup('example.org', options).then((result) => {\n  console.log('addresses: %j', result);\n  // addresses: [{\"address\":\"2606:2800:21f:cb07:6820:80da:af6b:8b2c\",\"family\":6}]\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.lookupService(address, port)`",
              "name": "lookupService",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`address` {string}",
                      "name": "address",
                      "type": "string"
                    },
                    {
                      "textRaw": "`port` {number}",
                      "name": "port",
                      "type": "number"
                    }
                  ]
                }
              ],
              "desc": "<p>Resolves the given <code>address</code> and <code>port</code> into a host name and service using\nthe operating system's underlying <code>getnameinfo</code> implementation.</p>\n<p>If <code>address</code> is not a valid IP address, a <code>TypeError</code> will be thrown.\nThe <code>port</code> will be coerced to a number. If it is not a legal port, a <code>TypeError</code>\nwill be thrown.</p>\n<p>On error, the <code>Promise</code> is rejected with an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code>\nis the error code.</p>\n<pre><code class=\"language-mjs\">import dnsPromises from 'node:dns/promises';\nconst result = await dnsPromises.lookupService('127.0.0.1', 22);\n\nconsole.log(result.hostname, result.service); // Prints: localhost ssh\n</code></pre>\n<pre><code class=\"language-cjs\">const dnsPromises = require('node:dns').promises;\ndnsPromises.lookupService('127.0.0.1', 22).then((result) => {\n  console.log(result.hostname, result.service);\n  // Prints: localhost ssh\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolve(hostname[, rrtype])`",
              "name": "resolve",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string} Host name to resolve.",
                      "name": "hostname",
                      "type": "string",
                      "desc": "Host name to resolve."
                    },
                    {
                      "textRaw": "`rrtype` {string} Resource record type. **Default:** `'A'`.",
                      "name": "rrtype",
                      "type": "string",
                      "default": "`'A'`",
                      "desc": "Resource record type.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve a host name (e.g. <code>'nodejs.org'</code>) into an array\nof the resource records. When successful, the <code>Promise</code> is resolved with an\narray of resource records. The type and structure of individual results vary\nbased on <code>rrtype</code>:</p>\n<table>\n<thead>\n<tr>\n<th><code>rrtype</code></th>\n<th><code>records</code> contains</th>\n<th>Result type</th>\n<th>Shorthand method</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'A'</code></td>\n<td>IPv4 addresses (default)</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolve4hostname-options\"><code>dnsPromises.resolve4()</code></a></td>\n</tr>\n<tr>\n<td><code>'AAAA'</code></td>\n<td>IPv6 addresses</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolve6hostname-options\"><code>dnsPromises.resolve6()</code></a></td>\n</tr>\n<tr>\n<td><code>'ANY'</code></td>\n<td>any records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolveanyhostname\"><code>dnsPromises.resolveAny()</code></a></td>\n</tr>\n<tr>\n<td><code>'CAA'</code></td>\n<td>CA authorization records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvecaahostname\"><code>dnsPromises.resolveCaa()</code></a></td>\n</tr>\n<tr>\n<td><code>'CNAME'</code></td>\n<td>canonical name records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolvecnamehostname\"><code>dnsPromises.resolveCname()</code></a></td>\n</tr>\n<tr>\n<td><code>'MX'</code></td>\n<td>mail exchange records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvemxhostname\"><code>dnsPromises.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>name authority pointer records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvenaptrhostname\"><code>dnsPromises.resolveNaptr()</code></a></td>\n</tr>\n<tr>\n<td><code>'NS'</code></td>\n<td>name server records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolvenshostname\"><code>dnsPromises.resolveNs()</code></a></td>\n</tr>\n<tr>\n<td><code>'PTR'</code></td>\n<td>pointer records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"#dnspromisesresolveptrhostname\"><code>dnsPromises.resolvePtr()</code></a></td>\n</tr>\n<tr>\n<td><code>'SOA'</code></td>\n<td>start of authority records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvesoahostname\"><code>dnsPromises.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>service records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvesrvhostname\"><code>dnsPromises.resolveSrv()</code></a></td>\n</tr>\n<tr>\n<td><code>'TLSA'</code></td>\n<td>certificate associations</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></td>\n<td><a href=\"#dnspromisesresolvetlsahostname\"><code>dnsPromises.resolveTlsa()</code></a></td>\n</tr>\n<tr>\n<td><code>'TXT'</code></td>\n<td>text records</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a></td>\n<td><a href=\"#dnspromisesresolvetxthostname\"><code>dnsPromises.resolveTxt()</code></a></td>\n</tr>\n</tbody>\n</table>\n<p>On error, the <code>Promise</code> is rejected with an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code>\nis one of the <a href=\"#error-codes\">DNS error codes</a>.</p>"
            },
            {
              "textRaw": "`dnsPromises.resolve4(hostname[, options])`",
              "name": "resolve4",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string} Host name to resolve.",
                      "name": "hostname",
                      "type": "string",
                      "desc": "Host name to resolve."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds.",
                          "name": "ttl",
                          "type": "boolean",
                          "desc": "Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '1.2.3.4', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve IPv4 addresses (<code>A</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of IPv4\naddresses (e.g. <code>['74.125.79.104', '74.125.79.105', '74.125.79.106']</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolve6(hostname[, options])`",
              "name": "resolve6",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string} Host name to resolve.",
                      "name": "hostname",
                      "type": "string",
                      "desc": "Host name to resolve."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ttl` {boolean} Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds.",
                          "name": "ttl",
                          "type": "boolean",
                          "desc": "Retrieve the Time-To-Live value (TTL) of each record. When `true`, the `Promise` is resolved with an array of `{ address: '0:1:2:3:4:5:6:7', ttl: 60 }` objects rather than an array of strings, with the TTL expressed in seconds."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve IPv6 addresses (<code>AAAA</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of IPv6\naddresses.</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveAny(hostname)`",
              "name": "resolveAny",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve all records (also known as <code>ANY</code> or <code>*</code> query).\nOn success, the <code>Promise</code> is resolved with an array containing various types of\nrecords. Each object has a property <code>type</code> that indicates the type of the\ncurrent record. And depending on the <code>type</code>, additional properties will be\npresent on the object:</p>\n<table>\n<thead>\n<tr>\n<th>Type</th>\n<th>Properties</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'A'</code></td>\n<td><code>address</code>/<code>ttl</code></td>\n</tr>\n<tr>\n<td><code>'AAAA'</code></td>\n<td><code>address</code>/<code>ttl</code></td>\n</tr>\n<tr>\n<td><code>'CAA'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvecaahostname\"><code>dnsPromises.resolveCaa()</code></a></td>\n</tr>\n<tr>\n<td><code>'CNAME'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'MX'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvemxhostname\"><code>dnsPromises.resolveMx()</code></a></td>\n</tr>\n<tr>\n<td><code>'NAPTR'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvenaptrhostname\"><code>dnsPromises.resolveNaptr()</code></a></td>\n</tr>\n<tr>\n<td><code>'NS'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'PTR'</code></td>\n<td><code>value</code></td>\n</tr>\n<tr>\n<td><code>'SOA'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvesoahostname\"><code>dnsPromises.resolveSoa()</code></a></td>\n</tr>\n<tr>\n<td><code>'SRV'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvesrvhostname\"><code>dnsPromises.resolveSrv()</code></a></td>\n</tr>\n<tr>\n<td><code>'TLSA'</code></td>\n<td>Refer to <a href=\"#dnspromisesresolvetlsahostname\"><code>dnsPromises.resolveTlsa()</code></a></td>\n</tr>\n<tr>\n<td><code>'TXT'</code></td>\n<td>This type of record contains an array property called <code>entries</code> which refers to <a href=\"#dnspromisesresolvetxthostname\"><code>dnsPromises.resolveTxt()</code></a>, e.g. <code>{ entries: ['...'], type: 'TXT' }</code></td>\n</tr>\n</tbody>\n</table>\n<p>Here is an example of the result object:</p>\n<pre><code class=\"language-js\">[ { type: 'A', address: '127.0.0.1', ttl: 299 },\n  { type: 'CNAME', value: 'example.com' },\n  { type: 'MX', exchange: 'alt4.aspmx.l.example.com', priority: 50 },\n  { type: 'NS', value: 'ns1.example.com' },\n  { type: 'TXT', entries: [ 'v=spf1 include:_spf.example.com ~all' ] },\n  { type: 'SOA',\n    nsname: 'ns1.example.com',\n    hostmaster: 'admin.example.com',\n    serial: 156696742,\n    refresh: 900,\n    retry: 900,\n    expire: 1800,\n    minttl: 60 } ];\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveCaa(hostname)`",
              "name": "resolveCaa",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve <code>CAA</code> records for the <code>hostname</code>. On success,\nthe <code>Promise</code> is resolved with an array of objects containing available\ncertification authority authorization records available for the <code>hostname</code>\n(e.g. <code>[{critical: 0, iodef: 'mailto:pki@example.com'},{critical: 128, issue: 'pki.example.com'}]</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveCname(hostname)`",
              "name": "resolveCname",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve <code>CNAME</code> records for the <code>hostname</code>. On success,\nthe <code>Promise</code> is resolved with an array of canonical name records available for\nthe <code>hostname</code> (e.g. <code>['bar.example.com']</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveMx(hostname)`",
              "name": "resolveMx",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve mail exchange records (<code>MX</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of objects\ncontaining both a <code>priority</code> and <code>exchange</code> property (e.g.\n<code>[{priority: 10, exchange: 'mx.example.com'}, ...]</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveNaptr(hostname)`",
              "name": "resolveNaptr",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve regular expression-based records (<code>NAPTR</code>\nrecords) for the <code>hostname</code>. On success, the <code>Promise</code> is resolved with an array\nof objects with the following properties:</p>\n<ul>\n<li><code>flags</code></li>\n<li><code>service</code></li>\n<li><code>regexp</code></li>\n<li><code>replacement</code></li>\n<li><code>order</code></li>\n<li><code>preference</code></li>\n</ul>\n<pre><code class=\"language-js\">({\n  flags: 's',\n  service: 'SIP+D2U',\n  regexp: '',\n  replacement: '_sip._udp.example.com',\n  order: 30,\n  preference: 100,\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveNs(hostname)`",
              "name": "resolveNs",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve name server records (<code>NS</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of name server\nrecords available for <code>hostname</code> (e.g.\n<code>['ns1.example.com', 'ns2.example.com']</code>).</p>"
            },
            {
              "textRaw": "`dnsPromises.resolvePtr(hostname)`",
              "name": "resolvePtr",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve pointer records (<code>PTR</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of strings\ncontaining the reply records.</p>"
            },
            {
              "textRaw": "`dnsPromises.resolveSoa(hostname)`",
              "name": "resolveSoa",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve a start of authority record (<code>SOA</code> record) for\nthe <code>hostname</code>. On success, the <code>Promise</code> is resolved with an object with the\nfollowing properties:</p>\n<ul>\n<li><code>nsname</code></li>\n<li><code>hostmaster</code></li>\n<li><code>serial</code></li>\n<li><code>refresh</code></li>\n<li><code>retry</code></li>\n<li><code>expire</code></li>\n<li><code>minttl</code></li>\n</ul>\n<pre><code class=\"language-js\">({\n  nsname: 'ns.example.com',\n  hostmaster: 'root.example.com',\n  serial: 2013101809,\n  refresh: 10000,\n  retry: 2400,\n  expire: 604800,\n  minttl: 3600,\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveSrv(hostname)`",
              "name": "resolveSrv",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve service records (<code>SRV</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of objects with\nthe following properties:</p>\n<ul>\n<li><code>priority</code></li>\n<li><code>weight</code></li>\n<li><code>port</code></li>\n<li><code>name</code></li>\n</ul>\n<pre><code class=\"language-js\">({\n  priority: 10,\n  weight: 5,\n  port: 21223,\n  name: 'service.example.com',\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveTlsa(hostname)`",
              "name": "resolveTlsa",
              "type": "method",
              "meta": {
                "added": [
                  "v23.9.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve certificate associations (<code>TLSA</code> records) for\nthe <code>hostname</code>. On success, the <code>Promise</code> is resolved with an array of objects\nwith these properties:</p>\n<ul>\n<li><code>certUsage</code></li>\n<li><code>selector</code></li>\n<li><code>match</code></li>\n<li><code>data</code></li>\n</ul>\n<pre><code class=\"language-js\">({\n  certUsage: 3,\n  selector: 1,\n  match: 1,\n  data: [ArrayBuffer],\n});\n</code></pre>"
            },
            {
              "textRaw": "`dnsPromises.resolveTxt(hostname)`",
              "name": "resolveTxt",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string}",
                      "name": "hostname",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Uses the DNS protocol to resolve text queries (<code>TXT</code> records) for the\n<code>hostname</code>. On success, the <code>Promise</code> is resolved with a two-dimensional array\nof the text records available for <code>hostname</code> (e.g.\n<code>[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]</code>). Each sub-array contains TXT chunks of\none record. Depending on the use case, these could be either joined together or\ntreated separately.</p>"
            },
            {
              "textRaw": "`dnsPromises.reverse(ip)`",
              "name": "reverse",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`ip` {string}",
                      "name": "ip",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Performs a reverse DNS query that resolves an IPv4 or IPv6 address to an\narray of host names.</p>\n<p>On error, the <code>Promise</code> is rejected with an <a href=\"errors.html#class-error\"><code>Error</code></a> object, where <code>err.code</code>\nis one of the <a href=\"#error-codes\">DNS error codes</a>.</p>"
            },
            {
              "textRaw": "`dnsPromises.setDefaultResultOrder(order)`",
              "name": "setDefaultResultOrder",
              "type": "method",
              "meta": {
                "added": [
                  "v16.4.0",
                  "v14.18.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.1.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52492",
                    "description": "The `ipv6first` value is supported now."
                  },
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39987",
                    "description": "Changed default value to `verbatim`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`order` {string} must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`.",
                      "name": "order",
                      "type": "string",
                      "desc": "must be `'ipv4first'`, `'ipv6first'` or `'verbatim'`."
                    }
                  ]
                }
              ],
              "desc": "<p>Set the default value of <code>order</code> in <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and\n<a href=\"#dnspromiseslookuphostname-options\"><code>dnsPromises.lookup()</code></a>. The value could be:</p>\n<ul>\n<li><code>ipv4first</code>: sets default <code>order</code> to <code>ipv4first</code>.</li>\n<li><code>ipv6first</code>: sets default <code>order</code> to <code>ipv6first</code>.</li>\n<li><code>verbatim</code>: sets default <code>order</code> to <code>verbatim</code>.</li>\n</ul>\n<p>The default is <code>verbatim</code> and <a href=\"#dnspromisessetdefaultresultorderorder\"><code>dnsPromises.setDefaultResultOrder()</code></a> have\nhigher priority than <a href=\"cli.html#--dns-result-orderorder\"><code>--dns-result-order</code></a>. When using <a href=\"worker_threads.html\">worker threads</a>,\n<a href=\"#dnspromisessetdefaultresultorderorder\"><code>dnsPromises.setDefaultResultOrder()</code></a> from the main thread won't affect the\ndefault dns orders in workers.</p>"
            },
            {
              "textRaw": "`dnsPromises.getDefaultResultOrder()`",
              "name": "getDefaultResultOrder",
              "type": "method",
              "meta": {
                "added": [
                  "v20.1.0",
                  "v18.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Get the value of <code>dnsOrder</code>.</p>"
            },
            {
              "textRaw": "`dnsPromises.setServers(servers)`",
              "name": "setServers",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`servers` {string[]} array of RFC 5952 formatted addresses",
                      "name": "servers",
                      "type": "string[]",
                      "desc": "array of RFC 5952 formatted addresses"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the IP address and port of servers to be used when performing DNS\nresolution. The <code>servers</code> argument is an array of <a href=\"https://tools.ietf.org/html/rfc5952#section-6\">RFC 5952</a> formatted\naddresses. If the port is the IANA default DNS port (53) it can be omitted.</p>\n<pre><code class=\"language-js\">dnsPromises.setServers([\n  '8.8.8.8',\n  '[2001:4860:4860::8888]',\n  '8.8.8.8:1053',\n  '[2001:4860:4860::8888]:1053',\n]);\n</code></pre>\n<p>An error will be thrown if an invalid address is provided.</p>\n<p>The <code>dnsPromises.setServers()</code> method must not be called while a DNS query is in\nprogress.</p>\n<p>This method works much like\n<a href=\"https://man7.org/linux/man-pages/man5/resolv.conf.5.html\">resolve.conf</a>.\nThat is, if attempting to resolve with the first server provided results in a\n<code>NOTFOUND</code> error, the <code>resolve()</code> method will <em>not</em> attempt to resolve with\nsubsequent servers provided. Fallback DNS servers will only be used if the\nearlier ones time out or result in some other error.</p>"
            }
          ],
          "displayName": "DNS promises API"
        },
        {
          "textRaw": "Error codes",
          "name": "error_codes",
          "type": "module",
          "desc": "<p>Each DNS query can return one of the following error codes:</p>\n<ul>\n<li><code>dns.NODATA</code>: DNS server returned an answer with no data.</li>\n<li><code>dns.FORMERR</code>: DNS server claims query was misformatted.</li>\n<li><code>dns.SERVFAIL</code>: DNS server returned general failure.</li>\n<li><code>dns.NOTFOUND</code>: Domain name not found.</li>\n<li><code>dns.NOTIMP</code>: DNS server does not implement the requested operation.</li>\n<li><code>dns.REFUSED</code>: DNS server refused query.</li>\n<li><code>dns.BADQUERY</code>: Misformatted DNS query.</li>\n<li><code>dns.BADNAME</code>: Misformatted host name.</li>\n<li><code>dns.BADFAMILY</code>: Unsupported address family.</li>\n<li><code>dns.BADRESP</code>: Misformatted DNS reply.</li>\n<li><code>dns.CONNREFUSED</code>: Could not contact DNS servers.</li>\n<li><code>dns.TIMEOUT</code>: Timeout while contacting DNS servers.</li>\n<li><code>dns.EOF</code>: End of file.</li>\n<li><code>dns.FILE</code>: Error reading file.</li>\n<li><code>dns.NOMEM</code>: Out of memory.</li>\n<li><code>dns.DESTRUCTION</code>: Channel is being destroyed.</li>\n<li><code>dns.BADSTR</code>: Misformatted string.</li>\n<li><code>dns.BADFLAGS</code>: Illegal flags specified.</li>\n<li><code>dns.NONAME</code>: Given host name is not numeric.</li>\n<li><code>dns.BADHINTS</code>: Illegal hints flags specified.</li>\n<li><code>dns.NOTINITIALIZED</code>: c-ares library initialization not yet performed.</li>\n<li><code>dns.LOADIPHLPAPI</code>: Error loading <code>iphlpapi.dll</code>.</li>\n<li><code>dns.ADDRGETNETWORKPARAMS</code>: Could not find <code>GetNetworkParams</code> function.</li>\n<li><code>dns.CANCELLED</code>: DNS query cancelled.</li>\n</ul>\n<p>The <code>dnsPromises</code> API also exports the above error codes, e.g., <code>dnsPromises.NODATA</code>.</p>",
          "displayName": "Error codes"
        },
        {
          "textRaw": "Implementation considerations",
          "name": "implementation_considerations",
          "type": "module",
          "desc": "<p>Although <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> and the various <code>dns.resolve*()/dns.reverse()</code>\nfunctions have the same goal of associating a network name with a network\naddress (or vice versa), their behavior is quite different. These differences\ncan have subtle but significant consequences on the behavior of Node.js\nprograms.</p>",
          "methods": [
            {
              "textRaw": "`dns.lookup()`",
              "name": "lookup",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Under the hood, <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> uses the same operating system facilities\nas most other programs. For instance, <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> will almost always\nresolve a given name the same way as the <code>ping</code> command. On most POSIX-like\noperating systems, the behavior of the <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> function can be\nmodified by changing settings in <a href=\"http://man7.org/linux/man-pages/man5/nsswitch.conf.5.html\"><code>nsswitch.conf(5)</code></a> and/or <a href=\"http://man7.org/linux/man-pages/man5/resolv.conf.5.html\"><code>resolv.conf(5)</code></a>,\nbut changing these files will change the behavior of all other\nprograms running on the same operating system.</p>\n<p>Though the call to <code>dns.lookup()</code> will be asynchronous from JavaScript's\nperspective, it is implemented as a synchronous call to <a href=\"http://man7.org/linux/man-pages/man3/getaddrinfo.3.html\"><code>getaddrinfo(3)</code></a> that runs\non libuv's threadpool. This can have surprising negative performance\nimplications for some applications, see the <a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a>\ndocumentation for more information.</p>\n<p>Various networking APIs will call <code>dns.lookup()</code> internally to resolve\nhost names. If that is an issue, consider resolving the host name to an address\nusing <code>dns.resolve()</code> and using the address instead of a host name. Also, some\nnetworking APIs (such as <a href=\"net.html#socketconnectoptions-connectlistener\"><code>socket.connect()</code></a> and <a href=\"dgram.html#dgramcreatesocketoptions-callback\"><code>dgram.createSocket()</code></a>)\nallow the default resolver, <code>dns.lookup()</code>, to be replaced.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "`dns.resolve()`, `dns.resolve*()`, and `dns.reverse()`",
              "name": "`dns.resolve()`,_`dns.resolve*()`,_and_`dns.reverse()`",
              "type": "module",
              "desc": "<p>These functions are implemented quite differently than <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>. They\ndo not use <a href=\"http://man7.org/linux/man-pages/man3/getaddrinfo.3.html\"><code>getaddrinfo(3)</code></a> and they <em>always</em> perform a DNS query on the\nnetwork. This network communication is always done asynchronously and does not\nuse libuv's threadpool.</p>\n<p>As a result, these functions cannot have the same negative impact on other\nprocessing that happens on libuv's threadpool that <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a> can have.</p>\n<p>They do not use the same set of configuration files that <a href=\"#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>\nuses. For instance, they do not use the configuration from <code>/etc/hosts</code>.</p>",
              "displayName": "`dns.resolve()`, `dns.resolve*()`, and `dns.reverse()`"
            }
          ],
          "displayName": "Implementation considerations"
        }
      ],
      "displayName": "DNS",
      "source": "doc/api/dns.md"
    },
    {
      "textRaw": "Domain",
      "name": "domain",
      "introduced_in": "v0.10.0",
      "type": "module",
      "meta": {
        "changes": [
          {
            "version": "v8.8.0",
            "pr-url": "https://github.com/nodejs/node/pull/15695",
            "description": "Any `Promise`s created in VM contexts no longer have a `.domain` property. Their handlers are still executed in the proper domain, however, and `Promise`s created in the main context still possess a `.domain` property."
          },
          {
            "version": "v8.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/12489",
            "description": "Handlers for `Promise`s are now invoked in the domain in which the first promise of a chain was created."
          }
        ],
        "deprecated": [
          "v1.4.2"
        ]
      },
      "stability": 0,
      "stabilityText": "Deprecated",
      "desc": "<p><strong>This module is pending deprecation.</strong> Once a replacement API has been\nfinalized, this module will be fully deprecated. Most developers should\n<strong>not</strong> have cause to use this module. Users who absolutely must have\nthe functionality that domains provide may rely on it for the time being\nbut should expect to have to migrate to a different solution\nin the future.</p>\n<p>Domains provide a way to handle multiple different IO operations as a\nsingle group. If any of the event emitters or callbacks registered to a\ndomain emit an <code>'error'</code> event, or throw an error, then the domain object\nwill be notified, rather than losing the context of the error in the\n<code>process.on('uncaughtException')</code> handler, or causing the program to\nexit immediately with an error code.</p>",
      "miscs": [
        {
          "textRaw": "Warning: Don't ignore errors!",
          "name": "Warning: Don't ignore errors!",
          "type": "misc",
          "desc": "<p>Domain error handlers are not a substitute for closing down a\nprocess when an error occurs.</p>\n<p>By the very nature of how <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/throw\"><code>throw</code></a> works in JavaScript, there is almost\nnever any way to safely \"pick up where it left off\", without leaking\nreferences, or creating some other sort of undefined brittle state.</p>\n<p>The safest way to respond to a thrown error is to shut down the\nprocess. Of course, in a normal web server, there may be many\nopen connections, and it is not reasonable to abruptly shut those down\nbecause an error was triggered by someone else.</p>\n<p>The better approach is to send an error response to the request that\ntriggered the error, while letting the others finish in their normal\ntime, and stop listening for new requests in that worker.</p>\n<p>In this way, <code>domain</code> usage goes hand-in-hand with the cluster module,\nsince the primary process can fork a new worker when a worker\nencounters an error. For Node.js programs that scale to multiple\nmachines, the terminating proxy or service registry can take note of\nthe failure, and react accordingly.</p>\n<p>For example, this is not a good idea:</p>\n<pre><code class=\"language-js\">// XXX WARNING! BAD IDEA!\n\nconst d = require('node:domain').create();\nd.on('error', (er) => {\n  // The error won't crash the process, but what it does is worse!\n  // Though we've prevented abrupt process restarting, we are leaking\n  // a lot of resources if this ever happens.\n  // This is no better than process.on('uncaughtException')!\n  console.log(`error, but oh well ${er.message}`);\n});\nd.run(() => {\n  require('node:http').createServer((req, res) => {\n    handleRequest(req, res);\n  }).listen(PORT);\n});\n</code></pre>\n<p>By using the context of a domain, and the resilience of separating our\nprogram into multiple worker processes, we can react more\nappropriately, and handle errors with much greater safety.</p>\n<pre><code class=\"language-js\">// Much better!\n\nconst cluster = require('node:cluster');\nconst PORT = +process.env.PORT || 1337;\n\nif (cluster.isPrimary) {\n  // A more realistic scenario would have more than 2 workers,\n  // and perhaps not put the primary and worker in the same file.\n  //\n  // It is also possible to get a bit fancier about logging, and\n  // implement whatever custom logic is needed to prevent DoS\n  // attacks and other bad behavior.\n  //\n  // See the options in the cluster documentation.\n  //\n  // The important thing is that the primary does very little,\n  // increasing our resilience to unexpected errors.\n\n  cluster.fork();\n  cluster.fork();\n\n  cluster.on('disconnect', (worker) => {\n    console.error('disconnect!');\n    cluster.fork();\n  });\n\n} else {\n  // the worker\n  //\n  // This is where we put our bugs!\n\n  const domain = require('node:domain');\n\n  // See the cluster documentation for more details about using\n  // worker processes to serve requests. How it works, caveats, etc.\n\n  const server = require('node:http').createServer((req, res) => {\n    const d = domain.create();\n    d.on('error', (er) => {\n      console.error(`error ${er.stack}`);\n\n      // We're in dangerous territory!\n      // By definition, something unexpected occurred,\n      // which we probably didn't want.\n      // Anything can happen now! Be very careful!\n\n      try {\n        // Make sure we close down within 30 seconds\n        const killtimer = setTimeout(() => {\n          process.exit(1);\n        }, 30000);\n        // But don't keep the process open just for that!\n        killtimer.unref();\n\n        // Stop taking new requests.\n        server.close();\n\n        // Let the primary know we're dead. This will trigger a\n        // 'disconnect' in the cluster primary, and then it will fork\n        // a new worker.\n        cluster.worker.disconnect();\n\n        // Try to send an error to the request that triggered the problem\n        res.statusCode = 500;\n        res.setHeader('content-type', 'text/plain');\n        res.end('Oops, there was a problem!\\n');\n      } catch (er2) {\n        // Oh well, not much we can do at this point.\n        console.error(`Error sending 500! ${er2.stack}`);\n      }\n    });\n\n    // Because req and res were created before this domain existed,\n    // we need to explicitly add them.\n    // See the explanation of implicit vs explicit binding below.\n    d.add(req);\n    d.add(res);\n\n    // Now run the handler function in the domain.\n    d.run(() => {\n      handleRequest(req, res);\n    });\n  });\n  server.listen(PORT);\n}\n\n// This part is not important. Just an example routing thing.\n// Put fancy application logic here.\nfunction handleRequest(req, res) {\n  switch (req.url) {\n    case '/error':\n      // We do some async stuff, and then...\n      setTimeout(() => {\n        // Whoops!\n        flerb.bark();\n      }, timeout);\n      break;\n    default:\n      res.end('ok');\n  }\n}\n</code></pre>"
        },
        {
          "textRaw": "Additions to `Error` objects",
          "name": "Additions to `Error` objects",
          "type": "misc",
          "desc": "<p>Any time an <code>Error</code> object is routed through a domain, a few extra fields\nare added to it.</p>\n<ul>\n<li><code>error.domain</code> The domain that first handled the error.</li>\n<li><code>error.domainEmitter</code> The event emitter that emitted an <code>'error'</code> event\nwith the error object.</li>\n<li><code>error.domainBound</code> The callback function which was bound to the\ndomain, and passed an error as its first argument.</li>\n<li><code>error.domainThrown</code> A boolean indicating whether the error was\nthrown, emitted, or passed to a bound callback function.</li>\n</ul>"
        },
        {
          "textRaw": "Implicit binding",
          "name": "Implicit binding",
          "type": "misc",
          "desc": "<p>If domains are in use, then all <strong>new</strong> <code>EventEmitter</code> objects (including\nStream objects, requests, responses, etc.) will be implicitly bound to\nthe active domain at the time of their creation.</p>\n<p>Additionally, callbacks passed to low-level event loop requests (such as\nto <code>fs.open()</code>, or other callback-taking methods) will automatically be\nbound to the active domain. If they throw, then the domain will catch\nthe error.</p>\n<p>In order to prevent excessive memory usage, <code>Domain</code> objects themselves\nare not implicitly added as children of the active domain. If they\nwere, then it would be too easy to prevent request and response objects\nfrom being properly garbage collected.</p>\n<p>To nest <code>Domain</code> objects as children of a parent <code>Domain</code> they must be\nexplicitly added.</p>\n<p>Implicit binding routes thrown errors and <code>'error'</code> events to the\n<code>Domain</code>'s <code>'error'</code> event, but does not register the <code>EventEmitter</code> on the\n<code>Domain</code>.\nImplicit binding only takes care of thrown errors and <code>'error'</code> events.</p>"
        },
        {
          "textRaw": "Explicit binding",
          "name": "Explicit binding",
          "type": "misc",
          "desc": "<p>Sometimes, the domain in use is not the one that ought to be used for a\nspecific event emitter. Or, the event emitter could have been created\nin the context of one domain, but ought to instead be bound to some\nother domain.</p>\n<p>For example, there could be one domain in use for an HTTP server, but\nperhaps we would like to have a separate domain to use for each request.</p>\n<p>That is possible via explicit binding.</p>\n<pre><code class=\"language-js\">// Create a top-level domain for the server\nconst domain = require('node:domain');\nconst http = require('node:http');\nconst serverDomain = domain.create();\n\nserverDomain.run(() => {\n  // Server is created in the scope of serverDomain\n  http.createServer((req, res) => {\n    // Req and res are also created in the scope of serverDomain\n    // however, we'd prefer to have a separate domain for each request.\n    // create it first thing, and add req and res to it.\n    const reqd = domain.create();\n    reqd.add(req);\n    reqd.add(res);\n    reqd.on('error', (er) => {\n      console.error('Error', er, req.url);\n      try {\n        res.writeHead(500);\n        res.end('Error occurred, sorry.');\n      } catch (er2) {\n        console.error('Error sending 500', er2, req.url);\n      }\n    });\n  }).listen(1337);\n});\n</code></pre>"
        }
      ],
      "methods": [
        {
          "textRaw": "`domain.create()`",
          "name": "create",
          "type": "method",
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Domain}",
                "name": "return",
                "type": "Domain"
              }
            }
          ]
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Domain`",
          "name": "Domain",
          "type": "class",
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>The <code>Domain</code> class encapsulates the functionality of routing errors and\nuncaught exceptions to the active <code>Domain</code> object.</p>\n<p>To handle the errors that it catches, listen to its <code>'error'</code> event.</p>",
          "properties": [
            {
              "textRaw": "Type: {Array}",
              "name": "members",
              "type": "Array",
              "desc": "<p>An array of event emitters that have been explicitly added to the domain.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`domain.add(emitter)`",
              "name": "add",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": "v9.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16222",
                    "description": "No longer accepts timer objects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`emitter` {EventEmitter} emitter to be added to the domain",
                      "name": "emitter",
                      "type": "EventEmitter",
                      "desc": "emitter to be added to the domain"
                    }
                  ]
                }
              ],
              "desc": "<p>Explicitly adds an emitter to the domain. If any event handlers called by\nthe emitter throw an error, or if the emitter emits an <code>'error'</code> event, it\nwill be routed to the domain's <code>'error'</code> event, just like with implicit\nbinding.</p>\n<p>If the <code>EventEmitter</code> was already bound to a domain, it is removed from that\none, and bound to this one instead.</p>"
            },
            {
              "textRaw": "`domain.bind(callback)`",
              "name": "bind",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} The callback function",
                      "name": "callback",
                      "type": "Function",
                      "desc": "The callback function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} The bound function",
                    "name": "return",
                    "type": "Function",
                    "desc": "The bound function"
                  }
                }
              ],
              "desc": "<p>The returned function will be a wrapper around the supplied callback\nfunction. When the returned function is called, any errors that are\nthrown will be routed to the domain's <code>'error'</code> event.</p>\n<pre><code class=\"language-js\">const d = domain.create();\n\nfunction readSomeFile(filename, cb) {\n  fs.readFile(filename, 'utf8', d.bind((er, data) => {\n    // If this throws, it will also be passed to the domain.\n    return cb(er, data ? JSON.parse(data) : null);\n  }));\n}\n\nd.on('error', (er) => {\n  // An error occurred somewhere. If we throw it now, it will crash the program\n  // with the normal line number and stack message.\n});\n</code></pre>"
            },
            {
              "textRaw": "`domain.enter()`",
              "name": "enter",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>enter()</code> method is plumbing used by the <code>run()</code>, <code>bind()</code>, and\n<code>intercept()</code> methods to set the active domain. It sets <code>domain.active</code> and\n<code>process.domain</code> to the domain, and implicitly pushes the domain onto the domain\nstack managed by the domain module (see <a href=\"#domainexit\"><code>domain.exit()</code></a> for details on the\ndomain stack). The call to <code>enter()</code> delimits the beginning of a chain of\nasynchronous calls and I/O operations bound to a domain.</p>\n<p>Calling <code>enter()</code> changes only the active domain, and does not alter the domain\nitself. <code>enter()</code> and <code>exit()</code> can be called an arbitrary number of times on a\nsingle domain.</p>"
            },
            {
              "textRaw": "`domain.exit()`",
              "name": "exit",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>exit()</code> method exits the current domain, popping it off the domain stack.\nAny time execution is going to switch to the context of a different chain of\nasynchronous calls, it's important to ensure that the current domain is exited.\nThe call to <code>exit()</code> delimits either the end of or an interruption to the chain\nof asynchronous calls and I/O operations bound to a domain.</p>\n<p>If there are multiple, nested domains bound to the current execution context,\n<code>exit()</code> will exit any domains nested within this domain.</p>\n<p>Calling <code>exit()</code> changes only the active domain, and does not alter the domain\nitself. <code>enter()</code> and <code>exit()</code> can be called an arbitrary number of times on a\nsingle domain.</p>"
            },
            {
              "textRaw": "`domain.intercept(callback)`",
              "name": "intercept",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} The callback function",
                      "name": "callback",
                      "type": "Function",
                      "desc": "The callback function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} The intercepted function",
                    "name": "return",
                    "type": "Function",
                    "desc": "The intercepted function"
                  }
                }
              ],
              "desc": "<p>This method is almost identical to <a href=\"#domainbindcallback\"><code>domain.bind(callback)</code></a>. However, in\naddition to catching thrown errors, it will also intercept <a href=\"errors.html#class-error\"><code>Error</code></a>\nobjects sent as the first argument to the function.</p>\n<p>In this way, the common <code>if (err) return callback(err);</code> pattern can be replaced\nwith a single error handler in a single place.</p>\n<pre><code class=\"language-js\">const d = domain.create();\n\nfunction readSomeFile(filename, cb) {\n  fs.readFile(filename, 'utf8', d.intercept((data) => {\n    // Note, the first argument is never passed to the\n    // callback since it is assumed to be the 'Error' argument\n    // and thus intercepted by the domain.\n\n    // If this throws, it will also be passed to the domain\n    // so the error-handling logic can be moved to the 'error'\n    // event on the domain instead of being repeated throughout\n    // the program.\n    return cb(null, JSON.parse(data));\n  }));\n}\n\nd.on('error', (er) => {\n  // An error occurred somewhere. If we throw it now, it will crash the program\n  // with the normal line number and stack message.\n});\n</code></pre>"
            },
            {
              "textRaw": "`domain.remove(emitter)`",
              "name": "remove",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`emitter` {EventEmitter} emitter to be removed from the domain",
                      "name": "emitter",
                      "type": "EventEmitter",
                      "desc": "emitter to be removed from the domain"
                    }
                  ]
                }
              ],
              "desc": "<p>The opposite of <a href=\"#domainaddemitter\"><code>domain.add(emitter)</code></a>. Removes domain handling from the\nspecified emitter.</p>"
            },
            {
              "textRaw": "`domain.run(fn[, ...args])`",
              "name": "run",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function}",
                      "name": "fn",
                      "type": "Function"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Run the supplied function in the context of the domain, implicitly\nbinding all event emitters, timers, and low-level requests that are\ncreated in that context. Optionally, arguments can be passed to\nthe function.</p>\n<p>This is the most basic way to use a domain.</p>\n<pre><code class=\"language-js\">const domain = require('node:domain');\nconst fs = require('node:fs');\nconst d = domain.create();\nd.on('error', (er) => {\n  console.error('Caught error!', er);\n});\nd.run(() => {\n  process.nextTick(() => {\n    setTimeout(() => { // Simulating some various async stuff\n      fs.open('non-existent file', 'r', (er, fd) => {\n        if (er) throw er;\n        // proceed...\n      });\n    }, 100);\n  });\n});\n</code></pre>\n<p>In this example, the <code>d.on('error')</code> handler will be triggered, rather\nthan crashing the program.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Domains and promises",
          "name": "domains_and_promises",
          "type": "module",
          "desc": "<p>As of Node.js 8.0.0, the handlers of promises are run inside the domain in\nwhich the call to <code>.then()</code> or <code>.catch()</code> itself was made:</p>\n<pre><code class=\"language-js\">const d1 = domain.create();\nconst d2 = domain.create();\n\nlet p;\nd1.run(() => {\n  p = Promise.resolve(42);\n});\n\nd2.run(() => {\n  p.then((v) => {\n    // running in d2\n  });\n});\n</code></pre>\n<p>A callback may be bound to a specific domain using <a href=\"#domainbindcallback\"><code>domain.bind(callback)</code></a>:</p>\n<pre><code class=\"language-js\">const d1 = domain.create();\nconst d2 = domain.create();\n\nlet p;\nd1.run(() => {\n  p = Promise.resolve(42);\n});\n\nd2.run(() => {\n  p.then(p.domain.bind((v) => {\n    // running in d1\n  }));\n});\n</code></pre>\n<p>Domains will not interfere with the error handling mechanisms for\npromises. In other words, no <code>'error'</code> event will be emitted for unhandled\n<code>Promise</code> rejections.</p>",
          "displayName": "Domains and promises"
        }
      ],
      "displayName": "Domain",
      "source": "doc/api/domain.md"
    },
    {
      "textRaw": "Environment Variables",
      "name": "environment_variables",
      "introduced_in": "v20.12.0",
      "type": "module",
      "desc": "<p>Environment variables are variables associated to the environment the Node.js process runs in.</p>",
      "modules": [
        {
          "textRaw": "CLI Environment Variables",
          "name": "cli_environment_variables",
          "type": "module",
          "desc": "<p>There is a set of environment variables that can be defined to customize the behavior of Node.js,\nfor more details refer to the <a href=\"cli.html#environment-variables_1\">CLI Environment Variables documentation</a>.</p>",
          "displayName": "CLI Environment Variables"
        },
        {
          "textRaw": "DotEnv",
          "name": "dotenv",
          "type": "module",
          "stability": 2,
          "stabilityText": "Stable",
          "desc": "<p>Set of utilities for dealing with additional environment variables defined in <code>.env</code> files.</p>",
          "modules": [
            {
              "textRaw": ".env files",
              "name": ".env_files",
              "type": "module",
              "desc": "<p><code>.env</code> files (also known as dotenv files) are files that define environment variables,\nwhich Node.js applications can then interact with (popularized by the <a href=\"https://github.com/motdotla/dotenv\">dotenv</a> package).</p>\n<p>The following is an example of the content of a basic <code>.env</code> file:</p>\n<pre><code class=\"language-text\">MY_VAR_A = \"my variable A\"\nMY_VAR_B = \"my variable B\"\n</code></pre>\n<p>This type of file is used in various different programming languages and platforms but there\nis no formal specification for it, therefore Node.js defines its own specification described below.</p>\n<p>A <code>.env</code> file is a file that contains key-value pairs, each pair is represented by a variable name\nfollowed by the equal sign (<code>=</code>) followed by a variable value.</p>\n<p>The name of such files is usually <code>.env</code> or it starts with <code>.env</code> (like for example <code>.env.dev</code> where\n<code>dev</code> indicates a specific target environment). This is the recommended naming scheme but it is not\nmandatory and dotenv files can have any arbitrary file name.</p>",
              "modules": [
                {
                  "textRaw": "Variable Names",
                  "name": "variable_names",
                  "type": "module",
                  "desc": "<p>A valid variable name must contain only letters (uppercase or lowercase), digits and underscores\n(<code>_</code>) and it can't begin with a digit.</p>\n<p>More specifically a valid variable name must match the following regular expression:</p>\n<pre><code class=\"language-text\">^[a-zA-Z_]+[a-zA-Z0-9_]*$\n</code></pre>\n<p>The recommended convention is to use capital letters with underscores and digits when necessary,\nbut any variable name respecting the above definition will work just fine.</p>\n<p>For example, the following are some valid variable names: <code>MY_VAR</code>, <code>MY_VAR_1</code>, <code>my_var</code>, <code>my_var_1</code>,\n<code>myVar</code>, <code>My_Var123</code>, while these are instead not valid: <code>1_VAR</code>, <code>'my-var'</code>, <code>\"my var\"</code>, <code>VAR_#1</code>.</p>",
                  "displayName": "Variable Names"
                },
                {
                  "textRaw": "Variable Values",
                  "name": "variable_values",
                  "type": "module",
                  "desc": "<p>Variable values are comprised by any arbitrary text, which can optionally be wrapped inside\nsingle (<code>'</code>) or double (<code>\"</code>) quotes.</p>\n<p>Quoted variables can span across multiple lines, while non quoted ones are restricted to a single line.</p>\n<p>Noting that when parsed by Node.js all values are interpreted as text, meaning that any value will\nresult in a JavaScript string inside Node.js. For example the following values: <code>0</code>, <code>true</code> and\n<code>{ \"hello\": \"world\" }</code> will result in the literal strings <code>'0'</code>, <code>'true'</code> and <code>'{ \"hello\": \"world\" }'</code>\ninstead of the number zero, the boolean <code>true</code> and an object with the <code>hello</code> property respectively.</p>\n<p>Examples of valid variables:</p>\n<pre><code class=\"language-text\">MY_SIMPLE_VAR = a simple single line variable\nMY_EQUALS_VAR = \"this variable contains an = sign!\"\nMY_HASH_VAR = 'this variable contains a # symbol!'\nMY_MULTILINE_VAR = '\nthis is a multiline variable containing\ntwo separate lines\\nSorry, I meant three lines'\n</code></pre>",
                  "displayName": "Variable Values"
                },
                {
                  "textRaw": "Spacing",
                  "name": "spacing",
                  "type": "module",
                  "desc": "<p>Leading and trailing whitespace characters around variable keys and values are ignored unless they\nare enclosed within quotes.</p>\n<p>For example:</p>\n<pre><code class=\"language-text\">   MY_VAR_A   =    my variable a\n    MY_VAR_B   =    '   my variable b   '\n</code></pre>\n<p>will be treated identically to:</p>\n<pre><code class=\"language-text\">MY_VAR_A = my variable a\nMY_VAR_B = '   my variable b   '\n</code></pre>",
                  "displayName": "Spacing"
                },
                {
                  "textRaw": "Comments",
                  "name": "comments",
                  "type": "module",
                  "desc": "<p>Hash-tag (<code>#</code>) characters denote the beginning of a comment, meaning that the rest of the line\nwill be completely ignored.</p>\n<p>Hash-tags found within quotes are however treated as any other standard character.</p>\n<p>For example:</p>\n<pre><code class=\"language-text\"># This is a comment\nMY_VAR = my variable # This is also a comment\nMY_VAR_A = \"# this is NOT a comment\"\n</code></pre>",
                  "displayName": "Comments"
                },
                {
                  "textRaw": "`export` prefixes",
                  "name": "`export`_prefixes",
                  "type": "module",
                  "desc": "<p>The <code>export</code> keyword can optionally be added in front of variable declarations, such keyword will be completely ignored\nby all processing done on the file.</p>\n<p>This is useful so that the file can be sourced, without modifications, in shell terminals.</p>\n<p>Example:</p>\n<pre><code class=\"language-text\">export MY_VAR = my variable\n</code></pre>",
                  "displayName": "`export` prefixes"
                }
              ],
              "displayName": ".env files"
            },
            {
              "textRaw": "CLI Options",
              "name": "cli_options",
              "type": "module",
              "desc": "<p><code>.env</code> files can be used to populate the <code>process.env</code> object via one the following CLI options:</p>\n<ul>\n<li>\n<p><a href=\"cli.html#--env-filefile\"><code>--env-file=file</code></a></p>\n</li>\n<li>\n<p><a href=\"cli.html#--env-file-if-existsfile\"><code>--env-file-if-exists=file</code></a></p>\n</li>\n</ul>",
              "displayName": "CLI Options"
            },
            {
              "textRaw": "Programmatic APIs",
              "name": "programmatic_apis",
              "type": "module",
              "desc": "<p>There following two functions allow you to directly interact with <code>.env</code> files:</p>\n<ul>\n<li>\n<p><a href=\"process.html#processloadenvfilepath\"><code>process.loadEnvFile</code></a> loads an <code>.env</code> file and populates <code>process.env</code> with its variables</p>\n</li>\n<li>\n<p><a href=\"util.html#utilparseenvcontent\"><code>util.parseEnv</code></a> parses the raw content of an <code>.env</code> file and returns its value in an object</p>\n</li>\n</ul>",
              "displayName": "Programmatic APIs"
            }
          ],
          "displayName": "DotEnv"
        }
      ],
      "properties": [
        {
          "textRaw": "`process.env`",
          "name": "env",
          "type": "property",
          "desc": "<p>The basic API for interacting with environment variables is <code>process.env</code>, it consists of an object\nwith pre-populated user environment variables that can be modified and expanded.</p>\n<p>For more details refer to the <a href=\"process.html#processenv\"><code>process.env</code> documentation</a>.</p>"
        }
      ],
      "displayName": "Environment Variables",
      "source": "doc/api/environment_variables.md"
    },
    {
      "textRaw": "Events",
      "name": "events",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>Much of the Node.js core API is built around an idiomatic asynchronous\nevent-driven architecture in which certain kinds of objects (called \"emitters\")\nemit named events that cause <code>Function</code> objects (\"listeners\") to be called.</p>\n<p>For instance: a <a href=\"net.html#class-netserver\"><code>net.Server</code></a> object emits an event each time a peer\nconnects to it; a <a href=\"fs.html#class-fsreadstream\"><code>fs.ReadStream</code></a> emits an event when the file is opened;\na <a href=\"stream.html\">stream</a> emits an event whenever data is available to be read.</p>\n<p>All objects that emit events are instances of the <code>EventEmitter</code> class. These\nobjects expose an <code>eventEmitter.on()</code> function that allows one or more\nfunctions to be attached to named events emitted by the object. Typically,\nevent names are camel-cased strings but any valid JavaScript property key\ncan be used.</p>\n<p>When the <code>EventEmitter</code> object emits an event, all of the functions attached\nto that specific event are called <em>synchronously</em>. Any values returned by the\ncalled listeners are <em>ignored</em> and discarded.</p>\n<p>The following example shows a simple <code>EventEmitter</code> instance with a single\nlistener. The <code>eventEmitter.on()</code> method is used to register listeners, while\nthe <code>eventEmitter.emit()</code> method is used to trigger the event.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\n\nclass MyEmitter extends EventEmitter {}\n\nconst myEmitter = new MyEmitter();\nmyEmitter.on('event', () => {\n  console.log('an event occurred!');\n});\nmyEmitter.emit('event');\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\n\nclass MyEmitter extends EventEmitter {}\n\nconst myEmitter = new MyEmitter();\nmyEmitter.on('event', () => {\n  console.log('an event occurred!');\n});\nmyEmitter.emit('event');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Passing arguments and `this` to listeners",
          "name": "passing_arguments_and_`this`_to_listeners",
          "type": "module",
          "desc": "<p>The <code>eventEmitter.emit()</code> method allows an arbitrary set of arguments to be\npassed to the listener functions. Keep in mind that when\nan ordinary listener function is called, the standard <code>this</code> keyword\nis intentionally set to reference the <code>EventEmitter</code> instance to which the\nlistener is attached.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.on('event', function(a, b) {\n  console.log(a, b, this, this === myEmitter);\n  // Prints:\n  //   a b MyEmitter {\n  //     _events: [Object: null prototype] { event: [Function (anonymous)] },\n  //     _eventsCount: 1,\n  //     _maxListeners: undefined,\n  //     Symbol(shapeMode): false,\n  //     Symbol(kCapture): false\n  //   } true\n});\nmyEmitter.emit('event', 'a', 'b');\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.on('event', function(a, b) {\n  console.log(a, b, this, this === myEmitter);\n  // Prints:\n  //   a b MyEmitter {\n  //     _events: [Object: null prototype] { event: [Function (anonymous)] },\n  //     _eventsCount: 1,\n  //     _maxListeners: undefined,\n  //     Symbol(shapeMode): false,\n  //     Symbol(kCapture): false\n  //   } true\n});\nmyEmitter.emit('event', 'a', 'b');\n</code></pre>\n<p>It is possible to use ES6 Arrow Functions as listeners, however, when doing so,\nthe <code>this</code> keyword will no longer reference the <code>EventEmitter</code> instance:</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.on('event', (a, b) => {\n  console.log(a, b, this);\n  // Prints: a b undefined\n});\nmyEmitter.emit('event', 'a', 'b');\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.on('event', (a, b) => {\n  console.log(a, b, this);\n  // Prints: a b {}\n});\nmyEmitter.emit('event', 'a', 'b');\n</code></pre>",
          "displayName": "Passing arguments and `this` to listeners"
        },
        {
          "textRaw": "Asynchronous vs. synchronous",
          "name": "asynchronous_vs._synchronous",
          "type": "module",
          "desc": "<p>The <code>EventEmitter</code> calls all listeners synchronously in the order in which\nthey were registered. This ensures the proper sequencing of\nevents and helps avoid race conditions and logic errors. When appropriate,\nlistener functions can switch to an asynchronous mode of operation using\nthe <code>setImmediate()</code> or <code>process.nextTick()</code> methods:</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.on('event', (a, b) => {\n  setImmediate(() => {\n    console.log('this happens asynchronously');\n  });\n});\nmyEmitter.emit('event', 'a', 'b');\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.on('event', (a, b) => {\n  setImmediate(() => {\n    console.log('this happens asynchronously');\n  });\n});\nmyEmitter.emit('event', 'a', 'b');\n</code></pre>",
          "displayName": "Asynchronous vs. synchronous"
        },
        {
          "textRaw": "Handling events only once",
          "name": "handling_events_only_once",
          "type": "module",
          "desc": "<p>When a listener is registered using the <code>eventEmitter.on()</code> method, that\nlistener is invoked <em>every time</em> the named event is emitted.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nlet m = 0;\nmyEmitter.on('event', () => {\n  console.log(++m);\n});\nmyEmitter.emit('event');\n// Prints: 1\nmyEmitter.emit('event');\n// Prints: 2\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nlet m = 0;\nmyEmitter.on('event', () => {\n  console.log(++m);\n});\nmyEmitter.emit('event');\n// Prints: 1\nmyEmitter.emit('event');\n// Prints: 2\n</code></pre>\n<p>Using the <code>eventEmitter.once()</code> method, it is possible to register a listener\nthat is called at most once for a particular event. Once the event is emitted,\nthe listener is unregistered and <em>then</em> called.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nlet m = 0;\nmyEmitter.once('event', () => {\n  console.log(++m);\n});\nmyEmitter.emit('event');\n// Prints: 1\nmyEmitter.emit('event');\n// Ignored\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nlet m = 0;\nmyEmitter.once('event', () => {\n  console.log(++m);\n});\nmyEmitter.emit('event');\n// Prints: 1\nmyEmitter.emit('event');\n// Ignored\n</code></pre>",
          "displayName": "Handling events only once"
        },
        {
          "textRaw": "Error events",
          "name": "error_events",
          "type": "module",
          "desc": "<p>When an error occurs within an <code>EventEmitter</code> instance, the typical action is\nfor an <code>'error'</code> event to be emitted. These are treated as special cases\nwithin Node.js.</p>\n<p>If an <code>EventEmitter</code> does <em>not</em> have at least one listener registered for the\n<code>'error'</code> event, and an <code>'error'</code> event is emitted, the error is thrown, a\nstack trace is printed, and the Node.js process exits.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.emit('error', new Error('whoops!'));\n// Throws and crashes Node.js\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.emit('error', new Error('whoops!'));\n// Throws and crashes Node.js\n</code></pre>\n<p>To guard against crashing the Node.js process the <a href=\"domain.html\"><code>domain</code></a> module can be\nused. (Note, however, that the <code>node:domain</code> module is deprecated.)</p>\n<p>As a best practice, listeners should always be added for the <code>'error'</code> events.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.on('error', (err) => {\n  console.error('whoops! there was an error');\n});\nmyEmitter.emit('error', new Error('whoops!'));\n// Prints: whoops! there was an error\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\nmyEmitter.on('error', (err) => {\n  console.error('whoops! there was an error');\n});\nmyEmitter.emit('error', new Error('whoops!'));\n// Prints: whoops! there was an error\n</code></pre>\n<p>It is possible to monitor <code>'error'</code> events without consuming the emitted error\nby installing a listener using the symbol <code>events.errorMonitor</code>.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter, errorMonitor } from 'node:events';\n\nconst myEmitter = new EventEmitter();\nmyEmitter.on(errorMonitor, (err) => {\n  MyMonitoringTool.log(err);\n});\nmyEmitter.emit('error', new Error('whoops!'));\n// Still throws and crashes Node.js\n</code></pre>\n<pre><code class=\"language-cjs\">const { EventEmitter, errorMonitor } = require('node:events');\n\nconst myEmitter = new EventEmitter();\nmyEmitter.on(errorMonitor, (err) => {\n  MyMonitoringTool.log(err);\n});\nmyEmitter.emit('error', new Error('whoops!'));\n// Still throws and crashes Node.js\n</code></pre>",
          "displayName": "Error events"
        },
        {
          "textRaw": "Capture rejections of promises",
          "name": "capture_rejections_of_promises",
          "type": "module",
          "desc": "<p>Using <code>async</code> functions with event handlers is problematic, because it\ncan lead to an unhandled rejection in case of a thrown exception:</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nconst ee = new EventEmitter();\nee.on('something', async (value) => {\n  throw new Error('kaboom');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nconst ee = new EventEmitter();\nee.on('something', async (value) => {\n  throw new Error('kaboom');\n});\n</code></pre>\n<p>The <code>captureRejections</code> option in the <code>EventEmitter</code> constructor or the global\nsetting change this behavior, installing a <code>.then(undefined, handler)</code>\nhandler on the <code>Promise</code>. This handler routes the exception\nasynchronously to the <a href=\"#emittersymbolfornodejsrejectionerr-eventname-args\"><code>Symbol.for('nodejs.rejection')</code></a> method\nif there is one, or to <a href=\"#error-events\"><code>'error'</code></a> event handler if there is none.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nconst ee1 = new EventEmitter({ captureRejections: true });\nee1.on('something', async (value) => {\n  throw new Error('kaboom');\n});\n\nee1.on('error', console.log);\n\nconst ee2 = new EventEmitter({ captureRejections: true });\nee2.on('something', async (value) => {\n  throw new Error('kaboom');\n});\n\nee2[Symbol.for('nodejs.rejection')] = console.log;\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nconst ee1 = new EventEmitter({ captureRejections: true });\nee1.on('something', async (value) => {\n  throw new Error('kaboom');\n});\n\nee1.on('error', console.log);\n\nconst ee2 = new EventEmitter({ captureRejections: true });\nee2.on('something', async (value) => {\n  throw new Error('kaboom');\n});\n\nee2[Symbol.for('nodejs.rejection')] = console.log;\n</code></pre>\n<p>Setting <code>events.captureRejections = true</code> will change the default for all\nnew instances of <code>EventEmitter</code>.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\n\nEventEmitter.captureRejections = true;\nconst ee1 = new EventEmitter();\nee1.on('something', async (value) => {\n  throw new Error('kaboom');\n});\n\nee1.on('error', console.log);\n</code></pre>\n<pre><code class=\"language-cjs\">const events = require('node:events');\nevents.captureRejections = true;\nconst ee1 = new events.EventEmitter();\nee1.on('something', async (value) => {\n  throw new Error('kaboom');\n});\n\nee1.on('error', console.log);\n</code></pre>\n<p>The <code>'error'</code> events that are generated by the <code>captureRejections</code> behavior\ndo not have a catch handler to avoid infinite error loops: the\nrecommendation is to <strong>not use <code>async</code> functions as <code>'error'</code> event handlers</strong>.</p>",
          "displayName": "Capture rejections of promises"
        },
        {
          "textRaw": "`EventTarget` and `Event` API",
          "name": "`eventtarget`_and_`event`_api",
          "type": "module",
          "meta": {
            "added": [
              "v14.5.0"
            ],
            "changes": [
              {
                "version": "v16.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/37237",
                "description": "changed EventTarget error handling."
              },
              {
                "version": "v15.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/35949",
                "description": "No longer experimental."
              },
              {
                "version": "v15.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/35496",
                "description": "The `EventTarget` and `Event` classes are now available as globals."
              }
            ]
          },
          "desc": "<p>The <code>EventTarget</code> and <code>Event</code> objects are a Node.js-specific implementation\nof the <a href=\"https://dom.spec.whatwg.org/#eventtarget\"><code>EventTarget</code> Web API</a> that are exposed by some Node.js core APIs.</p>\n<pre><code class=\"language-js\">const target = new EventTarget();\n\ntarget.addEventListener('foo', (event) => {\n  console.log('foo event happened!');\n});\n</code></pre>",
          "modules": [
            {
              "textRaw": "Node.js `EventTarget` vs. DOM `EventTarget`",
              "name": "node.js_`eventtarget`_vs._dom_`eventtarget`",
              "type": "module",
              "desc": "<p>There are two key differences between the Node.js <code>EventTarget</code> and the\n<a href=\"https://dom.spec.whatwg.org/#eventtarget\"><code>EventTarget</code> Web API</a>:</p>\n<ol>\n<li>Whereas DOM <code>EventTarget</code> instances <em>may</em> be hierarchical, there is no\nconcept of hierarchy and event propagation in Node.js. That is, an event\ndispatched to an <code>EventTarget</code> does not propagate through a hierarchy of\nnested target objects that may each have their own set of handlers for the\nevent.</li>\n<li>In the Node.js <code>EventTarget</code>, if an event listener is an async function\nor returns a <code>Promise</code>, and the returned <code>Promise</code> rejects, the rejection\nis automatically captured and handled the same way as a listener that\nthrows synchronously (see <a href=\"#eventtarget-error-handling\"><code>EventTarget</code> error handling</a> for details).</li>\n</ol>",
              "displayName": "Node.js `EventTarget` vs. DOM `EventTarget`"
            },
            {
              "textRaw": "`NodeEventTarget` vs. `EventEmitter`",
              "name": "`nodeeventtarget`_vs._`eventemitter`",
              "type": "module",
              "desc": "<p>The <code>NodeEventTarget</code> object implements a modified subset of the\n<code>EventEmitter</code> API that allows it to closely <em>emulate</em> an <code>EventEmitter</code> in\ncertain situations. A <code>NodeEventTarget</code> is <em>not</em> an instance of <code>EventEmitter</code>\nand cannot be used in place of an <code>EventEmitter</code> in most cases.</p>\n<ol>\n<li>Unlike <code>EventEmitter</code>, any given <code>listener</code> can be registered at most once\nper event <code>type</code>. Attempts to register a <code>listener</code> multiple times are\nignored.</li>\n<li>The <code>NodeEventTarget</code> does not emulate the full <code>EventEmitter</code> API.\nSpecifically the <code>prependListener()</code>, <code>prependOnceListener()</code>,\n<code>rawListeners()</code>, and <code>errorMonitor</code> APIs are not emulated.\nThe <code>'newListener'</code> and <code>'removeListener'</code> events will also not be emitted.</li>\n<li>The <code>NodeEventTarget</code> does not implement any special default behavior\nfor events with type <code>'error'</code>.</li>\n<li>The <code>NodeEventTarget</code> supports <code>EventListener</code> objects as well as\nfunctions as handlers for all event types.</li>\n</ol>",
              "displayName": "`NodeEventTarget` vs. `EventEmitter`"
            },
            {
              "textRaw": "Event listener",
              "name": "event_listener",
              "type": "module",
              "desc": "<p>Event listeners registered for an event <code>type</code> may either be JavaScript\nfunctions or objects with a <code>handleEvent</code> property whose value is a function.</p>\n<p>In either case, the handler function is invoked with the <code>event</code> argument\npassed to the <code>eventTarget.dispatchEvent()</code> function.</p>\n<p>Async functions may be used as event listeners. If an async handler function\nrejects, the rejection is captured and handled as described in\n<a href=\"#eventtarget-error-handling\"><code>EventTarget</code> error handling</a>.</p>\n<p>An error thrown by one handler function does not prevent the other handlers\nfrom being invoked.</p>\n<p>The return value of a handler function is ignored.</p>\n<p>Handlers are always invoked in the order they were added.</p>\n<p>Handler functions may mutate the <code>event</code> object.</p>\n<pre><code class=\"language-js\">function handler1(event) {\n  console.log(event.type);  // Prints 'foo'\n  event.a = 1;\n}\n\nasync function handler2(event) {\n  console.log(event.type);  // Prints 'foo'\n  console.log(event.a);  // Prints 1\n}\n\nconst handler3 = {\n  handleEvent(event) {\n    console.log(event.type);  // Prints 'foo'\n  },\n};\n\nconst handler4 = {\n  async handleEvent(event) {\n    console.log(event.type);  // Prints 'foo'\n  },\n};\n\nconst target = new EventTarget();\n\ntarget.addEventListener('foo', handler1);\ntarget.addEventListener('foo', handler2);\ntarget.addEventListener('foo', handler3);\ntarget.addEventListener('foo', handler4, { once: true });\n</code></pre>",
              "displayName": "Event listener"
            },
            {
              "textRaw": "`EventTarget` error handling",
              "name": "`eventtarget`_error_handling",
              "type": "module",
              "desc": "<p>When a registered event listener throws (or returns a Promise that rejects),\nby default the error is treated as an uncaught exception on\n<code>process.nextTick()</code>. This means uncaught exceptions in <code>EventTarget</code>s will\nterminate the Node.js process by default.</p>\n<p>Throwing within an event listener will <em>not</em> stop the other registered handlers\nfrom being invoked.</p>\n<p>The <code>EventTarget</code> does not implement any special default handling for <code>'error'</code>\ntype events like <code>EventEmitter</code>.</p>\n<p>Currently errors are first forwarded to the <code>process.on('error')</code> event\nbefore reaching <code>process.on('uncaughtException')</code>. This behavior is\ndeprecated and will change in a future release to align <code>EventTarget</code> with\nother Node.js APIs. Any code relying on the <code>process.on('error')</code> event should\nbe aligned with the new behavior.</p>",
              "displayName": "`EventTarget` error handling"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `Event`",
              "name": "Event",
              "type": "class",
              "meta": {
                "added": [
                  "v14.5.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35496",
                    "description": "The `Event` class is now available through the global object."
                  }
                ]
              },
              "desc": "<p>The <code>Event</code> object is an adaptation of the <a href=\"https://dom.spec.whatwg.org/#event\"><code>Event</code> Web API</a>. Instances\nare created internally by Node.js.</p>",
              "properties": [
                {
                  "textRaw": "Type: {boolean} Always returns `false`.",
                  "name": "bubbles",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This is not used in Node.js and is provided purely for completeness.</p>",
                  "shortDesc": "Always returns `false`."
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "cancelBubble",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "stability": 3,
                  "stabilityText": "Legacy: Use `event.stopPropagation()` instead.",
                  "desc": "<p>Alias for <code>event.stopPropagation()</code> if set to <code>true</code>. This is not used\nin Node.js and is provided purely for completeness.</p>"
                },
                {
                  "textRaw": "Type: {boolean} True if the event was created with the `cancelable` option.",
                  "name": "cancelable",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "True if the event was created with the `cancelable` option."
                },
                {
                  "textRaw": "Type: {boolean} Always returns `false`.",
                  "name": "composed",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This is not used in Node.js and is provided purely for completeness.</p>",
                  "shortDesc": "Always returns `false`."
                },
                {
                  "textRaw": "Type: {EventTarget} The `EventTarget` dispatching the event.",
                  "name": "currentTarget",
                  "type": "EventTarget",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Alias for <code>event.target</code>.</p>",
                  "shortDesc": "The `EventTarget` dispatching the event."
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "defaultPrevented",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Is <code>true</code> if <code>cancelable</code> is <code>true</code> and <code>event.preventDefault()</code> has been\ncalled.</p>"
                },
                {
                  "textRaw": "Type: {number} Returns `0` while an event is not being dispatched, `2` while it is being dispatched.",
                  "name": "eventPhase",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This is not used in Node.js and is provided purely for completeness.</p>",
                  "shortDesc": "Returns `0` while an event is not being dispatched, `2` while it is being dispatched."
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "isTrusted",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> <code>\"abort\"</code> event is emitted with <code>isTrusted</code> set to <code>true</code>. The\nvalue is <code>false</code> in all other cases.</p>"
                },
                {
                  "textRaw": "Type: {boolean} True if the event has not been canceled.",
                  "name": "returnValue",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "stability": 3,
                  "stabilityText": "Legacy: Use `event.defaultPrevented` instead.",
                  "desc": "<p>The value of <code>event.returnValue</code> is always the opposite of <code>event.defaultPrevented</code>.\nThis is not used in Node.js and is provided purely for completeness.</p>",
                  "shortDesc": "True if the event has not been canceled."
                },
                {
                  "textRaw": "Type: {EventTarget} The `EventTarget` dispatching the event.",
                  "name": "srcElement",
                  "type": "EventTarget",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "stability": 3,
                  "stabilityText": "Legacy: Use `event.target` instead.",
                  "desc": "<p>Alias for <code>event.target</code>.</p>",
                  "shortDesc": "The `EventTarget` dispatching the event."
                },
                {
                  "textRaw": "Type: {EventTarget} The `EventTarget` dispatching the event.",
                  "name": "target",
                  "type": "EventTarget",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "The `EventTarget` dispatching the event."
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "timeStamp",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The millisecond timestamp when the <code>Event</code> object was created.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "type",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The event type identifier.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`event.composedPath()`",
                  "name": "composedPath",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Returns an array containing the current <code>EventTarget</code> as the only entry or\nempty if the event is not being dispatched. This is not used in\nNode.js and is provided purely for completeness.</p>"
                },
                {
                  "textRaw": "`event.initEvent(type[, bubbles[, cancelable]])`",
                  "name": "initEvent",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.5.0"
                    ],
                    "changes": []
                  },
                  "stability": 3,
                  "stabilityText": "Legacy: The WHATWG spec considers it deprecated and users shouldn't use it at all.",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`bubbles` {boolean}",
                          "name": "bubbles",
                          "type": "boolean",
                          "optional": true
                        },
                        {
                          "textRaw": "`cancelable` {boolean}",
                          "name": "cancelable",
                          "type": "boolean",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Redundant with event constructors and incapable of setting <code>composed</code>.\nThis is not used in Node.js and is provided purely for completeness.</p>"
                },
                {
                  "textRaw": "`event.preventDefault()`",
                  "name": "preventDefault",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Sets the <code>defaultPrevented</code> property to <code>true</code> if <code>cancelable</code> is <code>true</code>.</p>"
                },
                {
                  "textRaw": "`event.stopImmediatePropagation()`",
                  "name": "stopImmediatePropagation",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Stops the invocation of event listeners after the current one completes.</p>"
                },
                {
                  "textRaw": "`event.stopPropagation()`",
                  "name": "stopPropagation",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>This is not used in Node.js and is provided purely for completeness.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `EventTarget`",
              "name": "EventTarget",
              "type": "class",
              "meta": {
                "added": [
                  "v14.5.0"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35496",
                    "description": "The `EventTarget` class is now available through the global object."
                  }
                ]
              },
              "methods": [
                {
                  "textRaw": "`eventTarget.addEventListener(type, listener[, options])`",
                  "name": "addEventListener",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": [
                      {
                        "version": "v15.4.0",
                        "pr-url": "https://github.com/nodejs/node/pull/36258",
                        "description": "add support for `signal` option."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`listener` {Function|EventListener}",
                          "name": "listener",
                          "type": "Function|EventListener"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`once` {boolean} When `true`, the listener is automatically removed when it is first invoked. **Default:** `false`.",
                              "name": "once",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "When `true`, the listener is automatically removed when it is first invoked."
                            },
                            {
                              "textRaw": "`passive` {boolean} When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method. **Default:** `false`.",
                              "name": "passive",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "When `true`, serves as a hint that the listener will not call the `Event` object's `preventDefault()` method."
                            },
                            {
                              "textRaw": "`capture` {boolean} Not directly used by Node.js. Added for API completeness. **Default:** `false`.",
                              "name": "capture",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Not directly used by Node.js. Added for API completeness."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} The listener will be removed when the given AbortSignal object's `abort()` method is called.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "The listener will be removed when the given AbortSignal object's `abort()` method is called."
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Adds a new handler for the <code>type</code> event. Any given <code>listener</code> is added\nonly once per <code>type</code> and per <code>capture</code> option value.</p>\n<p>If the <code>once</code> option is <code>true</code>, the <code>listener</code> is removed after the\nnext time a <code>type</code> event is dispatched.</p>\n<p>The <code>capture</code> option is not used by Node.js in any functional way other than\ntracking registered event listeners per the <code>EventTarget</code> specification.\nSpecifically, the <code>capture</code> option is used as part of the key when registering\na <code>listener</code>. Any individual <code>listener</code> may be added once with\n<code>capture = false</code>, and once with <code>capture = true</code>.</p>\n<pre><code class=\"language-js\">function handler(event) {}\n\nconst target = new EventTarget();\ntarget.addEventListener('foo', handler, { capture: true });  // first\ntarget.addEventListener('foo', handler, { capture: false }); // second\n\n// Removes the second instance of handler\ntarget.removeEventListener('foo', handler);\n\n// Removes the first instance of handler\ntarget.removeEventListener('foo', handler, { capture: true });\n</code></pre>"
                },
                {
                  "textRaw": "`eventTarget.dispatchEvent(event)`",
                  "name": "dispatchEvent",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`event` {Event}",
                          "name": "event",
                          "type": "Event"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if either event's `cancelable` attribute value is false or its `preventDefault()` method was not invoked, otherwise `false`.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if either event's `cancelable` attribute value is false or its `preventDefault()` method was not invoked, otherwise `false`."
                      }
                    }
                  ],
                  "desc": "<p>Dispatches the <code>event</code> to the list of handlers for <code>event.type</code>.</p>\n<p>The registered event listeners is synchronously invoked in the order they\nwere registered.</p>"
                },
                {
                  "textRaw": "`eventTarget.removeEventListener(type, listener[, options])`",
                  "name": "removeEventListener",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`listener` {Function|EventListener}",
                          "name": "listener",
                          "type": "Function|EventListener"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`capture` {boolean}",
                              "name": "capture",
                              "type": "boolean"
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Removes the <code>listener</code> from the list of handlers for event <code>type</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `CustomEvent`",
              "name": "CustomEvent",
              "type": "class",
              "meta": {
                "added": [
                  "v18.7.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v23.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52723",
                    "description": "No longer experimental."
                  },
                  {
                    "version": [
                      "v22.1.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52618",
                    "description": "CustomEvent is now stable."
                  },
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44860",
                    "description": "No longer behind `--experimental-global-customevent` CLI flag."
                  }
                ]
              },
              "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-event\"><code>&#x3C;Event></code></a></li>\n</ul>\n<p>The <code>CustomEvent</code> object is an adaptation of the <a href=\"https://dom.spec.whatwg.org/#customevent\"><code>CustomEvent</code> Web API</a>.\nInstances are created internally by Node.js.</p>",
              "properties": [
                {
                  "textRaw": "Type: {any} Returns custom data passed when initializing.",
                  "name": "detail",
                  "type": "any",
                  "meta": {
                    "added": [
                      "v18.7.0",
                      "v16.17.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v22.1.0",
                          "v20.13.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/52618",
                        "description": "CustomEvent is now stable."
                      }
                    ]
                  },
                  "desc": "<p>Read-only.</p>",
                  "shortDesc": "Returns custom data passed when initializing."
                }
              ]
            },
            {
              "textRaw": "Class: `NodeEventTarget`",
              "name": "NodeEventTarget",
              "type": "class",
              "meta": {
                "added": [
                  "v14.5.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventtarget\"><code>&#x3C;EventTarget></code></a></li>\n</ul>\n<p>The <code>NodeEventTarget</code> is a Node.js-specific extension to <code>EventTarget</code>\nthat emulates a subset of the <code>EventEmitter</code> API.</p>",
              "methods": [
                {
                  "textRaw": "`nodeEventTarget.addListener(type, listener)`",
                  "name": "addListener",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`listener` {Function|EventListener}",
                          "name": "listener",
                          "type": "Function|EventListener"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {EventTarget} this",
                        "name": "return",
                        "type": "EventTarget",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class that emulates the\nequivalent <code>EventEmitter</code> API. The only difference between <code>addListener()</code> and\n<code>addEventListener()</code> is that <code>addListener()</code> will return a reference to the\n<code>EventTarget</code>.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.emit(type, arg)`",
                  "name": "emit",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.2.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`arg` {any}",
                          "name": "arg",
                          "type": "any"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if event listeners registered for the `type` exist, otherwise `false`.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if event listeners registered for the `type` exist, otherwise `false`."
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class that dispatches the\n<code>arg</code> to the list of handlers for <code>type</code>.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.eventNames()`",
                  "name": "eventNames",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {string[]}",
                        "name": "return",
                        "type": "string[]"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class that returns an array\nof event <code>type</code> names for which event listeners are registered.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.listenerCount(type)`",
                  "name": "listenerCount",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {number}",
                        "name": "return",
                        "type": "number"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class that returns the number\nof event listeners registered for the <code>type</code>.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.setMaxListeners(n)`",
                  "name": "setMaxListeners",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`n` {number}",
                          "name": "n",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class that sets the number\nof max event listeners as <code>n</code>.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.getMaxListeners()`",
                  "name": "getMaxListeners",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {number}",
                        "name": "return",
                        "type": "number"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class that returns the number\nof max event listeners.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.off(type, listener[, options])`",
                  "name": "off",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`listener` {Function|EventListener}",
                          "name": "listener",
                          "type": "Function|EventListener"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`capture` {boolean}",
                              "name": "capture",
                              "type": "boolean"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {EventTarget} this",
                        "name": "return",
                        "type": "EventTarget",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific alias for <code>eventTarget.removeEventListener()</code>.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.on(type, listener)`",
                  "name": "on",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`listener` {Function|EventListener}",
                          "name": "listener",
                          "type": "Function|EventListener"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {EventTarget} this",
                        "name": "return",
                        "type": "EventTarget",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific alias for <code>eventTarget.addEventListener()</code>.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.once(type, listener)`",
                  "name": "once",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`listener` {Function|EventListener}",
                          "name": "listener",
                          "type": "Function|EventListener"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {EventTarget} this",
                        "name": "return",
                        "type": "EventTarget",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class that adds a <code>once</code>\nlistener for the given event <code>type</code>. This is equivalent to calling <code>on</code>\nwith the <code>once</code> option set to <code>true</code>.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.removeAllListeners([type])`",
                  "name": "removeAllListeners",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {EventTarget} this",
                        "name": "return",
                        "type": "EventTarget",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class. If <code>type</code> is specified,\nremoves all registered listeners for <code>type</code>, otherwise removes all registered\nlisteners.</p>"
                },
                {
                  "textRaw": "`nodeEventTarget.removeListener(type, listener[, options])`",
                  "name": "removeListener",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`type` {string}",
                          "name": "type",
                          "type": "string"
                        },
                        {
                          "textRaw": "`listener` {Function|EventListener}",
                          "name": "listener",
                          "type": "Function|EventListener"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`capture` {boolean}",
                              "name": "capture",
                              "type": "boolean"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {EventTarget} this",
                        "name": "return",
                        "type": "EventTarget",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>Node.js-specific extension to the <code>EventTarget</code> class that removes the\n<code>listener</code> for the given <code>type</code>. The only difference between <code>removeListener()</code>\nand <code>removeEventListener()</code> is that <code>removeListener()</code> will return a reference\nto the <code>EventTarget</code>.</p>"
                }
              ]
            }
          ],
          "displayName": "`EventTarget` and `Event` API"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `EventEmitter`",
          "name": "EventEmitter",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.26"
            ],
            "changes": [
              {
                "version": [
                  "v13.4.0",
                  "v12.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/27867",
                "description": "Added captureRejections option."
              }
            ]
          },
          "desc": "<p>The <code>EventEmitter</code> class is defined and exposed by the <code>node:events</code> module:</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\n</code></pre>\n<p>All <code>EventEmitter</code>s emit the event <code>'newListener'</code> when new listeners are\nadded and <code>'removeListener'</code> when existing listeners are removed.</p>\n<p>It supports the following option:</p>\n<ul>\n<li><code>captureRejections</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> It enables <a href=\"#capture-rejections-of-promises\">automatic capturing of promise rejection</a>.\n<strong>Default:</strong> <code>false</code>.</li>\n</ul>",
          "events": [
            {
              "textRaw": "Event: `'newListener'`",
              "name": "newListener",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`eventName` {string|symbol} The name of the event being listened for",
                  "name": "eventName",
                  "type": "string|symbol",
                  "desc": "The name of the event being listened for"
                },
                {
                  "textRaw": "`listener` {Function} The event handler function",
                  "name": "listener",
                  "type": "Function",
                  "desc": "The event handler function"
                }
              ],
              "desc": "<p>The <code>EventEmitter</code> instance will emit its own <code>'newListener'</code> event <em>before</em>\na listener is added to its internal array of listeners.</p>\n<p>Listeners registered for the <code>'newListener'</code> event are passed the event\nname and a reference to the listener being added.</p>\n<p>The fact that the event is triggered before adding the listener has a subtle\nbut important side effect: any <em>additional</em> listeners registered to the same\n<code>name</code> <em>within</em> the <code>'newListener'</code> callback are inserted <em>before</em> the\nlistener that is in the process of being added.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\n\nconst myEmitter = new MyEmitter();\n// Only do this once so we don't loop forever\nmyEmitter.once('newListener', (event, listener) => {\n  if (event === 'event') {\n    // Insert a new listener in front\n    myEmitter.on('event', () => {\n      console.log('B');\n    });\n  }\n});\nmyEmitter.on('event', () => {\n  console.log('A');\n});\nmyEmitter.emit('event');\n// Prints:\n//   B\n//   A\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\n\nconst myEmitter = new MyEmitter();\n// Only do this once so we don't loop forever\nmyEmitter.once('newListener', (event, listener) => {\n  if (event === 'event') {\n    // Insert a new listener in front\n    myEmitter.on('event', () => {\n      console.log('B');\n    });\n  }\n});\nmyEmitter.on('event', () => {\n  console.log('A');\n});\nmyEmitter.emit('event');\n// Prints:\n//   B\n//   A\n</code></pre>"
            },
            {
              "textRaw": "Event: `'removeListener'`",
              "name": "removeListener",
              "type": "event",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": [
                  {
                    "version": [
                      "v6.1.0",
                      "v4.7.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/6394",
                    "description": "For listeners attached using `.once()`, the `listener` argument now yields the original listener function."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`eventName` {string|symbol} The event name",
                  "name": "eventName",
                  "type": "string|symbol",
                  "desc": "The event name"
                },
                {
                  "textRaw": "`listener` {Function} The event handler function",
                  "name": "listener",
                  "type": "Function",
                  "desc": "The event handler function"
                }
              ],
              "desc": "<p>The <code>'removeListener'</code> event is emitted <em>after</em> the <code>listener</code> is removed.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`emitter.addListener(eventName, listener)`",
              "name": "addListener",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    },
                    {
                      "textRaw": "`listener` {Function}",
                      "name": "listener",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>Alias for <code>emitter.on(eventName, listener)</code>.</p>"
            },
            {
              "textRaw": "`emitter.emit(eventName[, ...args])`",
              "name": "emit",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Synchronously calls each of the listeners registered for the event named\n<code>eventName</code>, in the order they were registered, passing the supplied arguments\nto each.</p>\n<p>Returns <code>true</code> if the event had listeners, <code>false</code> otherwise.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nconst myEmitter = new EventEmitter();\n\n// First listener\nmyEmitter.on('event', function firstListener() {\n  console.log('Helloooo! first listener');\n});\n// Second listener\nmyEmitter.on('event', function secondListener(arg1, arg2) {\n  console.log(`event with parameters ${arg1}, ${arg2} in second listener`);\n});\n// Third listener\nmyEmitter.on('event', function thirdListener(...args) {\n  const parameters = args.join(', ');\n  console.log(`event with parameters ${parameters} in third listener`);\n});\n\nconsole.log(myEmitter.listeners('event'));\n\nmyEmitter.emit('event', 1, 2, 3, 4, 5);\n\n// Prints:\n// [\n//   [Function: firstListener],\n//   [Function: secondListener],\n//   [Function: thirdListener]\n// ]\n// Helloooo! first listener\n// event with parameters 1, 2 in second listener\n// event with parameters 1, 2, 3, 4, 5 in third listener\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nconst myEmitter = new EventEmitter();\n\n// First listener\nmyEmitter.on('event', function firstListener() {\n  console.log('Helloooo! first listener');\n});\n// Second listener\nmyEmitter.on('event', function secondListener(arg1, arg2) {\n  console.log(`event with parameters ${arg1}, ${arg2} in second listener`);\n});\n// Third listener\nmyEmitter.on('event', function thirdListener(...args) {\n  const parameters = args.join(', ');\n  console.log(`event with parameters ${parameters} in third listener`);\n});\n\nconsole.log(myEmitter.listeners('event'));\n\nmyEmitter.emit('event', 1, 2, 3, 4, 5);\n\n// Prints:\n// [\n//   [Function: firstListener],\n//   [Function: secondListener],\n//   [Function: thirdListener]\n// ]\n// Helloooo! first listener\n// event with parameters 1, 2 in second listener\n// event with parameters 1, 2, 3, 4, 5 in third listener\n</code></pre>"
            },
            {
              "textRaw": "`emitter.eventNames()`",
              "name": "eventNames",
              "type": "method",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]|symbol[]}",
                    "name": "return",
                    "type": "string[]|symbol[]"
                  }
                }
              ],
              "desc": "<p>Returns an array listing the events for which the emitter has registered\nlisteners.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\n\nconst myEE = new EventEmitter();\nmyEE.on('foo', () => {});\nmyEE.on('bar', () => {});\n\nconst sym = Symbol('symbol');\nmyEE.on(sym, () => {});\n\nconsole.log(myEE.eventNames());\n// Prints: [ 'foo', 'bar', Symbol(symbol) ]\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\n\nconst myEE = new EventEmitter();\nmyEE.on('foo', () => {});\nmyEE.on('bar', () => {});\n\nconst sym = Symbol('symbol');\nmyEE.on(sym, () => {});\n\nconsole.log(myEE.eventNames());\n// Prints: [ 'foo', 'bar', Symbol(symbol) ]\n</code></pre>"
            },
            {
              "textRaw": "`emitter.getMaxListeners()`",
              "name": "getMaxListeners",
              "type": "method",
              "meta": {
                "added": [
                  "v1.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Returns the current max listener value for the <code>EventEmitter</code> which is either\nset by <a href=\"#emittersetmaxlistenersn\"><code>emitter.setMaxListeners(n)</code></a> or defaults to\n<a href=\"#eventsdefaultmaxlisteners\"><code>events.defaultMaxListeners</code></a>.</p>"
            },
            {
              "textRaw": "`emitter.listenerCount(eventName[, listener])`",
              "name": "listenerCount",
              "type": "method",
              "meta": {
                "added": [
                  "v3.2.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.8.0",
                      "v18.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46523",
                    "description": "Added the `listener` argument."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol} The name of the event being listened for",
                      "name": "eventName",
                      "type": "string|symbol",
                      "desc": "The name of the event being listened for"
                    },
                    {
                      "textRaw": "`listener` {Function} The event handler function",
                      "name": "listener",
                      "type": "Function",
                      "desc": "The event handler function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Returns the number of listeners listening for the event named <code>eventName</code>.\nIf <code>listener</code> is provided, it will return how many times the listener is found\nin the list of the listeners of the event.</p>"
            },
            {
              "textRaw": "`emitter.listeners(eventName)`",
              "name": "listeners",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": [
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6881",
                    "description": "For listeners attached using `.once()` this returns the original listeners instead of wrapper functions now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function[]}",
                    "name": "return",
                    "type": "Function[]"
                  }
                }
              ],
              "desc": "<p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>\n<pre><code class=\"language-js\">server.on('connection', (stream) => {\n  console.log('someone connected!');\n});\nconsole.log(util.inspect(server.listeners('connection')));\n// Prints: [ [Function] ]\n</code></pre>"
            },
            {
              "textRaw": "`emitter.off(eventName, listener)`",
              "name": "off",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    },
                    {
                      "textRaw": "`listener` {Function}",
                      "name": "listener",
                      "type": "Function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  }
                }
              ],
              "desc": "<p>Alias for <a href=\"#emitterremovelistenereventname-listener\"><code>emitter.removeListener()</code></a>.</p>"
            },
            {
              "textRaw": "`emitter.on(eventName, listener)`",
              "name": "on",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.101"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol} The name of the event.",
                      "name": "eventName",
                      "type": "string|symbol",
                      "desc": "The name of the event."
                    },
                    {
                      "textRaw": "`listener` {Function} The callback function",
                      "name": "listener",
                      "type": "Function",
                      "desc": "The callback function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  }
                }
              ],
              "desc": "<p>Adds the <code>listener</code> function to the end of the listeners array for the\nevent named <code>eventName</code>. No checks are made to see if the <code>listener</code> has\nalready been added. Multiple calls passing the same combination of <code>eventName</code>\nand <code>listener</code> will result in the <code>listener</code> being added, and called, multiple\ntimes.</p>\n<pre><code class=\"language-js\">server.on('connection', (stream) => {\n  console.log('someone connected!');\n});\n</code></pre>\n<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>\n<p>By default, event listeners are invoked in the order they are added. The\n<code>emitter.prependListener()</code> method can be used as an alternative to add the\nevent listener to the beginning of the listeners array.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nconst myEE = new EventEmitter();\nmyEE.on('foo', () => console.log('a'));\nmyEE.prependListener('foo', () => console.log('b'));\nmyEE.emit('foo');\n// Prints:\n//   b\n//   a\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nconst myEE = new EventEmitter();\nmyEE.on('foo', () => console.log('a'));\nmyEE.prependListener('foo', () => console.log('b'));\nmyEE.emit('foo');\n// Prints:\n//   b\n//   a\n</code></pre>"
            },
            {
              "textRaw": "`emitter.once(eventName, listener)`",
              "name": "once",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol} The name of the event.",
                      "name": "eventName",
                      "type": "string|symbol",
                      "desc": "The name of the event."
                    },
                    {
                      "textRaw": "`listener` {Function} The callback function",
                      "name": "listener",
                      "type": "Function",
                      "desc": "The callback function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  }
                }
              ],
              "desc": "<p>Adds a <strong>one-time</strong> <code>listener</code> function for the event named <code>eventName</code>. The\nnext time <code>eventName</code> is triggered, this listener is removed and then invoked.</p>\n<pre><code class=\"language-js\">server.once('connection', (stream) => {\n  console.log('Ah, we have our first user!');\n});\n</code></pre>\n<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>\n<p>By default, event listeners are invoked in the order they are added. The\n<code>emitter.prependOnceListener()</code> method can be used as an alternative to add the\nevent listener to the beginning of the listeners array.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nconst myEE = new EventEmitter();\nmyEE.once('foo', () => console.log('a'));\nmyEE.prependOnceListener('foo', () => console.log('b'));\nmyEE.emit('foo');\n// Prints:\n//   b\n//   a\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nconst myEE = new EventEmitter();\nmyEE.once('foo', () => console.log('a'));\nmyEE.prependOnceListener('foo', () => console.log('b'));\nmyEE.emit('foo');\n// Prints:\n//   b\n//   a\n</code></pre>"
            },
            {
              "textRaw": "`emitter.prependListener(eventName, listener)`",
              "name": "prependListener",
              "type": "method",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol} The name of the event.",
                      "name": "eventName",
                      "type": "string|symbol",
                      "desc": "The name of the event."
                    },
                    {
                      "textRaw": "`listener` {Function} The callback function",
                      "name": "listener",
                      "type": "Function",
                      "desc": "The callback function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  }
                }
              ],
              "desc": "<p>Adds the <code>listener</code> function to the <em>beginning</em> of the listeners array for the\nevent named <code>eventName</code>. No checks are made to see if the <code>listener</code> has\nalready been added. Multiple calls passing the same combination of <code>eventName</code>\nand <code>listener</code> will result in the <code>listener</code> being added, and called, multiple\ntimes.</p>\n<pre><code class=\"language-js\">server.prependListener('connection', (stream) => {\n  console.log('someone connected!');\n});\n</code></pre>\n<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>"
            },
            {
              "textRaw": "`emitter.prependOnceListener(eventName, listener)`",
              "name": "prependOnceListener",
              "type": "method",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol} The name of the event.",
                      "name": "eventName",
                      "type": "string|symbol",
                      "desc": "The name of the event."
                    },
                    {
                      "textRaw": "`listener` {Function} The callback function",
                      "name": "listener",
                      "type": "Function",
                      "desc": "The callback function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  }
                }
              ],
              "desc": "<p>Adds a <strong>one-time</strong> <code>listener</code> function for the event named <code>eventName</code> to the\n<em>beginning</em> of the listeners array. The next time <code>eventName</code> is triggered, this\nlistener is removed, and then invoked.</p>\n<pre><code class=\"language-js\">server.prependOnceListener('connection', (stream) => {\n  console.log('Ah, we have our first user!');\n});\n</code></pre>\n<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>"
            },
            {
              "textRaw": "`emitter.removeAllListeners([eventName])`",
              "name": "removeAllListeners",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  }
                }
              ],
              "desc": "<p>Removes all listeners, or those of the specified <code>eventName</code>.</p>\n<p>It is bad practice to remove listeners added elsewhere in the code,\nparticularly when the <code>EventEmitter</code> instance was created by some other\ncomponent or module (e.g. sockets or file streams).</p>\n<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>"
            },
            {
              "textRaw": "`emitter.removeListener(eventName, listener)`",
              "name": "removeListener",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.26"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    },
                    {
                      "textRaw": "`listener` {Function}",
                      "name": "listener",
                      "type": "Function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  }
                }
              ],
              "desc": "<p>Removes the specified <code>listener</code> from the listener array for the event named\n<code>eventName</code>.</p>\n<pre><code class=\"language-js\">const callback = (stream) => {\n  console.log('someone connected!');\n};\nserver.on('connection', callback);\n// ...\nserver.removeListener('connection', callback);\n</code></pre>\n<p><code>removeListener()</code> will remove, at most, one instance of a listener from the\nlistener array. If any single listener has been added multiple times to the\nlistener array for the specified <code>eventName</code>, then <code>removeListener()</code> must be\ncalled multiple times to remove each instance.</p>\n<p>Once an event is emitted, all listeners attached to it at the\ntime of emitting are called in order. This implies that any\n<code>removeListener()</code> or <code>removeAllListeners()</code> calls <em>after</em> emitting and\n<em>before</em> the last listener finishes execution will not remove them from\n<code>emit()</code> in progress. Subsequent events behave as expected.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\n\nconst callbackA = () => {\n  console.log('A');\n  myEmitter.removeListener('event', callbackB);\n};\n\nconst callbackB = () => {\n  console.log('B');\n};\n\nmyEmitter.on('event', callbackA);\n\nmyEmitter.on('event', callbackB);\n\n// callbackA removes listener callbackB but it will still be called.\n// Internal listener array at time of emit [callbackA, callbackB]\nmyEmitter.emit('event');\n// Prints:\n//   A\n//   B\n\n// callbackB is now removed.\n// Internal listener array [callbackA]\nmyEmitter.emit('event');\n// Prints:\n//   A\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nclass MyEmitter extends EventEmitter {}\nconst myEmitter = new MyEmitter();\n\nconst callbackA = () => {\n  console.log('A');\n  myEmitter.removeListener('event', callbackB);\n};\n\nconst callbackB = () => {\n  console.log('B');\n};\n\nmyEmitter.on('event', callbackA);\n\nmyEmitter.on('event', callbackB);\n\n// callbackA removes listener callbackB but it will still be called.\n// Internal listener array at time of emit [callbackA, callbackB]\nmyEmitter.emit('event');\n// Prints:\n//   A\n//   B\n\n// callbackB is now removed.\n// Internal listener array [callbackA]\nmyEmitter.emit('event');\n// Prints:\n//   A\n</code></pre>\n<p>Because listeners are managed using an internal array, calling this will\nchange the position indexes of any listener registered <em>after</em> the listener\nbeing removed. This will not impact the order in which listeners are called,\nbut it means that any copies of the listener array as returned by\nthe <code>emitter.listeners()</code> method will need to be recreated.</p>\n<p>When a single function has been added as a handler multiple times for a single\nevent (as in the example below), <code>removeListener()</code> will remove the most\nrecently added instance. In the example the <code>once('ping')</code>\nlistener is removed:</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nconst ee = new EventEmitter();\n\nfunction pong() {\n  console.log('pong');\n}\n\nee.on('ping', pong);\nee.once('ping', pong);\nee.removeListener('ping', pong);\n\nee.emit('ping');\nee.emit('ping');\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nconst ee = new EventEmitter();\n\nfunction pong() {\n  console.log('pong');\n}\n\nee.on('ping', pong);\nee.once('ping', pong);\nee.removeListener('ping', pong);\n\nee.emit('ping');\nee.emit('ping');\n</code></pre>\n<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>"
            },
            {
              "textRaw": "`emitter.setMaxListeners(n)`",
              "name": "setMaxListeners",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.5"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`n` {integer}",
                      "name": "n",
                      "type": "integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {EventEmitter}",
                    "name": "return",
                    "type": "EventEmitter"
                  }
                }
              ],
              "desc": "<p>By default <code>EventEmitter</code>s will print a warning if more than <code>10</code> listeners are\nadded for a particular event. This is a useful default that helps finding\nmemory leaks. The <code>emitter.setMaxListeners()</code> method allows the limit to be\nmodified for this specific <code>EventEmitter</code> instance. The value can be set to\n<code>Infinity</code> (or <code>0</code>) to indicate an unlimited number of listeners.</p>\n<p>Returns a reference to the <code>EventEmitter</code>, so that calls can be chained.</p>"
            },
            {
              "textRaw": "`emitter.rawListeners(eventName)`",
              "name": "rawListeners",
              "type": "method",
              "meta": {
                "added": [
                  "v9.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function[]}",
                    "name": "return",
                    "type": "Function[]"
                  }
                }
              ],
              "desc": "<p>Returns a copy of the array of listeners for the event named <code>eventName</code>,\nincluding any wrappers (such as those created by <code>.once()</code>).</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nconst emitter = new EventEmitter();\nemitter.once('log', () => console.log('log once'));\n\n// Returns a new Array with a function `onceWrapper` which has a property\n// `listener` which contains the original listener bound above\nconst listeners = emitter.rawListeners('log');\nconst logFnWrapper = listeners[0];\n\n// Logs \"log once\" to the console and does not unbind the `once` event\nlogFnWrapper.listener();\n\n// Logs \"log once\" to the console and removes the listener\nlogFnWrapper();\n\nemitter.on('log', () => console.log('log persistently'));\n// Will return a new Array with a single function bound by `.on()` above\nconst newListeners = emitter.rawListeners('log');\n\n// Logs \"log persistently\" twice\nnewListeners[0]();\nemitter.emit('log');\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nconst emitter = new EventEmitter();\nemitter.once('log', () => console.log('log once'));\n\n// Returns a new Array with a function `onceWrapper` which has a property\n// `listener` which contains the original listener bound above\nconst listeners = emitter.rawListeners('log');\nconst logFnWrapper = listeners[0];\n\n// Logs \"log once\" to the console and does not unbind the `once` event\nlogFnWrapper.listener();\n\n// Logs \"log once\" to the console and removes the listener\nlogFnWrapper();\n\nemitter.on('log', () => console.log('log persistently'));\n// Will return a new Array with a single function bound by `.on()` above\nconst newListeners = emitter.rawListeners('log');\n\n// Logs \"log persistently\" twice\nnewListeners[0]();\nemitter.emit('log');\n</code></pre>"
            },
            {
              "textRaw": "`emitter[Symbol.for('nodejs.rejection')](err, eventName[, ...args])`",
              "name": "[Symbol.for('nodejs.rejection')]",
              "type": "method",
              "meta": {
                "added": [
                  "v13.4.0",
                  "v12.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.4.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41267",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`eventName` {string|symbol}",
                      "name": "eventName",
                      "type": "string|symbol"
                    },
                    {
                      "textRaw": "`...args` {any}",
                      "name": "...args",
                      "type": "any",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>Symbol.for('nodejs.rejection')</code> method is called in case a\npromise rejection happens when emitting an event and\n<a href=\"#capture-rejections-of-promises\"><code>captureRejections</code></a> is enabled on the emitter.\nIt is possible to use <a href=\"#eventscapturerejectionsymbol\"><code>events.captureRejectionSymbol</code></a> in\nplace of <code>Symbol.for('nodejs.rejection')</code>.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter, captureRejectionSymbol } from 'node:events';\n\nclass MyClass extends EventEmitter {\n  constructor() {\n    super({ captureRejections: true });\n  }\n\n  [captureRejectionSymbol](err, event, ...args) {\n    console.log('rejection happened for', event, 'with', err, ...args);\n    this.destroy(err);\n  }\n\n  destroy(err) {\n    // Tear the resource down here.\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { EventEmitter, captureRejectionSymbol } = require('node:events');\n\nclass MyClass extends EventEmitter {\n  constructor() {\n    super({ captureRejections: true });\n  }\n\n  [captureRejectionSymbol](err, event, ...args) {\n    console.log('rejection happened for', event, 'with', err, ...args);\n    this.destroy(err);\n  }\n\n  destroy(err) {\n    // Tear the resource down here.\n  }\n}\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `events.EventEmitterAsyncResource extends EventEmitter`",
          "name": "events.EventEmitterAsyncResource extends EventEmitter",
          "type": "class",
          "meta": {
            "added": [
              "v17.4.0",
              "v16.14.0"
            ],
            "changes": []
          },
          "desc": "<p>Integrates <code>EventEmitter</code> with <a href=\"async_hooks.html#class-asyncresource\"><code>&#x3C;AsyncResource></code></a> for <code>EventEmitter</code>s that\nrequire manual async tracking. Specifically, all events emitted by instances\nof <code>events.EventEmitterAsyncResource</code> will run within its <a href=\"async_context.html\">async context</a>.</p>\n<pre><code class=\"language-mjs\">import { EventEmitterAsyncResource, EventEmitter } from 'node:events';\nimport { notStrictEqual, strictEqual } from 'node:assert';\nimport { executionAsyncId, triggerAsyncId } from 'node:async_hooks';\n\n// Async tracking tooling will identify this as 'Q'.\nconst ee1 = new EventEmitterAsyncResource({ name: 'Q' });\n\n// 'foo' listeners will run in the EventEmitters async context.\nee1.on('foo', () => {\n  strictEqual(executionAsyncId(), ee1.asyncId);\n  strictEqual(triggerAsyncId(), ee1.triggerAsyncId);\n});\n\nconst ee2 = new EventEmitter();\n\n// 'foo' listeners on ordinary EventEmitters that do not track async\n// context, however, run in the same async context as the emit().\nee2.on('foo', () => {\n  notStrictEqual(executionAsyncId(), ee2.asyncId);\n  notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId);\n});\n\nPromise.resolve().then(() => {\n  ee1.emit('foo');\n  ee2.emit('foo');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { EventEmitterAsyncResource, EventEmitter } = require('node:events');\nconst { notStrictEqual, strictEqual } = require('node:assert');\nconst { executionAsyncId, triggerAsyncId } = require('node:async_hooks');\n\n// Async tracking tooling will identify this as 'Q'.\nconst ee1 = new EventEmitterAsyncResource({ name: 'Q' });\n\n// 'foo' listeners will run in the EventEmitters async context.\nee1.on('foo', () => {\n  strictEqual(executionAsyncId(), ee1.asyncId);\n  strictEqual(triggerAsyncId(), ee1.triggerAsyncId);\n});\n\nconst ee2 = new EventEmitter();\n\n// 'foo' listeners on ordinary EventEmitters that do not track async\n// context, however, run in the same async context as the emit().\nee2.on('foo', () => {\n  notStrictEqual(executionAsyncId(), ee2.asyncId);\n  notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId);\n});\n\nPromise.resolve().then(() => {\n  ee1.emit('foo');\n  ee2.emit('foo');\n});\n</code></pre>\n<p>The <code>EventEmitterAsyncResource</code> class has the same methods and takes the\nsame options as <code>EventEmitter</code> and <code>AsyncResource</code> themselves.</p>",
          "signatures": [
            {
              "textRaw": "`new events.EventEmitterAsyncResource([options])`",
              "name": "events.EventEmitterAsyncResource",
              "type": "ctor",
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`captureRejections` {boolean} It enables automatic capturing of promise rejection. **Default:** `false`.",
                      "name": "captureRejections",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "It enables automatic capturing of promise rejection."
                    },
                    {
                      "textRaw": "`name` {string} The type of async event. **Default:** `new.target.name`.",
                      "name": "name",
                      "type": "string",
                      "default": "`new.target.name`",
                      "desc": "The type of async event."
                    },
                    {
                      "textRaw": "`triggerAsyncId` {number} The ID of the execution context that created this async event. **Default:** `executionAsyncId()`.",
                      "name": "triggerAsyncId",
                      "type": "number",
                      "default": "`executionAsyncId()`",
                      "desc": "The ID of the execution context that created this async event."
                    },
                    {
                      "textRaw": "`requireManualDestroy` {boolean} If set to `true`, disables `emitDestroy` when the object is garbage collected. This usually does not need to be set (even if `emitDestroy` is called manually), unless the resource's `asyncId` is retrieved and the sensitive API's `emitDestroy` is called with it. When set to `false`, the `emitDestroy` call on garbage collection will only take place if there is at least one active `destroy` hook. **Default:** `false`.",
                      "name": "requireManualDestroy",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, disables `emitDestroy` when the object is garbage collected. This usually does not need to be set (even if `emitDestroy` is called manually), unless the resource's `asyncId` is retrieved and the sensitive API's `emitDestroy` is called with it. When set to `false`, the `emitDestroy` call on garbage collection will only take place if there is at least one active `destroy` hook."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {number} The unique `asyncId` assigned to the resource.",
              "name": "asyncId",
              "type": "number",
              "desc": "The unique `asyncId` assigned to the resource."
            },
            {
              "textRaw": "Type: {AsyncResource} The underlying {AsyncResource}.",
              "name": "asyncResource",
              "type": "AsyncResource",
              "desc": "<p>The returned <code>AsyncResource</code> object has an additional <code>eventEmitter</code> property\nthat provides a reference to this <code>EventEmitterAsyncResource</code>.</p>",
              "shortDesc": "The underlying {AsyncResource}."
            },
            {
              "textRaw": "Type: {number} The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.",
              "name": "triggerAsyncId",
              "type": "number",
              "desc": "<p><a id=\"event-target-and-event-api\"></a></p>",
              "shortDesc": "The same `triggerAsyncId` that is passed to the `AsyncResource` constructor."
            }
          ],
          "methods": [
            {
              "textRaw": "`eventemitterasyncresource.emitDestroy()`",
              "name": "emitDestroy",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Call all <code>destroy</code> hooks. This should only ever be called once. An error will\nbe thrown if it is called more than once. This <strong>must</strong> be manually called. If\nthe resource is left to be collected by the GC then the <code>destroy</code> hooks will\nnever be called.</p>"
            }
          ]
        }
      ],
      "properties": [
        {
          "textRaw": "`events.defaultMaxListeners`",
          "name": "defaultMaxListeners",
          "type": "property",
          "meta": {
            "added": [
              "v0.11.2"
            ],
            "changes": []
          },
          "desc": "<p>By default, a maximum of <code>10</code> listeners can be registered for any single\nevent. This limit can be changed for individual <code>EventEmitter</code> instances\nusing the <a href=\"#emittersetmaxlistenersn\"><code>emitter.setMaxListeners(n)</code></a> method. To change the default\nfor <em>all</em> <code>EventEmitter</code> instances, the <code>events.defaultMaxListeners</code>\nproperty can be used. If this value is not a positive number, a <code>RangeError</code>\nis thrown.</p>\n<p>Take caution when setting the <code>events.defaultMaxListeners</code> because the\nchange affects <em>all</em> <code>EventEmitter</code> instances, including those created before\nthe change is made. However, calling <a href=\"#emittersetmaxlistenersn\"><code>emitter.setMaxListeners(n)</code></a> still has\nprecedence over <code>events.defaultMaxListeners</code>.</p>\n<p>This is not a hard limit. The <code>EventEmitter</code> instance will allow\nmore listeners to be added but will output a trace warning to stderr indicating\nthat a \"possible EventEmitter memory leak\" has been detected. For any single\n<code>EventEmitter</code>, the <code>emitter.getMaxListeners()</code> and <code>emitter.setMaxListeners()</code>\nmethods can be used to temporarily avoid this warning:</p>\n<p><code>defaultMaxListeners</code> has no effect on <code>AbortSignal</code> instances. While it is\nstill possible to use <a href=\"#emittersetmaxlistenersn\"><code>emitter.setMaxListeners(n)</code></a> to set a warning limit\nfor individual <code>AbortSignal</code> instances, per default <code>AbortSignal</code> instances will not warn.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter } from 'node:events';\nconst emitter = new EventEmitter();\nemitter.setMaxListeners(emitter.getMaxListeners() + 1);\nemitter.once('event', () => {\n  // do stuff\n  emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\nconst emitter = new EventEmitter();\nemitter.setMaxListeners(emitter.getMaxListeners() + 1);\nemitter.once('event', () => {\n  // do stuff\n  emitter.setMaxListeners(Math.max(emitter.getMaxListeners() - 1, 0));\n});\n</code></pre>\n<p>The <a href=\"cli.html#--trace-warnings\"><code>--trace-warnings</code></a> command-line flag can be used to display the\nstack trace for such warnings.</p>\n<p>The emitted warning can be inspected with <a href=\"process.html#event-warning\"><code>process.on('warning')</code></a> and will\nhave the additional <code>emitter</code>, <code>type</code>, and <code>count</code> properties, referring to\nthe event emitter instance, the event's name and the number of attached\nlisteners, respectively.\nIts <code>name</code> property is set to <code>'MaxListenersExceededWarning'</code>.</p>"
        },
        {
          "textRaw": "`events.errorMonitor`",
          "name": "errorMonitor",
          "type": "property",
          "meta": {
            "added": [
              "v13.6.0",
              "v12.17.0"
            ],
            "changes": []
          },
          "desc": "<p>This symbol shall be used to install a listener for only monitoring <code>'error'</code>\nevents. Listeners installed using this symbol are called before the regular\n<code>'error'</code> listeners are called.</p>\n<p>Installing a listener using this symbol does not change the behavior once an\n<code>'error'</code> event is emitted. Therefore, the process will still crash if no\nregular <code>'error'</code> listener is installed.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "captureRejections",
          "type": "boolean",
          "meta": {
            "added": [
              "v13.4.0",
              "v12.16.0"
            ],
            "changes": [
              {
                "version": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41267",
                "description": "No longer experimental."
              }
            ]
          },
          "desc": "<p>Change the default <code>captureRejections</code> option on all new <code>EventEmitter</code> objects.</p>"
        },
        {
          "textRaw": "Type: {symbol} `Symbol.for('nodejs.rejection')`",
          "name": "captureRejectionSymbol",
          "type": "symbol",
          "meta": {
            "added": [
              "v13.4.0",
              "v12.16.0"
            ],
            "changes": [
              {
                "version": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41267",
                "description": "No longer experimental."
              }
            ]
          },
          "desc": "<p>See how to write a custom <a href=\"#emittersymbolfornodejsrejectionerr-eventname-args\">rejection handler</a>.</p>",
          "shortDesc": "`Symbol.for('nodejs.rejection')`"
        }
      ],
      "methods": [
        {
          "textRaw": "`events.getEventListeners(emitterOrTarget, eventName)`",
          "name": "getEventListeners",
          "type": "method",
          "meta": {
            "added": [
              "v15.2.0",
              "v14.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`emitterOrTarget` {EventEmitter|EventTarget}",
                  "name": "emitterOrTarget",
                  "type": "EventEmitter|EventTarget"
                },
                {
                  "textRaw": "`eventName` {string|symbol}",
                  "name": "eventName",
                  "type": "string|symbol"
                }
              ],
              "return": {
                "textRaw": "Returns: {Function[]}",
                "name": "return",
                "type": "Function[]"
              }
            }
          ],
          "desc": "<p>Returns a copy of the array of listeners for the event named <code>eventName</code>.</p>\n<p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.listeners</code> on\nthe emitter.</p>\n<p>For <code>EventTarget</code>s this is the only way to get the event listeners for the\nevent target. This is useful for debugging and diagnostic purposes.</p>\n<pre><code class=\"language-mjs\">import { getEventListeners, EventEmitter } from 'node:events';\n\n{\n  const ee = new EventEmitter();\n  const listener = () => console.log('Events are fun');\n  ee.on('foo', listener);\n  console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]\n}\n{\n  const et = new EventTarget();\n  const listener = () => console.log('Events are fun');\n  et.addEventListener('foo', listener);\n  console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { getEventListeners, EventEmitter } = require('node:events');\n\n{\n  const ee = new EventEmitter();\n  const listener = () => console.log('Events are fun');\n  ee.on('foo', listener);\n  console.log(getEventListeners(ee, 'foo')); // [ [Function: listener] ]\n}\n{\n  const et = new EventTarget();\n  const listener = () => console.log('Events are fun');\n  et.addEventListener('foo', listener);\n  console.log(getEventListeners(et, 'foo')); // [ [Function: listener] ]\n}\n</code></pre>"
        },
        {
          "textRaw": "`events.getMaxListeners(emitterOrTarget)`",
          "name": "getMaxListeners",
          "type": "method",
          "meta": {
            "added": [
              "v19.9.0",
              "v18.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`emitterOrTarget` {EventEmitter|EventTarget}",
                  "name": "emitterOrTarget",
                  "type": "EventEmitter|EventTarget"
                }
              ],
              "return": {
                "textRaw": "Returns: {number}",
                "name": "return",
                "type": "number"
              }
            }
          ],
          "desc": "<p>Returns the currently set max amount of listeners.</p>\n<p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.getMaxListeners</code> on\nthe emitter.</p>\n<p>For <code>EventTarget</code>s this is the only way to get the max event listeners for the\nevent target. If the number of event handlers on a single EventTarget exceeds\nthe max set, the EventTarget will print a warning.</p>\n<pre><code class=\"language-mjs\">import { getMaxListeners, setMaxListeners, EventEmitter } from 'node:events';\n\n{\n  const ee = new EventEmitter();\n  console.log(getMaxListeners(ee)); // 10\n  setMaxListeners(11, ee);\n  console.log(getMaxListeners(ee)); // 11\n}\n{\n  const et = new EventTarget();\n  console.log(getMaxListeners(et)); // 10\n  setMaxListeners(11, et);\n  console.log(getMaxListeners(et)); // 11\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { getMaxListeners, setMaxListeners, EventEmitter } = require('node:events');\n\n{\n  const ee = new EventEmitter();\n  console.log(getMaxListeners(ee)); // 10\n  setMaxListeners(11, ee);\n  console.log(getMaxListeners(ee)); // 11\n}\n{\n  const et = new EventTarget();\n  console.log(getMaxListeners(et)); // 10\n  setMaxListeners(11, et);\n  console.log(getMaxListeners(et)); // 11\n}\n</code></pre>"
        },
        {
          "textRaw": "`events.once(emitter, name[, options])`",
          "name": "once",
          "type": "method",
          "meta": {
            "added": [
              "v11.13.0",
              "v10.16.0"
            ],
            "changes": [
              {
                "version": "v15.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/34912",
                "description": "The `signal` option is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`emitter` {EventEmitter}",
                  "name": "emitter",
                  "type": "EventEmitter"
                },
                {
                  "textRaw": "`name` {string|symbol}",
                  "name": "name",
                  "type": "string|symbol"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`signal` {AbortSignal} Can be used to cancel waiting for the event.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "Can be used to cancel waiting for the event."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise}",
                "name": "return",
                "type": "Promise"
              }
            }
          ],
          "desc": "<p>Creates a <code>Promise</code> that is fulfilled when the <code>EventEmitter</code> emits the given\nevent or that is rejected if the <code>EventEmitter</code> emits <code>'error'</code> while waiting.\nThe <code>Promise</code> will resolve with an array of all the arguments emitted to the\ngiven event.</p>\n<p>This method is intentionally generic and works with the web platform\n<a href=\"https://dom.spec.whatwg.org/#interface-eventtarget\">EventTarget</a> interface, which has no special\n<code>'error'</code> event semantics and does not listen to the <code>'error'</code> event.</p>\n<pre><code class=\"language-mjs\">import { once, EventEmitter } from 'node:events';\nimport process from 'node:process';\n\nconst ee = new EventEmitter();\n\nprocess.nextTick(() => {\n  ee.emit('myevent', 42);\n});\n\nconst [value] = await once(ee, 'myevent');\nconsole.log(value);\n\nconst err = new Error('kaboom');\nprocess.nextTick(() => {\n  ee.emit('error', err);\n});\n\ntry {\n  await once(ee, 'myevent');\n} catch (err) {\n  console.error('error happened', err);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { once, EventEmitter } = require('node:events');\n\nasync function run() {\n  const ee = new EventEmitter();\n\n  process.nextTick(() => {\n    ee.emit('myevent', 42);\n  });\n\n  const [value] = await once(ee, 'myevent');\n  console.log(value);\n\n  const err = new Error('kaboom');\n  process.nextTick(() => {\n    ee.emit('error', err);\n  });\n\n  try {\n    await once(ee, 'myevent');\n  } catch (err) {\n    console.error('error happened', err);\n  }\n}\n\nrun();\n</code></pre>\n<p>The special handling of the <code>'error'</code> event is only used when <code>events.once()</code>\nis used to wait for another event. If <code>events.once()</code> is used to wait for the\n'<code>error'</code> event itself, then it is treated as any other kind of event without\nspecial handling:</p>\n<pre><code class=\"language-mjs\">import { EventEmitter, once } from 'node:events';\n\nconst ee = new EventEmitter();\n\nonce(ee, 'error')\n  .then(([err]) => console.log('ok', err.message))\n  .catch((err) => console.error('error', err.message));\n\nee.emit('error', new Error('boom'));\n\n// Prints: ok boom\n</code></pre>\n<pre><code class=\"language-cjs\">const { EventEmitter, once } = require('node:events');\n\nconst ee = new EventEmitter();\n\nonce(ee, 'error')\n  .then(([err]) => console.log('ok', err.message))\n  .catch((err) => console.error('error', err.message));\n\nee.emit('error', new Error('boom'));\n\n// Prints: ok boom\n</code></pre>\n<p>An <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> can be used to cancel waiting for the event:</p>\n<pre><code class=\"language-mjs\">import { EventEmitter, once } from 'node:events';\n\nconst ee = new EventEmitter();\nconst ac = new AbortController();\n\nasync function foo(emitter, event, signal) {\n  try {\n    await once(emitter, event, { signal });\n    console.log('event emitted!');\n  } catch (error) {\n    if (error.name === 'AbortError') {\n      console.error('Waiting for the event was canceled!');\n    } else {\n      console.error('There was an error', error.message);\n    }\n  }\n}\n\nfoo(ee, 'foo', ac.signal);\nac.abort(); // Prints: Waiting for the event was canceled!\n</code></pre>\n<pre><code class=\"language-cjs\">const { EventEmitter, once } = require('node:events');\n\nconst ee = new EventEmitter();\nconst ac = new AbortController();\n\nasync function foo(emitter, event, signal) {\n  try {\n    await once(emitter, event, { signal });\n    console.log('event emitted!');\n  } catch (error) {\n    if (error.name === 'AbortError') {\n      console.error('Waiting for the event was canceled!');\n    } else {\n      console.error('There was an error', error.message);\n    }\n  }\n}\n\nfoo(ee, 'foo', ac.signal);\nac.abort(); // Prints: Waiting for the event was canceled!\n</code></pre>",
          "modules": [
            {
              "textRaw": "Caveats when awaiting multiple events",
              "name": "caveats_when_awaiting_multiple_events",
              "type": "module",
              "desc": "<p>It is important to be aware of execution order when using the <code>events.once()</code>\nmethod to await multiple events.</p>\n<p>Conventional event listeners are called synchronously when the event is\nemitted. This guarantees that execution will not proceed beyond the emitted\nevent until all listeners have finished executing.</p>\n<p>The same is <em>not</em> true when awaiting Promises returned by <code>events.once()</code>.\nPromise tasks are not handled until after the current execution stack runs to\ncompletion, which means that multiple events could be emitted before\nasynchronous execution continues from the relevant <code>await</code> statement.</p>\n<p>As a result, events can be \"missed\" if a series of <code>await events.once()</code>\nstatements is used to listen to multiple events, since there might be times\nwhere more than one event is emitted during the same phase of the event loop.\n(The same is true when using <code>process.nextTick()</code> to emit events, because the\ntasks queued by <code>process.nextTick()</code> are executed before Promise tasks.)</p>\n<pre><code class=\"language-mjs\">import { EventEmitter, once } from 'node:events';\nimport process from 'node:process';\n\nconst myEE = new EventEmitter();\n\nasync function listen() {\n  await once(myEE, 'foo');\n  console.log('foo');\n\n  // This Promise will never resolve, because the 'bar' event will\n  // have already been emitted before the next line is executed.\n  await once(myEE, 'bar');\n  console.log('bar');\n}\n\nprocess.nextTick(() => {\n  myEE.emit('foo');\n  myEE.emit('bar');\n});\n\nlisten().then(() => console.log('done'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { EventEmitter, once } = require('node:events');\n\nconst myEE = new EventEmitter();\n\nasync function listen() {\n  await once(myEE, 'foo');\n  console.log('foo');\n\n  // This Promise will never resolve, because the 'bar' event will\n  // have already been emitted before the next line is executed.\n  await once(myEE, 'bar');\n  console.log('bar');\n}\n\nprocess.nextTick(() => {\n  myEE.emit('foo');\n  myEE.emit('bar');\n});\n\nlisten().then(() => console.log('done'));\n</code></pre>\n<p>To catch multiple events, create all of the Promises <em>before</em> awaiting any of\nthem. This is usually made easier by using <code>Promise.all()</code>, <code>Promise.race()</code>,\nor <code>Promise.allSettled()</code>:</p>\n<pre><code class=\"language-mjs\">import { EventEmitter, once } from 'node:events';\nimport process from 'node:process';\n\nconst myEE = new EventEmitter();\n\nasync function listen() {\n  await Promise.all([\n    once(myEE, 'foo'),\n    once(myEE, 'bar'),\n  ]);\n  console.log('foo', 'bar');\n}\n\nprocess.nextTick(() => {\n  myEE.emit('foo');\n  myEE.emit('bar');\n});\n\nlisten().then(() => console.log('done'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { EventEmitter, once } = require('node:events');\n\nconst myEE = new EventEmitter();\n\nasync function listen() {\n  await Promise.all([\n    once(myEE, 'bar'),\n    once(myEE, 'foo'),\n  ]);\n  console.log('foo', 'bar');\n}\n\nprocess.nextTick(() => {\n  myEE.emit('foo');\n  myEE.emit('bar');\n});\n\nlisten().then(() => console.log('done'));\n</code></pre>",
              "displayName": "Caveats when awaiting multiple events"
            }
          ]
        },
        {
          "textRaw": "`events.listenerCount(emitterOrTarget, eventName)`",
          "name": "listenerCount",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.12"
            ],
            "changes": [
              {
                "version": [
                  "v25.4.0",
                  "v24.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/60214",
                "description": "Now accepts EventTarget arguments."
              },
              {
                "version": [
                  "v25.4.0",
                  "v24.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/60214",
                "description": "Deprecation revoked."
              },
              {
                "version": "v3.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/2349",
                "description": "Documentation-only deprecation."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`emitterOrTarget` {EventEmitter|EventTarget}",
                  "name": "emitterOrTarget",
                  "type": "EventEmitter|EventTarget"
                },
                {
                  "textRaw": "`eventName` {string|symbol}",
                  "name": "eventName",
                  "type": "string|symbol"
                }
              ],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns the number of registered listeners for the event named <code>eventName</code>.</p>\n<p>For <code>EventEmitter</code>s this behaves exactly the same as calling <code>.listenerCount</code>\non the emitter.</p>\n<p>For <code>EventTarget</code>s this is the only way to obtain the listener count. This can\nbe useful for debugging and diagnostic purposes.</p>\n<pre><code class=\"language-mjs\">import { EventEmitter, listenerCount } from 'node:events';\n\n{\n  const ee = new EventEmitter();\n  ee.on('event', () => {});\n  ee.on('event', () => {});\n  console.log(listenerCount(ee, 'event')); // 2\n}\n{\n  const et = new EventTarget();\n  et.addEventListener('event', () => {});\n  et.addEventListener('event', () => {});\n  console.log(listenerCount(et, 'event')); // 2\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { EventEmitter, listenerCount } = require('node:events');\n\n{\n  const ee = new EventEmitter();\n  ee.on('event', () => {});\n  ee.on('event', () => {});\n  console.log(listenerCount(ee, 'event')); // 2\n}\n{\n  const et = new EventTarget();\n  et.addEventListener('event', () => {});\n  et.addEventListener('event', () => {});\n  console.log(listenerCount(et, 'event')); // 2\n}\n</code></pre>"
        },
        {
          "textRaw": "`events.on(emitter, eventName[, options])`",
          "name": "on",
          "type": "method",
          "meta": {
            "added": [
              "v13.6.0",
              "v12.16.0"
            ],
            "changes": [
              {
                "version": [
                  "v22.0.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52080",
                "description": "Support `highWaterMark` and `lowWaterMark` options, For consistency. Old options are still supported."
              },
              {
                "version": [
                  "v20.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41276",
                "description": "The `close`, `highWatermark`, and `lowWatermark` options are supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`emitter` {EventEmitter}",
                  "name": "emitter",
                  "type": "EventEmitter"
                },
                {
                  "textRaw": "`eventName` {string|symbol} The name of the event being listened for",
                  "name": "eventName",
                  "type": "string|symbol",
                  "desc": "The name of the event being listened for"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`signal` {AbortSignal} Can be used to cancel awaiting events.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "Can be used to cancel awaiting events."
                    },
                    {
                      "textRaw": "`close` {string[]} Names of events that will end the iteration.",
                      "name": "close",
                      "type": "string[]",
                      "desc": "Names of events that will end the iteration."
                    },
                    {
                      "textRaw": "`highWaterMark` {integer} **Default:** `Number.MAX_SAFE_INTEGER` The high watermark. The emitter is paused every time the size of events being buffered is higher than it. Supported only on emitters implementing `pause()` and `resume()` methods.",
                      "name": "highWaterMark",
                      "type": "integer",
                      "default": "`Number.MAX_SAFE_INTEGER` The high watermark. The emitter is paused every time the size of events being buffered is higher than it. Supported only on emitters implementing `pause()` and `resume()` methods"
                    },
                    {
                      "textRaw": "`lowWaterMark` {integer} **Default:** `1` The low watermark. The emitter is resumed every time the size of events being buffered is lower than it. Supported only on emitters implementing `pause()` and `resume()` methods.",
                      "name": "lowWaterMark",
                      "type": "integer",
                      "default": "`1` The low watermark. The emitter is resumed every time the size of events being buffered is lower than it. Supported only on emitters implementing `pause()` and `resume()` methods"
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {AsyncIterator} that iterates `eventName` events emitted by the `emitter`",
                "name": "return",
                "type": "AsyncIterator",
                "desc": "that iterates `eventName` events emitted by the `emitter`"
              }
            }
          ],
          "desc": "<pre><code class=\"language-mjs\">import { on, EventEmitter } from 'node:events';\nimport process from 'node:process';\n\nconst ee = new EventEmitter();\n\n// Emit later on\nprocess.nextTick(() => {\n  ee.emit('foo', 'bar');\n  ee.emit('foo', 42);\n});\n\nfor await (const event of on(ee, 'foo')) {\n  // The execution of this inner block is synchronous and it\n  // processes one event at a time (even with await). Do not use\n  // if concurrent execution is required.\n  console.log(event); // prints ['bar'] [42]\n}\n// Unreachable here\n</code></pre>\n<pre><code class=\"language-cjs\">const { on, EventEmitter } = require('node:events');\n\n(async () => {\n  const ee = new EventEmitter();\n\n  // Emit later on\n  process.nextTick(() => {\n    ee.emit('foo', 'bar');\n    ee.emit('foo', 42);\n  });\n\n  for await (const event of on(ee, 'foo')) {\n    // The execution of this inner block is synchronous and it\n    // processes one event at a time (even with await). Do not use\n    // if concurrent execution is required.\n    console.log(event); // prints ['bar'] [42]\n  }\n  // Unreachable here\n})();\n</code></pre>\n<p>Returns an <code>AsyncIterator</code> that iterates <code>eventName</code> events. It will throw\nif the <code>EventEmitter</code> emits <code>'error'</code>. It removes all listeners when\nexiting the loop. The <code>value</code> returned by each iteration is an array\ncomposed of the emitted event arguments.</p>\n<p>An <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> can be used to cancel waiting on events:</p>\n<pre><code class=\"language-mjs\">import { on, EventEmitter } from 'node:events';\nimport process from 'node:process';\n\nconst ac = new AbortController();\n\n(async () => {\n  const ee = new EventEmitter();\n\n  // Emit later on\n  process.nextTick(() => {\n    ee.emit('foo', 'bar');\n    ee.emit('foo', 42);\n  });\n\n  for await (const event of on(ee, 'foo', { signal: ac.signal })) {\n    // The execution of this inner block is synchronous and it\n    // processes one event at a time (even with await). Do not use\n    // if concurrent execution is required.\n    console.log(event); // prints ['bar'] [42]\n  }\n  // Unreachable here\n})();\n\nprocess.nextTick(() => ac.abort());\n</code></pre>\n<pre><code class=\"language-cjs\">const { on, EventEmitter } = require('node:events');\n\nconst ac = new AbortController();\n\n(async () => {\n  const ee = new EventEmitter();\n\n  // Emit later on\n  process.nextTick(() => {\n    ee.emit('foo', 'bar');\n    ee.emit('foo', 42);\n  });\n\n  for await (const event of on(ee, 'foo', { signal: ac.signal })) {\n    // The execution of this inner block is synchronous and it\n    // processes one event at a time (even with await). Do not use\n    // if concurrent execution is required.\n    console.log(event); // prints ['bar'] [42]\n  }\n  // Unreachable here\n})();\n\nprocess.nextTick(() => ac.abort());\n</code></pre>"
        },
        {
          "textRaw": "`events.setMaxListeners(n[, ...eventTargets])`",
          "name": "setMaxListeners",
          "type": "method",
          "meta": {
            "added": [
              "v15.4.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`n` {number} A non-negative number. The maximum number of listeners per `EventTarget` event.",
                  "name": "n",
                  "type": "number",
                  "desc": "A non-negative number. The maximum number of listeners per `EventTarget` event."
                },
                {
                  "name": "...eventTargets",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<pre><code class=\"language-mjs\">import { setMaxListeners, EventEmitter } from 'node:events';\n\nconst target = new EventTarget();\nconst emitter = new EventEmitter();\n\nsetMaxListeners(5, target, emitter);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  setMaxListeners,\n  EventEmitter,\n} = require('node:events');\n\nconst target = new EventTarget();\nconst emitter = new EventEmitter();\n\nsetMaxListeners(5, target, emitter);\n</code></pre>"
        },
        {
          "textRaw": "`events.addAbortListener(signal, listener)`",
          "name": "addAbortListener",
          "type": "method",
          "meta": {
            "added": [
              "v20.5.0",
              "v18.18.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57765",
                "description": "Change stability index for this feature from Experimental to Stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`signal` {AbortSignal}",
                  "name": "signal",
                  "type": "AbortSignal"
                },
                {
                  "textRaw": "`listener` {Function|EventListener}",
                  "name": "listener",
                  "type": "Function|EventListener"
                }
              ],
              "return": {
                "textRaw": "Returns: {Disposable} A Disposable that removes the `abort` listener.",
                "name": "return",
                "type": "Disposable",
                "desc": "A Disposable that removes the `abort` listener."
              }
            }
          ],
          "desc": "<p>Listens once to the <code>abort</code> event on the provided <code>signal</code>.</p>\n<p>Listening to the <code>abort</code> event on abort signals is unsafe and may\nlead to resource leaks since another third party with the signal can\ncall <a href=\"#eventstopimmediatepropagation\"><code>e.stopImmediatePropagation()</code></a>. Unfortunately Node.js cannot change\nthis since it would violate the web standard. Additionally, the original\nAPI makes it easy to forget to remove listeners.</p>\n<p>This API allows safely using <code>AbortSignal</code>s in Node.js APIs by solving these\ntwo issues by listening to the event such that <code>stopImmediatePropagation</code> does\nnot prevent the listener from running.</p>\n<p>Returns a disposable so that it may be unsubscribed from more easily.</p>\n<pre><code class=\"language-cjs\">const { addAbortListener } = require('node:events');\n\nfunction example(signal) {\n  signal.addEventListener('abort', (e) => e.stopImmediatePropagation());\n  // addAbortListener() returns a disposable, so the `using` keyword ensures\n  // the abort listener is automatically removed when this scope exits.\n  using _ = addAbortListener(signal, (e) => {\n    // Do something when signal is aborted.\n  });\n}\n</code></pre>\n<pre><code class=\"language-mjs\">import { addAbortListener } from 'node:events';\n\nfunction example(signal) {\n  signal.addEventListener('abort', (e) => e.stopImmediatePropagation());\n  // addAbortListener() returns a disposable, so the `using` keyword ensures\n  // the abort listener is automatically removed when this scope exits.\n  using _ = addAbortListener(signal, (e) => {\n    // Do something when signal is aborted.\n  });\n}\n</code></pre>"
        }
      ],
      "source": "doc/api/events.md"
    },
    {
      "textRaw": "File system",
      "name": "file_system",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:fs</code> module enables interacting with the file system in a\nway modeled on standard POSIX functions.</p>\n<p>To use the promise-based APIs:</p>\n<pre><code class=\"language-mjs\">import * as fs from 'node:fs/promises';\n</code></pre>\n<pre><code class=\"language-cjs\">const fs = require('node:fs/promises');\n</code></pre>\n<p>To use the callback and sync APIs:</p>\n<pre><code class=\"language-mjs\">import * as fs from 'node:fs';\n</code></pre>\n<pre><code class=\"language-cjs\">const fs = require('node:fs');\n</code></pre>\n<p>All file system operations have synchronous, callback, and promise-based\nforms, and are accessible using both CommonJS syntax and ES6 Modules (ESM).</p>",
      "modules": [
        {
          "textRaw": "Promise example",
          "name": "promise_example",
          "type": "module",
          "desc": "<p>Promise-based operations return a promise that is fulfilled when the\nasynchronous operation is complete.</p>\n<pre><code class=\"language-mjs\">import { unlink } from 'node:fs/promises';\n\ntry {\n  await unlink('/tmp/hello');\n  console.log('successfully deleted /tmp/hello');\n} catch (error) {\n  console.error('there was an error:', error.message);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { unlink } = require('node:fs/promises');\n\n(async function(path) {\n  try {\n    await unlink(path);\n    console.log(`successfully deleted ${path}`);\n  } catch (error) {\n    console.error('there was an error:', error.message);\n  }\n})('/tmp/hello');\n</code></pre>",
          "displayName": "Promise example"
        },
        {
          "textRaw": "Callback example",
          "name": "callback_example",
          "type": "module",
          "desc": "<p>The callback form takes a completion callback function as its last\nargument and invokes the operation asynchronously. The arguments passed to\nthe completion callback depend on the method, but the first argument is always\nreserved for an exception. If the operation is completed successfully, then\nthe first argument is <code>null</code> or <code>undefined</code>.</p>\n<pre><code class=\"language-mjs\">import { unlink } from 'node:fs';\n\nunlink('/tmp/hello', (err) => {\n  if (err) throw err;\n  console.log('successfully deleted /tmp/hello');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { unlink } = require('node:fs');\n\nunlink('/tmp/hello', (err) => {\n  if (err) throw err;\n  console.log('successfully deleted /tmp/hello');\n});\n</code></pre>\n<p>The callback-based versions of the <code>node:fs</code> module APIs are preferable over\nthe use of the promise APIs when maximal performance (both in terms of\nexecution time and memory allocation) is required.</p>",
          "displayName": "Callback example"
        },
        {
          "textRaw": "Synchronous example",
          "name": "synchronous_example",
          "type": "module",
          "desc": "<p>The synchronous APIs block the Node.js event loop and further JavaScript\nexecution until the operation is complete. Exceptions are thrown immediately\nand can be handled using <code>try…catch</code>, or can be allowed to bubble up.</p>\n<pre><code class=\"language-mjs\">import { unlinkSync } from 'node:fs';\n\ntry {\n  unlinkSync('/tmp/hello');\n  console.log('successfully deleted /tmp/hello');\n} catch (err) {\n  // handle the error\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { unlinkSync } = require('node:fs');\n\ntry {\n  unlinkSync('/tmp/hello');\n  console.log('successfully deleted /tmp/hello');\n} catch (err) {\n  // handle the error\n}\n</code></pre>",
          "displayName": "Synchronous example"
        },
        {
          "textRaw": "Promises API",
          "name": "promises_api",
          "type": "module",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": [
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/31553",
                "description": "Exposed as `require('fs/promises')`."
              },
              {
                "version": [
                  "v11.14.0",
                  "v10.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/26581",
                "description": "This API is no longer experimental."
              },
              {
                "version": "v10.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/20504",
                "description": "The API is accessible via `require('fs').promises` only."
              }
            ]
          },
          "desc": "<p>The <code>fs/promises</code> API provides asynchronous file system methods that return\npromises.</p>\n<p>The promise APIs use the underlying Node.js threadpool to perform file\nsystem operations off the event loop thread. These operations are not\nsynchronized or threadsafe. Care must be taken when performing multiple\nconcurrent modifications on the same file or data corruption may occur.</p>",
          "classes": [
            {
              "textRaw": "Class: `FileHandle`",
              "name": "FileHandle",
              "type": "class",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> object is an object wrapper for a numeric file descriptor.</p>\n<p>Instances of the <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> object are created by the <code>fsPromises.open()</code>\nmethod.</p>\n<p>All <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> objects are <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a>s.</p>\n<p>If a <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> is not closed using the <code>filehandle.close()</code> method, it will\ntry to automatically close the file descriptor and emit a process warning,\nhelping to prevent memory leaks. Please do not rely on this behavior because\nit can be unreliable and the file may not be closed. Instead, always explicitly\nclose <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a>s. Node.js may change this behavior in the future.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v15.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'close'</code> event is emitted when the <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has been closed and can no\nlonger be used.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`filehandle.appendFile(data[, options])`",
                  "name": "appendFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v21.1.0",
                          "v20.10.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50095",
                        "description": "The `flush` option is now supported."
                      },
                      {
                        "version": [
                          "v15.14.0",
                          "v14.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/37490",
                        "description": "The `data` argument supports `AsyncIterable`, `Iterable`, and `Stream`."
                      },
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/31030",
                        "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer|TypedArray|DataView|AsyncIterable|Stream}",
                          "name": "data",
                          "type": "string|Buffer|TypedArray|DataView|AsyncIterable|Stream"
                        },
                        {
                          "textRaw": "`options` {Object|string}",
                          "name": "options",
                          "type": "Object|string",
                          "options": [
                            {
                              "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`'utf8'`"
                            },
                            {
                              "textRaw": "`signal` {AbortSignal|undefined} allows aborting an in-progress writeFile. **Default:** `undefined`",
                              "name": "signal",
                              "type": "AbortSignal|undefined",
                              "default": "`undefined`",
                              "desc": "allows aborting an in-progress writeFile."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Alias of <a href=\"#filehandlewritefiledata-options\"><code>filehandle.writeFile()</code></a>.</p>\n<p>When operating on file handles, the mode cannot be changed from what it was set\nto with <a href=\"#fspromisesopenpath-flags-mode\"><code>fsPromises.open()</code></a>. Therefore, this is equivalent to\n<a href=\"#filehandlewritefiledata-options\"><code>filehandle.writeFile()</code></a>.</p>"
                },
                {
                  "textRaw": "`filehandle.chmod(mode)`",
                  "name": "chmod",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`mode` {integer} the file mode bit mask.",
                          "name": "mode",
                          "type": "integer",
                          "desc": "the file mode bit mask."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Modifies the permissions on the file. See <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a>.</p>"
                },
                {
                  "textRaw": "`filehandle.chown(uid, gid)`",
                  "name": "chown",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`uid` {integer} The file's new owner's user id.",
                          "name": "uid",
                          "type": "integer",
                          "desc": "The file's new owner's user id."
                        },
                        {
                          "textRaw": "`gid` {integer} The file's new group's group id.",
                          "name": "gid",
                          "type": "integer",
                          "desc": "The file's new group's group id."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Changes the ownership of the file. A wrapper for <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a>.</p>"
                },
                {
                  "textRaw": "`filehandle.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Closes the file handle after waiting for any pending operation on the handle to\ncomplete.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet filehandle;\ntry {\n  filehandle = await open('thefile.txt', 'r');\n} finally {\n  await filehandle?.close();\n}\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.createReadStream([options])`",
                  "name": "createReadStream",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.11.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`encoding` {string} **Default:** `null`",
                              "name": "encoding",
                              "type": "string",
                              "default": "`null`"
                            },
                            {
                              "textRaw": "`autoClose` {boolean} **Default:** `true`",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`emitClose` {boolean} **Default:** `true`",
                              "name": "emitClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`start` {integer}",
                              "name": "start",
                              "type": "integer"
                            },
                            {
                              "textRaw": "`end` {integer} **Default:** `Infinity`",
                              "name": "end",
                              "type": "integer",
                              "default": "`Infinity`"
                            },
                            {
                              "textRaw": "`highWaterMark` {integer} **Default:** `64 * 1024`",
                              "name": "highWaterMark",
                              "type": "integer",
                              "default": "`64 * 1024`"
                            },
                            {
                              "textRaw": "`signal` {AbortSignal|undefined} **Default:** `undefined`",
                              "name": "signal",
                              "type": "AbortSignal|undefined",
                              "default": "`undefined`"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {fs.ReadStream}",
                        "name": "return",
                        "type": "fs.ReadStream"
                      }
                    }
                  ],
                  "desc": "<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from\nthe file instead of the entire file. Both <code>start</code> and <code>end</code> are inclusive and\nstart counting at 0, allowed values are in the\n[0, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>] range. If <code>start</code> is\nomitted or <code>undefined</code>, <code>filehandle.createReadStream()</code> reads sequentially from\nthe current file position. The <code>encoding</code> can be any one of those accepted by\n<a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If the <code>FileHandle</code> points to a character device that only supports blocking\nreads (such as keyboard or sound card), read operations do not finish until data\nis available. This can prevent the process from exiting and the stream from\nclosing naturally.</p>\n<p>By default, the stream will emit a <code>'close'</code> event after it has been\ndestroyed.  Set the <code>emitClose</code> option to <code>false</code> to change this behavior.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nconst fd = await open('/dev/input/event0');\n// Create a stream from some character device.\nconst stream = fd.createReadStream();\nsetTimeout(() => {\n  stream.close(); // This may not close the stream.\n  // Artificially marking end-of-stream, as if the underlying resource had\n  // indicated end-of-file by itself, allows the stream to close.\n  // This does not cancel pending read operations, and if there is such an\n  // operation, the process may still not be able to exit successfully\n  // until it finishes.\n  stream.push(null);\n  stream.read(0);\n}, 100);\n</code></pre>\n<p>If <code>autoClose</code> is false, then the file descriptor won't be closed, even if\nthere's an error. It is the application's responsibility to close it and make\nsure there's no file descriptor leak. If <code>autoClose</code> is set to true (default\nbehavior), on <code>'error'</code> or <code>'end'</code> the file descriptor will be closed\nautomatically.</p>\n<p>An example to read the last 10 bytes of a file which is 100 bytes long:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nconst fd = await open('sample.txt');\nfd.createReadStream({ start: 90, end: 99 });\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.createWriteStream([options])`",
                  "name": "createWriteStream",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.11.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v21.0.0",
                          "v20.10.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50093",
                        "description": "The `flush` option is now supported."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string",
                              "default": "`'utf8'`"
                            },
                            {
                              "textRaw": "`autoClose` {boolean} **Default:** `true`",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`emitClose` {boolean} **Default:** `true`",
                              "name": "emitClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`start` {integer}",
                              "name": "start",
                              "type": "integer"
                            },
                            {
                              "textRaw": "`highWaterMark` {number} **Default:** `16384`",
                              "name": "highWaterMark",
                              "type": "number",
                              "default": "`16384`"
                            },
                            {
                              "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                              "name": "flush",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {fs.WriteStream}",
                        "name": "return",
                        "type": "fs.WriteStream"
                      }
                    }
                  ],
                  "desc": "<p><code>options</code> may also include a <code>start</code> option to allow writing data at some\nposition past the beginning of the file, allowed values are in the\n[0, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>] range. Modifying a file rather than\nreplacing it may require the <code>flags</code> <code>open</code> option to be set to <code>r+</code> rather than\nthe default <code>r</code>. The <code>encoding</code> can be any one of those accepted by <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If <code>autoClose</code> is set to true (default behavior) on <code>'error'</code> or <code>'finish'</code>\nthe file descriptor will be closed automatically. If <code>autoClose</code> is false,\nthen the file descriptor won't be closed, even if there's an error.\nIt is the application's responsibility to close it and make sure there's no\nfile descriptor leak.</p>\n<p>By default, the stream will emit a <code>'close'</code> event after it has been\ndestroyed.  Set the <code>emitClose</code> option to <code>false</code> to change this behavior.</p>"
                },
                {
                  "textRaw": "`filehandle.datasync()`",
                  "name": "datasync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Forces all currently queued I/O operations associated with the file to the\noperating system's synchronized I/O completion state. Refer to the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a> documentation for details.</p>\n<p>Unlike <code>filehandle.sync</code> this method does not flush modified metadata.</p>"
                },
                {
                  "textRaw": "`filehandle.pull([...transforms][, options])`",
                  "name": "pull",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`...transforms` {Function|Object} Optional transforms to apply via `stream/iter pull()`.",
                          "name": "...transforms",
                          "type": "Function|Object",
                          "desc": "Optional transforms to apply via `stream/iter pull()`.",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal}",
                              "name": "signal",
                              "type": "AbortSignal"
                            },
                            {
                              "textRaw": "`autoClose` {boolean} Close the file handle when the stream ends. **Default:** `false`.",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Close the file handle when the stream ends."
                            },
                            {
                              "textRaw": "`start` {number} Byte offset to begin reading from. When specified, reads use explicit positioning (`pread` semantics). **Default:** current file position.",
                              "name": "start",
                              "type": "number",
                              "default": "current file position",
                              "desc": "Byte offset to begin reading from. When specified, reads use explicit positioning (`pread` semantics)."
                            },
                            {
                              "textRaw": "`limit` {number} Maximum number of bytes to read before ending the iterator. Reads stop when `limit` bytes have been delivered or EOF is reached, whichever comes first. **Default:** read until EOF.",
                              "name": "limit",
                              "type": "number",
                              "default": "read until EOF",
                              "desc": "Maximum number of bytes to read before ending the iterator. Reads stop when `limit` bytes have been delivered or EOF is reached, whichever comes first."
                            },
                            {
                              "textRaw": "`chunkSize` {number} Size in bytes of the buffer allocated for each read operation. **Default:** `131072` (128 KB).",
                              "name": "chunkSize",
                              "type": "number",
                              "default": "`131072` (128 KB)",
                              "desc": "Size in bytes of the buffer allocated for each read operation."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {AsyncIterable<Uint8Array[]>}",
                        "name": "return",
                        "type": "AsyncIterable<Uint8Array[]>"
                      }
                    }
                  ],
                  "desc": "<p>Return the file contents as an async iterable using the\n<a href=\"stream_iter.html\"><code>node:stream/iter</code></a> pull model. Reads are performed in <code>chunkSize</code>-byte\nchunks (default 128 KB). If transforms are provided, they are applied\nvia <a href=\"stream_iter.html#pullsource-transforms-options\"><code>stream/iter pull()</code></a>.</p>\n<p>The file handle is locked while the iterable is being consumed and unlocked\nwhen iteration completes, an error occurs, or the consumer breaks.</p>\n<p>This function is only available when the <code>--experimental-stream-iter</code> flag is\nenabled.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { text } from 'node:stream/iter';\nimport { compressGzip } from 'node:zlib/iter';\n\nconst fh = await open('input.txt', 'r');\n\n// Read as text\nconsole.log(await text(fh.pull({ autoClose: true })));\n\n// Read 1 KB starting at byte 100\nconst fh2 = await open('input.txt', 'r');\nconsole.log(await text(fh2.pull({ start: 100, limit: 1024, autoClose: true })));\n\n// Read with compression\nconst fh3 = await open('input.txt', 'r');\nconst compressed = fh3.pull(compressGzip(), { autoClose: true });\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\nconst { text } = require('node:stream/iter');\nconst { compressGzip } = require('node:zlib/iter');\n\nasync function run() {\n  const fh = await open('input.txt', 'r');\n\n  // Read as text\n  console.log(await text(fh.pull({ autoClose: true })));\n\n  // Read 1 KB starting at byte 100\n  const fh2 = await open('input.txt', 'r');\n  console.log(await text(fh2.pull({ start: 100, limit: 1024, autoClose: true })));\n\n  // Read with compression\n  const fh3 = await open('input.txt', 'r');\n  const compressed = fh3.pull(compressGzip(), { autoClose: true });\n}\n\nrun().catch(console.error);\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.pullSync([...transforms][, options])`",
                  "name": "pullSync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`...transforms` {Function|Object} Optional transforms to apply via `stream/iter pullSync()`.",
                          "name": "...transforms",
                          "type": "Function|Object",
                          "desc": "Optional transforms to apply via `stream/iter pullSync()`.",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`autoClose` {boolean} Close the file handle when the stream ends. **Default:** `false`.",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Close the file handle when the stream ends."
                            },
                            {
                              "textRaw": "`start` {number} Byte offset to begin reading from. When specified, reads use explicit positioning. **Default:** current file position.",
                              "name": "start",
                              "type": "number",
                              "default": "current file position",
                              "desc": "Byte offset to begin reading from. When specified, reads use explicit positioning."
                            },
                            {
                              "textRaw": "`limit` {number} Maximum number of bytes to read before ending the iterator. **Default:** read until EOF.",
                              "name": "limit",
                              "type": "number",
                              "default": "read until EOF",
                              "desc": "Maximum number of bytes to read before ending the iterator."
                            },
                            {
                              "textRaw": "`chunkSize` {number} Size in bytes of the buffer allocated for each read operation. **Default:** `131072` (128 KB).",
                              "name": "chunkSize",
                              "type": "number",
                              "default": "`131072` (128 KB)",
                              "desc": "Size in bytes of the buffer allocated for each read operation."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Iterable<Uint8Array[]>}",
                        "name": "return",
                        "type": "Iterable<Uint8Array[]>"
                      }
                    }
                  ],
                  "desc": "<p>Synchronous counterpart of <a href=\"#filehandlepulltransforms-options\"><code>filehandle.pull()</code></a>. Returns a sync iterable\nthat reads the file using synchronous I/O on the main thread. Reads are\nperformed in <code>chunkSize</code>-byte chunks (default 128 KB).</p>\n<p>The file handle is locked while the iterable is being consumed. Unlike the\nasync <code>pull()</code>, this method does not support <code>AbortSignal</code> since all\noperations are synchronous.</p>\n<p>This function is only available when the <code>--experimental-stream-iter</code> flag is\nenabled.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { textSync, pipeToSync } from 'node:stream/iter';\nimport { compressGzipSync, decompressGzipSync } from 'node:zlib/iter';\n\nconst fh = await open('input.txt', 'r');\n\n// Read as text (sync)\nconsole.log(textSync(fh.pullSync({ autoClose: true })));\n\n// Sync compress pipeline: file -> gzip -> file\nconst src = await open('input.txt', 'r');\nconst dst = await open('output.gz', 'w');\npipeToSync(src.pullSync(compressGzipSync(), { autoClose: true }), dst.writer({ autoClose: true }));\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\nconst { textSync, pipeToSync } = require('node:stream/iter');\nconst { compressGzipSync, decompressGzipSync } = require('node:zlib/iter');\n\nasync function run() {\n  const fh = await open('input.txt', 'r');\n\n  // Read as text (sync)\n  console.log(textSync(fh.pullSync({ autoClose: true })));\n\n  // Sync compress pipeline: file -> gzip -> file\n  const src = await open('input.txt', 'r');\n  const dst = await open('output.gz', 'w');\n  pipeToSync(\n    src.pullSync(compressGzipSync(), { autoClose: true }),\n    dst.writer({ autoClose: true }),\n  );\n}\n\nrun().catch(console.error);\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.read(buffer, offset, length, position)`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v21.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/42835",
                        "description": "Accepts bigint values as `position`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the file data read.",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView",
                          "desc": "A buffer that will be filled with the file data read."
                        },
                        {
                          "textRaw": "`offset` {integer} The location in the buffer at which to start filling. **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "The location in the buffer at which to start filling."
                        },
                        {
                          "textRaw": "`length` {integer} The number of bytes to read. **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`",
                          "desc": "The number of bytes to read."
                        },
                        {
                          "textRaw": "`position` {integer|bigint|null} The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged. **Default:** `null`",
                          "name": "position",
                          "type": "integer|bigint|null",
                          "default": "`null`",
                          "desc": "The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon success with an object with two properties:",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon success with an object with two properties:",
                        "options": [
                          {
                            "textRaw": "`bytesRead` {integer} The number of bytes read",
                            "name": "bytesRead",
                            "type": "integer",
                            "desc": "The number of bytes read"
                          },
                          {
                            "textRaw": "`buffer` {Buffer|TypedArray|DataView} A reference to the passed in `buffer` argument.",
                            "name": "buffer",
                            "type": "Buffer|TypedArray|DataView",
                            "desc": "A reference to the passed in `buffer` argument."
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Reads data from the file and stores that in the given buffer.</p>\n<p>If the file is not modified concurrently, the end-of-file is reached when the\nnumber of bytes read is zero.</p>"
                },
                {
                  "textRaw": "`filehandle.read([options])`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v13.11.0",
                      "v12.17.0"
                    ],
                    "changes": [
                      {
                        "version": "v21.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/42835",
                        "description": "Accepts bigint values as `position`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the file data read. **Default:** `Buffer.alloc(16384)`",
                              "name": "buffer",
                              "type": "Buffer|TypedArray|DataView",
                              "default": "`Buffer.alloc(16384)`",
                              "desc": "A buffer that will be filled with the file data read."
                            },
                            {
                              "textRaw": "`offset` {integer} The location in the buffer at which to start filling. **Default:** `0`",
                              "name": "offset",
                              "type": "integer",
                              "default": "`0`",
                              "desc": "The location in the buffer at which to start filling."
                            },
                            {
                              "textRaw": "`length` {integer} The number of bytes to read. **Default:** `buffer.byteLength - offset`",
                              "name": "length",
                              "type": "integer",
                              "default": "`buffer.byteLength - offset`",
                              "desc": "The number of bytes to read."
                            },
                            {
                              "textRaw": "`position` {integer|bigint|null} The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged. **Default:**: `null`",
                              "name": "position",
                              "type": "integer|bigint|null",
                              "default": ": `null`",
                              "desc": "The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon success with an object with two properties:",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon success with an object with two properties:",
                        "options": [
                          {
                            "textRaw": "`bytesRead` {integer} The number of bytes read",
                            "name": "bytesRead",
                            "type": "integer",
                            "desc": "The number of bytes read"
                          },
                          {
                            "textRaw": "`buffer` {Buffer|TypedArray|DataView} A reference to the passed in `buffer` argument.",
                            "name": "buffer",
                            "type": "Buffer|TypedArray|DataView",
                            "desc": "A reference to the passed in `buffer` argument."
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Reads data from the file and stores that in the given buffer.</p>\n<p>If the file is not modified concurrently, the end-of-file is reached when the\nnumber of bytes read is zero.</p>"
                },
                {
                  "textRaw": "`filehandle.read(buffer[, options])`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.2.0",
                      "v16.17.0"
                    ],
                    "changes": [
                      {
                        "version": "v21.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/42835",
                        "description": "Accepts bigint values as `position`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView} A buffer that will be filled with the file data read.",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView",
                          "desc": "A buffer that will be filled with the file data read."
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`offset` {integer} The location in the buffer at which to start filling. **Default:** `0`",
                              "name": "offset",
                              "type": "integer",
                              "default": "`0`",
                              "desc": "The location in the buffer at which to start filling."
                            },
                            {
                              "textRaw": "`length` {integer} The number of bytes to read. **Default:** `buffer.byteLength - offset`",
                              "name": "length",
                              "type": "integer",
                              "default": "`buffer.byteLength - offset`",
                              "desc": "The number of bytes to read."
                            },
                            {
                              "textRaw": "`position` {integer|bigint|null} The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged. **Default:**: `null`",
                              "name": "position",
                              "type": "integer|bigint|null",
                              "default": ": `null`",
                              "desc": "The location where to begin reading data from the file. If `null` or `-1`, data will be read from the current file position, and the position will be updated. If `position` is a non-negative integer, the current file position will remain unchanged."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon success with an object with two properties:",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon success with an object with two properties:",
                        "options": [
                          {
                            "textRaw": "`bytesRead` {integer} The number of bytes read",
                            "name": "bytesRead",
                            "type": "integer",
                            "desc": "The number of bytes read"
                          },
                          {
                            "textRaw": "`buffer` {Buffer|TypedArray|DataView} A reference to the passed in `buffer` argument.",
                            "name": "buffer",
                            "type": "Buffer|TypedArray|DataView",
                            "desc": "A reference to the passed in `buffer` argument."
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Reads data from the file and stores that in the given buffer.</p>\n<p>If the file is not modified concurrently, the end-of-file is reached when the\nnumber of bytes read is zero.</p>"
                },
                {
                  "textRaw": "`filehandle.readableWebStream([options])`",
                  "name": "readableWebStream",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.0.0",
                          "v22.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/57513",
                        "description": "Marking the API stable."
                      },
                      {
                        "version": [
                          "v23.8.0",
                          "v22.15.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/55461",
                        "description": "Removed option to create a 'bytes' stream. Streams are now always 'bytes' streams."
                      },
                      {
                        "version": [
                          "v20.0.0",
                          "v18.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/46933",
                        "description": "Added option to create a 'bytes' stream."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`autoClose` {boolean} When true, causes the {FileHandle} to be closed when the stream is closed. **Default:** `false`",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "When true, causes the {FileHandle} to be closed when the stream is closed."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {ReadableStream}",
                        "name": "return",
                        "type": "ReadableStream"
                      }
                    }
                  ],
                  "desc": "<p>Returns a byte-oriented <code>ReadableStream</code> that may be used to read the file's\ncontents.</p>\n<p>An error will be thrown if this method is called more than once or is called\nafter the <code>FileHandle</code> is closed or closing.</p>\n<pre><code class=\"language-mjs\">import {\n  open,\n} from 'node:fs/promises';\n\nconst file = await open('./some/file/to/read');\n\nfor await (const chunk of file.readableWebStream())\n  console.log(chunk);\n\nawait file.close();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  open,\n} = require('node:fs/promises');\n\n(async () => {\n  const file = await open('./some/file/to/read');\n\n  for await (const chunk of file.readableWebStream())\n    console.log(chunk);\n\n  await file.close();\n})();\n</code></pre>\n<p>While the <code>ReadableStream</code> will read the file to completion, it will not\nclose the <code>FileHandle</code> automatically. User code must still call the\n<code>fileHandle.close()</code> method unless the <code>autoClose</code> option is set to <code>true</code>.</p>"
                },
                {
                  "textRaw": "`filehandle.readFile(options)`",
                  "name": "readFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object|string}",
                          "name": "options",
                          "type": "Object|string",
                          "options": [
                            {
                              "textRaw": "`encoding` {string|null} **Default:** `null`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`null`"
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} allows aborting an in-progress readFile",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "allows aborting an in-progress readFile"
                            }
                          ]
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the data will be a string.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon a successful read with the contents of the file. If no encoding is specified (using `options.encoding`), the data is returned as a {Buffer} object. Otherwise, the data will be a string."
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously reads the entire contents of a file.</p>\n<p>If <code>options</code> is a string, then it specifies the <code>encoding</code>.</p>\n<p>The <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has to support reading.</p>\n<p>If one or more <code>filehandle.read()</code> calls are made on a file handle and then a\n<code>filehandle.readFile()</code> call is made, the data will be read from the current\nposition till the end of the file. It doesn't always read from the beginning\nof the file.</p>"
                },
                {
                  "textRaw": "`filehandle.readLines([options])`",
                  "name": "readLines",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.11.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`encoding` {string} **Default:** `null`",
                              "name": "encoding",
                              "type": "string",
                              "default": "`null`"
                            },
                            {
                              "textRaw": "`autoClose` {boolean} **Default:** `true`",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`emitClose` {boolean} **Default:** `true`",
                              "name": "emitClose",
                              "type": "boolean",
                              "default": "`true`"
                            },
                            {
                              "textRaw": "`start` {integer}",
                              "name": "start",
                              "type": "integer"
                            },
                            {
                              "textRaw": "`end` {integer} **Default:** `Infinity`",
                              "name": "end",
                              "type": "integer",
                              "default": "`Infinity`"
                            },
                            {
                              "textRaw": "`highWaterMark` {integer} **Default:** `64 * 1024`",
                              "name": "highWaterMark",
                              "type": "integer",
                              "default": "`64 * 1024`"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {readline.InterfaceConstructor}",
                        "name": "return",
                        "type": "readline.InterfaceConstructor"
                      }
                    }
                  ],
                  "desc": "<p>Convenience method to create a <code>readline</code> interface and stream over the file.\nSee <a href=\"#filehandlecreatereadstreamoptions\"><code>filehandle.createReadStream()</code></a> for the options.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nconst file = await open('./some/file/to/read');\n\nfor await (const line of file.readLines()) {\n  console.log(line);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\n\n(async () => {\n  const file = await open('./some/file/to/read');\n\n  for await (const line of file.readLines()) {\n    console.log(line);\n  }\n})();\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle.readv(buffers[, position])`",
                  "name": "readv",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v13.13.0",
                      "v12.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffers` {Buffer[]|TypedArray[]|DataView[]}",
                          "name": "buffers",
                          "type": "Buffer[]|TypedArray[]|DataView[]"
                        },
                        {
                          "textRaw": "`position` {integer|null} The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position. **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`",
                          "desc": "The offset from the beginning of the file where the data should be read from. If `position` is not a `number`, the data will be read from the current position.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills upon success an object containing two properties:",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills upon success an object containing two properties:",
                        "options": [
                          {
                            "textRaw": "`bytesRead` {integer} the number of bytes read",
                            "name": "bytesRead",
                            "type": "integer",
                            "desc": "the number of bytes read"
                          },
                          {
                            "textRaw": "`buffers` {Buffer[]|TypedArray[]|DataView[]} property containing a reference to the `buffers` input.",
                            "name": "buffers",
                            "type": "Buffer[]|TypedArray[]|DataView[]",
                            "desc": "property containing a reference to the `buffers` input."
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Read from a file and write to an array of {ArrayBufferView}s</p>"
                },
                {
                  "textRaw": "`filehandle.stat([options])`",
                  "name": "stat",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v26.1.0",
                        "pr-url": "https://github.com/nodejs/node/pull/57775",
                        "description": "Now accepts an additional `signal` property to allow aborting the operation."
                      },
                      {
                        "version": "v10.5.0",
                        "pr-url": "https://github.com/nodejs/node/pull/20220",
                        "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                              "name": "bigint",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} An AbortSignal to cancel the operation. **Default:** `undefined`.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "default": "`undefined`",
                              "desc": "An AbortSignal to cancel the operation."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with an {fs.Stats} for the file.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with an {fs.Stats} for the file."
                      }
                    }
                  ]
                },
                {
                  "textRaw": "`filehandle.sync()`",
                  "name": "sync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Request that all data for the open file descriptor is flushed to the storage\ndevice. The specific implementation is operating system and device specific.\nRefer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a> documentation for more detail.</p>"
                },
                {
                  "textRaw": "`filehandle.truncate(len)`",
                  "name": "truncate",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`len` {integer} **Default:** `0`",
                          "name": "len",
                          "type": "integer",
                          "default": "`0`"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` upon success."
                      }
                    }
                  ],
                  "desc": "<p>Truncates the file.</p>\n<p>If the file was larger than <code>len</code> bytes, only the first <code>len</code> bytes will be\nretained in the file.</p>\n<p>The following example retains only the first four bytes of the file:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet filehandle = null;\ntry {\n  filehandle = await open('temp.txt', 'r+');\n  await filehandle.truncate(4);\n} finally {\n  await filehandle?.close();\n}\n</code></pre>\n<p>If the file previously was shorter than <code>len</code> bytes, it is extended, and the\nextended part is filled with null bytes (<code>'\\0'</code>):</p>\n<p>If <code>len</code> is negative then <code>0</code> will be used.</p>"
                },
                {
                  "textRaw": "`filehandle.utimes(atime, mtime)`",
                  "name": "utimes",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`atime` {number|string|Date}",
                          "name": "atime",
                          "type": "number|string|Date"
                        },
                        {
                          "textRaw": "`mtime` {number|string|Date}",
                          "name": "mtime",
                          "type": "number|string|Date"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Change the file system timestamps of the object referenced by the <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a>\nthen fulfills the promise with no arguments upon success.</p>"
                },
                {
                  "textRaw": "`filehandle.write(buffer, offset[, length[, position]])`",
                  "name": "write",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/31030",
                        "description": "The `buffer` parameter won't coerce unsupported input to buffers anymore."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`offset` {integer} The start position from within `buffer` where the data to write begins.",
                          "name": "offset",
                          "type": "integer",
                          "desc": "The start position from within `buffer` where the data to write begins."
                        },
                        {
                          "textRaw": "`length` {integer} The number of bytes from `buffer` to write. **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`",
                          "desc": "The number of bytes from `buffer` to write.",
                          "optional": true
                        },
                        {
                          "textRaw": "`position` {integer|null} The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. See the POSIX `pwrite(2)` documentation for more detail. **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`",
                          "desc": "The offset from the beginning of the file where the data from `buffer` should be written. If `position` is not a `number`, the data will be written at the current position. See the POSIX `pwrite(2)` documentation for more detail.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write <code>buffer</code> to the file.</p>\n<p>The promise is fulfilled with an object containing two properties:</p>\n<ul>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> the number of bytes written</li>\n<li><code>buffer</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> a reference to the <code>buffer</code> written.</li>\n</ul>\n<p>It is unsafe to use <code>filehandle.write()</code> multiple times on the same file\nwithout waiting for the promise to be fulfilled (or rejected). For this\nscenario, use <a href=\"#filehandlecreatewritestreamoptions\"><code>filehandle.createWriteStream()</code></a>.</p>\n<p>On Linux, positional writes do not work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
                },
                {
                  "textRaw": "`filehandle.write(buffer[, options])`",
                  "name": "write",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.3.0",
                      "v16.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`offset` {integer} **Default:** `0`",
                              "name": "offset",
                              "type": "integer",
                              "default": "`0`"
                            },
                            {
                              "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                              "name": "length",
                              "type": "integer",
                              "default": "`buffer.byteLength - offset`"
                            },
                            {
                              "textRaw": "`position` {integer|null} **Default:** `null`",
                              "name": "position",
                              "type": "integer|null",
                              "default": "`null`"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write <code>buffer</code> to the file.</p>\n<p>Similar to the above <code>filehandle.write</code> function, this version takes an\noptional <code>options</code> object. If no <code>options</code> object is specified, it will\ndefault with the above values.</p>"
                },
                {
                  "textRaw": "`filehandle.write(string[, position[, encoding]])`",
                  "name": "write",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/31030",
                        "description": "The `string` parameter won't coerce unsupported input to strings anymore."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`string` {string}",
                          "name": "string",
                          "type": "string"
                        },
                        {
                          "textRaw": "`position` {integer|null} The offset from the beginning of the file where the data from `string` should be written. If `position` is not a `number` the data will be written at the current position. See the POSIX `pwrite(2)` documentation for more detail. **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`",
                          "desc": "The offset from the beginning of the file where the data from `string` should be written. If `position` is not a `number` the data will be written at the current position. See the POSIX `pwrite(2)` documentation for more detail.",
                          "optional": true
                        },
                        {
                          "textRaw": "`encoding` {string} The expected string encoding. **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`",
                          "desc": "The expected string encoding.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write <code>string</code> to the file. If <code>string</code> is not a string, the promise is\nrejected with an error.</p>\n<p>The promise is fulfilled with an object containing two properties:</p>\n<ul>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> the number of bytes written</li>\n<li><code>buffer</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> a reference to the <code>string</code> written.</li>\n</ul>\n<p>It is unsafe to use <code>filehandle.write()</code> multiple times on the same file\nwithout waiting for the promise to be fulfilled (or rejected). For this\nscenario, use <a href=\"#filehandlecreatewritestreamoptions\"><code>filehandle.createWriteStream()</code></a>.</p>\n<p>On Linux, positional writes do not work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
                },
                {
                  "textRaw": "`filehandle.writeFile(data, options)`",
                  "name": "writeFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v15.14.0",
                          "v14.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/37490",
                        "description": "The `data` argument supports `AsyncIterable`, `Iterable`, and `Stream`."
                      },
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/31030",
                        "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer|TypedArray|DataView|AsyncIterable|Stream}",
                          "name": "data",
                          "type": "string|Buffer|TypedArray|DataView|AsyncIterable|Stream"
                        },
                        {
                          "textRaw": "`options` {Object|string}",
                          "name": "options",
                          "type": "Object|string",
                          "options": [
                            {
                              "textRaw": "`encoding` {string|null} The expected character encoding when `data` is a string. **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`'utf8'`",
                              "desc": "The expected character encoding when `data` is a string."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal|undefined} allows aborting an in-progress writeFile. **Default:** `undefined`",
                              "name": "signal",
                              "type": "AbortSignal|undefined",
                              "default": "`undefined`",
                              "desc": "allows aborting an in-progress writeFile."
                            }
                          ]
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously writes data to a file, replacing the file if it already exists.\n<code>data</code> can be a string, a buffer, an <a href=\"https://tc39.github.io/ecma262/#sec-asynciterable-interface\"><code>&#x3C;AsyncIterable></code></a>, or an {Iterable} object.\nThe promise is fulfilled with no arguments upon success.</p>\n<p>If <code>options</code> is a string, then it specifies the <code>encoding</code>.</p>\n<p>The <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has to support writing.</p>\n<p>It is unsafe to use <code>filehandle.writeFile()</code> multiple times on the same file\nwithout waiting for the promise to be fulfilled (or rejected).</p>\n<p>If one or more <code>filehandle.write()</code> calls are made on a file handle and then a\n<code>filehandle.writeFile()</code> call is made, the data will be written from the\ncurrent position till the end of the file. It doesn't always write from the\nbeginning of the file.</p>"
                },
                {
                  "textRaw": "`filehandle.writev(buffers[, position])`",
                  "name": "writev",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.9.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffers` {Buffer[]|TypedArray[]|DataView[]}",
                          "name": "buffers",
                          "type": "Buffer[]|TypedArray[]|DataView[]"
                        },
                        {
                          "textRaw": "`position` {integer|null} The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current position. **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`",
                          "desc": "The offset from the beginning of the file where the data from `buffers` should be written. If `position` is not a `number`, the data will be written at the current position.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write an array of {ArrayBufferView}s to the file.</p>\n<p>The promise is fulfilled with an object containing a two properties:</p>\n<ul>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> the number of bytes written</li>\n<li><code>buffers</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer[]></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray[]></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView[]></code></a> a reference to the <code>buffers</code>\ninput.</li>\n</ul>\n<p>It is unsafe to call <code>writev()</code> multiple times on the same file without waiting\nfor the promise to be fulfilled (or rejected).</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
                },
                {
                  "textRaw": "`filehandle.writer([options])`",
                  "name": "writer",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "stability": 1,
                  "stabilityText": "Experimental",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`autoClose` {boolean} Close the file handle when the writer ends or fails. **Default:** `false`.",
                              "name": "autoClose",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "Close the file handle when the writer ends or fails."
                            },
                            {
                              "textRaw": "`start` {number} Byte offset to start writing at. When specified, writes use explicit positioning. **Default:** current file position.",
                              "name": "start",
                              "type": "number",
                              "default": "current file position",
                              "desc": "Byte offset to start writing at. When specified, writes use explicit positioning."
                            },
                            {
                              "textRaw": "`limit` {number} Maximum number of bytes the writer will accept. Async writes (`write()`, `writev()`) that would exceed the limit reject with `ERR_OUT_OF_RANGE`. Sync writes (`writeSync()`, `writevSync()`) return `false`. **Default:** no limit.",
                              "name": "limit",
                              "type": "number",
                              "default": "no limit",
                              "desc": "Maximum number of bytes the writer will accept. Async writes (`write()`, `writev()`) that would exceed the limit reject with `ERR_OUT_OF_RANGE`. Sync writes (`writeSync()`, `writevSync()`) return `false`."
                            },
                            {
                              "textRaw": "`chunkSize` {number} Maximum chunk size in bytes for synchronous write operations. Writes larger than this threshold fall back to async I/O. Set this to match the reader's `chunkSize` for optimal `pipeTo()` performance. **Default:** `131072` (128 KB).",
                              "name": "chunkSize",
                              "type": "number",
                              "default": "`131072` (128 KB)",
                              "desc": "Maximum chunk size in bytes for synchronous write operations. Writes larger than this threshold fall back to async I/O. Set this to match the reader's `chunkSize` for optimal `pipeTo()` performance."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Object}`write(chunk[, options])` {Function} Returns {Promise}. Accepts `Uint8Array`, `Buffer`, or string (UTF-8 encoded).`chunk` {Buffer|TypedArray|DataView|string}`options` {Object}`signal` {AbortSignal} If the signal is already aborted, the write rejects with `AbortError` without performing I/O.`writev(chunks[, options])` {Function} Returns {Promise}. Uses scatter/gather I/O via a single `writev()` syscall. Accepts mixed `Uint8Array`/string arrays.`chunks` {Buffer[]|TypedArray[]|DataView[]|string[]}`options` {Object}`signal` {AbortSignal} If the signal is already aborted, the write rejects with `AbortError` without performing I/O.`writeSync(chunk)` {Function} Returns {boolean}. Attempts a synchronous write. Returns `true` if the write succeeded, `false` if the caller should fall back to async `write()`. Returns `false` when: the writer is closed/errored, an async operation is in flight, the chunk exceeds `chunkSize`, or the write would exceed `limit`.`chunk` {Buffer|TypedArray|DataView|string}`writevSync(chunks)` {Function} Returns {boolean}. Synchronous batch write. Same fallback semantics as `writeSync()`.`chunks` {Buffer[]|TypedArray[]|DataView[]|string[]}`end([options])` {Function} Returns {Promise}, fulfills with the total number of bytes written. Idempotent: returns `totalBytesWritten` if already closed, returns the pending promise if already closing. Rejects if the writer is in an errored state.`options` {Object}`signal` {AbortSignal} If the signal is already aborted, `end()` rejects with `AbortError` and the writer remains open.`endSync()` {Function} Returns {number|number} total bytes written on success, `-1` if the writer is errored or an async operation is in flight. Idempotent when already closed.`fail(reason)` {Function} Puts the writer into a terminal error state. Synchronous. If the writer is already closed or errored, this is a no-op. If `autoClose` is true, closes the file handle synchronously.",
                        "name": "return",
                        "type": "Object",
                        "desc": "`write(chunk[, options])` {Function} Returns {Promise}. Accepts `Uint8Array`, `Buffer`, or string (UTF-8 encoded).`chunk` {Buffer|TypedArray|DataView|string}`options` {Object}`signal` {AbortSignal} If the signal is already aborted, the write rejects with `AbortError` without performing I/O.`writev(chunks[, options])` {Function} Returns {Promise}. Uses scatter/gather I/O via a single `writev()` syscall. Accepts mixed `Uint8Array`/string arrays.`chunks` {Buffer[]|TypedArray[]|DataView[]|string[]}`options` {Object}`signal` {AbortSignal} If the signal is already aborted, the write rejects with `AbortError` without performing I/O.`writeSync(chunk)` {Function} Returns {boolean}. Attempts a synchronous write. Returns `true` if the write succeeded, `false` if the caller should fall back to async `write()`. Returns `false` when: the writer is closed/errored, an async operation is in flight, the chunk exceeds `chunkSize`, or the write would exceed `limit`.`chunk` {Buffer|TypedArray|DataView|string}`writevSync(chunks)` {Function} Returns {boolean}. Synchronous batch write. Same fallback semantics as `writeSync()`.`chunks` {Buffer[]|TypedArray[]|DataView[]|string[]}`end([options])` {Function} Returns {Promise}, fulfills with the total number of bytes written. Idempotent: returns `totalBytesWritten` if already closed, returns the pending promise if already closing. Rejects if the writer is in an errored state.`options` {Object}`signal` {AbortSignal} If the signal is already aborted, `end()` rejects with `AbortError` and the writer remains open.`endSync()` {Function} Returns {number|number} total bytes written on success, `-1` if the writer is errored or an async operation is in flight. Idempotent when already closed.`fail(reason)` {Function} Puts the writer into a terminal error state. Synchronous. If the writer is already closed or errored, this is a no-op. If `autoClose` is true, closes the file handle synchronously."
                      }
                    }
                  ],
                  "desc": "<p>Return a <a href=\"stream_iter.html\"><code>node:stream/iter</code></a> writer backed by this file handle.</p>\n<p>The writer supports both <code>Symbol.asyncDispose</code> and <code>Symbol.dispose</code>:</p>\n<ul>\n<li><code>await using w = fh.writer()</code> — if the writer is still open (no <code>end()</code>\ncalled), <code>asyncDispose</code> calls <code>fail()</code>. If <code>end()</code> is pending, it waits\nfor it to complete.</li>\n<li><code>using w = fh.writer()</code> — calls <code>fail()</code> unconditionally.</li>\n</ul>\n<p>The <code>writeSync()</code> and <code>writevSync()</code> methods enable the try-sync fast path\nused by <a href=\"stream_iter.html#pipetosource-transforms-writer\"><code>stream/iter pipeTo()</code></a>. When the reader's chunk size matches the\nwriter's <code>chunkSize</code>, all writes in a <code>pipeTo()</code> pipeline complete\nsynchronously with zero promise overhead.</p>\n<p>This function is only available when the <code>--experimental-stream-iter</code> flag is\nenabled.</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { from, pipeTo } from 'node:stream/iter';\nimport { compressGzip } from 'node:zlib/iter';\n\n// Async pipeline\nconst fh = await open('output.gz', 'w');\nawait pipeTo(from('Hello!'), compressGzip(), fh.writer({ autoClose: true }));\n\n// Sync pipeline with limit\nconst src = await open('input.txt', 'r');\nconst dst = await open('output.txt', 'w');\nconst w = dst.writer({ limit: 1024 * 1024 }); // Max 1 MB\nawait pipeTo(src.pull({ autoClose: true }), w);\nawait w.end();\nawait dst.close();\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\nconst { from, pipeTo } = require('node:stream/iter');\nconst { compressGzip } = require('node:zlib/iter');\n\nasync function run() {\n  // Async pipeline\n  const fh = await open('output.gz', 'w');\n  await pipeTo(from('Hello!'), compressGzip(), fh.writer({ autoClose: true }));\n\n  // Sync pipeline with limit\n  const src = await open('input.txt', 'r');\n  const dst = await open('output.txt', 'w');\n  const w = dst.writer({ limit: 1024 * 1024 }); // Max 1 MB\n  await pipeTo(src.pull({ autoClose: true }), w);\n  await w.end();\n  await dst.close();\n}\n\nrun().catch(console.error);\n</code></pre>"
                },
                {
                  "textRaw": "`filehandle[Symbol.asyncDispose]()`",
                  "name": "[Symbol.asyncDispose]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v20.4.0",
                      "v18.18.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58467",
                        "description": "No longer experimental."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <code>filehandle.close()</code> and returns a promise that fulfills when the\nfilehandle is closed.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number} The numeric file descriptor managed by the {FileHandle} object.",
                  "name": "fd",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "The numeric file descriptor managed by the {FileHandle} object."
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`fsPromises.access(path[, mode])`",
              "name": "access",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer} **Default:** `fs.constants.F_OK`",
                      "name": "mode",
                      "type": "integer",
                      "default": "`fs.constants.F_OK`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Tests a user's permissions for the file or directory specified by <code>path</code>.\nThe <code>mode</code> argument is an optional integer that specifies the accessibility\nchecks to be performed. <code>mode</code> should be either the value <code>fs.constants.F_OK</code>\nor a mask consisting of the bitwise OR of any of <code>fs.constants.R_OK</code>,\n<code>fs.constants.W_OK</code>, and <code>fs.constants.X_OK</code> (e.g.\n<code>fs.constants.W_OK | fs.constants.R_OK</code>). Check <a href=\"#file-access-constants\">File access constants</a> for\npossible values of <code>mode</code>.</p>\n<p>If the accessibility check is successful, the promise is fulfilled with no\nvalue. If any of the accessibility checks fail, the promise is rejected\nwith an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> object. The following example checks if the file <code>/etc/passwd</code> can be read and written by the current process.</p>\n<pre><code class=\"language-mjs\">import { access, constants } from 'node:fs/promises';\n\ntry {\n  await access('/etc/passwd', constants.R_OK | constants.W_OK);\n  console.log('can access');\n} catch {\n  console.error('cannot access');\n}\n</code></pre>\n<p>Using <code>fsPromises.access()</code> to check for the accessibility of a file before\ncalling <code>fsPromises.open()</code> is not recommended. Doing so introduces a race\ncondition, since other processes may change the file's state between the two\ncalls. Instead, user code should open/read/write the file directly and handle\nthe error raised if the file is not accessible.</p>"
            },
            {
              "textRaw": "`fsPromises.appendFile(path, data[, options])`",
              "name": "appendFile",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.1.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50095",
                    "description": "The `flush` option is now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|FileHandle} filename or {FileHandle}",
                      "name": "path",
                      "type": "string|Buffer|URL|FileHandle",
                      "desc": "filename or {FileHandle}"
                    },
                    {
                      "textRaw": "`data` {string|Buffer}",
                      "name": "data",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'a'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'a'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Asynchronously append data to a file, creating the file if it does not yet\nexist. <code>data</code> can be a string or a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If <code>options</code> is a string, then it specifies the <code>encoding</code>.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<p>The <code>path</code> may be specified as a <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> that has been opened\nfor appending (using <code>fsPromises.open()</code>).</p>"
            },
            {
              "textRaw": "`fsPromises.chmod(path, mode)`",
              "name": "chmod",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the permissions of a file.</p>"
            },
            {
              "textRaw": "`fsPromises.chown(path, uid, gid)`",
              "name": "chown",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the ownership of a file.</p>"
            },
            {
              "textRaw": "`fsPromises.copyFile(src, dest[, mode])`",
              "name": "copyFile",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27044",
                    "description": "Changed `flags` argument to `mode` and imposed stricter type validation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|Buffer|URL} source filename to copy",
                      "name": "src",
                      "type": "string|Buffer|URL",
                      "desc": "source filename to copy"
                    },
                    {
                      "textRaw": "`dest` {string|Buffer|URL} destination filename of the copy operation",
                      "name": "dest",
                      "type": "string|Buffer|URL",
                      "desc": "destination filename of the copy operation"
                    },
                    {
                      "textRaw": "`mode` {integer} Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`) **Default:** `0`.",
                      "name": "mode",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Optional modifiers that specify the behavior of the copy operation. It is possible to create a mask consisting of the bitwise OR of two or more values (e.g. `fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE`)",
                      "options": [
                        {
                          "textRaw": "`fs.constants.COPYFILE_EXCL`: The copy operation will fail if `dest` already exists.",
                          "name": "fs.constants.COPYFILE_EXCL",
                          "desc": "The copy operation will fail if `dest` already exists."
                        },
                        {
                          "textRaw": "`fs.constants.COPYFILE_FICLONE`: The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then a fallback copy mechanism is used.",
                          "name": "fs.constants.COPYFILE_FICLONE",
                          "desc": "The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then a fallback copy mechanism is used."
                        },
                        {
                          "textRaw": "`fs.constants.COPYFILE_FICLONE_FORCE`: The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then the operation will fail.",
                          "name": "fs.constants.COPYFILE_FICLONE_FORCE",
                          "desc": "The copy operation will attempt to create a copy-on-write reflink. If the platform does not support copy-on-write, then the operation will fail."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Asynchronously copies <code>src</code> to <code>dest</code>. By default, <code>dest</code> is overwritten if it\nalready exists.</p>\n<p>No guarantees are made about the atomicity of the copy operation. If an\nerror occurs after the destination file has been opened for writing, an attempt\nwill be made to remove the destination.</p>\n<pre><code class=\"language-mjs\">import { copyFile, constants } from 'node:fs/promises';\n\ntry {\n  await copyFile('source.txt', 'destination.txt');\n  console.log('source.txt was copied to destination.txt');\n} catch {\n  console.error('The file could not be copied');\n}\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\ntry {\n  await copyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL);\n  console.log('source.txt was copied to destination.txt');\n} catch {\n  console.error('The file could not be copied');\n}\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.cp(src, dest[, options])`",
              "name": "cp",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53127",
                    "description": "This API is no longer experimental."
                  },
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47084",
                    "description": "Accept an additional `mode` option to specify the copy behavior as the `mode` argument of `fs.copyFile()`."
                  },
                  {
                    "version": [
                      "v17.6.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41819",
                    "description": "Accepts an additional `verbatimSymlinks` option to specify whether to perform path resolution for symlinks."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|URL} source path to copy.",
                      "name": "src",
                      "type": "string|URL",
                      "desc": "source path to copy."
                    },
                    {
                      "textRaw": "`dest` {string|URL} destination path to copy to.",
                      "name": "dest",
                      "type": "string|URL",
                      "desc": "destination path to copy to."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`dereference` {boolean} dereference symlinks. **Default:** `false`.",
                          "name": "dereference",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "dereference symlinks."
                        },
                        {
                          "textRaw": "`errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`.",
                          "name": "errorOnExist",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "when `force` is `false`, and the destination exists, throw an error."
                        },
                        {
                          "textRaw": "`filter` {Function} Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. Can also return a `Promise` that resolves to `true` or `false` **Default:** `undefined`.",
                          "name": "filter",
                          "type": "Function",
                          "default": "`undefined`",
                          "desc": "Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. Can also return a `Promise` that resolves to `true` or `false`",
                          "options": [
                            {
                              "textRaw": "`src` {string} source path to copy.",
                              "name": "src",
                              "type": "string",
                              "desc": "source path to copy."
                            },
                            {
                              "textRaw": "`dest` {string} destination path to copy to.",
                              "name": "dest",
                              "type": "string",
                              "desc": "destination path to copy to."
                            },
                            {
                              "textRaw": "Returns: {boolean|Promise} A value that is coercible to `boolean` or a `Promise` that fulfils with such value.",
                              "name": "return",
                              "type": "boolean|Promise",
                              "desc": "A value that is coercible to `boolean` or a `Promise` that fulfils with such value."
                            }
                          ]
                        },
                        {
                          "textRaw": "`force` {boolean} overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior. **Default:** `true`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior."
                        },
                        {
                          "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`. See `mode` flag of `fsPromises.copyFile()`.",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0`. See `mode` flag of `fsPromises.copyFile()`",
                          "desc": "modifiers for copy operation."
                        },
                        {
                          "textRaw": "`preserveTimestamps` {boolean} When `true` timestamps from `src` will be preserved. **Default:** `false`.",
                          "name": "preserveTimestamps",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true` timestamps from `src` will be preserved."
                        },
                        {
                          "textRaw": "`recursive` {boolean} copy directories recursively **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "copy directories recursively"
                        },
                        {
                          "textRaw": "`verbatimSymlinks` {boolean} When `true`, path resolution for symlinks will be skipped. **Default:** `false`",
                          "name": "verbatimSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, path resolution for symlinks will be skipped."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Asynchronously copies the entire directory structure from <code>src</code> to <code>dest</code>,\nincluding subdirectories and files.</p>\n<p>When copying a directory to another directory, globs are not supported and\nbehavior is similar to <code>cp dir1/ dir2/</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.glob(pattern[, options])`",
              "name": "glob",
              "type": "method",
              "meta": {
                "added": [
                  "v22.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62695",
                    "description": "Add support for the `followSymlinks` option."
                  },
                  {
                    "version": [
                      "v24.1.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58182",
                    "description": "Add support for `URL` instances for `cwd` option."
                  },
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  },
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56489",
                    "description": "Add support for `exclude` option to accept glob patterns."
                  },
                  {
                    "version": "v22.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52837",
                    "description": "Add support for `withFileTypes` as an option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pattern` {string|string[]}",
                      "name": "pattern",
                      "type": "string|string[]"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} current working directory. **Default:** `process.cwd()`",
                          "name": "cwd",
                          "type": "string|URL",
                          "default": "`process.cwd()`",
                          "desc": "current working directory."
                        },
                        {
                          "textRaw": "`exclude` {Function|string[]} Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it. **Default:** `undefined`. If a string array is provided, each string should be a glob pattern that specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are not supported.",
                          "name": "exclude",
                          "type": "Function|string[]",
                          "default": "`undefined`. If a string array is provided, each string should be a glob pattern that specifies paths to exclude. Note: Negation patterns (e.g., '!foo.js') are not supported",
                          "desc": "Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it."
                        },
                        {
                          "textRaw": "`followSymlinks` {boolean} When `true`, symbolic links to directories are followed while expanding `**` patterns. **Default:** `false`.",
                          "name": "followSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, symbolic links to directories are followed while expanding `**` patterns."
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} `true` if the glob should return paths as Dirents, `false` otherwise. **Default:** `false`.",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "`true` if the glob should return paths as Dirents, `false` otherwise."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {AsyncIterator} An AsyncIterator that yields the paths of files that match the pattern.",
                    "name": "return",
                    "type": "AsyncIterator",
                    "desc": "An AsyncIterator that yields the paths of files that match the pattern."
                  }
                }
              ],
              "desc": "<p>When <code>followSymlinks</code> is enabled, detected symbolic link cycles are not\ntraversed recursively.</p>\n<pre><code class=\"language-mjs\">import { glob } from 'node:fs/promises';\n\nfor await (const entry of glob('**/*.js'))\n  console.log(entry);\n</code></pre>\n<pre><code class=\"language-cjs\">const { glob } = require('node:fs/promises');\n\n(async () => {\n  for await (const entry of glob('**/*.js'))\n    console.log(entry);\n})();\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.lchmod(path, mode)`",
              "name": "lchmod",
              "type": "method",
              "meta": {
                "changes": [],
                "deprecated": [
                  "v10.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer}",
                      "name": "mode",
                      "type": "integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the permissions on a symbolic link.</p>\n<p>This method is only implemented on macOS.</p>"
            },
            {
              "textRaw": "`fsPromises.lchown(path, uid, gid)`",
              "name": "lchown",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "This API is no longer deprecated."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the ownership on a symbolic link.</p>"
            },
            {
              "textRaw": "`fsPromises.lutimes(path, atime, mtime)`",
              "name": "lutimes",
              "type": "method",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Changes the access and modification times of a file in the same way as\n<a href=\"#fspromisesutimespath-atime-mtime\"><code>fsPromises.utimes()</code></a>, with the difference that if the path refers to a\nsymbolic link, then the link is not dereferenced: instead, the timestamps of\nthe symbolic link itself are changed.</p>"
            },
            {
              "textRaw": "`fsPromises.link(existingPath, newPath)`",
              "name": "link",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`existingPath` {string|Buffer|URL}",
                      "name": "existingPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Creates a new link from the <code>existingPath</code> to the <code>newPath</code>. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fsPromises.lstat(path[, options])`",
              "name": "lstat",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the {fs.Stats} object for the given symbolic link `path`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the {fs.Stats} object for the given symbolic link `path`."
                  }
                }
              ],
              "desc": "<p>Equivalent to <a href=\"#fspromisesstatpath-options\"><code>fsPromises.stat()</code></a> unless <code>path</code> refers to a symbolic link,\nin which case the link itself is stat-ed, not the file that it refers to.\nRefer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lstat.2.html\"><code>lstat(2)</code></a> document for more detail.</p>"
            },
            {
              "textRaw": "`fsPromises.mkdir(path[, options])`",
              "name": "mkdir",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object|integer}",
                      "name": "options",
                      "type": "Object|integer",
                      "options": [
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`mode` {string|integer} Not supported on Windows. See File modes for more details. **Default:** `0o777`.",
                          "name": "mode",
                          "type": "string|integer",
                          "default": "`0o777`",
                          "desc": "Not supported on Windows. See File modes for more details."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Upon success, fulfills with `undefined` if `recursive` is `false`, or the first directory path created if `recursive` is `true`."
                  }
                }
              ],
              "desc": "<p>Asynchronously creates a directory.</p>\n<p>The optional <code>options</code> argument can be an integer specifying <code>mode</code> (permission\nand sticky bits), or an object with a <code>mode</code> property and a <code>recursive</code>\nproperty indicating whether parent directories should be created. Calling\n<code>fsPromises.mkdir()</code> when <code>path</code> is a directory that exists results in a\nrejection only when <code>recursive</code> is false.</p>\n<pre><code class=\"language-mjs\">import { mkdir } from 'node:fs/promises';\n\ntry {\n  const projectFolder = new URL('./test/project/', import.meta.url);\n  const createDir = await mkdir(projectFolder, { recursive: true });\n\n  console.log(`created ${createDir}`);\n} catch (err) {\n  console.error(err.message);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { mkdir } = require('node:fs/promises');\nconst { join } = require('node:path');\n\nasync function makeDirectory() {\n  const projectFolder = join(__dirname, 'test', 'project');\n  const dirCreation = await mkdir(projectFolder, { recursive: true });\n\n  console.log(dirCreation);\n  return dirCreation;\n}\n\nmakeDirectory().catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.mkdtemp(prefix[, options])`",
              "name": "mkdtemp",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/48828",
                    "description": "The `prefix` parameter now accepts buffers and URL."
                  },
                  {
                    "version": [
                      "v16.5.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39028",
                    "description": "The `prefix` parameter now accepts an empty string."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a string containing the file system path of the newly created temporary directory.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a string containing the file system path of the newly created temporary directory."
                  }
                }
              ],
              "desc": "<p>Creates a unique temporary directory. A unique directory name is generated by\nappending six random characters to the end of the provided <code>prefix</code>. Due to\nplatform inconsistencies, avoid trailing <code>X</code> characters in <code>prefix</code>. Some\nplatforms, notably the BSDs, can return more than six random characters, and\nreplace trailing <code>X</code> characters in <code>prefix</code> with random characters.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>\n<pre><code class=\"language-mjs\">import { mkdtemp } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { tmpdir } from 'node:os';\n\ntry {\n  await mkdtemp(join(tmpdir(), 'foo-'));\n} catch (err) {\n  console.error(err);\n}\n</code></pre>\n<p>The <code>fsPromises.mkdtemp()</code> method will append the six randomly selected\ncharacters directly to the <code>prefix</code> string. For instance, given a directory\n<code>/tmp</code>, if the intention is to create a temporary directory <em>within</em> <code>/tmp</code>, the\n<code>prefix</code> must end with a trailing platform-specific path separator\n(<code>require('node:path').sep</code>).</p>"
            },
            {
              "textRaw": "`fsPromises.mkdtempDisposable(prefix[, options])`",
              "name": "mkdtempDisposable",
              "type": "method",
              "meta": {
                "added": [
                  "v24.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a Promise for an async-disposable Object:",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a Promise for an async-disposable Object:",
                    "options": [
                      {
                        "textRaw": "`path` {string} The path of the created directory.",
                        "name": "path",
                        "type": "string",
                        "desc": "The path of the created directory."
                      },
                      {
                        "textRaw": "`remove` {AsyncFunction} A function which removes the created directory.",
                        "name": "remove",
                        "type": "AsyncFunction",
                        "desc": "A function which removes the created directory."
                      },
                      {
                        "textRaw": "`[Symbol.asyncDispose]` {AsyncFunction} The same as `remove`.",
                        "name": "[Symbol.asyncDispose]",
                        "type": "AsyncFunction",
                        "desc": "The same as `remove`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>The resulting Promise holds an async-disposable object whose <code>path</code> property\nholds the created directory path. When the object is disposed, the directory\nand its contents will be removed asynchronously if it still exists. If the\ndirectory cannot be deleted, disposal will throw an error. The object has an\nasync <code>remove()</code> method which will perform the same task.</p>\n<p>Both this function and the disposal function on the resulting object are\nasync, so it should be used with <code>await</code> + <code>await using</code> as in\n<code>await using dir = await fsPromises.mkdtempDisposable('prefix')</code>.</p>\n<p>For detailed information, see the documentation of <a href=\"#fspromisesmkdtempprefix-options\"><code>fsPromises.mkdtemp()</code></a>.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>"
            },
            {
              "textRaw": "`fsPromises.open(path, flags[, mode])`",
              "name": "open",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v11.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23767",
                    "description": "The `flags` argument is now optional and defaults to `'r'`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`flags` {string|number} See support of file system `flags`. **Default:** `'r'`.",
                      "name": "flags",
                      "type": "string|number",
                      "default": "`'r'`",
                      "desc": "See support of file system `flags`."
                    },
                    {
                      "textRaw": "`mode` {string|integer} Sets the file mode (permission and sticky bits) if the file is created. See File modes for more details. **Default:** `0o666` (readable and writable)",
                      "name": "mode",
                      "type": "string|integer",
                      "default": "`0o666` (readable and writable)",
                      "desc": "Sets the file mode (permission and sticky bits) if the file is created. See File modes for more details.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {FileHandle} object.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {FileHandle} object."
                  }
                }
              ],
              "desc": "<p>Opens a <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a>.</p>\n<p>Refer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a> documentation for more detail.</p>\n<p>Some characters (<code>&#x3C; > : \" / \\ | ? *</code>) are reserved under Windows as documented\nby <a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file\">Naming Files, Paths, and Namespaces</a>. Under NTFS, if the filename contains\na colon, Node.js will open a file system stream, as described by\n<a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams\">this MSDN page</a>.</p>"
            },
            {
              "textRaw": "`fsPromises.opendir(path[, options])`",
              "name": "opendir",
              "type": "method",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": [
                      "v13.1.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30114",
                    "description": "The `bufferSize` option was introduced."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`bufferSize` {number} Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage. **Default:** `32`",
                          "name": "bufferSize",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage."
                        },
                        {
                          "textRaw": "`recursive` {boolean} Resolved `Dir` will be an {AsyncIterable} containing all sub files and directories. **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Resolved `Dir` will be an {AsyncIterable} containing all sub files and directories."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {fs.Dir}.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {fs.Dir}."
                  }
                }
              ],
              "desc": "<p>Asynchronously open a directory for iterative scanning. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man3/opendir.3.html\"><code>opendir(3)</code></a> documentation for more detail.</p>\n<p>Creates an <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a>, which contains all further functions for reading from\nand cleaning up the directory.</p>\n<p>The <code>encoding</code> option sets the encoding for the <code>path</code> while opening the\ndirectory and subsequent read operations.</p>\n<p>Example using async iteration:</p>\n<pre><code class=\"language-mjs\">import { opendir } from 'node:fs/promises';\n\ntry {\n  const dir = await opendir('./');\n  for await (const dirent of dir)\n    console.log(dirent.name);\n} catch (err) {\n  console.error(err);\n}\n</code></pre>\n<p>When using the async iterator, the <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a> object will be automatically\nclosed after the iterator exits.</p>"
            },
            {
              "textRaw": "`fsPromises.readdir(path[, options])`",
              "name": "readdir",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": "v10.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22020",
                    "description": "New option `withFileTypes` was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} **Default:** `false`",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files, and directories. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files, and directories."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an array of the names of the files in the directory excluding `'.'` and `'..'`."
                  }
                }
              ],
              "desc": "<p>Reads the contents of a directory.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe filenames. If the <code>encoding</code> is set to <code>'buffer'</code>, the filenames returned\nwill be passed as <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> objects.</p>\n<p>If <code>options.withFileTypes</code> is set to <code>true</code>, the returned array will contain\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> objects.</p>\n<pre><code class=\"language-mjs\">import { readdir } from 'node:fs/promises';\n\ntry {\n  const files = await readdir(path);\n  for (const file of files)\n    console.log(file);\n} catch (err) {\n  console.error(err);\n}\n</code></pre>"
            },
            {
              "textRaw": "`fsPromises.readFile(path[, options])`",
              "name": "readFile",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.2.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35911",
                    "description": "The options argument may include an AbortSignal to abort an ongoing readFile request."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|FileHandle} filename or `FileHandle`",
                      "name": "path",
                      "type": "string|Buffer|URL|FileHandle",
                      "desc": "filename or `FileHandle`"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `null`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'r'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'r'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting an in-progress readFile",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting an in-progress readFile"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the contents of the file.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the contents of the file."
                  }
                }
              ],
              "desc": "<p>Asynchronously reads the entire contents of a file.</p>\n<p>If no encoding is specified (using <code>options.encoding</code>), the data is returned\nas a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object. Otherwise, the data will be a string.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>\n<p>When the <code>path</code> is a directory, the behavior of <code>fsPromises.readFile()</code> is\nplatform-specific. On macOS, Linux, and Windows, the promise will be rejected\nwith an error. On FreeBSD, a representation of the directory's contents will be\nreturned.</p>\n<p>An example of reading a <code>package.json</code> file located in the same directory of the\nrunning code:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs/promises';\ntry {\n  const filePath = new URL('./package.json', import.meta.url);\n  const contents = await readFile(filePath, { encoding: 'utf8' });\n  console.log(contents);\n} catch (err) {\n  console.error(err.message);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { readFile } = require('node:fs/promises');\nconst { resolve } = require('node:path');\nasync function logFile() {\n  try {\n    const filePath = resolve('./package.json');\n    const contents = await readFile(filePath, { encoding: 'utf8' });\n    console.log(contents);\n  } catch (err) {\n    console.error(err.message);\n  }\n}\nlogFile();\n</code></pre>\n<p>It is possible to abort an ongoing <code>readFile</code> using an <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a>. If a\nrequest is aborted the promise returned is rejected with an <code>AbortError</code>:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs/promises';\n\ntry {\n  const controller = new AbortController();\n  const { signal } = controller;\n  const promise = readFile(fileName, { signal });\n\n  // Abort the request before the promise settles.\n  controller.abort();\n\n  await promise;\n} catch (err) {\n  // When a request is aborted - err is an AbortError\n  console.error(err);\n}\n</code></pre>\n<p>Aborting an ongoing request does not abort individual operating\nsystem requests but rather the internal buffering <code>fs.readFile</code> performs.</p>\n<p>Any specified <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has to support reading.</p>"
            },
            {
              "textRaw": "`fsPromises.readlink(path[, options])`",
              "name": "readlink",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the `linkString` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the `linkString` upon success."
                  }
                }
              ],
              "desc": "<p>Reads the contents of the symbolic link referred to by <code>path</code>. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a> documentation for more detail. The promise is fulfilled with the <code>linkString</code> upon success.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe link path returned. If the <code>encoding</code> is set to <code>'buffer'</code>, the link path\nreturned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>"
            },
            {
              "textRaw": "`fsPromises.realpath(path[, options])`",
              "name": "realpath",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the resolved path upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the resolved path upon success."
                  }
                }
              ],
              "desc": "<p>Determines the actual location of <code>path</code> using the same semantics as the\n<code>fs.realpath.native()</code> function.</p>\n<p>Only paths that can be converted to UTF8 strings are supported.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe path. If the <code>encoding</code> is set to <code>'buffer'</code>, the path returned will be\npassed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>\n<p>On Linux, when Node.js is linked against musl libc, the procfs file system must\nbe mounted on <code>/proc</code> in order for this function to work. Glibc does not have\nthis restriction.</p>"
            },
            {
              "textRaw": "`fsPromises.rename(oldPath, newPath)`",
              "name": "rename",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`oldPath` {string|Buffer|URL}",
                      "name": "oldPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Renames <code>oldPath</code> to <code>newPath</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.rmdir(path[, options])`",
              "name": "rmdir",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58616",
                    "description": "Remove `recursive` option."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fsPromises.rmdir(path, { recursive: true })` on a `path` that is a file is no longer permitted and results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fsPromises.rmdir(path, { recursive: true })` on a `path` that does not exist is no longer permitted and results in a `ENOENT` error."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37302",
                    "description": "The `recursive` option is deprecated, using it triggers a deprecation warning."
                  },
                  {
                    "version": "v14.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35579",
                    "description": "The `recursive` option is deprecated, use `fsPromises.rm` instead."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30644",
                    "description": "The `maxBusyTries` option is renamed to `maxRetries`, and its default is 0. The `emfileWait` option has been removed, and `EMFILE` errors use the same retry logic as other errors. The `retryDelay` option is now supported. `ENFILE` errors are now retried."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29168",
                    "description": "The `recursive`, `maxBusyTries`, and `emfileWait` options are now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object} There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "name": "options",
                      "type": "Object",
                      "desc": "There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Removes the directory identified by <code>path</code>.</p>\n<p>Using <code>fsPromises.rmdir()</code> on a file (not a directory) results in the\npromise being rejected with an <code>ENOENT</code> error on Windows and an <code>ENOTDIR</code>\nerror on POSIX.</p>\n<p>To get a behavior similar to the <code>rm -rf</code> Unix command, use\n<a href=\"#fspromisesrmpath-options\"><code>fsPromises.rm()</code></a> with options <code>{ recursive: true, force: true }</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.rm(path[, options])`",
              "name": "rm",
              "type": "method",
              "meta": {
                "added": [
                  "v14.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`force` {boolean} When `true`, exceptions will be ignored if `path` does not exist. **Default:** `false`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, exceptions will be ignored if `path` does not exist."
                        },
                        {
                          "textRaw": "`maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`. **Default:** `0`.",
                          "name": "maxRetries",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`."
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, perform a recursive directory removal. In recursive mode operations are retried on failure. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, perform a recursive directory removal. In recursive mode operations are retried on failure."
                        },
                        {
                          "textRaw": "`retryDelay` {integer} The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`. **Default:** `100`.",
                          "name": "retryDelay",
                          "type": "integer",
                          "default": "`100`",
                          "desc": "The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Removes files and directories (modeled on the standard POSIX <code>rm</code> utility).</p>"
            },
            {
              "textRaw": "`fsPromises.stat(path[, options])`",
              "name": "stat",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61178",
                    "description": "Accepts a `throwIfNoEntry` option to specify whether an exception should be thrown if the entry does not exist."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the {fs.Stats} object for the given `path`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the {fs.Stats} object for the given `path`."
                  }
                }
              ]
            },
            {
              "textRaw": "`fsPromises.statfs(path[, options])`",
              "name": "statfs",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.StatFs} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.StatFs} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the {fs.StatFs} object for the given `path`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the {fs.StatFs} object for the given `path`."
                  }
                }
              ]
            },
            {
              "textRaw": "`fsPromises.symlink(target, path[, type])`",
              "name": "symlink",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42894",
                    "description": "If the `type` argument is `null` or omitted, Node.js will autodetect `target` type and automatically select `dir` or `file`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {string|Buffer|URL}",
                      "name": "target",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`type` {string|null} **Default:** `null`",
                      "name": "type",
                      "type": "string|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Creates a symbolic link.</p>\n<p>The <code>type</code> argument is only used on Windows platforms and can be one of <code>'dir'</code>,\n<code>'file'</code>, or <code>'junction'</code>. If the <code>type</code> argument is <code>null</code>, Node.js will\nautodetect <code>target</code> type and use <code>'file'</code> or <code>'dir'</code>. If the <code>target</code> does not\nexist, <code>'file'</code> will be used. Windows junction points require the destination\npath to be absolute. When using <code>'junction'</code>, the <code>target</code> argument will\nautomatically be normalized to absolute path. Junction points on NTFS volumes\ncan only point to directories.</p>"
            },
            {
              "textRaw": "`fsPromises.truncate(path[, len])`",
              "name": "truncate",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Truncates (shortens or extends the length) of the content at <code>path</code> to <code>len</code>\nbytes.</p>"
            },
            {
              "textRaw": "`fsPromises.unlink(path)`",
              "name": "unlink",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>If <code>path</code> refers to a symbolic link, then the link is removed without affecting\nthe file or directory to which that link refers. If the <code>path</code> refers to a file\npath that is not a symbolic link, the file is deleted. See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a>\ndocumentation for more detail.</p>"
            },
            {
              "textRaw": "`fsPromises.utimes(path, atime, mtime)`",
              "name": "utimes",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Change the file system timestamps of the object referenced by <code>path</code>.</p>\n<p>The <code>atime</code> and <code>mtime</code> arguments follow these rules:</p>\n<ul>\n<li>Values can be either numbers representing Unix epoch time, <code>Date</code>s, or a\nnumeric string like <code>'123456789.0'</code>.</li>\n<li>If the value can not be converted to a number, or is <code>NaN</code>, <code>Infinity</code>, or\n<code>-Infinity</code>, an <code>Error</code> will be thrown.</li>\n</ul>"
            },
            {
              "textRaw": "`fsPromises.watch(filename[, options])`",
              "name": "watch",
              "type": "method",
              "meta": {
                "added": [
                  "v15.9.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|Buffer|URL}",
                      "name": "filename",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`persistent` {boolean} Indicates whether the process should continue to run as long as files are being watched. **Default:** `true`.",
                          "name": "persistent",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Indicates whether the process should continue to run as long as files are being watched."
                        },
                        {
                          "textRaw": "`recursive` {boolean} Indicates whether all subdirectories should be watched, or only the current directory. This applies when a directory is specified, and only on supported platforms (See caveats). **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Indicates whether all subdirectories should be watched, or only the current directory. This applies when a directory is specified, and only on supported platforms (See caveats)."
                        },
                        {
                          "textRaw": "`encoding` {string} Specifies the character encoding to be used for the filename passed to the listener. **Default:** `'utf8'`.",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`",
                          "desc": "Specifies the character encoding to be used for the filename passed to the listener."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} An {AbortSignal} used to signal when the watcher should stop.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "An {AbortSignal} used to signal when the watcher should stop."
                        },
                        {
                          "textRaw": "`maxQueue` {number} Specifies the number of events to queue between iterations of the {AsyncIterator} returned. **Default:** `2048`.",
                          "name": "maxQueue",
                          "type": "number",
                          "default": "`2048`",
                          "desc": "Specifies the number of events to queue between iterations of the {AsyncIterator} returned."
                        },
                        {
                          "textRaw": "`overflow` {string} Either `'ignore'` or `'throw'` when there are more events to be queued than `maxQueue` allows. `'ignore'` means overflow events are dropped and a warning is emitted, while `'throw'` means to throw an exception. **Default:** `'ignore'`.",
                          "name": "overflow",
                          "type": "string",
                          "default": "`'ignore'`",
                          "desc": "Either `'ignore'` or `'throw'` when there are more events to be queued than `maxQueue` allows. `'ignore'` means overflow events are dropped and a warning is emitted, while `'throw'` means to throw an exception."
                        },
                        {
                          "textRaw": "`ignore` {string|RegExp|Function|Array} Pattern(s) to ignore. Strings are glob patterns (using `minimatch`), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to ignore. **Default:** `undefined`.",
                          "name": "ignore",
                          "type": "string|RegExp|Function|Array",
                          "default": "`undefined`",
                          "desc": "Pattern(s) to ignore. Strings are glob patterns (using `minimatch`), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to ignore."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {AsyncIterator} of objects with the properties:",
                    "name": "return",
                    "type": "AsyncIterator",
                    "desc": "of objects with the properties:",
                    "options": [
                      {
                        "textRaw": "`eventType` {string} The type of change",
                        "name": "eventType",
                        "type": "string",
                        "desc": "The type of change"
                      },
                      {
                        "textRaw": "`filename` {string|Buffer|null} The name of the file changed.",
                        "name": "filename",
                        "type": "string|Buffer|null",
                        "desc": "The name of the file changed."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Returns an async iterator that watches for changes on <code>filename</code>, where <code>filename</code>\nis either a file or a directory.</p>\n<pre><code class=\"language-js\">const { watch } = require('node:fs/promises');\n\nconst ac = new AbortController();\nconst { signal } = ac;\nsetTimeout(() => ac.abort(), 10000);\n\n(async () => {\n  try {\n    const watcher = watch(__filename, { signal });\n    for await (const event of watcher)\n      console.log(event);\n  } catch (err) {\n    if (err.name === 'AbortError')\n      return;\n    throw err;\n  }\n})();\n</code></pre>\n<p>On most platforms, <code>'rename'</code> is emitted whenever a filename appears or\ndisappears in the directory.</p>\n<p>All the <a href=\"#caveats\">caveats</a> for <code>fs.watch()</code> also apply to <code>fsPromises.watch()</code>.</p>"
            },
            {
              "textRaw": "`fsPromises.writeFile(file, data[, options])`",
              "name": "writeFile",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.0.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50009",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": [
                      "v15.14.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37490",
                    "description": "The `data` argument supports `AsyncIterable`, `Iterable`, and `Stream`."
                  },
                  {
                    "version": [
                      "v15.2.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35993",
                    "description": "The options argument may include an AbortSignal to abort an ongoing writeFile request."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`file` {string|Buffer|URL|FileHandle} filename or `FileHandle`",
                      "name": "file",
                      "type": "string|Buffer|URL|FileHandle",
                      "desc": "filename or `FileHandle`"
                    },
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView|AsyncIterable|Stream}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView|AsyncIterable|Stream"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'w'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'w'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If all data is successfully written to the file, and `flush` is `true`, `filehandle.sync()` is used to flush the data. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If all data is successfully written to the file, and `flush` is `true`, `filehandle.sync()` is used to flush the data."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting an in-progress writeFile",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting an in-progress writeFile"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Asynchronously writes data to a file, replacing the file if it already exists.\n<code>data</code> can be a string, a buffer, an <a href=\"https://tc39.github.io/ecma262/#sec-asynciterable-interface\"><code>&#x3C;AsyncIterable></code></a>, or an {Iterable} object.</p>\n<p>The <code>encoding</code> option is ignored if <code>data</code> is a buffer.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<p>Any specified <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> has to support writing.</p>\n<p>It is unsafe to use <code>fsPromises.writeFile()</code> multiple times on the same file\nwithout waiting for the promise to be settled.</p>\n<p>Similarly to <code>fsPromises.readFile</code> - <code>fsPromises.writeFile</code> is a convenience\nmethod that performs multiple <code>write</code> calls internally to write the buffer\npassed to it. For performance sensitive code consider using\n<a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> or <a href=\"#filehandlecreatewritestreamoptions\"><code>filehandle.createWriteStream()</code></a>.</p>\n<p>It is possible to use an <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> to cancel an <code>fsPromises.writeFile()</code>.\nCancelation is \"best effort\", and some amount of data is likely still\nto be written.</p>\n<pre><code class=\"language-mjs\">import { writeFile } from 'node:fs/promises';\nimport { Buffer } from 'node:buffer';\n\ntry {\n  const controller = new AbortController();\n  const { signal } = controller;\n  const data = new Uint8Array(Buffer.from('Hello Node.js'));\n  const promise = writeFile('message.txt', data, { signal });\n\n  // Abort the request before the promise settles.\n  controller.abort();\n\n  await promise;\n} catch (err) {\n  // When a request is aborted - err is an AbortError\n  console.error(err);\n}\n</code></pre>\n<p>Aborting an ongoing request does not abort individual operating\nsystem requests but rather the internal buffering <code>fs.writeFile</code> performs.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "constants",
              "type": "Object",
              "meta": {
                "added": [
                  "v18.4.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Returns an object containing commonly used constants for file system\noperations. The object is the same as <code>fs.constants</code>. See <a href=\"#fs-constants\">FS constants</a>\nfor more details.</p>"
            }
          ],
          "displayName": "Promises API"
        },
        {
          "textRaw": "Callback API",
          "name": "callback_api",
          "type": "module",
          "desc": "<p>The callback APIs perform all operations asynchronously, without blocking the\nevent loop, then invoke a callback function upon completion or error.</p>\n<p>The callback APIs use the underlying Node.js threadpool to perform file\nsystem operations off the event loop thread. These operations are not\nsynchronized or threadsafe. Care must be taken when performing multiple\nconcurrent modifications on the same file or data corruption may occur.</p>",
          "methods": [
            {
              "textRaw": "`fs.access(path[, mode], callback)`",
              "name": "access",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/55862",
                    "description": "The constants `fs.F_OK`, `fs.R_OK`, `fs.W_OK` and `fs.X_OK` which were present directly on `fs` are removed."
                  },
                  {
                    "version": "v20.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/49683",
                    "description": "The constants `fs.F_OK`, `fs.R_OK`, `fs.W_OK` and `fs.X_OK` which were present directly on `fs` are deprecated."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v6.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6534",
                    "description": "The constants like `fs.R_OK`, etc which were present directly on `fs` were moved into `fs.constants` as a soft deprecation. Thus for Node.js `< v6.3.0` use `fs` to access those constants, or do something like `(fs.constants || fs).R_OK` to work with all versions."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer} **Default:** `fs.constants.F_OK`",
                      "name": "mode",
                      "type": "integer",
                      "default": "`fs.constants.F_OK`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Tests a user's permissions for the file or directory specified by <code>path</code>.\nThe <code>mode</code> argument is an optional integer that specifies the accessibility\nchecks to be performed. <code>mode</code> should be either the value <code>fs.constants.F_OK</code>\nor a mask consisting of the bitwise OR of any of <code>fs.constants.R_OK</code>,\n<code>fs.constants.W_OK</code>, and <code>fs.constants.X_OK</code> (e.g.\n<code>fs.constants.W_OK | fs.constants.R_OK</code>). Check <a href=\"#file-access-constants\">File access constants</a> for\npossible values of <code>mode</code>.</p>\n<p>The final argument, <code>callback</code>, is a callback function that is invoked with\na possible error argument. If any of the accessibility checks fail, the error\nargument will be an <code>Error</code> object. The following examples check if\n<code>package.json</code> exists, and if it is readable or writable.</p>\n<pre><code class=\"language-mjs\">import { access, constants } from 'node:fs';\n\nconst file = 'package.json';\n\n// Check if the file exists in the current directory.\naccess(file, constants.F_OK, (err) => {\n  console.log(`${file} ${err ? 'does not exist' : 'exists'}`);\n});\n\n// Check if the file is readable.\naccess(file, constants.R_OK, (err) => {\n  console.log(`${file} ${err ? 'is not readable' : 'is readable'}`);\n});\n\n// Check if the file is writable.\naccess(file, constants.W_OK, (err) => {\n  console.log(`${file} ${err ? 'is not writable' : 'is writable'}`);\n});\n\n// Check if the file is readable and writable.\naccess(file, constants.R_OK | constants.W_OK, (err) => {\n  console.log(`${file} ${err ? 'is not' : 'is'} readable and writable`);\n});\n</code></pre>\n<p>Do not use <code>fs.access()</code> to check for the accessibility of a file before calling\n<code>fs.open()</code>, <code>fs.readFile()</code>, or <code>fs.writeFile()</code>. Doing\nso introduces a race condition, since other processes may change the file's\nstate between the two calls. Instead, user code should open/read/write the\nfile directly and handle the error raised if the file is not accessible.</p>\n<p><strong>write (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { access, open, close } from 'node:fs';\n\naccess('myfile', (err) => {\n  if (!err) {\n    console.error('myfile already exists');\n    return;\n  }\n\n  open('myfile', 'wx', (err, fd) => {\n    if (err) throw err;\n\n    try {\n      writeMyData(fd);\n    } finally {\n      close(fd, (err) => {\n        if (err) throw err;\n      });\n    }\n  });\n});\n</code></pre>\n<p><strong>write (RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close } from 'node:fs';\n\nopen('myfile', 'wx', (err, fd) => {\n  if (err) {\n    if (err.code === 'EEXIST') {\n      console.error('myfile already exists');\n      return;\n    }\n\n    throw err;\n  }\n\n  try {\n    writeMyData(fd);\n  } finally {\n    close(fd, (err) => {\n      if (err) throw err;\n    });\n  }\n});\n</code></pre>\n<p><strong>read (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { access, open, close } from 'node:fs';\naccess('myfile', (err) => {\n  if (err) {\n    if (err.code === 'ENOENT') {\n      console.error('myfile does not exist');\n      return;\n    }\n\n    throw err;\n  }\n\n  open('myfile', 'r', (err, fd) => {\n    if (err) throw err;\n\n    try {\n      readMyData(fd);\n    } finally {\n      close(fd, (err) => {\n        if (err) throw err;\n      });\n    }\n  });\n});\n</code></pre>\n<p><strong>read (RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close } from 'node:fs';\n\nopen('myfile', 'r', (err, fd) => {\n  if (err) {\n    if (err.code === 'ENOENT') {\n      console.error('myfile does not exist');\n      return;\n    }\n\n    throw err;\n  }\n\n  try {\n    readMyData(fd);\n  } finally {\n    close(fd, (err) => {\n      if (err) throw err;\n    });\n  }\n});\n</code></pre>\n<p>The \"not recommended\" examples above check for accessibility and then use the\nfile; the \"recommended\" examples are better because they use the file directly\nand handle the error, if any.</p>\n<p>In general, check for the accessibility of a file only if the file will not be\nused directly, for example when its accessibility is a signal from another\nprocess.</p>\n<p>On Windows, access-control policies (ACLs) on a directory may limit access to\na file or directory. The <code>fs.access()</code> function, however, does not check the\nACL and therefore may report that a path is accessible even if the ACL restricts\nthe user from reading or writing to it.</p>"
            },
            {
              "textRaw": "`fs.appendFile(path, data[, options], callback)`",
              "name": "appendFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.7"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.1.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50095",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `file` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|number} filename or file descriptor",
                      "name": "path",
                      "type": "string|Buffer|URL|number",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`data` {string|Buffer}",
                      "name": "data",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'a'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'a'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously append data to a file, creating the file if it does not yet\nexist. <code>data</code> can be a string or a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<pre><code class=\"language-mjs\">import { appendFile } from 'node:fs';\n\nappendFile('message.txt', 'data to append', (err) => {\n  if (err) throw err;\n  console.log('The \"data to append\" was appended to file!');\n});\n</code></pre>\n<p>If <code>options</code> is a string, then it specifies the encoding:</p>\n<pre><code class=\"language-mjs\">import { appendFile } from 'node:fs';\n\nappendFile('message.txt', 'data to append', 'utf8', callback);\n</code></pre>\n<p>The <code>path</code> may be specified as a numeric file descriptor that has been opened\nfor appending (using <code>fs.open()</code> or <code>fs.openSync()</code>). The file descriptor will\nnot be closed automatically.</p>\n<pre><code class=\"language-mjs\">import { open, close, appendFile } from 'node:fs';\n\nfunction closeFd(fd) {\n  close(fd, (err) => {\n    if (err) throw err;\n  });\n}\n\nopen('message.txt', 'a', (err, fd) => {\n  if (err) throw err;\n\n  try {\n    appendFile(fd, 'data to append', 'utf8', (err) => {\n      closeFd(fd);\n      if (err) throw err;\n    });\n  } catch (err) {\n    closeFd(fd);\n    throw err;\n  }\n});\n</code></pre>"
            },
            {
              "textRaw": "`fs.chmod(path, mode, callback)`",
              "name": "chmod",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.30"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously changes the permissions of a file. No arguments other than a\npossible exception are given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a> documentation for more detail.</p>\n<pre><code class=\"language-mjs\">import { chmod } from 'node:fs';\n\nchmod('my_file.txt', 0o775, (err) => {\n  if (err) throw err;\n  console.log('The permissions for file \"my_file.txt\" have been changed!');\n});\n</code></pre>",
              "modules": [
                {
                  "textRaw": "File modes",
                  "name": "file_modes",
                  "type": "module",
                  "desc": "<p>The <code>mode</code> argument used in both the <code>fs.chmod()</code> and <code>fs.chmodSync()</code>\nmethods is a numeric bitmask created using a logical OR of the following\nconstants:</p>\n<table>\n<thead>\n<tr>\n<th>Constant</th>\n<th>Octal</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>fs.constants.S_IRUSR</code></td>\n<td><code>0o400</code></td>\n<td>read by owner</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IWUSR</code></td>\n<td><code>0o200</code></td>\n<td>write by owner</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IXUSR</code></td>\n<td><code>0o100</code></td>\n<td>execute/search by owner</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IRGRP</code></td>\n<td><code>0o40</code></td>\n<td>read by group</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IWGRP</code></td>\n<td><code>0o20</code></td>\n<td>write by group</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IXGRP</code></td>\n<td><code>0o10</code></td>\n<td>execute/search by group</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IROTH</code></td>\n<td><code>0o4</code></td>\n<td>read by others</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IWOTH</code></td>\n<td><code>0o2</code></td>\n<td>write by others</td>\n</tr>\n<tr>\n<td><code>fs.constants.S_IXOTH</code></td>\n<td><code>0o1</code></td>\n<td>execute/search by others</td>\n</tr>\n</tbody>\n</table>\n<p>An easier method of constructing the <code>mode</code> is to use a sequence of three\noctal digits (e.g. <code>765</code>). The left-most digit (<code>7</code> in the example), specifies\nthe permissions for the file owner. The middle digit (<code>6</code> in the example),\nspecifies permissions for the group. The right-most digit (<code>5</code> in the example),\nspecifies the permissions for others.</p>\n<table>\n<thead>\n<tr>\n<th>Number</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>7</code></td>\n<td>read, write, and execute</td>\n</tr>\n<tr>\n<td><code>6</code></td>\n<td>read and write</td>\n</tr>\n<tr>\n<td><code>5</code></td>\n<td>read and execute</td>\n</tr>\n<tr>\n<td><code>4</code></td>\n<td>read only</td>\n</tr>\n<tr>\n<td><code>3</code></td>\n<td>write and execute</td>\n</tr>\n<tr>\n<td><code>2</code></td>\n<td>write only</td>\n</tr>\n<tr>\n<td><code>1</code></td>\n<td>execute only</td>\n</tr>\n<tr>\n<td><code>0</code></td>\n<td>no permission</td>\n</tr>\n</tbody>\n</table>\n<p>For example, the octal value <code>0o765</code> means:</p>\n<ul>\n<li>The owner may read, write, and execute the file.</li>\n<li>The group may read and write the file.</li>\n<li>Others may read and execute the file.</li>\n</ul>\n<p>When using raw numbers where file modes are expected, any value larger than\n<code>0o777</code> may result in platform-specific behaviors that are not supported to work\nconsistently. Therefore constants like <code>S_ISVTX</code>, <code>S_ISGID</code>, or <code>S_ISUID</code> are\nnot exposed in <code>fs.constants</code>.</p>\n<p>Caveats: on Windows only the write permission can be changed, and the\ndistinction among the permissions of group, owner, or others is not\nimplemented.</p>",
                  "displayName": "File modes"
                }
              ]
            },
            {
              "textRaw": "`fs.chown(path, uid, gid, callback)`",
              "name": "chown",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.97"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously changes owner and group of a file. No arguments other than a\npossible exception are given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.close(fd[, callback])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v15.9.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37174",
                    "description": "A default callback is now used if one is not provided."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Closes the file descriptor. No arguments other than a possible exception are\ngiven to the completion callback.</p>\n<p>Calling <code>fs.close()</code> on any file descriptor (<code>fd</code>) that is currently in use\nthrough any other <code>fs</code> operation may lead to undefined behavior.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/close.2.html\"><code>close(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.copyFile(src, dest[, mode], callback)`",
              "name": "copyFile",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27044",
                    "description": "Changed `flags` argument to `mode` and imposed stricter type validation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|Buffer|URL} source filename to copy",
                      "name": "src",
                      "type": "string|Buffer|URL",
                      "desc": "source filename to copy"
                    },
                    {
                      "textRaw": "`dest` {string|Buffer|URL} destination filename of the copy operation",
                      "name": "dest",
                      "type": "string|Buffer|URL",
                      "desc": "destination filename of the copy operation"
                    },
                    {
                      "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`.",
                      "name": "mode",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "modifiers for copy operation.",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously copies <code>src</code> to <code>dest</code>. By default, <code>dest</code> is overwritten if it\nalready exists. No arguments other than a possible exception are given to the\ncallback function. Node.js makes no guarantees about the atomicity of the copy\noperation. If an error occurs after the destination file has been opened for\nwriting, Node.js will attempt to remove the destination.</p>\n<p><code>mode</code> is an optional integer that specifies the behavior\nof the copy operation. It is possible to create a mask consisting of the bitwise\nOR of two or more values (e.g.\n<code>fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE</code>).</p>\n<ul>\n<li><code>fs.constants.COPYFILE_EXCL</code>: The copy operation will fail if <code>dest</code> already\nexists.</li>\n<li><code>fs.constants.COPYFILE_FICLONE</code>: The copy operation will attempt to create a\ncopy-on-write reflink. If the platform does not support copy-on-write, then a\nfallback copy mechanism is used.</li>\n<li><code>fs.constants.COPYFILE_FICLONE_FORCE</code>: The copy operation will attempt to\ncreate a copy-on-write reflink. If the platform does not support\ncopy-on-write, then the operation will fail.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { copyFile, constants } from 'node:fs';\n\nfunction callback(err) {\n  if (err) throw err;\n  console.log('source.txt was copied to destination.txt');\n}\n\n// destination.txt will be created or overwritten by default.\ncopyFile('source.txt', 'destination.txt', callback);\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\ncopyFile('source.txt', 'destination.txt', constants.COPYFILE_EXCL, callback);\n</code></pre>"
            },
            {
              "textRaw": "`fs.cp(src, dest[, options], callback)`",
              "name": "cp",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53127",
                    "description": "This API is no longer experimental."
                  },
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47084",
                    "description": "Accept an additional `mode` option to specify the copy behavior as the `mode` argument of `fs.copyFile()`."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v17.6.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41819",
                    "description": "Accepts an additional `verbatimSymlinks` option to specify whether to perform path resolution for symlinks."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|URL} source path to copy.",
                      "name": "src",
                      "type": "string|URL",
                      "desc": "source path to copy."
                    },
                    {
                      "textRaw": "`dest` {string|URL} destination path to copy to.",
                      "name": "dest",
                      "type": "string|URL",
                      "desc": "destination path to copy to."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`dereference` {boolean} dereference symlinks. **Default:** `false`.",
                          "name": "dereference",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "dereference symlinks."
                        },
                        {
                          "textRaw": "`errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`.",
                          "name": "errorOnExist",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "when `force` is `false`, and the destination exists, throw an error."
                        },
                        {
                          "textRaw": "`filter` {Function} Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. Can also return a `Promise` that fulfills with `true` or `false`. **Default:** `undefined`.",
                          "name": "filter",
                          "type": "Function",
                          "default": "`undefined`",
                          "desc": "Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. Can also return a `Promise` that fulfills with `true` or `false`.",
                          "options": [
                            {
                              "textRaw": "`src` {string} source path to copy.",
                              "name": "src",
                              "type": "string",
                              "desc": "source path to copy."
                            },
                            {
                              "textRaw": "`dest` {string} destination path to copy to.",
                              "name": "dest",
                              "type": "string",
                              "desc": "destination path to copy to."
                            },
                            {
                              "textRaw": "Returns: {boolean|Promise} A value that is coercible to `boolean` or a `Promise` that fulfils with such value.",
                              "name": "return",
                              "type": "boolean|Promise",
                              "desc": "A value that is coercible to `boolean` or a `Promise` that fulfils with such value."
                            }
                          ]
                        },
                        {
                          "textRaw": "`force` {boolean} overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior. **Default:** `true`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior."
                        },
                        {
                          "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`. See `mode` flag of `fs.copyFile()`.",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0`. See `mode` flag of `fs.copyFile()`",
                          "desc": "modifiers for copy operation."
                        },
                        {
                          "textRaw": "`preserveTimestamps` {boolean} When `true` timestamps from `src` will be preserved. **Default:** `false`.",
                          "name": "preserveTimestamps",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true` timestamps from `src` will be preserved."
                        },
                        {
                          "textRaw": "`recursive` {boolean} copy directories recursively **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "copy directories recursively"
                        },
                        {
                          "textRaw": "`verbatimSymlinks` {boolean} When `true`, path resolution for symlinks will be skipped. **Default:** `false`",
                          "name": "verbatimSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, path resolution for symlinks will be skipped."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously copies the entire directory structure from <code>src</code> to <code>dest</code>,\nincluding subdirectories and files.</p>\n<p>When copying a directory to another directory, globs are not supported and\nbehavior is similar to <code>cp dir1/ dir2/</code>.</p>"
            },
            {
              "textRaw": "`fs.createReadStream(path[, options])`",
              "name": "createReadStream",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40013",
                    "description": "The `fs` option does not need `open` method if an `fd` was provided."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40013",
                    "description": "The `fs` option does not need `close` method if `autoClose` is `false`."
                  },
                  {
                    "version": "v15.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36431",
                    "description": "Add support for `AbortSignal`."
                  },
                  {
                    "version": [
                      "v15.4.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35922",
                    "description": "The `fd` option accepts FileHandle arguments."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31408",
                    "description": "Change `emitClose` default to `true`."
                  },
                  {
                    "version": [
                      "v13.6.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29083",
                    "description": "The `fs` options allow overriding the used `fs` implementation."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29212",
                    "description": "Enable `emitClose` option."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19898",
                    "description": "Impose new restrictions on `start` and `end`, throwing more appropriate errors in cases when we cannot reasonably handle the input values."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  },
                  {
                    "version": "v2.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/1845",
                    "description": "The passed `options` object can be a string now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`flags` {string} See support of file system `flags`. **Default:** `'r'`.",
                          "name": "flags",
                          "type": "string",
                          "default": "`'r'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`encoding` {string} **Default:** `null`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`fd` {integer|FileHandle} **Default:** `null`",
                          "name": "fd",
                          "type": "integer|FileHandle",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`autoClose` {boolean} **Default:** `true`",
                          "name": "autoClose",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`emitClose` {boolean} **Default:** `true`",
                          "name": "emitClose",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`start` {integer}",
                          "name": "start",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`end` {integer} **Default:** `Infinity`",
                          "name": "end",
                          "type": "integer",
                          "default": "`Infinity`"
                        },
                        {
                          "textRaw": "`highWaterMark` {integer} **Default:** `64 * 1024`",
                          "name": "highWaterMark",
                          "type": "integer",
                          "default": "`64 * 1024`"
                        },
                        {
                          "textRaw": "`fs` {Object|null} **Default:** `null`",
                          "name": "fs",
                          "type": "Object|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`signal` {AbortSignal|null} **Default:** `null`",
                          "name": "signal",
                          "type": "AbortSignal|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.ReadStream}",
                    "name": "return",
                    "type": "fs.ReadStream"
                  }
                }
              ],
              "desc": "<p><code>options</code> can include <code>start</code> and <code>end</code> values to read a range of bytes from\nthe file instead of the entire file. Both <code>start</code> and <code>end</code> are inclusive and\nstart counting at 0, allowed values are in the\n[0, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>] range. If <code>fd</code> is specified and <code>start</code> is\nomitted or <code>undefined</code>, <code>fs.createReadStream()</code> reads sequentially from the\ncurrent file position. The <code>encoding</code> can be any one of those accepted by\n<a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If <code>fd</code> is specified, <code>ReadStream</code> will ignore the <code>path</code> argument and will use\nthe specified file descriptor. This means that no <code>'open'</code> event will be\nemitted. <code>fd</code> should be blocking; non-blocking <code>fd</code>s should be passed to\n<a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>\n<p>If <code>fd</code> points to a character device that only supports blocking reads\n(such as keyboard or sound card), read operations do not finish until data is\navailable. This can prevent the process from exiting and the stream from\nclosing naturally.</p>\n<p>By default, the stream will emit a <code>'close'</code> event after it has been\ndestroyed.  Set the <code>emitClose</code> option to <code>false</code> to change this behavior.</p>\n<p>By providing the <code>fs</code> option, it is possible to override the corresponding <code>fs</code>\nimplementations for <code>open</code>, <code>read</code>, and <code>close</code>. When providing the <code>fs</code> option,\nan override for <code>read</code> is required. If no <code>fd</code> is provided, an override for\n<code>open</code> is also required. If <code>autoClose</code> is <code>true</code>, an override for <code>close</code> is\nalso required.</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\n\n// Create a stream from some character device.\nconst stream = createReadStream('/dev/input/event0');\nsetTimeout(() => {\n  stream.close(); // This may not close the stream.\n  // Artificially marking end-of-stream, as if the underlying resource had\n  // indicated end-of-file by itself, allows the stream to close.\n  // This does not cancel pending read operations, and if there is such an\n  // operation, the process may still not be able to exit successfully\n  // until it finishes.\n  stream.push(null);\n  stream.read(0);\n}, 100);\n</code></pre>\n<p>If <code>autoClose</code> is false, then the file descriptor won't be closed, even if\nthere's an error. It is the application's responsibility to close it and make\nsure there's no file descriptor leak. If <code>autoClose</code> is set to true (default\nbehavior), on <code>'error'</code> or <code>'end'</code> the file descriptor will be closed\nautomatically.</p>\n<p><code>mode</code> sets the file mode (permission and sticky bits), but only if the\nfile was created.</p>\n<p>An example to read the last 10 bytes of a file which is 100 bytes long:</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\n\ncreateReadStream('sample.txt', { start: 90, end: 99 });\n</code></pre>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>"
            },
            {
              "textRaw": "`fs.createWriteStream(path[, options])`",
              "name": "createWriteStream",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.0.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50093",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40013",
                    "description": "The `fs` option does not need `open` method if an `fd` was provided."
                  },
                  {
                    "version": "v16.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/40013",
                    "description": "The `fs` option does not need `close` method if `autoClose` is `false`."
                  },
                  {
                    "version": "v15.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36431",
                    "description": "Add support for `AbortSignal`."
                  },
                  {
                    "version": [
                      "v15.4.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35922",
                    "description": "The `fd` option accepts FileHandle arguments."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31408",
                    "description": "Change `emitClose` default to `true`."
                  },
                  {
                    "version": [
                      "v13.6.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/29083",
                    "description": "The `fs` options allow overriding the used `fs` implementation."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29212",
                    "description": "Enable `emitClose` option."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  },
                  {
                    "version": "v5.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3679",
                    "description": "The `autoClose` option is supported now."
                  },
                  {
                    "version": "v2.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/1845",
                    "description": "The passed `options` object can be a string now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`flags` {string} See support of file system `flags`. **Default:** `'w'`.",
                          "name": "flags",
                          "type": "string",
                          "default": "`'w'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`fd` {integer|FileHandle} **Default:** `null`",
                          "name": "fd",
                          "type": "integer|FileHandle",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`autoClose` {boolean} **Default:** `true`",
                          "name": "autoClose",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`emitClose` {boolean} **Default:** `true`",
                          "name": "emitClose",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`start` {integer}",
                          "name": "start",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`fs` {Object|null} **Default:** `null`",
                          "name": "fs",
                          "type": "Object|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`signal` {AbortSignal|null} **Default:** `null`",
                          "name": "signal",
                          "type": "AbortSignal|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`highWaterMark` {number} **Default:** `16384`",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`16384`"
                        },
                        {
                          "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.WriteStream}",
                    "name": "return",
                    "type": "fs.WriteStream"
                  }
                }
              ],
              "desc": "<p><code>options</code> may also include a <code>start</code> option to allow writing data at some\nposition past the beginning of the file, allowed values are in the\n[0, <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER\"><code>Number.MAX_SAFE_INTEGER</code></a>] range. Modifying a file rather than\nreplacing it may require the <code>flags</code> option to be set to <code>r+</code> rather than the\ndefault <code>w</code>. The <code>encoding</code> can be any one of those accepted by <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>If <code>autoClose</code> is set to true (default behavior) on <code>'error'</code> or <code>'finish'</code>\nthe file descriptor will be closed automatically. If <code>autoClose</code> is false,\nthen the file descriptor won't be closed, even if there's an error.\nIt is the application's responsibility to close it and make sure there's no\nfile descriptor leak.</p>\n<p>By default, the stream will emit a <code>'close'</code> event after it has been\ndestroyed.  Set the <code>emitClose</code> option to <code>false</code> to change this behavior.</p>\n<p>By providing the <code>fs</code> option it is possible to override the corresponding <code>fs</code>\nimplementations for <code>open</code>, <code>write</code>, <code>writev</code>, and <code>close</code>. Overriding <code>write()</code>\nwithout <code>writev()</code> can reduce performance as some optimizations (<code>_writev()</code>)\nwill be disabled. When providing the <code>fs</code> option, overrides for at least one of\n<code>write</code> and <code>writev</code> are required. If no <code>fd</code> option is supplied, an override\nfor <code>open</code> is also required. If <code>autoClose</code> is <code>true</code>, an override for <code>close</code>\nis also required.</p>\n<p>Like <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a>, if <code>fd</code> is specified, <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a> will ignore the <code>path</code> argument and will use the specified file descriptor. This means that no\n<code>'open'</code> event will be emitted. <code>fd</code> should be blocking; non-blocking <code>fd</code>s\nshould be passed to <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding.</p>"
            },
            {
              "textRaw": "`fs.exists(path, callback)`",
              "name": "exists",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ],
                "deprecated": [
                  "v1.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `fs.stat()` or `fs.access()` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`exists` {boolean}",
                          "name": "exists",
                          "type": "boolean"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Test whether or not the element at the given <code>path</code> exists by checking with the file system.\nThen call the <code>callback</code> argument with either true or false:</p>\n<pre><code class=\"language-mjs\">import { exists } from 'node:fs';\n\nexists('/etc/passwd', (e) => {\n  console.log(e ? 'it exists' : 'no passwd!');\n});\n</code></pre>\n<p><strong>The parameters for this callback are not consistent with other Node.js\ncallbacks.</strong> Normally, the first parameter to a Node.js callback is an <code>err</code>\nparameter, optionally followed by other parameters. The <code>fs.exists()</code> callback\nhas only one boolean parameter. This is one reason <code>fs.access()</code> is recommended\ninstead of <code>fs.exists()</code>.</p>\n<p>If <code>path</code> is a symbolic link, it is followed. Thus, if <code>path</code> exists but points\nto a non-existent element, the callback will receive the value <code>false</code>.</p>\n<p>Using <code>fs.exists()</code> to check for the existence of a file before calling\n<code>fs.open()</code>, <code>fs.readFile()</code>, or <code>fs.writeFile()</code> is not recommended. Doing\nso introduces a race condition, since other processes may change the file's\nstate between the two calls. Instead, user code should open/read/write the\nfile directly and handle the error raised if the file does not exist.</p>\n<p><strong>write (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { exists, open, close } from 'node:fs';\n\nexists('myfile', (e) => {\n  if (e) {\n    console.error('myfile already exists');\n  } else {\n    open('myfile', 'wx', (err, fd) => {\n      if (err) throw err;\n\n      try {\n        writeMyData(fd);\n      } finally {\n        close(fd, (err) => {\n          if (err) throw err;\n        });\n      }\n    });\n  }\n});\n</code></pre>\n<p><strong>write (RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close } from 'node:fs';\nopen('myfile', 'wx', (err, fd) => {\n  if (err) {\n    if (err.code === 'EEXIST') {\n      console.error('myfile already exists');\n      return;\n    }\n\n    throw err;\n  }\n\n  try {\n    writeMyData(fd);\n  } finally {\n    close(fd, (err) => {\n      if (err) throw err;\n    });\n  }\n});\n</code></pre>\n<p><strong>read (NOT RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close, exists } from 'node:fs';\n\nexists('myfile', (e) => {\n  if (e) {\n    open('myfile', 'r', (err, fd) => {\n      if (err) throw err;\n\n      try {\n        readMyData(fd);\n      } finally {\n        close(fd, (err) => {\n          if (err) throw err;\n        });\n      }\n    });\n  } else {\n    console.error('myfile does not exist');\n  }\n});\n</code></pre>\n<p><strong>read (RECOMMENDED)</strong></p>\n<pre><code class=\"language-mjs\">import { open, close } from 'node:fs';\n\nopen('myfile', 'r', (err, fd) => {\n  if (err) {\n    if (err.code === 'ENOENT') {\n      console.error('myfile does not exist');\n      return;\n    }\n\n    throw err;\n  }\n\n  try {\n    readMyData(fd);\n  } finally {\n    close(fd, (err) => {\n      if (err) throw err;\n    });\n  }\n});\n</code></pre>\n<p>The \"not recommended\" examples above check for existence and then use the\nfile; the \"recommended\" examples are better because they use the file directly\nand handle the error, if any.</p>\n<p>In general, check for the existence of a file only if the file won't be\nused directly, for example when its existence is a signal from another\nprocess.</p>"
            },
            {
              "textRaw": "`fs.fchmod(fd, mode, callback)`",
              "name": "fchmod",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.7"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the permissions on the file. No arguments other than a possible exception\nare given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fchmod.2.html\"><code>fchmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fchown(fd, uid, gid, callback)`",
              "name": "fchown",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.7"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the owner of the file. No arguments other than a possible exception are\ngiven to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fchown.2.html\"><code>fchown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fdatasync(fd, callback)`",
              "name": "fdatasync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.96"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Forces all currently queued I/O operations associated with the file to the\noperating system's synchronized I/O completion state. Refer to the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a> documentation for details. No arguments other than a possible\nexception are given to the completion callback.</p>"
            },
            {
              "textRaw": "`fs.fstat(fd[, options], callback)`",
              "name": "fstat",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.95"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stats` {fs.Stats}",
                          "name": "stats",
                          "type": "fs.Stats"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Invokes the callback with the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the file descriptor.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fstat.2.html\"><code>fstat(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fsync(fd, callback)`",
              "name": "fsync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.96"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Request that all data for the open file descriptor is flushed to the storage\ndevice. The specific implementation is operating system and device specific.\nRefer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a> documentation for more detail. No arguments other\nthan a possible exception are given to the completion callback.</p>"
            },
            {
              "textRaw": "`fs.ftruncate(fd[, len], callback)`",
              "name": "ftruncate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.8.6"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the file descriptor. No arguments other than a possible exception are\ngiven to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/ftruncate.2.html\"><code>ftruncate(2)</code></a> documentation for more detail.</p>\n<p>If the file referred to by the file descriptor was larger than <code>len</code> bytes, only\nthe first <code>len</code> bytes will be retained in the file.</p>\n<p>For example, the following program retains only the first four bytes of the\nfile:</p>\n<pre><code class=\"language-mjs\">import { open, close, ftruncate } from 'node:fs';\n\nfunction closeFd(fd) {\n  close(fd, (err) => {\n    if (err) throw err;\n  });\n}\n\nopen('temp.txt', 'r+', (err, fd) => {\n  if (err) throw err;\n\n  try {\n    ftruncate(fd, 4, (err) => {\n      closeFd(fd);\n      if (err) throw err;\n    });\n  } catch (err) {\n    closeFd(fd);\n    if (err) throw err;\n  }\n});\n</code></pre>\n<p>If the file previously was shorter than <code>len</code> bytes, it is extended, and the\nextended part is filled with null bytes (<code>'\\0'</code>):</p>\n<p>If <code>len</code> is negative then <code>0</code> will be used.</p>"
            },
            {
              "textRaw": "`fs.futimes(fd, atime, mtime, callback)`",
              "name": "futimes",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v4.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2387",
                    "description": "Numeric strings, `NaN`, and `Infinity` are now allowed time specifiers."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Change the file system timestamps of the object referenced by the supplied file\ndescriptor. See <a href=\"#fsutimespath-atime-mtime-callback\"><code>fs.utimes()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.glob(pattern[, options], callback)`",
              "name": "glob",
              "type": "method",
              "meta": {
                "added": [
                  "v22.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62695",
                    "description": "Add support for the `followSymlinks` option."
                  },
                  {
                    "version": [
                      "v24.1.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58182",
                    "description": "Add support for `URL` instances for `cwd` option."
                  },
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  },
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56489",
                    "description": "Add support for `exclude` option to accept glob patterns."
                  },
                  {
                    "version": "v22.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52837",
                    "description": "Add support for `withFileTypes` as an option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pattern` {string|string[]}",
                      "name": "pattern",
                      "type": "string|string[]"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} current working directory. **Default:** `process.cwd()`",
                          "name": "cwd",
                          "type": "string|URL",
                          "default": "`process.cwd()`",
                          "desc": "current working directory."
                        },
                        {
                          "textRaw": "`exclude` {Function|string[]} Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it. **Default:** `undefined`.",
                          "name": "exclude",
                          "type": "Function|string[]",
                          "default": "`undefined`",
                          "desc": "Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it."
                        },
                        {
                          "textRaw": "`followSymlinks` {boolean} When `true`, symbolic links to directories are followed while expanding `**` patterns. **Default:** `false`.",
                          "name": "followSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, symbolic links to directories are followed while expanding `**` patterns."
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} `true` if the glob should return paths as Dirents, `false` otherwise. **Default:** `false`.",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "`true` if the glob should return paths as Dirents, `false` otherwise."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>When <code>followSymlinks</code> is enabled, detected symbolic link cycles are not\ntraversed recursively.</p>\n<pre><code class=\"language-mjs\">import { glob } from 'node:fs';\n\nglob('**/*.js', (err, matches) => {\n  if (err) throw err;\n  console.log(matches);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { glob } = require('node:fs');\n\nglob('**/*.js', (err, matches) => {\n  if (err) throw err;\n  console.log(matches);\n});\n</code></pre>"
            },
            {
              "textRaw": "`fs.lchmod(path, mode, callback)`",
              "name": "lchmod",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37460",
                    "description": "The error returned may be an `AggregateError` if more than one error is returned."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ],
                "deprecated": [
                  "v0.4.7"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer}",
                      "name": "mode",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error|AggregateError}",
                          "name": "err",
                          "type": "Error|AggregateError"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Changes the permissions on a symbolic link. No arguments other than a possible\nexception are given to the completion callback.</p>\n<p>This method is only implemented on macOS.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lchmod.2.html\"><code>lchmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.lchown(path, uid, gid, callback)`",
              "name": "lchown",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "This API is no longer deprecated."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v0.4.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Set the owner of the symbolic link. No arguments other than a possible\nexception are given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lchown.2.html\"><code>lchown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.lutimes(path, atime, mtime, callback)`",
              "name": "lutimes",
              "type": "method",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Changes the access and modification times of a file in the same way as\n<a href=\"#fsutimespath-atime-mtime-callback\"><code>fs.utimes()</code></a>, with the difference that if the path refers to a symbolic\nlink, then the link is not dereferenced: instead, the timestamps of the\nsymbolic link itself are changed.</p>\n<p>No arguments other than a possible exception are given to the completion\ncallback.</p>"
            },
            {
              "textRaw": "`fs.link(existingPath, newPath, callback)`",
              "name": "link",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `existingPath` and `newPath` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`existingPath` {string|Buffer|URL}",
                      "name": "existingPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new link from the <code>existingPath</code> to the <code>newPath</code>. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a> documentation for more detail. No arguments other than a possible\nexception are given to the completion callback.</p>"
            },
            {
              "textRaw": "`fs.lstat(path[, options], callback)`",
              "name": "lstat",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.30"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stats` {fs.Stats}",
                          "name": "stats",
                          "type": "fs.Stats"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Retrieves the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the symbolic link referred to by the path.\nThe callback gets two arguments <code>(err, stats)</code> where <code>stats</code> is a <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a>\nobject. <code>lstat()</code> is identical to <code>stat()</code>, except that if <code>path</code> is a symbolic\nlink, then the link itself is stat-ed, not the file that it refers to.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lstat.2.html\"><code>lstat(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.mkdir(path[, options], callback)`",
              "name": "mkdir",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.8"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v13.11.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31530",
                    "description": "In `recursive` mode, the callback now receives the first created path as an argument."
                  },
                  {
                    "version": "v10.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21875",
                    "description": "The second argument can now be an `options` object with `recursive` and `mode` properties."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object|integer}",
                      "name": "options",
                      "type": "Object|integer",
                      "options": [
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`mode` {string|integer} Not supported on Windows. See File modes for more details. **Default:** `0o777`.",
                          "name": "mode",
                          "type": "string|integer",
                          "default": "`0o777`",
                          "desc": "Not supported on Windows. See File modes for more details."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`path` {string|undefined} Present only if a directory is created with `recursive` set to `true`.",
                          "name": "path",
                          "type": "string|undefined",
                          "desc": "Present only if a directory is created with `recursive` set to `true`."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously creates a directory.</p>\n<p>The callback is given a possible exception and, if <code>recursive</code> is <code>true</code>, the\nfirst directory path created, <code>(err[, path])</code>.\n<code>path</code> can still be <code>undefined</code> when <code>recursive</code> is <code>true</code>, if no directory was\ncreated (for instance, if it was previously created).</p>\n<p>The optional <code>options</code> argument can be an integer specifying <code>mode</code> (permission\nand sticky bits), or an object with a <code>mode</code> property and a <code>recursive</code>\nproperty indicating whether parent directories should be created. Calling\n<code>fs.mkdir()</code> when <code>path</code> is a directory that exists results in an error only\nwhen <code>recursive</code> is false. If <code>recursive</code> is false and the directory exists,\nan <code>EEXIST</code> error occurs.</p>\n<pre><code class=\"language-mjs\">import { mkdir } from 'node:fs';\n\n// Create ./tmp/a/apple, regardless of whether ./tmp and ./tmp/a exist.\nmkdir('./tmp/a/apple', { recursive: true }, (err) => {\n  if (err) throw err;\n});\n</code></pre>\n<p>On Windows, using <code>fs.mkdir()</code> on the root directory even with recursion will\nresult in an error:</p>\n<pre><code class=\"language-mjs\">import { mkdir } from 'node:fs';\n\nmkdir('/', { recursive: true }, (err) => {\n  // => [Error: EPERM: operation not permitted, mkdir 'C:\\']\n});\n</code></pre>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/mkdir.2.html\"><code>mkdir(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.mkdtemp(prefix[, options], callback)`",
              "name": "mkdtemp",
              "type": "method",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/48828",
                    "description": "The `prefix` parameter now accepts buffers and URL."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v16.5.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39028",
                    "description": "The `prefix` parameter now accepts an empty string."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v6.2.1",
                    "pr-url": "https://github.com/nodejs/node/pull/6828",
                    "description": "The `callback` parameter is optional now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`directory` {string}",
                          "name": "directory",
                          "type": "string"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a unique temporary directory.</p>\n<p>Generates six random characters to be appended behind a required\n<code>prefix</code> to create a unique temporary directory. Due to platform\ninconsistencies, avoid trailing <code>X</code> characters in <code>prefix</code>. Some platforms,\nnotably the BSDs, can return more than six random characters, and replace\ntrailing <code>X</code> characters in <code>prefix</code> with random characters.</p>\n<p>The created directory path is passed as a string to the callback's second\nparameter.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>\n<pre><code class=\"language-mjs\">import { mkdtemp } from 'node:fs';\nimport { join } from 'node:path';\nimport { tmpdir } from 'node:os';\n\nmkdtemp(join(tmpdir(), 'foo-'), (err, directory) => {\n  if (err) throw err;\n  console.log(directory);\n  // Prints: /tmp/foo-itXde2 or C:\\Users\\...\\AppData\\Local\\Temp\\foo-itXde2\n});\n</code></pre>\n<p>The <code>fs.mkdtemp()</code> method will append the six randomly selected characters\ndirectly to the <code>prefix</code> string. For instance, given a directory <code>/tmp</code>, if the\nintention is to create a temporary directory <em>within</em> <code>/tmp</code>, the <code>prefix</code>\nmust end with a trailing platform-specific path separator\n(<code>require('node:path').sep</code>).</p>\n<pre><code class=\"language-mjs\">import { tmpdir } from 'node:os';\nimport { mkdtemp } from 'node:fs';\n\n// The parent directory for the new temporary directory\nconst tmpDir = tmpdir();\n\n// This method is *INCORRECT*:\nmkdtemp(tmpDir, (err, directory) => {\n  if (err) throw err;\n  console.log(directory);\n  // Will print something similar to `/tmpabc123`.\n  // A new temporary directory is created at the file system root\n  // rather than *within* the /tmp directory.\n});\n\n// This method is *CORRECT*:\nimport { sep } from 'node:path';\nmkdtemp(`${tmpDir}${sep}`, (err, directory) => {\n  if (err) throw err;\n  console.log(directory);\n  // Will print something similar to `/tmp/abc123`.\n  // A new temporary directory is created within\n  // the /tmp directory.\n});\n</code></pre>"
            },
            {
              "textRaw": "`fs.open(path[, flags[, mode]], callback)`",
              "name": "open",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v11.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23767",
                    "description": "The `flags` argument is now optional and defaults to `'r'`."
                  },
                  {
                    "version": "v9.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18801",
                    "description": "The `as` and `as+` flags are supported now."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`flags` {string|number} See support of file system `flags`. **Default:** `'r'`.",
                      "name": "flags",
                      "type": "string|number",
                      "default": "`'r'`",
                      "desc": "See support of file system `flags`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`mode` {string|integer} **Default:** `0o666` (readable and writable)",
                      "name": "mode",
                      "type": "string|integer",
                      "default": "`0o666` (readable and writable)",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`fd` {integer}",
                          "name": "fd",
                          "type": "integer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous file open. See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a> documentation for more details.</p>\n<p><code>mode</code> sets the file mode (permission and sticky bits), but only if the file was\ncreated. On Windows, only the write permission can be manipulated; see\n<a href=\"#fschmodpath-mode-callback\"><code>fs.chmod()</code></a>.</p>\n<p>The callback gets two arguments <code>(err, fd)</code>.</p>\n<p>Some characters (<code>&#x3C; > : \" / \\ | ? *</code>) are reserved under Windows as documented\nby <a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file\">Naming Files, Paths, and Namespaces</a>. Under NTFS, if the filename contains\na colon, Node.js will open a file system stream, as described by\n<a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/using-streams\">this MSDN page</a>.</p>\n<p>Functions based on <code>fs.open()</code> exhibit this behavior as well:\n<code>fs.writeFile()</code>, <code>fs.readFile()</code>, etc.</p>"
            },
            {
              "textRaw": "`fs.openAsBlob(path[, options])`",
              "name": "openAsBlob",
              "type": "method",
              "meta": {
                "added": [
                  "v19.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`type` {string} An optional mime type for the blob.",
                          "name": "type",
                          "type": "string",
                          "desc": "An optional mime type for the blob."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {Blob} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {Blob} upon success."
                  }
                }
              ],
              "desc": "<p>Returns a <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> whose data is backed by the given file.</p>\n<p>The file must not be modified after the <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> is created. Any modifications\nwill cause reading the <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> data to fail with a <code>DOMException</code> error.\nSynchronous stat operations on the file when the <code>Blob</code> is created, and before\neach read in order to detect whether the file data has been modified on disk.</p>\n<pre><code class=\"language-mjs\">import { openAsBlob } from 'node:fs';\n\nconst blob = await openAsBlob('the.file.txt');\nconst ab = await blob.arrayBuffer();\nblob.stream();\n</code></pre>\n<pre><code class=\"language-cjs\">const { openAsBlob } = require('node:fs');\n\n(async () => {\n  const blob = await openAsBlob('the.file.txt');\n  const ab = await blob.arrayBuffer();\n  blob.stream();\n})();\n</code></pre>"
            },
            {
              "textRaw": "`fs.opendir(path[, options], callback)`",
              "name": "opendir",
              "type": "method",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": [
                      "v13.1.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30114",
                    "description": "The `bufferSize` option was introduced."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`bufferSize` {number} Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage. **Default:** `32`",
                          "name": "bufferSize",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage."
                        },
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`dir` {fs.Dir}",
                          "name": "dir",
                          "type": "fs.Dir"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously open a directory. See the POSIX <a href=\"http://man7.org/linux/man-pages/man3/opendir.3.html\"><code>opendir(3)</code></a> documentation for\nmore details.</p>\n<p>Creates an <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a>, which contains all further functions for reading from\nand cleaning up the directory.</p>\n<p>The <code>encoding</code> option sets the encoding for the <code>path</code> while opening the\ndirectory and subsequent read operations.</p>"
            },
            {
              "textRaw": "`fs.read(fd, buffer, offset, length, position, callback)`",
              "name": "read",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `buffer` parameter can now be any `TypedArray`, or a `DataView`."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `buffer` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4518",
                    "description": "The `length` parameter can now be `0`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} The buffer that the data will be written to.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "The buffer that the data will be written to."
                    },
                    {
                      "textRaw": "`offset` {integer} The position in `buffer` to write the data to.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "The position in `buffer` to write the data to."
                    },
                    {
                      "textRaw": "`length` {integer} The number of bytes to read.",
                      "name": "length",
                      "type": "integer",
                      "desc": "The number of bytes to read."
                    },
                    {
                      "textRaw": "`position` {integer|bigint|null} Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If `position` is a non-negative integer, the file position will be unchanged.",
                      "name": "position",
                      "type": "integer|bigint|null",
                      "desc": "Specifies where to begin reading from in the file. If `position` is `null` or `-1 `, data will be read from the current file position, and the file position will be updated. If `position` is a non-negative integer, the file position will be unchanged."
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesRead` {integer}",
                          "name": "bytesRead",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer}",
                          "name": "buffer",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Read data from the file specified by <code>fd</code>.</p>\n<p>The callback is given the three arguments, <code>(err, bytesRead, buffer)</code>.</p>\n<p>If the file is not modified concurrently, the end-of-file is reached when the\nnumber of bytes read is zero.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na promise for an <code>Object</code> with <code>bytesRead</code> and <code>buffer</code> properties.</p>\n<p>The <code>fs.read()</code> method reads data from the file specified\nby the file descriptor (<code>fd</code>).\nThe <code>length</code> argument indicates the maximum number\nof bytes that Node.js\nwill attempt to read from the kernel.\nHowever, the actual number of bytes read (<code>bytesRead</code>) can be lower\nthan the specified <code>length</code> for various reasons.</p>\n<p>For example:</p>\n<ul>\n<li>If the file is shorter than the specified <code>length</code>, <code>bytesRead</code>\nwill be set to the actual number of bytes read.</li>\n<li>If the file encounters EOF (End of File) before the buffer could\nbe filled, Node.js will read all available bytes until EOF is encountered,\nand the <code>bytesRead</code> parameter in the callback will indicate\nthe actual number of bytes read, which may be less than the specified <code>length</code>.</li>\n<li>If the file is on a slow network <code>filesystem</code>\nor encounters any other issue during reading,\n<code>bytesRead</code> can be lower than the specified <code>length</code>.</li>\n</ul>\n<p>Therefore, when using <code>fs.read()</code>, it's important to\ncheck the <code>bytesRead</code> value to\ndetermine how many bytes were actually read from the file.\nDepending on your application\nlogic, you may need to handle cases where <code>bytesRead</code>\nis lower than the specified <code>length</code>,\nsuch as by wrapping the read call in a loop if you require\na minimum amount of bytes.</p>\n<p>This behavior is similar to the POSIX <code>preadv2</code> function.</p>"
            },
            {
              "textRaw": "`fs.read(fd[, options], callback)`",
              "name": "read",
              "type": "method",
              "meta": {
                "added": [
                  "v13.11.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.11.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31402",
                    "description": "Options object can be passed in to make buffer, offset, length, and position optional."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView} **Default:** `Buffer.alloc(16384)`",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView",
                          "default": "`Buffer.alloc(16384)`"
                        },
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|bigint|null} **Default:** `null`",
                          "name": "position",
                          "type": "integer|bigint|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesRead` {integer}",
                          "name": "bytesRead",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer}",
                          "name": "buffer",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Similar to the <a href=\"#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a> function, this version takes an optional\n<code>options</code> object. If no <code>options</code> object is specified, it will default with the\nabove values.</p>"
            },
            {
              "textRaw": "`fs.read(fd, buffer[, options], callback)`",
              "name": "read",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} The buffer that the data will be written to.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "The buffer that the data will be written to."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|bigint} **Default:** `null`",
                          "name": "position",
                          "type": "integer|bigint",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesRead` {integer}",
                          "name": "bytesRead",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer}",
                          "name": "buffer",
                          "type": "Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Similar to the <a href=\"#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a> function, this version takes an optional\n<code>options</code> object. If no <code>options</code> object is specified, it will default with the\nabove values.</p>"
            },
            {
              "textRaw": "`fs.readdir(path[, options], callback)`",
              "name": "readdir",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.8"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22020",
                    "description": "New option `withFileTypes` was added."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5616",
                    "description": "The `options` parameter was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} **Default:** `false`",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files and directories. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files and directories."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`files` {string[]|Buffer[]|fs.Dirent[]}",
                          "name": "files",
                          "type": "string[]|Buffer[]|fs.Dirent[]"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Reads the contents of a directory. The callback gets two arguments <code>(err, files)</code>\nwhere <code>files</code> is an array of the names of the files in the directory excluding\n<code>'.'</code> and <code>'..'</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> documentation for more details.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe filenames passed to the callback. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe filenames returned will be passed as <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> objects.</p>\n<p>If <code>options.withFileTypes</code> is set to <code>true</code>, the <code>files</code> array will contain\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> objects.</p>"
            },
            {
              "textRaw": "`fs.readFile(path[, options], callback)`",
              "name": "readFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37460",
                    "description": "The error returned may be an `AggregateError` if more than one error is returned."
                  },
                  {
                    "version": [
                      "v15.2.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35911",
                    "description": "The options argument may include an AbortSignal to abort an ongoing readFile request."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v5.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3740",
                    "description": "The `callback` will always be called with `null` as the `error` parameter in case of success."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `path` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|integer} filename or file descriptor",
                      "name": "path",
                      "type": "string|Buffer|URL|integer",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `null`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'r'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'r'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting an in-progress readFile",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting an in-progress readFile"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error|AggregateError}",
                          "name": "err",
                          "type": "Error|AggregateError"
                        },
                        {
                          "textRaw": "`data` {string|Buffer}",
                          "name": "data",
                          "type": "string|Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously reads the entire contents of a file.</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs';\n\nreadFile('/etc/passwd', (err, data) => {\n  if (err) throw err;\n  console.log(data);\n});\n</code></pre>\n<p>The callback is passed two arguments <code>(err, data)</code>, where <code>data</code> is the\ncontents of the file.</p>\n<p>If no encoding is specified, then the raw buffer is returned.</p>\n<p>If <code>options</code> is a string, then it specifies the encoding:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs';\n\nreadFile('/etc/passwd', 'utf8', callback);\n</code></pre>\n<p>When the path is a directory, the behavior of <code>fs.readFile()</code> and\n<a href=\"#fsreadfilesyncpath-options\"><code>fs.readFileSync()</code></a> is platform-specific. On macOS, Linux, and Windows, an\nerror will be returned. On FreeBSD, a representation of the directory's contents\nwill be returned.</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs';\n\n// macOS, Linux, and Windows\nreadFile('&#x3C;directory>', (err, data) => {\n  // => [Error: EISDIR: illegal operation on a directory, read &#x3C;directory>]\n});\n\n//  FreeBSD\nreadFile('&#x3C;directory>', (err, data) => {\n  // => null, &#x3C;data>\n});\n</code></pre>\n<p>It is possible to abort an ongoing request using an <code>AbortSignal</code>. If a\nrequest is aborted the callback is called with an <code>AbortError</code>:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs';\n\nconst controller = new AbortController();\nconst signal = controller.signal;\nreadFile(fileInfo[0].name, { signal }, (err, buf) => {\n  // ...\n});\n// When you want to abort the request\ncontroller.abort();\n</code></pre>\n<p>The <code>fs.readFile()</code> function buffers the entire file. To minimize memory costs,\nwhen possible prefer streaming via <code>fs.createReadStream()</code>.</p>\n<p>Aborting an ongoing request does not abort individual operating\nsystem requests but rather the internal buffering <code>fs.readFile</code> performs.</p>",
              "modules": [
                {
                  "textRaw": "File descriptors",
                  "name": "file_descriptors",
                  "type": "module",
                  "desc": "<ol>\n<li>Any specified file descriptor has to support reading.</li>\n<li>If a file descriptor is specified as the <code>path</code>, it will not be closed\nautomatically.</li>\n<li>The reading will begin at the current position. For example, if the file\nalready had <code>'Hello World'</code> and six bytes are read with the file descriptor,\nthe call to <code>fs.readFile()</code> with the same file descriptor, would give\n<code>'World'</code>, rather than <code>'Hello World'</code>.</li>\n</ol>",
                  "displayName": "File descriptors"
                },
                {
                  "textRaw": "Performance Considerations",
                  "name": "performance_considerations",
                  "type": "module",
                  "desc": "<p>The <code>fs.readFile()</code> method asynchronously reads the contents of a file into\nmemory one chunk at a time, allowing the event loop to turn between each chunk.\nThis allows the read operation to have less impact on other activity that may\nbe using the underlying libuv thread pool but means that it will take longer\nto read a complete file into memory.</p>\n<p>The additional read overhead can vary broadly on different systems and depends\non the type of file being read. If the file type is not a regular file (a pipe\nfor instance) and Node.js is unable to determine an actual file size, each read\noperation will load on 64 KiB of data. For regular files, each read will process\n512 KiB of data.</p>\n<p>For applications that require as-fast-as-possible reading of file contents, it\nis better to use <code>fs.read()</code> directly and for application code to manage\nreading the full contents of the file itself.</p>\n<p>The Node.js GitHub issue <a href=\"https://github.com/nodejs/node/issues/25741\">#25741</a> provides more information and a detailed\nanalysis on the performance of <code>fs.readFile()</code> for multiple file sizes in\ndifferent Node.js versions.</p>",
                  "displayName": "Performance Considerations"
                }
              ]
            },
            {
              "textRaw": "`fs.readlink(path[, options], callback)`",
              "name": "readlink",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`linkString` {string|Buffer}",
                          "name": "linkString",
                          "type": "string|Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Reads the contents of the symbolic link referred to by <code>path</code>. The callback gets\ntwo arguments <code>(err, linkString)</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a> documentation for more details.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe link path passed to the callback. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe link path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>"
            },
            {
              "textRaw": "`fs.readv(fd, buffers[, position], callback)`",
              "name": "readv",
              "type": "method",
              "meta": {
                "added": [
                  "v13.13.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffers` {ArrayBufferView[]}",
                      "name": "buffers",
                      "type": "ArrayBufferView[]"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesRead` {integer}",
                          "name": "bytesRead",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffers` {ArrayBufferView[]}",
                          "name": "buffers",
                          "type": "ArrayBufferView[]"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Read from a file specified by <code>fd</code> and write to an array of <code>ArrayBufferView</code>s\nusing <code>readv()</code>.</p>\n<p><code>position</code> is the offset from the beginning of the file from where data\nshould be read. If <code>typeof position !== 'number'</code>, the data will be read\nfrom the current position.</p>\n<p>The callback will be given three arguments: <code>err</code>, <code>bytesRead</code>, and\n<code>buffers</code>. <code>bytesRead</code> is how many bytes were read from the file.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na promise for an <code>Object</code> with <code>bytesRead</code> and <code>buffers</code> properties.</p>"
            },
            {
              "textRaw": "`fs.realpath(path[, options], callback)`",
              "name": "realpath",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13028",
                    "description": "Pipe/Socket resolve support was added."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v6.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7899",
                    "description": "Calling `realpath` now works again for various edge cases on Windows."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3594",
                    "description": "The `cache` parameter was removed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`resolvedPath` {string|Buffer}",
                          "name": "resolvedPath",
                          "type": "string|Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously computes the canonical pathname by resolving <code>.</code>, <code>..</code>, and\nsymbolic links.</p>\n<p>A canonical pathname is not necessarily unique. Hard links and bind mounts can\nexpose a file system entity through many pathnames.</p>\n<p>This function behaves like <a href=\"http://man7.org/linux/man-pages/man3/realpath.3.html\"><code>realpath(3)</code></a>, with some exceptions:</p>\n<ol>\n<li>\n<p>No case conversion is performed on case-insensitive file systems.</p>\n</li>\n<li>\n<p>The maximum number of symbolic links is platform-independent and generally\n(much) higher than what the native <a href=\"http://man7.org/linux/man-pages/man3/realpath.3.html\"><code>realpath(3)</code></a> implementation supports.</p>\n</li>\n</ol>\n<p>The <code>callback</code> gets two arguments <code>(err, resolvedPath)</code>. May use <code>process.cwd</code>\nto resolve relative paths.</p>\n<p>Only paths that can be converted to UTF8 strings are supported.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe path passed to the callback. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>\n<p>If <code>path</code> resolves to a socket or a pipe, the function will return a system\ndependent name for that object.</p>\n<p>A path that does not exist results in an ENOENT error.\n<code>error.path</code> is the absolute file path.</p>"
            },
            {
              "textRaw": "`fs.realpath.native(path[, options], callback)`",
              "name": "native",
              "type": "method",
              "meta": {
                "added": [
                  "v9.2.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`resolvedPath` {string|Buffer}",
                          "name": "resolvedPath",
                          "type": "string|Buffer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man3/realpath.3.html\"><code>realpath(3)</code></a>.</p>\n<p>The <code>callback</code> gets two arguments <code>(err, resolvedPath)</code>.</p>\n<p>Only paths that can be converted to UTF8 strings are supported.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe path passed to the callback. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>\n<p>On Linux, when Node.js is linked against musl libc, the procfs file system must\nbe mounted on <code>/proc</code> in order for this function to work. Glibc does not have\nthis restriction.</p>"
            },
            {
              "textRaw": "`fs.rename(oldPath, newPath, callback)`",
              "name": "rename",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `oldPath` and `newPath` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`oldPath` {string|Buffer|URL}",
                      "name": "oldPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously rename file at <code>oldPath</code> to the pathname provided\nas <code>newPath</code>. In the case that <code>newPath</code> already exists, it will\nbe overwritten. If there is a directory at <code>newPath</code>, an error will\nbe raised instead. No arguments other than a possible exception are\ngiven to the completion callback.</p>\n<p>See also: <a href=\"http://man7.org/linux/man-pages/man2/rename.2.html\"><code>rename(2)</code></a>.</p>\n<pre><code class=\"language-mjs\">import { rename } from 'node:fs';\n\nrename('oldFile.txt', 'newFile.txt', (err) => {\n  if (err) throw err;\n  console.log('Rename complete!');\n});\n</code></pre>"
            },
            {
              "textRaw": "`fs.rmdir(path[, options], callback)`",
              "name": "rmdir",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58616",
                    "description": "Remove `recursive` option."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fs.rmdir(path, { recursive: true })` on a `path` that is a file is no longer permitted and results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fs.rmdir(path, { recursive: true })` on a `path` that does not exist is no longer permitted and results in a `ENOENT` error."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37302",
                    "description": "The `recursive` option is deprecated, using it triggers a deprecation warning."
                  },
                  {
                    "version": "v14.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35579",
                    "description": "The `recursive` option is deprecated, use `fs.rm` instead."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30644",
                    "description": "The `maxBusyTries` option is renamed to `maxRetries`, and its default is 0. The `emfileWait` option has been removed, and `EMFILE` errors use the same retry logic as other errors. The `retryDelay` option is now supported. `ENFILE` errors are now retried."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29168",
                    "description": "The `recursive`, `maxBusyTries`, and `emfileWait` options are now supported."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameters can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object} There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "name": "options",
                      "type": "Object",
                      "desc": "There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/rmdir.2.html\"><code>rmdir(2)</code></a>. No arguments other than a possible exception are given\nto the completion callback.</p>\n<p>Using <code>fs.rmdir()</code> on a file (not a directory) results in an <code>ENOENT</code> error on\nWindows and an <code>ENOTDIR</code> error on POSIX.</p>\n<p>To get a behavior similar to the <code>rm -rf</code> Unix command, use <a href=\"#fsrmpath-options-callback\"><code>fs.rm()</code></a>\nwith options <code>{ recursive: true, force: true }</code>.</p>"
            },
            {
              "textRaw": "`fs.rm(path[, options], callback)`",
              "name": "rm",
              "type": "method",
              "meta": {
                "added": [
                  "v14.14.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41132",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`force` {boolean} When `true`, exceptions will be ignored if `path` does not exist. **Default:** `false`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, exceptions will be ignored if `path` does not exist."
                        },
                        {
                          "textRaw": "`maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`. **Default:** `0`.",
                          "name": "maxRetries",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`."
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, perform a recursive removal. In recursive mode operations are retried on failure. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, perform a recursive removal. In recursive mode operations are retried on failure."
                        },
                        {
                          "textRaw": "`retryDelay` {integer} The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`. **Default:** `100`.",
                          "name": "retryDelay",
                          "type": "integer",
                          "default": "`100`",
                          "desc": "The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously removes files and directories (modeled on the standard POSIX <code>rm</code>\nutility). No arguments other than a possible exception are given to the\ncompletion callback.</p>"
            },
            {
              "textRaw": "`fs.stat(path[, options], callback)`",
              "name": "stat",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61178",
                    "description": "Accepts a `throwIfNoEntry` option to specify whether an exception should be thrown if the entry does not exist."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stats` {fs.Stats}",
                          "name": "stats",
                          "type": "fs.Stats"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/stat.2.html\"><code>stat(2)</code></a>. The callback gets two arguments <code>(err, stats)</code> where\n<code>stats</code> is an <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object.</p>\n<p>In case of an error, the <code>err.code</code> will be one of <a href=\"errors.html#common-system-errors\">Common System Errors</a>.</p>\n<p><a href=\"#fsstatpath-options-callback\"><code>fs.stat()</code></a> follows symbolic links. Use <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a> to look at the\nlinks themselves.</p>\n<p>Using <code>fs.stat()</code> to check for the existence of a file before calling\n<code>fs.open()</code>, <code>fs.readFile()</code>, or <code>fs.writeFile()</code> is not recommended.\nInstead, user code should open/read/write the file directly and handle the\nerror raised if the file is not available.</p>\n<p>To check if a file exists without manipulating it afterwards, <a href=\"#fsaccesspath-mode-callback\"><code>fs.access()</code></a>\nis recommended.</p>\n<p>For example, given the following directory structure:</p>\n<pre><code class=\"language-text\">- txtDir\n-- file.txt\n- app.js\n</code></pre>\n<p>The next program will check for the stats of the given paths:</p>\n<pre><code class=\"language-mjs\">import { stat } from 'node:fs';\n\nconst pathsToCheck = ['./txtDir', './txtDir/file.txt'];\n\nfor (let i = 0; i &#x3C; pathsToCheck.length; i++) {\n  stat(pathsToCheck[i], (err, stats) => {\n    console.log(stats.isDirectory());\n    console.log(stats);\n  });\n}\n</code></pre>\n<p>The resulting output will resemble:</p>\n<pre><code class=\"language-console\">true\nStats {\n  dev: 16777220,\n  mode: 16877,\n  nlink: 3,\n  uid: 501,\n  gid: 20,\n  rdev: 0,\n  blksize: 4096,\n  ino: 14214262,\n  size: 96,\n  blocks: 0,\n  atimeMs: 1561174653071.963,\n  mtimeMs: 1561174614583.3518,\n  ctimeMs: 1561174626623.5366,\n  birthtimeMs: 1561174126937.2893,\n  atime: 2019-06-22T03:37:33.072Z,\n  mtime: 2019-06-22T03:36:54.583Z,\n  ctime: 2019-06-22T03:37:06.624Z,\n  birthtime: 2019-06-22T03:28:46.937Z,\n  atimeInstant: 2019-06-22T03:37:33.071963Z,\n  mtimeInstant: 2019-06-22T03:36:54.5833518Z,\n  ctimeInstant: 2019-06-22T03:37:06.6235366Z,\n  birthtimeInstant: 2019-06-22T03:28:46.9372893Z\n}\nfalse\nStats {\n  dev: 16777220,\n  mode: 33188,\n  nlink: 1,\n  uid: 501,\n  gid: 20,\n  rdev: 0,\n  blksize: 4096,\n  ino: 14214074,\n  size: 8,\n  blocks: 8,\n  atimeMs: 1561174616618.8555,\n  mtimeMs: 1561174614584,\n  ctimeMs: 1561174614583.8145,\n  birthtimeMs: 1561174007710.7478,\n  atime: 2019-06-22T03:36:56.619Z,\n  mtime: 2019-06-22T03:36:54.584Z,\n  ctime: 2019-06-22T03:36:54.584Z,\n  birthtime: 2019-06-22T03:26:47.711Z,\n  atimeInstant: 2019-06-22T03:36:56.6188555Z,\n  mtimeInstant: 2019-06-22T03:36:54.584Z,\n  ctimeInstant: 2019-06-22T03:36:54.5838145Z,\n  birthtimeInstant: 2019-06-22T03:26:47.7107478Z\n}\n</code></pre>"
            },
            {
              "textRaw": "`fs.statfs(path[, options], callback)`",
              "name": "statfs",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.StatFs} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.StatFs} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`stats` {fs.StatFs}",
                          "name": "stats",
                          "type": "fs.StatFs"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronous <a href=\"http://man7.org/linux/man-pages/man2/statfs.2.html\"><code>statfs(2)</code></a>. Returns information about the mounted file system which\ncontains <code>path</code>. The callback gets two arguments <code>(err, stats)</code> where <code>stats</code> is an <a href=\"fs.html#class-fsstatfs\"><code>&#x3C;fs.StatFs></code></a> object.</p>\n<p>In case of an error, the <code>err.code</code> will be one of <a href=\"errors.html#common-system-errors\">Common System Errors</a>.</p>"
            },
            {
              "textRaw": "`fs.symlink(target, path[, type], callback)`",
              "name": "symlink",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23724",
                    "description": "If the `type` argument is left undefined, Node will autodetect `target` type and automatically select `dir` or `file`."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `target` and `path` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {string|Buffer|URL}",
                      "name": "target",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`type` {string|null} **Default:** `null`",
                      "name": "type",
                      "type": "string|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Creates the link called <code>path</code> pointing to <code>target</code>. No arguments other than a\npossible exception are given to the completion callback.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/symlink.2.html\"><code>symlink(2)</code></a> documentation for more details.</p>\n<p>The <code>type</code> argument is only available on Windows and ignored on other platforms.\nIt can be set to <code>'dir'</code>, <code>'file'</code>, or <code>'junction'</code>. If the <code>type</code> argument is\n<code>null</code>, Node.js will autodetect <code>target</code> type and use <code>'file'</code> or <code>'dir'</code>.\nIf the <code>target</code> does not exist, <code>'file'</code> will be used. Windows junction points\nrequire the destination path to be absolute. When using <code>'junction'</code>, the\n<code>target</code> argument will automatically be normalized to absolute path. Junction\npoints on NTFS volumes can only point to directories.</p>\n<p>Relative targets are relative to the link's parent directory.</p>\n<pre><code class=\"language-mjs\">import { symlink } from 'node:fs';\n\nsymlink('./mew', './mewtwo', callback);\n</code></pre>\n<p>The above example creates a symbolic link <code>mewtwo</code> which points to <code>mew</code> in the\nsame directory:</p>\n<pre><code class=\"language-bash\">$ tree .\n.\n├── mew\n└── mewtwo -> ./mew\n</code></pre>"
            },
            {
              "textRaw": "`fs.truncate(path[, len], callback)`",
              "name": "truncate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.8.6"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37460",
                    "description": "The error returned may be an `AggregateError` if more than one error is returned."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error|AggregateError}",
                          "name": "err",
                          "type": "Error|AggregateError"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the file. No arguments other than a possible exception are\ngiven to the completion callback. A file descriptor can also be passed as the\nfirst argument. In this case, <code>fs.ftruncate()</code> is called.</p>\n<pre><code class=\"language-mjs\">import { truncate } from 'node:fs';\n// Assuming that 'path/file.txt' is a regular file.\ntruncate('path/file.txt', (err) => {\n  if (err) throw err;\n  console.log('path/file.txt was truncated');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { truncate } = require('node:fs');\n// Assuming that 'path/file.txt' is a regular file.\ntruncate('path/file.txt', (err) => {\n  if (err) throw err;\n  console.log('path/file.txt was truncated');\n});\n</code></pre>\n<p>Passing a file descriptor is deprecated and may result in an error being thrown\nin the future.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/truncate.2.html\"><code>truncate(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.unlink(path, callback)`",
              "name": "unlink",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Asynchronously removes a file or symbolic link. No arguments other than a\npossible exception are given to the completion callback.</p>\n<pre><code class=\"language-mjs\">import { unlink } from 'node:fs';\n// Assuming that 'path/file.txt' is a regular file.\nunlink('path/file.txt', (err) => {\n  if (err) throw err;\n  console.log('path/file.txt was deleted');\n});\n</code></pre>\n<p><code>fs.unlink()</code> will not work on a directory, empty or otherwise. To remove a\ndirectory, use <a href=\"#fsrmdirpath-options-callback\"><code>fs.rmdir()</code></a>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.unwatchFile(filename[, listener])`",
              "name": "unwatchFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|Buffer|URL}",
                      "name": "filename",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`listener` {Function} Optional, a listener previously attached using `fs.watchFile()`",
                      "name": "listener",
                      "type": "Function",
                      "desc": "Optional, a listener previously attached using `fs.watchFile()`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Stop watching for changes on <code>filename</code>. If <code>listener</code> is specified, only that\nparticular listener is removed. Otherwise, <em>all</em> listeners are removed,\neffectively stopping watching of <code>filename</code>.</p>\n<p>Calling <code>fs.unwatchFile()</code> with a filename that is not being watched is a\nno-op, not an error.</p>\n<p>Using <a href=\"#fswatchfilename-options-listener\"><code>fs.watch()</code></a> is more efficient than <code>fs.watchFile()</code> and\n<code>fs.unwatchFile()</code>. <code>fs.watch()</code> should be used instead of <code>fs.watchFile()</code>\nand <code>fs.unwatchFile()</code> when possible.</p>"
            },
            {
              "textRaw": "`fs.utimes(path, atime, mtime, callback)`",
              "name": "utimes",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11919",
                    "description": "`NaN`, `Infinity`, and `-Infinity` are no longer valid time specifiers."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v4.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2387",
                    "description": "Numeric strings, `NaN`, and `Infinity` are now allowed time specifiers."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Change the file system timestamps of the object referenced by <code>path</code>.</p>\n<p>The <code>atime</code> and <code>mtime</code> arguments follow these rules:</p>\n<ul>\n<li>Values can be either numbers representing Unix epoch time in seconds,\n<code>Date</code>s, or a numeric string like <code>'123456789.0'</code>.</li>\n<li>If the value can not be converted to a number, or is <code>NaN</code>, <code>Infinity</code>, or\n<code>-Infinity</code>, an <code>Error</code> will be thrown.</li>\n</ul>"
            },
            {
              "textRaw": "`fs.watch(filename[, options][, listener])`",
              "name": "watch",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.10"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61870",
                    "description": "Added `throwIfNoEntry` option."
                  },
                  {
                    "version": "v19.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/45098",
                    "description": "Added recursive support for Linux, AIX and IBMi."
                  },
                  {
                    "version": [
                      "v15.9.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37190",
                    "description": "Added support for closing the watcher with an AbortSignal."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `filename` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|Buffer|URL}",
                      "name": "filename",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`persistent` {boolean} Indicates whether the process should continue to run as long as files are being watched. **Default:** `true`.",
                          "name": "persistent",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Indicates whether the process should continue to run as long as files are being watched."
                        },
                        {
                          "textRaw": "`recursive` {boolean} Indicates whether all subdirectories should be watched, or only the current directory. This applies when a directory is specified, and only on supported platforms (See caveats). **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Indicates whether all subdirectories should be watched, or only the current directory. This applies when a directory is specified, and only on supported platforms (See caveats)."
                        },
                        {
                          "textRaw": "`encoding` {string} Specifies the character encoding to be used for the filename passed to the listener. **Default:** `'utf8'`.",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`",
                          "desc": "Specifies the character encoding to be used for the filename passed to the listener."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows closing the watcher with an AbortSignal.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows closing the watcher with an AbortSignal."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Indicates whether an exception should be thrown when the path does not exist. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Indicates whether an exception should be thrown when the path does not exist."
                        },
                        {
                          "textRaw": "`ignore` {string|RegExp|Function|Array} Pattern(s) to ignore. Strings are glob patterns (using `minimatch`), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to ignore. **Default:** `undefined`.",
                          "name": "ignore",
                          "type": "string|RegExp|Function|Array",
                          "default": "`undefined`",
                          "desc": "Pattern(s) to ignore. Strings are glob patterns (using `minimatch`), RegExp patterns are tested against the filename, and functions receive the filename and return `true` to ignore."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`listener` {Function|undefined} **Default:** `undefined`",
                      "name": "listener",
                      "type": "Function|undefined",
                      "default": "`undefined`",
                      "options": [
                        {
                          "textRaw": "`eventType` {string}",
                          "name": "eventType",
                          "type": "string"
                        },
                        {
                          "textRaw": "`filename` {string|Buffer|null}",
                          "name": "filename",
                          "type": "string|Buffer|null"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.FSWatcher}",
                    "name": "return",
                    "type": "fs.FSWatcher"
                  }
                }
              ],
              "desc": "<p>Watch for changes on <code>filename</code>, where <code>filename</code> is either a file or a\ndirectory.</p>\n<p>The second argument is optional. If <code>options</code> is provided as a string, it\nspecifies the <code>encoding</code>. Otherwise <code>options</code> should be passed as an object.</p>\n<p>The listener callback gets two arguments <code>(eventType, filename)</code>. <code>eventType</code>\nis either <code>'rename'</code> or <code>'change'</code>, and <code>filename</code> is the name of the file\nwhich triggered the event.</p>\n<p>On most platforms, <code>'rename'</code> is emitted whenever a filename appears or\ndisappears in the directory.</p>\n<p>The listener callback is attached to the <code>'change'</code> event fired by\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a>, but it is not the same thing as the <code>'change'</code> value of\n<code>eventType</code>.</p>\n<p>If a <code>signal</code> is passed, aborting the corresponding AbortController will close\nthe returned <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a>.</p>",
              "miscs": [
                {
                  "textRaw": "Caveats",
                  "name": "Caveats",
                  "type": "misc",
                  "desc": "<p>The <code>fs.watch</code> API is not 100% consistent across platforms, and is\nunavailable in some situations.</p>\n<p>On Windows, no events will be emitted if the watched directory is moved or\nrenamed. An <code>EPERM</code> error is reported when the watched directory is deleted.</p>\n<p>The <code>fs.watch</code> API does not provide any protection with respect\nto malicious actions on the file system. For example, on Windows it is\nimplemented by monitoring changes in a directory versus specific files. This\nallows substitution of a file and fs reporting changes on the new file\nwith the same filename.</p>",
                  "miscs": [
                    {
                      "textRaw": "Availability",
                      "name": "Availability",
                      "type": "misc",
                      "desc": "<p>This feature depends on the underlying operating system providing a way\nto be notified of file system changes.</p>\n<ul>\n<li>On Linux systems, this uses <a href=\"https://man7.org/linux/man-pages/man7/inotify.7.html\"><code>inotify(7)</code></a>.</li>\n<li>On BSD systems, this uses <a href=\"https://www.freebsd.org/cgi/man.cgi?query=kqueue&#x26;sektion=2\"><code>kqueue(2)</code></a>.</li>\n<li>On macOS, this uses <a href=\"https://www.freebsd.org/cgi/man.cgi?query=kqueue&#x26;sektion=2\"><code>kqueue(2)</code></a> for files and <a href=\"https://developer.apple.com/documentation/coreservices/file_system_events\"><code>FSEvents</code></a> for\ndirectories.</li>\n<li>On SunOS systems (including Solaris and SmartOS), this uses <a href=\"https://illumos.org/man/port_create\"><code>event ports</code></a>.</li>\n<li>On Windows systems, this feature depends on <a href=\"https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-readdirectorychangesw\"><code>ReadDirectoryChangesW</code></a>.</li>\n<li>On AIX systems, this feature depends on <a href=\"https://developer.ibm.com/articles/au-aix_event_infrastructure/\"><code>AHAFS</code></a>, which must be enabled.</li>\n<li>On IBM i systems, this feature is not supported.</li>\n</ul>\n<p>If the underlying functionality is not available for some reason, then\n<code>fs.watch()</code> will not be able to function and may throw an exception.\nFor example, watching files or directories can be unreliable, and in some\ncases impossible, on network file systems (NFS, SMB, etc) or host file systems\nwhen using virtualization software such as Vagrant or Docker.</p>\n<p>It is still possible to use <code>fs.watchFile()</code>, which uses stat polling, but\nthis method is slower and less reliable.</p>"
                    },
                    {
                      "textRaw": "Inodes",
                      "name": "Inodes",
                      "type": "misc",
                      "desc": "<p>On Linux and macOS systems, <code>fs.watch()</code> resolves the path to an <a href=\"https://en.wikipedia.org/wiki/Inode\">inode</a> and\nwatches the inode. If the watched path is deleted and recreated, it is assigned\na new inode. The watch will emit an event for the delete but will continue\nwatching the <em>original</em> inode. Events for the new inode will not be emitted.\nThis is expected behavior.</p>\n<p>AIX files retain the same inode for the lifetime of a file. Saving and closing a\nwatched file on AIX will result in two notifications (one for adding new\ncontent, and one for truncation).</p>"
                    },
                    {
                      "textRaw": "Filename argument",
                      "name": "Filename argument",
                      "type": "misc",
                      "desc": "<p>Providing <code>filename</code> argument in the callback is only supported on Linux,\nmacOS, Windows, and AIX. Even on supported platforms, <code>filename</code> is not always\nguaranteed to be provided. Therefore, don't assume that <code>filename</code> argument is\nalways provided in the callback, and have some fallback logic if it is <code>null</code>.</p>\n<pre><code class=\"language-mjs\">import { watch } from 'node:fs';\nwatch('somedir', (eventType, filename) => {\n  console.log(`event type is: ${eventType}`);\n  if (filename) {\n    console.log(`filename provided: ${filename}`);\n  } else {\n    console.log('filename not provided');\n  }\n});\n</code></pre>"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`fs.watchFile(filename[, options], listener)`",
              "name": "watchFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "The `bigint` option is now supported."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `filename` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|Buffer|URL}",
                      "name": "filename",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} **Default:** `false`",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`persistent` {boolean} **Default:** `true`",
                          "name": "persistent",
                          "type": "boolean",
                          "default": "`true`"
                        },
                        {
                          "textRaw": "`interval` {integer} **Default:** `5007`",
                          "name": "interval",
                          "type": "integer",
                          "default": "`5007`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`listener` {Function}",
                      "name": "listener",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`current` {fs.Stats}",
                          "name": "current",
                          "type": "fs.Stats"
                        },
                        {
                          "textRaw": "`previous` {fs.Stats}",
                          "name": "previous",
                          "type": "fs.Stats"
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.StatWatcher}",
                    "name": "return",
                    "type": "fs.StatWatcher"
                  }
                }
              ],
              "desc": "<p>Watch for changes on <code>filename</code>. The callback <code>listener</code> will be called each\ntime the file is accessed.</p>\n<p>The <code>options</code> argument may be omitted. If provided, it should be an object. The\n<code>options</code> object may contain a boolean named <code>persistent</code> that indicates\nwhether the process should continue to run as long as files are being watched.\nThe <code>options</code> object may specify an <code>interval</code> property indicating how often the\ntarget should be polled in milliseconds.</p>\n<p>The <code>listener</code> gets two arguments the current stat object and the previous\nstat object:</p>\n<pre><code class=\"language-mjs\">import { watchFile } from 'node:fs';\n\nwatchFile('message.text', (curr, prev) => {\n  console.log(`the current mtime is: ${curr.mtime}`);\n  console.log(`the previous mtime was: ${prev.mtime}`);\n});\n</code></pre>\n<p>These stat objects are instances of <code>fs.Stat</code>. If the <code>bigint</code> option is <code>true</code>,\nthe numeric values in these objects are specified as <code>BigInt</code>s.</p>\n<p>To be notified when the file was modified, not just accessed, it is necessary\nto compare <code>curr.mtimeMs</code> and <code>prev.mtimeMs</code>.</p>\n<p>When an <code>fs.watchFile</code> operation results in an <code>ENOENT</code> error, it\nwill invoke the listener once, with all the fields zeroed (or, for dates, the\nUnix Epoch). If the file is created later on, the listener will be called\nagain, with the latest stat objects. This is a change in functionality since\nv0.10.</p>\n<p>Using <a href=\"#fswatchfilename-options-listener\"><code>fs.watch()</code></a> is more efficient than <code>fs.watchFile</code> and\n<code>fs.unwatchFile</code>. <code>fs.watch</code> should be used instead of <code>fs.watchFile</code> and\n<code>fs.unwatchFile</code> when possible.</p>\n<p>When a file being watched by <code>fs.watchFile()</code> disappears and reappears,\nthen the contents of <code>previous</code> in the second callback event (the file's\nreappearance) will be the same as the contents of <code>previous</code> in the first\ncallback event (its disappearance).</p>\n<p>This happens when:</p>\n<ul>\n<li>the file is deleted, followed by a restore</li>\n<li>the file is renamed and then renamed a second time back to its original name</li>\n</ul>"
            },
            {
              "textRaw": "`fs.write(fd, buffer, offset[, length[, position]], callback)`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `buffer` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `buffer` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `buffer` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7856",
                    "description": "The `offset` and `length` parameters are optional now."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`offset` {integer} **Default:** `0`",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`"
                    },
                    {
                      "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                      "name": "length",
                      "type": "integer",
                      "default": "`buffer.byteLength - offset`",
                      "optional": true
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesWritten` {integer}",
                          "name": "bytesWritten",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Write <code>buffer</code> to the file specified by <code>fd</code>.</p>\n<p><code>offset</code> determines the part of the buffer to be written, and <code>length</code> is\nan integer specifying the number of bytes to write.</p>\n<p><code>position</code> refers to the offset from the beginning of the file where this data\nshould be written. If <code>typeof position !== 'number'</code>, the data will be written\nat the current position. See <a href=\"http://man7.org/linux/man-pages/man2/pwrite.2.html\"><code>pwrite(2)</code></a>.</p>\n<p>The callback will be given three arguments <code>(err, bytesWritten, buffer)</code> where\n<code>bytesWritten</code> specifies how many <em>bytes</em> were written from <code>buffer</code>.</p>\n<p>If this method is invoked as its <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed version, it returns\na promise for an <code>Object</code> with <code>bytesWritten</code> and <code>buffer</code> properties.</p>\n<p>It is unsafe to use <code>fs.write()</code> multiple times on the same file without waiting\nfor the callback. For this scenario, <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> is\nrecommended.</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
            },
            {
              "textRaw": "`fs.write(fd, buffer[, options], callback)`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|null} **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesWritten` {integer}",
                          "name": "bytesWritten",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Write <code>buffer</code> to the file specified by <code>fd</code>.</p>\n<p>Similar to the above <code>fs.write</code> function, this version takes an\noptional <code>options</code> object. If no <code>options</code> object is specified, it will\ndefault with the above values.</p>"
            },
            {
              "textRaw": "`fs.write(fd, string[, position[, encoding]], callback)`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42796",
                    "description": "Passing to the `string` parameter an object with an own `toString` function is no longer supported."
                  },
                  {
                    "version": "v17.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42149",
                    "description": "Passing to the `string` parameter an object with an own `toString` function is deprecated."
                  },
                  {
                    "version": "v14.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34993",
                    "description": "The `string` parameter will stringify an object with an explicit `toString` function."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `string` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7856",
                    "description": "The `position` parameter is optional now."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`string` {string}",
                      "name": "string",
                      "type": "string"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`written` {integer}",
                          "name": "written",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`string` {string}",
                          "name": "string",
                          "type": "string"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Write <code>string</code> to the file specified by <code>fd</code>. If <code>string</code> is not a string,\nan exception is thrown.</p>\n<p><code>position</code> refers to the offset from the beginning of the file where this data\nshould be written. If <code>typeof position !== 'number'</code> the data will be written at\nthe current position. See <a href=\"http://man7.org/linux/man-pages/man2/pwrite.2.html\"><code>pwrite(2)</code></a>.</p>\n<p><code>encoding</code> is the expected string encoding.</p>\n<p>The callback will receive the arguments <code>(err, written, string)</code> where <code>written</code>\nspecifies how many <em>bytes</em> the passed string required to be written. Bytes\nwritten is not necessarily the same as string characters written. See\n<a href=\"buffer.html#static-method-bufferbytelengthstring-encoding\"><code>Buffer.byteLength</code></a>.</p>\n<p>It is unsafe to use <code>fs.write()</code> multiple times on the same file without waiting\nfor the callback. For this scenario, <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> is\nrecommended.</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>\n<p>On Windows, if the file descriptor is connected to the console (e.g. <code>fd == 1</code>\nor <code>stdout</code>) a string containing non-ASCII characters will not be rendered\nproperly by default, regardless of the encoding used.\nIt is possible to configure the console to render UTF-8 properly by changing the\nactive codepage with the <code>chcp 65001</code> command. See the <a href=\"https://ss64.com/nt/chcp.html\">chcp</a> docs for more\ndetails.</p>"
            },
            {
              "textRaw": "`fs.writeFile(file, data[, options], callback)`",
              "name": "writeFile",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.0.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50009",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42796",
                    "description": "Passing to the `string` parameter an object with an own `toString` function is no longer supported."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v17.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42149",
                    "description": "Passing to the `string` parameter an object with an own `toString` function is deprecated."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37460",
                    "description": "The error returned may be an `AggregateError` if more than one error is returned."
                  },
                  {
                    "version": [
                      "v15.2.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35993",
                    "description": "The options argument may include an AbortSignal to abort an ongoing writeFile request."
                  },
                  {
                    "version": "v14.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34993",
                    "description": "The `data` parameter will stringify an object with an explicit `toString` function."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `data` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12562",
                    "description": "The `callback` parameter is no longer optional. Not passing it will throw a `TypeError` at runtime."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `data` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7897",
                    "description": "The `callback` parameter is no longer optional. Not passing it will emit a deprecation warning with id DEP0013."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `file` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`file` {string|Buffer|URL|integer} filename or file descriptor",
                      "name": "file",
                      "type": "string|Buffer|URL|integer",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'w'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'w'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If all data is successfully written to the file, and `flush` is `true`, `fs.fsync()` is used to flush the data. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If all data is successfully written to the file, and `flush` is `true`, `fs.fsync()` is used to flush the data."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting an in-progress writeFile",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting an in-progress writeFile"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error|AggregateError}",
                          "name": "err",
                          "type": "Error|AggregateError"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>When <code>file</code> is a filename, asynchronously writes data to the file, replacing the\nfile if it already exists. <code>data</code> can be a string or a buffer.</p>\n<p>When <code>file</code> is a file descriptor, the behavior is similar to calling\n<code>fs.write()</code> directly (which is recommended). See the notes below on using\na file descriptor.</p>\n<p>The <code>encoding</code> option is ignored if <code>data</code> is a buffer.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<pre><code class=\"language-mjs\">import { writeFile } from 'node:fs';\nimport { Buffer } from 'node:buffer';\n\nconst data = new Uint8Array(Buffer.from('Hello Node.js'));\nwriteFile('message.txt', data, (err) => {\n  if (err) throw err;\n  console.log('The file has been saved!');\n});\n</code></pre>\n<p>If <code>options</code> is a string, then it specifies the encoding:</p>\n<pre><code class=\"language-mjs\">import { writeFile } from 'node:fs';\n\nwriteFile('message.txt', 'Hello Node.js', 'utf8', callback);\n</code></pre>\n<p>It is unsafe to use <code>fs.writeFile()</code> multiple times on the same file without\nwaiting for the callback. For this scenario, <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> is\nrecommended.</p>\n<p>Similarly to <code>fs.readFile</code> - <code>fs.writeFile</code> is a convenience method that\nperforms multiple <code>write</code> calls internally to write the buffer passed to it.\nFor performance sensitive code consider using <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a>.</p>\n<p>It is possible to use an <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> to cancel an <code>fs.writeFile()</code>.\nCancelation is \"best effort\", and some amount of data is likely still\nto be written.</p>\n<pre><code class=\"language-mjs\">import { writeFile } from 'node:fs';\nimport { Buffer } from 'node:buffer';\n\nconst controller = new AbortController();\nconst { signal } = controller;\nconst data = new Uint8Array(Buffer.from('Hello Node.js'));\nwriteFile('message.txt', data, { signal }, (err) => {\n  // When a request is aborted - the callback is called with an AbortError\n});\n// When the request should be aborted\ncontroller.abort();\n</code></pre>\n<p>Aborting an ongoing request does not abort individual operating\nsystem requests but rather the internal buffering <code>fs.writeFile</code> performs.</p>",
              "modules": [
                {
                  "textRaw": "Using `fs.writeFile()` with file descriptors",
                  "name": "using_`fs.writefile()`_with_file_descriptors",
                  "type": "module",
                  "desc": "<p>When <code>file</code> is a file descriptor, the behavior is almost identical to directly\ncalling <code>fs.write()</code> like:</p>\n<pre><code class=\"language-mjs\">import { write } from 'node:fs';\nimport { Buffer } from 'node:buffer';\n\nwrite(fd, Buffer.from(data, options.encoding), callback);\n</code></pre>\n<p>The difference from directly calling <code>fs.write()</code> is that under some unusual\nconditions, <code>fs.write()</code> might write only part of the buffer and need to be\nretried to write the remaining data, whereas <code>fs.writeFile()</code> retries until\nthe data is entirely written (or an error occurs).</p>\n<p>The implications of this are a common source of confusion. In\nthe file descriptor case, the file is not replaced! The data is not necessarily\nwritten to the beginning of the file, and the file's original data may remain\nbefore and/or after the newly written data.</p>\n<p>For example, if <code>fs.writeFile()</code> is called twice in a row, first to write the\nstring <code>'Hello'</code>, then to write the string <code>', World'</code>, the file would contain\n<code>'Hello, World'</code>, and might contain some of the file's original data (depending\non the size of the original file, and the position of the file descriptor). If\na file name had been used instead of a descriptor, the file would be guaranteed\nto contain only <code>', World'</code>.</p>",
                  "displayName": "Using `fs.writeFile()` with file descriptors"
                }
              ]
            },
            {
              "textRaw": "`fs.writev(fd, buffers[, position], callback)`",
              "name": "writev",
              "type": "method",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffers` {ArrayBufferView[]}",
                      "name": "buffers",
                      "type": "ArrayBufferView[]"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`bytesWritten` {integer}",
                          "name": "bytesWritten",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`buffers` {ArrayBufferView[]}",
                          "name": "buffers",
                          "type": "ArrayBufferView[]"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Write an array of <code>ArrayBufferView</code>s to the file specified by <code>fd</code> using\n<code>writev()</code>.</p>\n<p><code>position</code> is the offset from the beginning of the file where this data\nshould be written. If <code>typeof position !== 'number'</code>, the data will be written\nat the current position.</p>\n<p>The callback will be given three arguments: <code>err</code>, <code>bytesWritten</code>, and\n<code>buffers</code>. <code>bytesWritten</code> is how many bytes were written from <code>buffers</code>.</p>\n<p>If this method is <a href=\"util.html#utilpromisifyoriginal\"><code>util.promisify()</code></a>ed, it returns a promise for an\n<code>Object</code> with <code>bytesWritten</code> and <code>buffers</code> properties.</p>\n<p>It is unsafe to use <code>fs.writev()</code> multiple times on the same file without\nwaiting for the callback. For this scenario, use <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a>.</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>"
            }
          ],
          "displayName": "Callback API"
        },
        {
          "textRaw": "Synchronous API",
          "name": "synchronous_api",
          "type": "module",
          "desc": "<p>The synchronous APIs perform all operations synchronously, blocking the\nevent loop until the operation completes or fails.</p>",
          "methods": [
            {
              "textRaw": "`fs.accessSync(path[, mode])`",
              "name": "accessSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.15"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer} **Default:** `fs.constants.F_OK`",
                      "name": "mode",
                      "type": "integer",
                      "default": "`fs.constants.F_OK`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously tests a user's permissions for the file or directory specified\nby <code>path</code>. The <code>mode</code> argument is an optional integer that specifies the\naccessibility checks to be performed. <code>mode</code> should be either the value\n<code>fs.constants.F_OK</code> or a mask consisting of the bitwise OR of any of\n<code>fs.constants.R_OK</code>, <code>fs.constants.W_OK</code>, and <code>fs.constants.X_OK</code> (e.g.\n<code>fs.constants.W_OK | fs.constants.R_OK</code>). Check <a href=\"#file-access-constants\">File access constants</a> for\npossible values of <code>mode</code>.</p>\n<p>If any of the accessibility checks fail, an <code>Error</code> will be thrown. Otherwise,\nthe method will return <code>undefined</code>.</p>\n<pre><code class=\"language-mjs\">import { accessSync, constants } from 'node:fs';\n\ntry {\n  accessSync('etc/passwd', constants.R_OK | constants.W_OK);\n  console.log('can read/write');\n} catch (err) {\n  console.error('no access!');\n}\n</code></pre>"
            },
            {
              "textRaw": "`fs.appendFileSync(path, data[, options])`",
              "name": "appendFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.7"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.1.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50095",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7831",
                    "description": "The passed `options` object will never be modified."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `file` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|number} filename or file descriptor",
                      "name": "path",
                      "type": "string|Buffer|URL|number",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`data` {string|Buffer}",
                      "name": "data",
                      "type": "string|Buffer"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'a'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'a'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If `true`, the underlying file descriptor is flushed prior to closing it. **Default:** `false`.",
                          "name": "flush",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the underlying file descriptor is flushed prior to closing it."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously append data to a file, creating the file if it does not yet\nexist. <code>data</code> can be a string or a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>\n<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<pre><code class=\"language-mjs\">import { appendFileSync } from 'node:fs';\n\ntry {\n  appendFileSync('message.txt', 'data to append');\n  console.log('The \"data to append\" was appended to file!');\n} catch (err) {\n  /* Handle the error */\n}\n</code></pre>\n<p>If <code>options</code> is a string, then it specifies the encoding:</p>\n<pre><code class=\"language-mjs\">import { appendFileSync } from 'node:fs';\n\nappendFileSync('message.txt', 'data to append', 'utf8');\n</code></pre>\n<p>The <code>path</code> may be specified as a numeric file descriptor that has been opened\nfor appending (using <code>fs.open()</code> or <code>fs.openSync()</code>). The file descriptor will\nnot be closed automatically.</p>\n<pre><code class=\"language-mjs\">import { openSync, closeSync, appendFileSync } from 'node:fs';\n\nlet fd;\n\ntry {\n  fd = openSync('message.txt', 'a');\n  appendFileSync(fd, 'data to append', 'utf8');\n} catch (err) {\n  /* Handle the error */\n} finally {\n  if (fd !== undefined)\n    closeSync(fd);\n}\n</code></pre>"
            },
            {
              "textRaw": "`fs.chmodSync(path, mode)`",
              "name": "chmodSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.7"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    }
                  ]
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fschmodpath-mode-callback\"><code>fs.chmod()</code></a>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.chownSync(path, uid, gid)`",
              "name": "chownSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.97"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer}",
                      "name": "uid",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`gid` {integer}",
                      "name": "gid",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously changes owner and group of a file. Returns <code>undefined</code>.\nThis is the synchronous version of <a href=\"#fschownpath-uid-gid-callback\"><code>fs.chown()</code></a>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.closeSync(fd)`",
              "name": "closeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Closes the file descriptor. Returns <code>undefined</code>.</p>\n<p>Calling <code>fs.closeSync()</code> on any file descriptor (<code>fd</code>) that is currently in use\nthrough any other <code>fs</code> operation may lead to undefined behavior.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/close.2.html\"><code>close(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.copyFileSync(src, dest[, mode])`",
              "name": "copyFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27044",
                    "description": "Changed `flags` argument to `mode` and imposed stricter type validation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|Buffer|URL} source filename to copy",
                      "name": "src",
                      "type": "string|Buffer|URL",
                      "desc": "source filename to copy"
                    },
                    {
                      "textRaw": "`dest` {string|Buffer|URL} destination filename of the copy operation",
                      "name": "dest",
                      "type": "string|Buffer|URL",
                      "desc": "destination filename of the copy operation"
                    },
                    {
                      "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`.",
                      "name": "mode",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "modifiers for copy operation.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously copies <code>src</code> to <code>dest</code>. By default, <code>dest</code> is overwritten if it\nalready exists. Returns <code>undefined</code>. Node.js makes no guarantees about the\natomicity of the copy operation. If an error occurs after the destination file\nhas been opened for writing, Node.js will attempt to remove the destination.</p>\n<p><code>mode</code> is an optional integer that specifies the behavior\nof the copy operation. It is possible to create a mask consisting of the bitwise\nOR of two or more values (e.g.\n<code>fs.constants.COPYFILE_EXCL | fs.constants.COPYFILE_FICLONE</code>).</p>\n<ul>\n<li><code>fs.constants.COPYFILE_EXCL</code>: The copy operation will fail if <code>dest</code> already\nexists.</li>\n<li><code>fs.constants.COPYFILE_FICLONE</code>: The copy operation will attempt to create a\ncopy-on-write reflink. If the platform does not support copy-on-write, then a\nfallback copy mechanism is used.</li>\n<li><code>fs.constants.COPYFILE_FICLONE_FORCE</code>: The copy operation will attempt to\ncreate a copy-on-write reflink. If the platform does not support\ncopy-on-write, then the operation will fail.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { copyFileSync, constants } from 'node:fs';\n\n// destination.txt will be created or overwritten by default.\ncopyFileSync('source.txt', 'destination.txt');\nconsole.log('source.txt was copied to destination.txt');\n\n// By using COPYFILE_EXCL, the operation will fail if destination.txt exists.\ncopyFileSync('source.txt', 'destination.txt', constants.COPYFILE_EXCL);\n</code></pre>"
            },
            {
              "textRaw": "`fs.cpSync(src, dest[, options])`",
              "name": "cpSync",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v22.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/53127",
                    "description": "This API is no longer experimental."
                  },
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47084",
                    "description": "Accept an additional `mode` option to specify the copy behavior as the `mode` argument of `fs.copyFile()`."
                  },
                  {
                    "version": [
                      "v17.6.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41819",
                    "description": "Accepts an additional `verbatimSymlinks` option to specify whether to perform path resolution for symlinks."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string|URL} source path to copy.",
                      "name": "src",
                      "type": "string|URL",
                      "desc": "source path to copy."
                    },
                    {
                      "textRaw": "`dest` {string|URL} destination path to copy to.",
                      "name": "dest",
                      "type": "string|URL",
                      "desc": "destination path to copy to."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`dereference` {boolean} dereference symlinks. **Default:** `false`.",
                          "name": "dereference",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "dereference symlinks."
                        },
                        {
                          "textRaw": "`errorOnExist` {boolean} when `force` is `false`, and the destination exists, throw an error. **Default:** `false`.",
                          "name": "errorOnExist",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "when `force` is `false`, and the destination exists, throw an error."
                        },
                        {
                          "textRaw": "`filter` {Function} Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well. **Default:** `undefined`",
                          "name": "filter",
                          "type": "Function",
                          "default": "`undefined`",
                          "desc": "Function to filter copied files/directories. Return `true` to copy the item, `false` to ignore it. When ignoring a directory, all of its contents will be skipped as well.",
                          "options": [
                            {
                              "textRaw": "`src` {string} source path to copy.",
                              "name": "src",
                              "type": "string",
                              "desc": "source path to copy."
                            },
                            {
                              "textRaw": "`dest` {string} destination path to copy to.",
                              "name": "dest",
                              "type": "string",
                              "desc": "destination path to copy to."
                            },
                            {
                              "textRaw": "Returns: {boolean} Any non-`Promise` value that is coercible to `boolean`.",
                              "name": "return",
                              "type": "boolean",
                              "desc": "Any non-`Promise` value that is coercible to `boolean`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`force` {boolean} overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior. **Default:** `true`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "overwrite existing file or directory. The copy operation will ignore errors if you set this to false and the destination exists. Use the `errorOnExist` option to change this behavior."
                        },
                        {
                          "textRaw": "`mode` {integer} modifiers for copy operation. **Default:** `0`. See `mode` flag of `fs.copyFileSync()`.",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0`. See `mode` flag of `fs.copyFileSync()`",
                          "desc": "modifiers for copy operation."
                        },
                        {
                          "textRaw": "`preserveTimestamps` {boolean} When `true` timestamps from `src` will be preserved. **Default:** `false`.",
                          "name": "preserveTimestamps",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true` timestamps from `src` will be preserved."
                        },
                        {
                          "textRaw": "`recursive` {boolean} copy directories recursively **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "copy directories recursively"
                        },
                        {
                          "textRaw": "`verbatimSymlinks` {boolean} When `true`, path resolution for symlinks will be skipped. **Default:** `false`",
                          "name": "verbatimSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, path resolution for symlinks will be skipped."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously copies the entire directory structure from <code>src</code> to <code>dest</code>,\nincluding subdirectories and files.</p>\n<p>When copying a directory to another directory, globs are not supported and\nbehavior is similar to <code>cp dir1/ dir2/</code>.</p>"
            },
            {
              "textRaw": "`fs.existsSync(path)`",
              "name": "existsSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the path exists, <code>false</code> otherwise.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsexistspath-callback\"><code>fs.exists()</code></a>.</p>\n<p><code>fs.exists()</code> is deprecated, but <code>fs.existsSync()</code> is not. The <code>callback</code>\nparameter to <code>fs.exists()</code> accepts parameters that are inconsistent with other\nNode.js callbacks. <code>fs.existsSync()</code> does not use a callback.</p>\n<pre><code class=\"language-mjs\">import { existsSync } from 'node:fs';\n\nif (existsSync('/etc/passwd'))\n  console.log('The path exists.');\n</code></pre>"
            },
            {
              "textRaw": "`fs.fchmodSync(fd, mode)`",
              "name": "fchmodSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`mode` {string|integer}",
                      "name": "mode",
                      "type": "string|integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the permissions on the file. Returns <code>undefined</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fchmod.2.html\"><code>fchmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fchownSync(fd, uid, gid)`",
              "name": "fchownSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`uid` {integer} The file's new owner's user id.",
                      "name": "uid",
                      "type": "integer",
                      "desc": "The file's new owner's user id."
                    },
                    {
                      "textRaw": "`gid` {integer} The file's new group's group id.",
                      "name": "gid",
                      "type": "integer",
                      "desc": "The file's new group's group id."
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the owner of the file. Returns <code>undefined</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fchown.2.html\"><code>fchown(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fdatasyncSync(fd)`",
              "name": "fdatasyncSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.96"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Forces all currently queued I/O operations associated with the file to the\noperating system's synchronized I/O completion state. Refer to the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/fdatasync.2.html\"><code>fdatasync(2)</code></a> documentation for details. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.fstatSync(fd[, options])`",
              "name": "fstatSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.95"
                ],
                "changes": [
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.Stats}",
                    "name": "return",
                    "type": "fs.Stats"
                  }
                }
              ],
              "desc": "<p>Retrieves the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the file descriptor.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fstat.2.html\"><code>fstat(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.fsyncSync(fd)`",
              "name": "fsyncSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.96"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Request that all data for the open file descriptor is flushed to the storage\ndevice. The specific implementation is operating system and device specific.\nRefer to the POSIX <a href=\"http://man7.org/linux/man-pages/man2/fsync.2.html\"><code>fsync(2)</code></a> documentation for more detail. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.ftruncateSync(fd[, len])`",
              "name": "ftruncateSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.8.6"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the file descriptor. Returns <code>undefined</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsftruncatefd-len-callback\"><code>fs.ftruncate()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.futimesSync(fd, atime, mtime)`",
              "name": "futimesSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v4.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2387",
                    "description": "Numeric strings, `NaN`, and `Infinity` are now allowed time specifiers."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronous version of <a href=\"#fsfutimesfd-atime-mtime-callback\"><code>fs.futimes()</code></a>. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.globSync(pattern[, options])`",
              "name": "globSync",
              "type": "method",
              "meta": {
                "added": [
                  "v22.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62695",
                    "description": "Add support for the `followSymlinks` option."
                  },
                  {
                    "version": [
                      "v24.1.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58182",
                    "description": "Add support for `URL` instances for `cwd` option."
                  },
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  },
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56489",
                    "description": "Add support for `exclude` option to accept glob patterns."
                  },
                  {
                    "version": "v22.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/52837",
                    "description": "Add support for `withFileTypes` as an option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pattern` {string|string[]}",
                      "name": "pattern",
                      "type": "string|string[]"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`cwd` {string|URL} current working directory. **Default:** `process.cwd()`",
                          "name": "cwd",
                          "type": "string|URL",
                          "default": "`process.cwd()`",
                          "desc": "current working directory."
                        },
                        {
                          "textRaw": "`exclude` {Function|string[]} Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it. **Default:** `undefined`.",
                          "name": "exclude",
                          "type": "Function|string[]",
                          "default": "`undefined`",
                          "desc": "Function to filter out files/directories or a list of glob patterns to be excluded. If a function is provided, return `true` to exclude the item, `false` to include it."
                        },
                        {
                          "textRaw": "`followSymlinks` {boolean} When `true`, symbolic links to directories are followed while expanding `**` patterns. **Default:** `false`.",
                          "name": "followSymlinks",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, symbolic links to directories are followed while expanding `**` patterns."
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} `true` if the glob should return paths as Dirents, `false` otherwise. **Default:** `false`.",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "`true` if the glob should return paths as Dirents, `false` otherwise."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string[]} paths of files that match the pattern.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "paths of files that match the pattern."
                  }
                }
              ],
              "desc": "<p>When <code>followSymlinks</code> is enabled, detected symbolic link cycles are not\ntraversed recursively.</p>\n<pre><code class=\"language-mjs\">import { globSync } from 'node:fs';\n\nconsole.log(globSync('**/*.js'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { globSync } = require('node:fs');\n\nconsole.log(globSync('**/*.js'));\n</code></pre>"
            },
            {
              "textRaw": "`fs.lchmodSync(path, mode)`",
              "name": "lchmodSync",
              "type": "method",
              "meta": {
                "changes": [],
                "deprecated": [
                  "v0.4.7"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`mode` {integer}",
                      "name": "mode",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Changes the permissions on a symbolic link. Returns <code>undefined</code>.</p>\n<p>This method is only implemented on macOS.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lchmod.2.html\"><code>lchmod(2)</code></a> documentation for more detail.</p>"
            },
            {
              "textRaw": "`fs.lchownSync(path, uid, gid)`",
              "name": "lchownSync",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21498",
                    "description": "This API is no longer deprecated."
                  },
                  {
                    "version": "v0.4.7",
                    "description": "Documentation-only deprecation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`uid` {integer} The file's new owner's user id.",
                      "name": "uid",
                      "type": "integer",
                      "desc": "The file's new owner's user id."
                    },
                    {
                      "textRaw": "`gid` {integer} The file's new group's group id.",
                      "name": "gid",
                      "type": "integer",
                      "desc": "The file's new group's group id."
                    }
                  ]
                }
              ],
              "desc": "<p>Set the owner for the path. Returns <code>undefined</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lchown.2.html\"><code>lchown(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.lutimesSync(path, atime, mtime)`",
              "name": "lutimesSync",
              "type": "method",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ]
                }
              ],
              "desc": "<p>Change the file system timestamps of the symbolic link referenced by <code>path</code>.\nReturns <code>undefined</code>, or throws an exception when parameters are incorrect or\nthe operation fails. This is the synchronous version of <a href=\"#fslutimespath-atime-mtime-callback\"><code>fs.lutimes()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.linkSync(existingPath, newPath)`",
              "name": "linkSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `existingPath` and `newPath` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`existingPath` {string|Buffer|URL}",
                      "name": "existingPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new link from the <code>existingPath</code> to the <code>newPath</code>. See the POSIX\n<a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a> documentation for more detail. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.lstatSync(path[, options])`",
              "name": "lstatSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.30"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.3.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33716",
                    "description": "Accepts a `throwIfNoEntry` option to specify whether an exception should be thrown if the entry does not exist."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.Stats}",
                    "name": "return",
                    "type": "fs.Stats"
                  }
                }
              ],
              "desc": "<p>Retrieves the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the symbolic link referred to by <code>path</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/lstat.2.html\"><code>lstat(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.mkdirSync(path[, options])`",
              "name": "mkdirSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.11.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31530",
                    "description": "In `recursive` mode, the first created path is returned now."
                  },
                  {
                    "version": "v10.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/21875",
                    "description": "The second argument can now be an `options` object with `recursive` and `mode` properties."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object|integer}",
                      "name": "options",
                      "type": "Object|integer",
                      "options": [
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`mode` {string|integer} Not supported on Windows. **Default:** `0o777`.",
                          "name": "mode",
                          "type": "string|integer",
                          "default": "`0o777`",
                          "desc": "Not supported on Windows."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined}",
                    "name": "return",
                    "type": "string|undefined"
                  }
                }
              ],
              "desc": "<p>Synchronously creates a directory. Returns <code>undefined</code>, or if <code>recursive</code> is\n<code>true</code>, the first directory path created.\nThis is the synchronous version of <a href=\"#fsmkdirpath-options-callback\"><code>fs.mkdir()</code></a>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/mkdir.2.html\"><code>mkdir(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.mkdtempSync(prefix[, options])`",
              "name": "mkdtempSync",
              "type": "method",
              "meta": {
                "added": [
                  "v5.10.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/48828",
                    "description": "The `prefix` parameter now accepts buffers and URL."
                  },
                  {
                    "version": [
                      "v16.5.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/39028",
                    "description": "The `prefix` parameter now accepts an empty string."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Returns the created directory path.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsmkdtempprefix-options-callback\"><code>fs.mkdtemp()</code></a>.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>"
            },
            {
              "textRaw": "`fs.mkdtempDisposableSync(prefix[, options])`",
              "name": "mkdtempDisposableSync",
              "type": "method",
              "meta": {
                "added": [
                  "v24.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prefix` {string|Buffer|URL}",
                      "name": "prefix",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A disposable object:",
                    "name": "return",
                    "type": "Object",
                    "desc": "A disposable object:",
                    "options": [
                      {
                        "textRaw": "`path` {string} The path of the created directory.",
                        "name": "path",
                        "type": "string",
                        "desc": "The path of the created directory."
                      },
                      {
                        "textRaw": "`remove` {Function} A function which removes the created directory.",
                        "name": "remove",
                        "type": "Function",
                        "desc": "A function which removes the created directory."
                      },
                      {
                        "textRaw": "`[Symbol.dispose]` {Function} The same as `remove`.",
                        "name": "[Symbol.dispose]",
                        "type": "Function",
                        "desc": "The same as `remove`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Returns a disposable object whose <code>path</code> property holds the created directory\npath. When the object is disposed, the directory and its contents will be\nremoved if it still exists. If the directory cannot be deleted, disposal will\nthrow an error. The object has a <code>remove()</code> method which will perform the same\ntask.</p>\n<p>For detailed information, see the documentation of <a href=\"#fsmkdtempprefix-options-callback\"><code>fs.mkdtemp()</code></a>.</p>\n<p>There is no callback-based version of this API because it is designed for use\nwith the <code>using</code> syntax.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use.</p>"
            },
            {
              "textRaw": "`fs.opendirSync(path[, options])`",
              "name": "opendirSync",
              "type": "method",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": [
                      "v13.1.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30114",
                    "description": "The `bufferSize` option was introduced."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`bufferSize` {number} Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage. **Default:** `32`",
                          "name": "bufferSize",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Number of directory entries that are buffered internally when reading from the directory. Higher values lead to better performance but higher memory usage."
                        },
                        {
                          "textRaw": "`recursive` {boolean} **Default:** `false`",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.Dir}",
                    "name": "return",
                    "type": "fs.Dir"
                  }
                }
              ],
              "desc": "<p>Synchronously open a directory. See <a href=\"http://man7.org/linux/man-pages/man3/opendir.3.html\"><code>opendir(3)</code></a>.</p>\n<p>Creates an <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a>, which contains all further functions for reading from\nand cleaning up the directory.</p>\n<p>The <code>encoding</code> option sets the encoding for the <code>path</code> while opening the\ndirectory and subsequent read operations.</p>"
            },
            {
              "textRaw": "`fs.openSync(path[, flags[, mode]])`",
              "name": "openSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v11.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23767",
                    "description": "The `flags` argument is now optional and defaults to `'r'`."
                  },
                  {
                    "version": "v9.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18801",
                    "description": "The `as` and `as+` flags are supported now."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`flags` {string|number} **Default:** `'r'`. See support of file system `flags`.",
                      "name": "flags",
                      "type": "string|number",
                      "default": "`'r'`. See support of file system `flags`",
                      "optional": true
                    },
                    {
                      "textRaw": "`mode` {string|integer} **Default:** `0o666`",
                      "name": "mode",
                      "type": "string|integer",
                      "default": "`0o666`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns an integer representing the file descriptor.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.readdirSync(path[, options])`",
              "name": "readdirSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.1.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41439",
                    "description": "Added `recursive` option."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22020",
                    "description": "New option `withFileTypes` was added."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`withFileTypes` {boolean} **Default:** `false`",
                          "name": "withFileTypes",
                          "type": "boolean",
                          "default": "`false`"
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files, and directories. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, reads the contents of a directory recursively. In recursive mode, it will list all files, sub files, and directories."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string[]|Buffer[]|fs.Dirent[]}",
                    "name": "return",
                    "type": "string[]|Buffer[]|fs.Dirent[]"
                  }
                }
              ],
              "desc": "<p>Reads the contents of the directory.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> documentation for more details.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe filenames returned. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe filenames returned will be passed as <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> objects.</p>\n<p>If <code>options.withFileTypes</code> is set to <code>true</code>, the result will contain\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> objects.</p>"
            },
            {
              "textRaw": "`fs.readFileSync(path[, options])`",
              "name": "readFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.8"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `path` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL|integer} filename or file descriptor",
                      "name": "path",
                      "type": "string|Buffer|URL|integer",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `null`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`null`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'r'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'r'`",
                          "desc": "See support of file system `flags`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>Returns the contents of the <code>path</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsreadfilepath-options-callback\"><code>fs.readFile()</code></a>.</p>\n<p>If the <code>encoding</code> option is specified then this function returns a\nstring. Otherwise it returns a buffer.</p>\n<p>Similar to <a href=\"#fsreadfilepath-options-callback\"><code>fs.readFile()</code></a>, when the path is a directory, the behavior of\n<code>fs.readFileSync()</code> is platform-specific.</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n\n// macOS, Linux, and Windows\nreadFileSync('&#x3C;directory>');\n// => [Error: EISDIR: illegal operation on a directory, read &#x3C;directory>]\n\n//  FreeBSD\nreadFileSync('&#x3C;directory>'); // => &#x3C;data>\n</code></pre>"
            },
            {
              "textRaw": "`fs.readlinkSync(path[, options])`",
              "name": "readlinkSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>Returns the symbolic link's string value.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/readlink.2.html\"><code>readlink(2)</code></a> documentation for more details.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe link path returned. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe link path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>"
            },
            {
              "textRaw": "`fs.readSync(fd, buffer, offset, length[, position])`",
              "name": "readSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `buffer` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4518",
                    "description": "The `length` parameter can now be `0`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`offset` {integer}",
                      "name": "offset",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`length` {integer}",
                      "name": "length",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`position` {integer|bigint|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|bigint|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns the number of <code>bytesRead</code>.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.readSync(fd, buffer[, options])`",
              "name": "readSync",
              "type": "method",
              "meta": {
                "added": [
                  "v13.13.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.13.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32460",
                    "description": "Options object can be passed in to make offset, length, and position optional."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|bigint|null} **Default:** `null`",
                          "name": "position",
                          "type": "integer|bigint|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns the number of <code>bytesRead</code>.</p>\n<p>Similar to the above <code>fs.readSync</code> function, this version takes an optional <code>options</code> object.\nIf no <code>options</code> object is specified, it will default with the above values.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsreadfd-buffer-offset-length-position-callback\"><code>fs.read()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.readvSync(fd, buffers[, position])`",
              "name": "readvSync",
              "type": "method",
              "meta": {
                "added": [
                  "v13.13.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffers` {ArrayBufferView[]}",
                      "name": "buffers",
                      "type": "ArrayBufferView[]"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes read.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes read."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsreadvfd-buffers-position-callback\"><code>fs.readv()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.realpathSync(path[, options])`",
              "name": "realpathSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13028",
                    "description": "Pipe/Socket resolve support was added."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v6.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7899",
                    "description": "Calling `realpathSync` now works again for various edge cases on Windows."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3594",
                    "description": "The `cache` parameter was removed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>Returns the resolved pathname.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsrealpathpath-options-callback\"><code>fs.realpath()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.realpathSync.native(path[, options])`",
              "name": "native",
              "type": "method",
              "meta": {
                "added": [
                  "v9.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {string|Object}",
                      "name": "options",
                      "type": "string|Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string",
                          "default": "`'utf8'`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|Buffer}",
                    "name": "return",
                    "type": "string|Buffer"
                  }
                }
              ],
              "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man3/realpath.3.html\"><code>realpath(3)</code></a>.</p>\n<p>Only paths that can be converted to UTF8 strings are supported.</p>\n<p>The optional <code>options</code> argument can be a string specifying an encoding, or an\nobject with an <code>encoding</code> property specifying the character encoding to use for\nthe path returned. If the <code>encoding</code> is set to <code>'buffer'</code>,\nthe path returned will be passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object.</p>\n<p>On Linux, when Node.js is linked against musl libc, the procfs file system must\nbe mounted on <code>/proc</code> in order for this function to work. Glibc does not have\nthis restriction.</p>"
            },
            {
              "textRaw": "`fs.renameSync(oldPath, newPath)`",
              "name": "renameSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `oldPath` and `newPath` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`oldPath` {string|Buffer|URL}",
                      "name": "oldPath",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`newPath` {string|Buffer|URL}",
                      "name": "newPath",
                      "type": "string|Buffer|URL"
                    }
                  ]
                }
              ],
              "desc": "<p>Renames the file from <code>oldPath</code> to <code>newPath</code>. Returns <code>undefined</code>.</p>\n<p>See the POSIX <a href=\"http://man7.org/linux/man-pages/man2/rename.2.html\"><code>rename(2)</code></a> documentation for more details.</p>"
            },
            {
              "textRaw": "`fs.rmdirSync(path[, options])`",
              "name": "rmdirSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v25.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58616",
                    "description": "Remove `recursive` option."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fs.rmdirSync(path, { recursive: true })` on a `path` that is a file is no longer permitted and results in an `ENOENT` error on Windows and an `ENOTDIR` error on POSIX."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37216",
                    "description": "Using `fs.rmdirSync(path, { recursive: true })` on a `path` that does not exist is no longer permitted and results in a `ENOENT` error."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37302",
                    "description": "The `recursive` option is deprecated, using it triggers a deprecation warning."
                  },
                  {
                    "version": "v14.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35579",
                    "description": "The `recursive` option is deprecated, use `fs.rmSync` instead."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30644",
                    "description": "The `maxBusyTries` option is renamed to `maxRetries`, and its default is 0. The `emfileWait` option has been removed, and `EMFILE` errors use the same retry logic as other errors. The `retryDelay` option is now supported. `ENFILE` errors are now retried."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29168",
                    "description": "The `recursive`, `maxBusyTries`, and `emfileWait` options are now supported."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameters can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object} There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "name": "options",
                      "type": "Object",
                      "desc": "There are currently no options exposed. There used to be options for `recursive`, `maxBusyTries`, and `emfileWait` but they were deprecated and removed. The `options` argument is still accepted for backwards compatibility but it is not used.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/rmdir.2.html\"><code>rmdir(2)</code></a>. Returns <code>undefined</code>.</p>\n<p>Using <code>fs.rmdirSync()</code> on a file (not a directory) results in an <code>ENOENT</code> error\non Windows and an <code>ENOTDIR</code> error on POSIX.</p>\n<p>To get a behavior similar to the <code>rm -rf</code> Unix command, use <a href=\"#fsrmsyncpath-options\"><code>fs.rmSync()</code></a>\nwith options <code>{ recursive: true, force: true }</code>.</p>"
            },
            {
              "textRaw": "`fs.rmSync(path[, options])`",
              "name": "rmSync",
              "type": "method",
              "meta": {
                "added": [
                  "v14.14.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41132",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`force` {boolean} When `true`, exceptions will be ignored if `path` does not exist. **Default:** `false`.",
                          "name": "force",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, exceptions will be ignored if `path` does not exist."
                        },
                        {
                          "textRaw": "`maxRetries` {integer} If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`. **Default:** `0`.",
                          "name": "maxRetries",
                          "type": "integer",
                          "default": "`0`",
                          "desc": "If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or `EPERM` error is encountered, Node.js will retry the operation with a linear backoff wait of `retryDelay` milliseconds longer on each try. This option represents the number of retries. This option is ignored if the `recursive` option is not `true`."
                        },
                        {
                          "textRaw": "`recursive` {boolean} If `true`, perform a recursive directory removal. In recursive mode operations are retried on failure. **Default:** `false`.",
                          "name": "recursive",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, perform a recursive directory removal. In recursive mode operations are retried on failure."
                        },
                        {
                          "textRaw": "`retryDelay` {integer} The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`. **Default:** `100`.",
                          "name": "retryDelay",
                          "type": "integer",
                          "default": "`100`",
                          "desc": "The amount of time in milliseconds to wait between retries. This option is ignored if the `recursive` option is not `true`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronously removes files and directories (modeled on the standard POSIX <code>rm</code>\nutility). Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.statSync(path[, options])`",
              "name": "statSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.3.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33716",
                    "description": "Accepts a `throwIfNoEntry` option to specify whether an exception should be thrown if the entry does not exist."
                  },
                  {
                    "version": "v10.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20220",
                    "description": "Accepts an additional `options` object to specify whether the numeric values returned should be bigint."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.Stats} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.Stats} object should be `bigint`."
                        },
                        {
                          "textRaw": "`throwIfNoEntry` {boolean} Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`. **Default:** `true`.",
                          "name": "throwIfNoEntry",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether an exception will be thrown if no file system entry exists, rather than returning `undefined`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.Stats}",
                    "name": "return",
                    "type": "fs.Stats"
                  }
                }
              ],
              "desc": "<p>Retrieves the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> for the path.</p>"
            },
            {
              "textRaw": "`fs.statfsSync(path[, options])`",
              "name": "statfsSync",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`bigint` {boolean} Whether the numeric values in the returned {fs.StatFs} object should be `bigint`. **Default:** `false`.",
                          "name": "bigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether the numeric values in the returned {fs.StatFs} object should be `bigint`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {fs.StatFs}",
                    "name": "return",
                    "type": "fs.StatFs"
                  }
                }
              ],
              "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/statfs.2.html\"><code>statfs(2)</code></a>. Returns information about the mounted file system which\ncontains <code>path</code>.</p>\n<p>In case of an error, the <code>err.code</code> will be one of <a href=\"errors.html#common-system-errors\">Common System Errors</a>.</p>"
            },
            {
              "textRaw": "`fs.symlinkSync(target, path[, type])`",
              "name": "symlinkSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.31"
                ],
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23724",
                    "description": "If the `type` argument is left undefined, Node will autodetect `target` type and automatically select `dir` or `file`."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `target` and `path` parameters can be WHATWG `URL` objects using `file:` protocol. Support is currently still *experimental*."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {string|Buffer|URL}",
                      "name": "target",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`type` {string|null} **Default:** `null`",
                      "name": "type",
                      "type": "string|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: `undefined`.",
                    "name": "return",
                    "desc": "`undefined`."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fssymlinktarget-path-type-callback\"><code>fs.symlink()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.truncateSync(path[, len])`",
              "name": "truncateSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.8.6"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`len` {integer} **Default:** `0`",
                      "name": "len",
                      "type": "integer",
                      "default": "`0`",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Truncates the file. Returns <code>undefined</code>. A file descriptor can also be\npassed as the first argument. In this case, <code>fs.ftruncateSync()</code> is called.</p>\n<p>Passing a file descriptor is deprecated and may result in an error being thrown\nin the future.</p>"
            },
            {
              "textRaw": "`fs.unlinkSync(path)`",
              "name": "unlinkSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    }
                  ]
                }
              ],
              "desc": "<p>Synchronous <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a>. Returns <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`fs.utimesSync(path, atime, mtime)`",
              "name": "utimesSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11919",
                    "description": "`NaN`, `Infinity`, and `-Infinity` are no longer valid time specifiers."
                  },
                  {
                    "version": "v7.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10739",
                    "description": "The `path` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": "v4.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2387",
                    "description": "Numeric strings, `NaN`, and `Infinity` are now allowed time specifiers."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string|Buffer|URL}",
                      "name": "path",
                      "type": "string|Buffer|URL"
                    },
                    {
                      "textRaw": "`atime` {number|string|Date}",
                      "name": "atime",
                      "type": "number|string|Date"
                    },
                    {
                      "textRaw": "`mtime` {number|string|Date}",
                      "name": "mtime",
                      "type": "number|string|Date"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: `undefined`.",
                    "name": "return",
                    "desc": "`undefined`."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fsutimespath-atime-mtime-callback\"><code>fs.utimes()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writeFileSync(file, data[, options])`",
              "name": "writeFileSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.0.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50009",
                    "description": "The `flush` option is now supported."
                  },
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42796",
                    "description": "Passing to the `data` parameter an object with an own `toString` function is no longer supported."
                  },
                  {
                    "version": "v17.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42149",
                    "description": "Passing to the `data` parameter an object with an own `toString` function is deprecated."
                  },
                  {
                    "version": "v14.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34993",
                    "description": "The `data` parameter will stringify an object with an explicit `toString` function."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `data` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `data` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `data` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/3163",
                    "description": "The `file` parameter can be a file descriptor now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`file` {string|Buffer|URL|integer} filename or file descriptor",
                      "name": "file",
                      "type": "string|Buffer|URL|integer",
                      "desc": "filename or file descriptor"
                    },
                    {
                      "textRaw": "`data` {string|Buffer|TypedArray|DataView}",
                      "name": "data",
                      "type": "string|Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object|string}",
                      "name": "options",
                      "type": "Object|string",
                      "options": [
                        {
                          "textRaw": "`encoding` {string|null} **Default:** `'utf8'`",
                          "name": "encoding",
                          "type": "string|null",
                          "default": "`'utf8'`"
                        },
                        {
                          "textRaw": "`mode` {integer} **Default:** `0o666`",
                          "name": "mode",
                          "type": "integer",
                          "default": "`0o666`"
                        },
                        {
                          "textRaw": "`flag` {string} See support of file system `flags`. **Default:** `'w'`.",
                          "name": "flag",
                          "type": "string",
                          "default": "`'w'`",
                          "desc": "See support of file system `flags`."
                        },
                        {
                          "textRaw": "`flush` {boolean} If all data is successfully written to the file, and `flush` is `true`, `fs.fsyncSync()` is used to flush the data.",
                          "name": "flush",
                          "type": "boolean",
                          "desc": "If all data is successfully written to the file, and `flush` is `true`, `fs.fsyncSync()` is used to flush the data."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: `undefined`.",
                    "name": "return",
                    "desc": "`undefined`."
                  }
                }
              ],
              "desc": "<p>The <code>mode</code> option only affects the newly created file. See <a href=\"#fsopenpath-flags-mode-callback\"><code>fs.open()</code></a>\nfor more details.</p>\n<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritefilefile-data-options-callback\"><code>fs.writeFile()</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writeSync(fd, buffer, offset[, length[, position]])`",
              "name": "writeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `buffer` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v10.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22150",
                    "description": "The `buffer` parameter can now be any `TypedArray` or a `DataView`."
                  },
                  {
                    "version": "v7.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10382",
                    "description": "The `buffer` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7856",
                    "description": "The `offset` and `length` parameters are optional now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`offset` {integer} **Default:** `0`",
                      "name": "offset",
                      "type": "integer",
                      "default": "`0`"
                    },
                    {
                      "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                      "name": "length",
                      "type": "integer",
                      "default": "`buffer.byteLength - offset`",
                      "optional": true
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritefd-buffer-offset-length-position-callback\"><code>fs.write(fd, buffer...)</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writeSync(fd, buffer[, options])`",
              "name": "writeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`offset` {integer} **Default:** `0`",
                          "name": "offset",
                          "type": "integer",
                          "default": "`0`"
                        },
                        {
                          "textRaw": "`length` {integer} **Default:** `buffer.byteLength - offset`",
                          "name": "length",
                          "type": "integer",
                          "default": "`buffer.byteLength - offset`"
                        },
                        {
                          "textRaw": "`position` {integer|null} **Default:** `null`",
                          "name": "position",
                          "type": "integer|null",
                          "default": "`null`"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritefd-buffer-offset-length-position-callback\"><code>fs.write(fd, buffer...)</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writeSync(fd, string[, position[, encoding]])`",
              "name": "writeSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.5"
                ],
                "changes": [
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31030",
                    "description": "The `string` parameter won't coerce unsupported input to strings anymore."
                  },
                  {
                    "version": "v7.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7856",
                    "description": "The `position` parameter is optional now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`string` {string}",
                      "name": "string",
                      "type": "string"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritefd-string-position-encoding-callback\"><code>fs.write(fd, string...)</code></a>.</p>"
            },
            {
              "textRaw": "`fs.writevSync(fd, buffers[, position])`",
              "name": "writevSync",
              "type": "method",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fd` {integer}",
                      "name": "fd",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`buffers` {ArrayBufferView[]}",
                      "name": "buffers",
                      "type": "ArrayBufferView[]"
                    },
                    {
                      "textRaw": "`position` {integer|null} **Default:** `null`",
                      "name": "position",
                      "type": "integer|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written."
                  }
                }
              ],
              "desc": "<p>For detailed information, see the documentation of the asynchronous version of\nthis API: <a href=\"#fswritevfd-buffers-position-callback\"><code>fs.writev()</code></a>.</p>"
            }
          ],
          "displayName": "Synchronous API"
        },
        {
          "textRaw": "Common Objects",
          "name": "common_objects",
          "type": "module",
          "desc": "<p>The common objects are shared by all of the file system API variants\n(promise, callback, and synchronous).</p>",
          "classes": [
            {
              "textRaw": "Class: `fs.Dir`",
              "name": "fs.Dir",
              "type": "class",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "desc": "<p>A class representing a directory stream.</p>\n<p>Created by <a href=\"#fsopendirpath-options-callback\"><code>fs.opendir()</code></a>, <a href=\"#fsopendirsyncpath-options\"><code>fs.opendirSync()</code></a>, or\n<a href=\"#fspromisesopendirpath-options\"><code>fsPromises.opendir()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { opendir } from 'node:fs/promises';\n\ntry {\n  const dir = await opendir('./');\n  for await (const dirent of dir)\n    console.log(dirent.name);\n} catch (err) {\n  console.error(err);\n}\n</code></pre>\n<p>When using the async iterator, the <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a> object will be automatically\nclosed after the iterator exits.</p>",
              "methods": [
                {
                  "textRaw": "`dir.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously close the directory's underlying resource handle.\nSubsequent reads will result in errors.</p>\n<p>A promise is returned that will be fulfilled after the resource has been\nclosed.</p>"
                },
                {
                  "textRaw": "`dir.close(callback)`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Asynchronously close the directory's underlying resource handle.\nSubsequent reads will result in errors.</p>\n<p>The <code>callback</code> will be called after the resource handle has been closed.</p>"
                },
                {
                  "textRaw": "`dir.closeSync()`",
                  "name": "closeSync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Synchronously close the directory's underlying resource handle.\nSubsequent reads will result in errors.</p>"
                },
                {
                  "textRaw": "`dir.read()`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with a {fs.Dirent|null}",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with a {fs.Dirent|null}"
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously read the next directory entry via <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> as an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>.</p>\n<p>A promise is returned that will be fulfilled with an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>, or <code>null</code>\nif there are no more directory entries to read.</p>\n<p>Directory entries returned by this function are in no particular order as\nprovided by the operating system's underlying directory mechanisms.\nEntries added or removed while iterating over the directory might not be\nincluded in the iteration results.</p>"
                },
                {
                  "textRaw": "`dir.read(callback)`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            },
                            {
                              "textRaw": "`dirent` {fs.Dirent|null}",
                              "name": "dirent",
                              "type": "fs.Dirent|null"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Asynchronously read the next directory entry via <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> as an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>.</p>\n<p>After the read is completed, the <code>callback</code> will be called with an\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>, or <code>null</code> if there are no more directory entries to read.</p>\n<p>Directory entries returned by this function are in no particular order as\nprovided by the operating system's underlying directory mechanisms.\nEntries added or removed while iterating over the directory might not be\nincluded in the iteration results.</p>"
                },
                {
                  "textRaw": "`dir.readSync()`",
                  "name": "readSync",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.Dirent|null}",
                        "name": "return",
                        "type": "fs.Dirent|null"
                      }
                    }
                  ],
                  "desc": "<p>Synchronously read the next directory entry as an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>. See the\nPOSIX <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> documentation for more detail.</p>\n<p>If there are no more directory entries to read, <code>null</code> will be returned.</p>\n<p>Directory entries returned by this function are in no particular order as\nprovided by the operating system's underlying directory mechanisms.\nEntries added or removed while iterating over the directory might not be\nincluded in the iteration results.</p>"
                },
                {
                  "textRaw": "`dir[Symbol.asyncIterator]()`",
                  "name": "[Symbol.asyncIterator]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {AsyncIterator} An AsyncIterator of {fs.Dirent}",
                        "name": "return",
                        "type": "AsyncIterator",
                        "desc": "An AsyncIterator of {fs.Dirent}"
                      }
                    }
                  ],
                  "desc": "<p>Asynchronously iterates over the directory until all entries have\nbeen read. Refer to the POSIX <a href=\"http://man7.org/linux/man-pages/man3/readdir.3.html\"><code>readdir(3)</code></a> documentation for more detail.</p>\n<p>Entries returned by the async iterator are always an <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a>.\nThe <code>null</code> case from <code>dir.read()</code> is handled internally.</p>\n<p>See <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a> for an example.</p>\n<p>Directory entries returned by this iterator are in no particular order as\nprovided by the operating system's underlying directory mechanisms.\nEntries added or removed while iterating over the directory might not be\nincluded in the iteration results.</p>"
                },
                {
                  "textRaw": "`dir[Symbol.asyncDispose]()`",
                  "name": "[Symbol.asyncDispose]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v24.1.0",
                      "v22.1.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58467",
                        "description": "No longer experimental."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <code>dir.close()</code> if the directory handle is open, and returns a promise that\nfulfills when disposal is complete.</p>"
                },
                {
                  "textRaw": "`dir[Symbol.dispose]()`",
                  "name": "[Symbol.dispose]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v24.1.0",
                      "v22.1.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58467",
                        "description": "No longer experimental."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <code>dir.closeSync()</code> if the directory handle is open, and returns\n<code>undefined</code>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "path",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v12.12.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The read-only path of this directory as was provided to <a href=\"#fsopendirpath-options-callback\"><code>fs.opendir()</code></a>,\n<a href=\"#fsopendirsyncpath-options\"><code>fs.opendirSync()</code></a>, or <a href=\"#fspromisesopendirpath-options\"><code>fsPromises.opendir()</code></a>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.Dirent`",
              "name": "fs.Dirent",
              "type": "class",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "desc": "<p>A representation of a directory entry, which can be a file or a subdirectory\nwithin the directory, as returned by reading from an <a href=\"fs.html#class-fsdir\"><code>&#x3C;fs.Dir></code></a>. The\ndirectory entry is a combination of the file name and file type pairs.</p>\n<p>Additionally, when <a href=\"#fsreaddirpath-options-callback\"><code>fs.readdir()</code></a> or <a href=\"#fsreaddirsyncpath-options\"><code>fs.readdirSync()</code></a> is called with\nthe <code>withFileTypes</code> option set to <code>true</code>, the resulting array is filled with\n<a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> objects, rather than strings or <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>s.</p>",
              "methods": [
                {
                  "textRaw": "`dirent.isBlockDevice()`",
                  "name": "isBlockDevice",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a block device.</p>"
                },
                {
                  "textRaw": "`dirent.isCharacterDevice()`",
                  "name": "isCharacterDevice",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a character device.</p>"
                },
                {
                  "textRaw": "`dirent.isDirectory()`",
                  "name": "isDirectory",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a file system\ndirectory.</p>"
                },
                {
                  "textRaw": "`dirent.isFIFO()`",
                  "name": "isFIFO",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a first-in-first-out\n(FIFO) pipe.</p>"
                },
                {
                  "textRaw": "`dirent.isFile()`",
                  "name": "isFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a regular file.</p>"
                },
                {
                  "textRaw": "`dirent.isSocket()`",
                  "name": "isSocket",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a socket.</p>"
                },
                {
                  "textRaw": "`dirent.isSymbolicLink()`",
                  "name": "isSymbolicLink",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object describes a symbolic link.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {string|Buffer}",
                  "name": "name",
                  "type": "string|Buffer",
                  "meta": {
                    "added": [
                      "v10.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The file name that this <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object refers to. The type of this\nvalue is determined by the <code>options.encoding</code> passed to <a href=\"#fsreaddirpath-options-callback\"><code>fs.readdir()</code></a> or\n<a href=\"#fsreaddirsyncpath-options\"><code>fs.readdirSync()</code></a>.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "parentPath",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v21.4.0",
                      "v20.12.0",
                      "v18.20.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.0.0",
                          "v22.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/57513",
                        "description": "Marking the API stable."
                      }
                    ]
                  },
                  "desc": "<p>The path to the parent directory of the file this <a href=\"fs.html#class-fsdirent\"><code>&#x3C;fs.Dirent></code></a> object refers to.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.FSWatcher`",
              "name": "fs.FSWatcher",
              "type": "class",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>A successful call to <a href=\"#fswatchfilename-options-listener\"><code>fs.watch()</code></a> method will return a new <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a>\nobject.</p>\n<p>All <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> objects emit a <code>'change'</code> event whenever a specific watched\nfile is modified.</p>",
              "events": [
                {
                  "textRaw": "Event: `'change'`",
                  "name": "change",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.5.8"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`eventType` {string} The type of change event that has occurred",
                      "name": "eventType",
                      "type": "string",
                      "desc": "The type of change event that has occurred"
                    },
                    {
                      "textRaw": "`filename` {string|Buffer} The filename that changed (if relevant/available)",
                      "name": "filename",
                      "type": "string|Buffer",
                      "desc": "The filename that changed (if relevant/available)"
                    }
                  ],
                  "desc": "<p>Emitted when something changes in a watched directory or file.\nSee more details in <a href=\"#fswatchfilename-options-listener\"><code>fs.watch()</code></a>.</p>\n<p>The <code>filename</code> argument may not be provided depending on operating system\nsupport. If <code>filename</code> is provided, it will be provided as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> if <code>fs.watch()</code> is called with its <code>encoding</code> option set to <code>'buffer'</code>, otherwise\n<code>filename</code> will be a UTF-8 string.</p>\n<pre><code class=\"language-mjs\">import { watch } from 'node:fs';\n// Example when handled through fs.watch() listener\nwatch('./tmp', { encoding: 'buffer' }, (eventType, filename) => {\n  if (filename) {\n    console.log(filename);\n    // Prints: &#x3C;Buffer ...>\n  }\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the watcher stops watching for changes. The closed\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object is no longer usable in the event handler.</p>"
                },
                {
                  "textRaw": "Event: `'error'`",
                  "name": "error",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.5.8"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    }
                  ],
                  "desc": "<p>Emitted when an error occurs while watching the file. The errored\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object is no longer usable in the event handler.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`watcher.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.5.8"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Stop watching for changes on the given <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a>. Once stopped, the\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object is no longer usable.</p>"
                },
                {
                  "textRaw": "`watcher.ref()`",
                  "name": "ref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.3.0",
                      "v12.20.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.FSWatcher}",
                        "name": "return",
                        "type": "fs.FSWatcher"
                      }
                    }
                  ],
                  "desc": "<p>When called, requests that the Node.js event loop <em>not</em> exit so long as the\n<a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> is active. Calling <code>watcher.ref()</code> multiple times will have\nno effect.</p>\n<p>By default, all <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> objects are \"ref'ed\", making it normally\nunnecessary to call <code>watcher.ref()</code> unless <code>watcher.unref()</code> had been\ncalled previously.</p>"
                },
                {
                  "textRaw": "`watcher.unref()`",
                  "name": "unref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.3.0",
                      "v12.20.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.FSWatcher}",
                        "name": "return",
                        "type": "fs.FSWatcher"
                      }
                    }
                  ],
                  "desc": "<p>When called, the active <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object will not require the Node.js\nevent loop to remain active. If there is no other activity keeping the\nevent loop running, the process may exit before the <a href=\"fs.html#fsfswatcher\"><code>&#x3C;fs.FSWatcher></code></a> object's\ncallback is invoked. Calling <code>watcher.unref()</code> multiple times will have\nno effect.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.StatWatcher`",
              "name": "fs.StatWatcher",
              "type": "class",
              "meta": {
                "added": [
                  "v14.3.0",
                  "v12.20.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>A successful call to <code>fs.watchFile()</code> method will return a new <a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a>\nobject.</p>",
              "methods": [
                {
                  "textRaw": "`watcher.ref()`",
                  "name": "ref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.3.0",
                      "v12.20.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.StatWatcher}",
                        "name": "return",
                        "type": "fs.StatWatcher"
                      }
                    }
                  ],
                  "desc": "<p>When called, requests that the Node.js event loop <em>not</em> exit so long as the\n<a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a> is active. Calling <code>watcher.ref()</code> multiple times will have\nno effect.</p>\n<p>By default, all <a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a> objects are \"ref'ed\", making it normally\nunnecessary to call <code>watcher.ref()</code> unless <code>watcher.unref()</code> had been\ncalled previously.</p>"
                },
                {
                  "textRaw": "`watcher.unref()`",
                  "name": "unref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v14.3.0",
                      "v12.20.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {fs.StatWatcher}",
                        "name": "return",
                        "type": "fs.StatWatcher"
                      }
                    }
                  ],
                  "desc": "<p>When called, the active <a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a> object will not require the Node.js\nevent loop to remain active. If there is no other activity keeping the\nevent loop running, the process may exit before the <a href=\"fs.html#class-fsstatwatcher\"><code>&#x3C;fs.StatWatcher></code></a> object's\ncallback is invoked. Calling <code>watcher.unref()</code> multiple times will have\nno effect.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.ReadStream`",
              "name": "fs.ReadStream",
              "type": "class",
              "meta": {
                "added": [
                  "v0.1.93"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamreadable\"><code>&#x3C;stream.Readable></code></a></li>\n</ul>\n<p>Instances of <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a> cannot be constructed directly. They are created and\nreturned using the <a href=\"#fscreatereadstreampath-options\"><code>fs.createReadStream()</code></a> function.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a>'s underlying file descriptor has been closed.</p>"
                },
                {
                  "textRaw": "Event: `'open'`",
                  "name": "open",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`fd` {integer} Integer file descriptor used by the {fs.ReadStream}.",
                      "name": "fd",
                      "type": "integer",
                      "desc": "Integer file descriptor used by the {fs.ReadStream}."
                    }
                  ],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a>'s file descriptor has been opened.</p>"
                },
                {
                  "textRaw": "Event: `'ready'`",
                  "name": "ready",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v9.11.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fsreadstream\"><code>&#x3C;fs.ReadStream></code></a> is ready to be used.</p>\n<p>Fires immediately after <code>'open'</code>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "bytesRead",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v6.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The number of bytes that have been read so far.</p>"
                },
                {
                  "textRaw": "Type: {string|Buffer}",
                  "name": "path",
                  "type": "string|Buffer",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The path to the file the stream is reading from as specified in the first\nargument to <code>fs.createReadStream()</code>. If <code>path</code> is passed as a string, then\n<code>readStream.path</code> will be a string. If <code>path</code> is passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, then <code>readStream.path</code> will be a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>. If <code>fd</code> is specified, then\n<code>readStream.path</code> will be <code>undefined</code>.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "pending",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v11.2.0",
                      "v10.16.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This property is <code>true</code> if the underlying file has not been opened yet,\ni.e. before the <code>'ready'</code> event is emitted.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.Stats`",
              "name": "fs.Stats",
              "type": "class",
              "meta": {
                "added": [
                  "v0.1.21"
                ],
                "changes": [
                  {
                    "version": "v26.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60789",
                    "description": "Added `Temporal.Instant` support."
                  },
                  {
                    "version": [
                      "v22.0.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/51879",
                    "description": "Public constructor is deprecated."
                  },
                  {
                    "version": "v8.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13173",
                    "description": "Added times as numbers."
                  }
                ]
              },
              "desc": "<p>A <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object provides information about a file.</p>\n<p>Objects returned from <a href=\"#fsstatpath-options-callback\"><code>fs.stat()</code></a>, <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a>, <a href=\"#fsfstatfd-options-callback\"><code>fs.fstat()</code></a>, and\ntheir synchronous counterparts are of this type.\nIf <code>bigint</code> in the <code>options</code> passed to those methods is true, the numeric values\nwill be <code>bigint</code> instead of <code>number</code>, and the object will contain additional\nnanosecond-precision properties suffixed with <code>Ns</code>.\n<code>Stat</code> objects are not to be created directly using the <code>new</code> keyword.</p>\n<pre><code class=\"language-console\">Stats {\n  dev: 2114,\n  ino: 48064969,\n  mode: 33188,\n  nlink: 1,\n  uid: 85,\n  gid: 100,\n  rdev: 0,\n  size: 527,\n  blksize: 4096,\n  blocks: 8,\n  atimeMs: 1318289051000.1,\n  mtimeMs: 1318289051000.1,\n  ctimeMs: 1318289051000.1,\n  birthtimeMs: 1318289051000.1,\n\n  // Instances of Date\n  atime: Mon, 10 Oct 2011 23:24:11 GMT,\n  mtime: Mon, 10 Oct 2011 23:24:11 GMT,\n  ctime: Mon, 10 Oct 2011 23:24:11 GMT,\n  birthtime: Mon, 10 Oct 2011 23:24:11 GMT,\n\n  // Instances of Temporal.Instant\n  atimeInstant: 2011-10-10T23:24:11.0001Z,\n  mtimeInstant: 2011-10-10T23:24:11.0001Z,\n  ctimeInstant: 2011-10-10T23:24:11.0001Z,\n  birthtimeInstant: 2011-10-10T23:24:11.0001Z\n}\n</code></pre>\n<p><code>bigint</code> version:</p>\n<pre><code class=\"language-console\">BigIntStats {\n  dev: 2114n,\n  ino: 48064969n,\n  mode: 33188n,\n  nlink: 1n,\n  uid: 85n,\n  gid: 100n,\n  rdev: 0n,\n  size: 527n,\n  blksize: 4096n,\n  blocks: 8n,\n  atimeMs: 1318289051000n,\n  mtimeMs: 1318289051000n,\n  ctimeMs: 1318289051000n,\n  birthtimeMs: 1318289051000n,\n  atimeNs: 1318289051000000000n,\n  mtimeNs: 1318289051000000000n,\n  ctimeNs: 1318289051000000000n,\n  birthtimeNs: 1318289051000000000n,\n\n  // Instances of Date\n  atime: Mon, 10 Oct 2011 23:24:11 GMT,\n  mtime: Mon, 10 Oct 2011 23:24:11 GMT,\n  ctime: Mon, 10 Oct 2011 23:24:11 GMT,\n  birthtime: Mon, 10 Oct 2011 23:24:11 GMT,\n\n  // Instances of Temporal.Instant\n  atimeInstant: 2011-10-10T23:24:11Z,\n  mtimeInstant: 2011-10-10T23:24:11Z,\n  ctimeInstant: 2011-10-10T23:24:11Z,\n  birthtimeInstant: 2011-10-10T23:24:11Z\n}\n</code></pre>",
              "methods": [
                {
                  "textRaw": "`stats.isBlockDevice()`",
                  "name": "isBlockDevice",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a block device.</p>"
                },
                {
                  "textRaw": "`stats.isCharacterDevice()`",
                  "name": "isCharacterDevice",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a character device.</p>"
                },
                {
                  "textRaw": "`stats.isDirectory()`",
                  "name": "isDirectory",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a file system directory.</p>\n<p>If the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object was obtained from calling <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a> on a\nsymbolic link which resolves to a directory, this method will return <code>false</code>.\nThis is because <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a> returns information\nabout a symbolic link itself and not the path it resolves to.</p>"
                },
                {
                  "textRaw": "`stats.isFIFO()`",
                  "name": "isFIFO",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a first-in-first-out (FIFO)\npipe.</p>"
                },
                {
                  "textRaw": "`stats.isFile()`",
                  "name": "isFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a regular file.</p>"
                },
                {
                  "textRaw": "`stats.isSocket()`",
                  "name": "isSocket",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a socket.</p>"
                },
                {
                  "textRaw": "`stats.isSymbolicLink()`",
                  "name": "isSymbolicLink",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object describes a symbolic link.</p>\n<p>This method is only valid when using <a href=\"#fslstatpath-options-callback\"><code>fs.lstat()</code></a>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "dev",
                  "type": "number|bigint",
                  "desc": "<p>The numeric identifier of the device containing the file.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "ino",
                  "type": "number|bigint",
                  "desc": "<p>The file system specific \"Inode\" number for the file.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "mode",
                  "type": "number|bigint",
                  "desc": "<p>A bit-field describing the file type and mode.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "nlink",
                  "type": "number|bigint",
                  "desc": "<p>The number of hard-links that exist for the file.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "uid",
                  "type": "number|bigint",
                  "desc": "<p>The numeric user identifier of the user that owns the file (POSIX).</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "gid",
                  "type": "number|bigint",
                  "desc": "<p>The numeric group identifier of the group that owns the file (POSIX).</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "rdev",
                  "type": "number|bigint",
                  "desc": "<p>A numeric device identifier if the file represents a device.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "size",
                  "type": "number|bigint",
                  "desc": "<p>The size of the file in bytes.</p>\n<p>If the underlying file system does not support getting the size of the file,\nthis will be <code>0</code>.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "blksize",
                  "type": "number|bigint",
                  "desc": "<p>The file system block size for i/o operations.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "blocks",
                  "type": "number|bigint",
                  "desc": "<p>The number of blocks allocated for this file.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "atimeMs",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time this file was accessed expressed in\nmilliseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "mtimeMs",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time this file was modified expressed in\nmilliseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "ctimeMs",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time the file status was changed expressed\nin milliseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "birthtimeMs",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v8.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the creation time of this file expressed in\nmilliseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {bigint}",
                  "name": "atimeNs",
                  "type": "bigint",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Only present when <code>bigint: true</code> is passed into the method that generates\nthe object.\nThe timestamp indicating the last time this file was accessed expressed in\nnanoseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {bigint}",
                  "name": "mtimeNs",
                  "type": "bigint",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Only present when <code>bigint: true</code> is passed into the method that generates\nthe object.\nThe timestamp indicating the last time this file was modified expressed in\nnanoseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {bigint}",
                  "name": "ctimeNs",
                  "type": "bigint",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Only present when <code>bigint: true</code> is passed into the method that generates\nthe object.\nThe timestamp indicating the last time the file status was changed expressed\nin nanoseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {bigint}",
                  "name": "birthtimeNs",
                  "type": "bigint",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Only present when <code>bigint: true</code> is passed into the method that generates\nthe object.\nThe timestamp indicating the creation time of this file expressed in\nnanoseconds since the POSIX Epoch.</p>"
                },
                {
                  "textRaw": "Type: {Date}",
                  "name": "atime",
                  "type": "Date",
                  "meta": {
                    "added": [
                      "v0.11.13"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time this file was accessed.</p>"
                },
                {
                  "textRaw": "Type: {Date}",
                  "name": "mtime",
                  "type": "Date",
                  "meta": {
                    "added": [
                      "v0.11.13"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time this file was modified.</p>"
                },
                {
                  "textRaw": "Type: {Date}",
                  "name": "ctime",
                  "type": "Date",
                  "meta": {
                    "added": [
                      "v0.11.13"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the last time the file status was changed.</p>"
                },
                {
                  "textRaw": "Type: {Date}",
                  "name": "birthtime",
                  "type": "Date",
                  "meta": {
                    "added": [
                      "v0.11.13"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The timestamp indicating the creation time of this file.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Stat time values",
                  "name": "stat_time_values",
                  "type": "module",
                  "desc": "<p>The <code>atimeMs</code>, <code>mtimeMs</code>, <code>ctimeMs</code>, <code>birthtimeMs</code> properties are\nnumeric values that hold the corresponding times in milliseconds. Their\nprecision is platform specific. When <code>bigint: true</code> is passed into the\nmethod that generates the object, the properties will be <a href=\"https://tc39.github.io/proposal-bigint\">bigints</a>,\notherwise they will be <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Data_structures#number_type\">numbers</a>.</p>\n<p>The <code>atimeNs</code>, <code>mtimeNs</code>, <code>ctimeNs</code>, <code>birthtimeNs</code> properties are\n<a href=\"https://tc39.github.io/proposal-bigint\">bigints</a> that hold the corresponding times in nanoseconds. They are\nonly present when <code>bigint: true</code> is passed into the method that generates\nthe object. Their precision is platform specific.</p>\n<p><code>atime</code>, <code>mtime</code>, <code>ctime</code>, and <code>birthtime</code> are\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\"><code>Date</code></a> object alternate representations of the various times. The\n<code>Date</code> and number values are not connected. Assigning a new number value, or\nmutating the <code>Date</code> value, will not be reflected in the corresponding alternate\nrepresentation.</p>\n<p>The times in the stat object have the following semantics:</p>\n<ul>\n<li><code>atime</code> \"Access Time\": Time when file data last accessed. Changed\nby the <a href=\"http://man7.org/linux/man-pages/man2/mknod.2.html\"><code>mknod(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/utimes.2.html\"><code>utimes(2)</code></a>, and <a href=\"http://man7.org/linux/man-pages/man2/read.2.html\"><code>read(2)</code></a> system calls.</li>\n<li><code>mtime</code> \"Modified Time\": Time when file data last modified.\nChanged by the <a href=\"http://man7.org/linux/man-pages/man2/mknod.2.html\"><code>mknod(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/utimes.2.html\"><code>utimes(2)</code></a>, and <a href=\"http://man7.org/linux/man-pages/man2/write.2.html\"><code>write(2)</code></a> system calls.</li>\n<li><code>ctime</code> \"Change Time\": Time when file status was last changed\n(inode data modification). Changed by the <a href=\"http://man7.org/linux/man-pages/man2/chmod.2.html\"><code>chmod(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/chown.2.html\"><code>chown(2)</code></a>,\n<a href=\"http://man7.org/linux/man-pages/man2/link.2.html\"><code>link(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/mknod.2.html\"><code>mknod(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/rename.2.html\"><code>rename(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/unlink.2.html\"><code>unlink(2)</code></a>, <a href=\"http://man7.org/linux/man-pages/man2/utimes.2.html\"><code>utimes(2)</code></a>,\n<a href=\"http://man7.org/linux/man-pages/man2/read.2.html\"><code>read(2)</code></a>, and <a href=\"http://man7.org/linux/man-pages/man2/write.2.html\"><code>write(2)</code></a> system calls.</li>\n<li><code>birthtime</code> \"Birth Time\": Time of file creation. Set once when the\nfile is created. On file systems where birthtime is not available,\nthis field may instead hold either the <code>ctime</code> or\n<code>1970-01-01T00:00Z</code> (ie, Unix epoch timestamp <code>0</code>). This value may be greater\nthan <code>atime</code> or <code>mtime</code> in this case. On Darwin and other FreeBSD variants,\nalso set if the <code>atime</code> is explicitly set to an earlier value than the current\n<code>birthtime</code> using the <a href=\"http://man7.org/linux/man-pages/man2/utimes.2.html\"><code>utimes(2)</code></a> system call.</li>\n</ul>\n<p>Prior to Node.js 0.12, the <code>ctime</code> held the <code>birthtime</code> on Windows systems. As\nof 0.12, <code>ctime</code> is not \"creation time\", and on Unix systems, it never was.</p>",
                  "displayName": "Stat time values"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.StatFs`",
              "name": "fs.StatFs",
              "type": "class",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "desc": "<p>Provides information about a mounted file system.</p>\n<p>Objects returned from <a href=\"#fsstatfspath-options-callback\"><code>fs.statfs()</code></a> and its synchronous counterpart are of\nthis type. If <code>bigint</code> in the <code>options</code> passed to those methods is <code>true</code>, the\nnumeric values will be <code>bigint</code> instead of <code>number</code>.</p>\n<pre><code class=\"language-console\">StatFs {\n  type: 1397114950,\n  bsize: 4096,\n  frsize: 4096,\n  blocks: 121938943,\n  bfree: 61058895,\n  bavail: 61058895,\n  files: 999,\n  ffree: 1000000\n}\n</code></pre>\n<p><code>bigint</code> version:</p>\n<pre><code class=\"language-console\">StatFs {\n  type: 1397114950n,\n  bsize: 4096n,\n  frsize: 4096n,\n  blocks: 121938943n,\n  bfree: 61058895n,\n  bavail: 61058895n,\n  files: 999n,\n  ffree: 1000000n\n}\n</code></pre>",
              "properties": [
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "bavail",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Free blocks available to unprivileged users. Multiply by <a href=\"#statfsbsize\"><code>statfs.bsize</code></a>\nto get the number of available bytes.</p>\n<pre><code class=\"language-mjs\">import { statfs } from 'node:fs/promises';\n\nconst stats = await statfs('/');\nconst availableBytes = stats.bsize * stats.bavail;\nconsole.log(`Available space: ${availableBytes} bytes`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { statfs } = require('node:fs/promises');\n\n(async () => {\n  const stats = await statfs('/');\n  const availableBytes = stats.bsize * stats.bavail;\n  console.log(`Available space: ${availableBytes} bytes`);\n})();\n</code></pre>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "bfree",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Free blocks in file system. Multiply by <a href=\"#statfsbsize\"><code>statfs.bsize</code></a> to get the number\nof free bytes.</p>\n<pre><code class=\"language-mjs\">import { statfs } from 'node:fs/promises';\n\nconst stats = await statfs('/');\nconst freeBytes = stats.bsize * stats.bfree;\nconsole.log(`Free space: ${freeBytes} bytes`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { statfs } = require('node:fs/promises');\n\n(async () => {\n  const stats = await statfs('/');\n  const freeBytes = stats.bsize * stats.bfree;\n  console.log(`Free space: ${freeBytes} bytes`);\n})();\n</code></pre>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "blocks",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Total data blocks in file system. Multiply by <a href=\"#statfsbsize\"><code>statfs.bsize</code></a> to get the\ntotal size in bytes.</p>\n<pre><code class=\"language-mjs\">import { statfs } from 'node:fs/promises';\n\nconst stats = await statfs('/');\nconst totalBytes = stats.bsize * stats.blocks;\nconsole.log(`Total space: ${totalBytes} bytes`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { statfs } = require('node:fs/promises');\n\n(async () => {\n  const stats = await statfs('/');\n  const totalBytes = stats.bsize * stats.blocks;\n  console.log(`Total space: ${totalBytes} bytes`);\n})();\n</code></pre>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "bsize",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Optimal transfer block size in bytes.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "frsize",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v26.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Fundamental file system block size.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "ffree",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Free file nodes in file system.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "files",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Total file nodes in file system.</p>"
                },
                {
                  "textRaw": "Type: {number|bigint}",
                  "name": "type",
                  "type": "number|bigint",
                  "meta": {
                    "added": [
                      "v19.6.0",
                      "v18.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Type of file system. A platform-specific numeric identifier for the type of\nfile system. This value corresponds to the <code>f_type</code> field returned by\n<code>statfs(2)</code> on POSIX systems (for example, <code>0xEF53</code> for ext4 on Linux). Its\nmeaning is OS-dependent and is not guaranteed to be consistent across\nplatforms.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.Utf8Stream`",
              "name": "fs.Utf8Stream",
              "type": "class",
              "meta": {
                "added": [
                  "v24.6.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>An optimized UTF-8 stream writer that allows for flushing all the internal\nbuffering on demand. It handles <code>EAGAIN</code> errors correctly, allowing for\ncustomization, for example, by dropping content if the disk is busy.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'close'</code> event is emitted when the stream is fully closed.</p>"
                },
                {
                  "textRaw": "Event: `'drain'`",
                  "name": "drain",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'drain'</code> event is emitted when the internal buffer has drained sufficiently\nto allow continued writing.</p>"
                },
                {
                  "textRaw": "Event: `'drop'`",
                  "name": "drop",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'drop'</code> event is emitted when the maximal length is reached and that data\nwill not be written. The data that was dropped is passed as the first argument\nto the event handler.</p>"
                },
                {
                  "textRaw": "Event: `'error'`",
                  "name": "error",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'error'</code> event is emitted when an error occurs.</p>"
                },
                {
                  "textRaw": "Event: `'finish'`",
                  "name": "finish",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'finish'</code> event is emitted when the stream has been ended and all data has\nbeen flushed to the underlying file.</p>"
                },
                {
                  "textRaw": "Event: `'ready'`",
                  "name": "ready",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'ready'</code> event is emitted when the stream is ready to accept writes.</p>"
                },
                {
                  "textRaw": "Event: `'write'`",
                  "name": "write",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <code>'write'</code> event is emitted when a write operation has completed. The number\nof bytes written is passed as the first argument to the event handler.</p>"
                }
              ],
              "signatures": [
                {
                  "textRaw": "`new fs.Utf8Stream([options])`",
                  "name": "fs.Utf8Stream",
                  "type": "ctor",
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`append`: {boolean} Appends writes to dest file instead of truncating it. **Default**: `true`.",
                          "name": "append",
                          "type": "boolean",
                          "desc": "Appends writes to dest file instead of truncating it. **Default**: `true`."
                        },
                        {
                          "textRaw": "`contentMode`: {string} Which type of data you can send to the write function, supported values are `'utf8'` or `'buffer'`. **Default**: `'utf8'`.",
                          "name": "contentMode",
                          "type": "string",
                          "desc": "Which type of data you can send to the write function, supported values are `'utf8'` or `'buffer'`. **Default**: `'utf8'`."
                        },
                        {
                          "textRaw": "`dest`: {string} A path to a file to be written to (mode controlled by the append option).",
                          "name": "dest",
                          "type": "string",
                          "desc": "A path to a file to be written to (mode controlled by the append option)."
                        },
                        {
                          "textRaw": "`fd`: {number} A file descriptor, something that is returned by `fs.open()` or `fs.openSync()`.",
                          "name": "fd",
                          "type": "number",
                          "desc": "A file descriptor, something that is returned by `fs.open()` or `fs.openSync()`."
                        },
                        {
                          "textRaw": "`fs`: {Object} An object that has the same API as the `fs` module, useful for mocking, testing, or customizing the behavior of the stream.",
                          "name": "fs",
                          "type": "Object",
                          "desc": "An object that has the same API as the `fs` module, useful for mocking, testing, or customizing the behavior of the stream."
                        },
                        {
                          "textRaw": "`fsync`: {boolean} Perform a `fs.fsyncSync()` every time a write is completed.",
                          "name": "fsync",
                          "type": "boolean",
                          "desc": "Perform a `fs.fsyncSync()` every time a write is completed."
                        },
                        {
                          "textRaw": "`maxLength`: {number} The maximum length of the internal buffer. If a write operation would cause the buffer to exceed `maxLength`, the data written is dropped and a drop event is emitted with the dropped data",
                          "name": "maxLength",
                          "type": "number",
                          "desc": "The maximum length of the internal buffer. If a write operation would cause the buffer to exceed `maxLength`, the data written is dropped and a drop event is emitted with the dropped data"
                        },
                        {
                          "textRaw": "`maxWrite`: {number} The maximum number of bytes that can be written; **Default**: `16384`",
                          "name": "maxWrite",
                          "type": "number",
                          "desc": "The maximum number of bytes that can be written; **Default**: `16384`"
                        },
                        {
                          "textRaw": "`minLength`: {number} The minimum length of the internal buffer that is required to be full before flushing.",
                          "name": "minLength",
                          "type": "number",
                          "desc": "The minimum length of the internal buffer that is required to be full before flushing."
                        },
                        {
                          "textRaw": "`mkdir`: {boolean} Ensure directory for `dest` file exists when true. **Default**: `false`.",
                          "name": "mkdir",
                          "type": "boolean",
                          "desc": "Ensure directory for `dest` file exists when true. **Default**: `false`."
                        },
                        {
                          "textRaw": "`mode`: {number|string} Specify the creating file mode (see `fs.open()`).",
                          "name": "mode",
                          "type": "number|string",
                          "desc": "Specify the creating file mode (see `fs.open()`)."
                        },
                        {
                          "textRaw": "`periodicFlush`: {number} Calls flush every `periodicFlush` milliseconds.",
                          "name": "periodicFlush",
                          "type": "number",
                          "desc": "Calls flush every `periodicFlush` milliseconds."
                        },
                        {
                          "textRaw": "`retryEAGAIN` {Function} A function that will be called when `write()`, `writeSync()`, or `flushSync()` encounters an `EAGAIN` or `EBUSY` error. If the return value is `true` the operation will be retried, otherwise it will bubble the error. The `err` is the error that caused this function to be called, `writeBufferLen` is the length of the buffer that was written, and `remainingBufferLen` is the length of the remaining buffer that the stream did not try to write.",
                          "name": "retryEAGAIN",
                          "type": "Function",
                          "desc": "A function that will be called when `write()`, `writeSync()`, or `flushSync()` encounters an `EAGAIN` or `EBUSY` error. If the return value is `true` the operation will be retried, otherwise it will bubble the error. The `err` is the error that caused this function to be called, `writeBufferLen` is the length of the buffer that was written, and `remainingBufferLen` is the length of the remaining buffer that the stream did not try to write.",
                          "options": [
                            {
                              "textRaw": "`err` {any} An error or `null`.",
                              "name": "err",
                              "type": "any",
                              "desc": "An error or `null`."
                            },
                            {
                              "textRaw": "`writeBufferLen` {number}",
                              "name": "writeBufferLen",
                              "type": "number"
                            },
                            {
                              "textRaw": "`remainingBufferLen`: {number}",
                              "name": "remainingBufferLen",
                              "type": "number"
                            }
                          ]
                        },
                        {
                          "textRaw": "`sync`: {boolean} Perform writes synchronously.",
                          "name": "sync",
                          "type": "boolean",
                          "desc": "Perform writes synchronously."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "properties": [
                {
                  "textRaw": "{boolean} Whether the stream is appending to the file or truncating it.",
                  "name": "append",
                  "type": "boolean",
                  "desc": "Whether the stream is appending to the file or truncating it."
                },
                {
                  "textRaw": "{string} The type of data that can be written to the stream. Supported values are `'utf8'` or `'buffer'`. **Default**: `'utf8'`.",
                  "name": "contentMode",
                  "type": "string",
                  "desc": "The type of data that can be written to the stream. Supported values are `'utf8'` or `'buffer'`. **Default**: `'utf8'`."
                },
                {
                  "textRaw": "{number} The file descriptor that is being written to.",
                  "name": "fd",
                  "type": "number",
                  "desc": "The file descriptor that is being written to."
                },
                {
                  "textRaw": "{string} The file that is being written to.",
                  "name": "file",
                  "type": "string",
                  "desc": "The file that is being written to."
                },
                {
                  "textRaw": "{boolean} Whether the stream is performing a `fs.fsyncSync()` after every write operation.",
                  "name": "fsync",
                  "type": "boolean",
                  "desc": "Whether the stream is performing a `fs.fsyncSync()` after every write operation."
                },
                {
                  "textRaw": "{number} The maximum length of the internal buffer. If a write operation would cause the buffer to exceed `maxLength`, the data written is dropped and a drop event is emitted with the dropped data.",
                  "name": "maxLength",
                  "type": "number",
                  "desc": "The maximum length of the internal buffer. If a write operation would cause the buffer to exceed `maxLength`, the data written is dropped and a drop event is emitted with the dropped data."
                },
                {
                  "textRaw": "{number} The minimum length of the internal buffer that is required to be full before flushing.",
                  "name": "minLength",
                  "type": "number",
                  "desc": "The minimum length of the internal buffer that is required to be full before flushing."
                },
                {
                  "textRaw": "{boolean} Whether the stream should ensure that the directory for the `dest` file exists. If `true`, it will create the directory if it does not exist. **Default**: `false`.",
                  "name": "mkdir",
                  "type": "boolean",
                  "desc": "Whether the stream should ensure that the directory for the `dest` file exists. If `true`, it will create the directory if it does not exist. **Default**: `false`."
                },
                {
                  "textRaw": "{number|string} The mode of the file that is being written to.",
                  "name": "mode",
                  "type": "number|string",
                  "desc": "The mode of the file that is being written to."
                },
                {
                  "textRaw": "{number} The number of milliseconds between flushes. If set to `0`, no periodic flushes will be performed.",
                  "name": "periodicFlush",
                  "type": "number",
                  "desc": "The number of milliseconds between flushes. If set to `0`, no periodic flushes will be performed."
                },
                {
                  "textRaw": "{boolean} Whether the stream is writing synchronously or asynchronously.",
                  "name": "sync",
                  "type": "boolean",
                  "desc": "Whether the stream is writing synchronously or asynchronously."
                },
                {
                  "textRaw": "{boolean} Whether the stream is currently writing data to the file.",
                  "name": "writing",
                  "type": "boolean",
                  "desc": "Whether the stream is currently writing data to the file."
                }
              ],
              "methods": [
                {
                  "textRaw": "`utf8Stream.destroy()`",
                  "name": "destroy",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Close the stream immediately, without flushing the internal buffer.</p>"
                },
                {
                  "textRaw": "`utf8Stream.end()`",
                  "name": "end",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Close the stream gracefully, flushing the internal buffer before closing.</p>"
                },
                {
                  "textRaw": "`utf8Stream.flush(callback)`",
                  "name": "flush",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "options": [
                            {
                              "textRaw": "`err` {Error|null} An error if the flush failed, otherwise `null`.",
                              "name": "err",
                              "type": "Error|null",
                              "desc": "An error if the flush failed, otherwise `null`."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Writes the current buffer to the file if a write was not in progress. Do\nnothing if <code>minLength</code> is zero or if it is already writing.</p>"
                },
                {
                  "textRaw": "`utf8Stream.flushSync()`",
                  "name": "flushSync",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Flushes the buffered data synchronously. This is a costly operation.</p>"
                },
                {
                  "textRaw": "`utf8Stream.reopen(file)`",
                  "name": "reopen",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "file"
                        }
                      ]
                    }
                  ],
                  "desc": "<ul>\n<li><code>file</code>: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> A path to a file to be written to (mode\ncontrolled by the append option).</li>\n</ul>\n<p>Reopen the file in place, useful for log rotation.</p>"
                },
                {
                  "textRaw": "`utf8Stream.write(data)`",
                  "name": "write",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer} The data to write.",
                          "name": "data",
                          "type": "string|Buffer",
                          "desc": "The data to write."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>When the <code>options.contentMode</code> is set to <code>'utf8'</code> when the stream is created,\nthe <code>data</code> argument must be a string. If the <code>contentMode</code> is set to <code>'buffer'</code>,\nthe <code>data</code> argument must be a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>"
                },
                {
                  "textRaw": "`utf8Stream[Symbol.dispose]()`",
                  "name": "[Symbol.dispose]",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <code>utf8Stream.destroy()</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `fs.WriteStream`",
              "name": "fs.WriteStream",
              "type": "class",
              "meta": {
                "added": [
                  "v0.1.93"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends <a href=\"stream.html#class-streamwritable\"><code>&#x3C;stream.Writable></code></a></li>\n</ul>\n<p>Instances of <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a> cannot be constructed directly. They are created and\nreturned using the <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a> function.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a>'s underlying file descriptor has been closed.</p>"
                },
                {
                  "textRaw": "Event: `'open'`",
                  "name": "open",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`fd` {integer} Integer file descriptor used by the {fs.WriteStream}.",
                      "name": "fd",
                      "type": "integer",
                      "desc": "Integer file descriptor used by the {fs.WriteStream}."
                    }
                  ],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a>'s file is opened.</p>"
                },
                {
                  "textRaw": "Event: `'ready'`",
                  "name": "ready",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v9.11.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the <a href=\"fs.html#class-fswritestream\"><code>&#x3C;fs.WriteStream></code></a> is ready to be used.</p>\n<p>Fires immediately after <code>'open'</code>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "`writeStream.bytesWritten`",
                  "name": "bytesWritten",
                  "type": "property",
                  "meta": {
                    "added": [
                      "v0.4.7"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The number of bytes written so far. Does not include data that is still queued\nfor writing.</p>"
                },
                {
                  "textRaw": "`writeStream.path`",
                  "name": "path",
                  "type": "property",
                  "meta": {
                    "added": [
                      "v0.1.93"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The path to the file the stream is writing to as specified in the first\nargument to <a href=\"#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a>. If <code>path</code> is passed as a string, then\n<code>writeStream.path</code> will be a string. If <code>path</code> is passed as a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, then <code>writeStream.path</code> will be a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "pending",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v11.2.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This property is <code>true</code> if the underlying file has not been opened yet,\ni.e. before the <code>'ready'</code> event is emitted.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`writeStream.close([callback])`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Closes <code>writeStream</code>. Optionally accepts a\ncallback that will be executed once the <code>writeStream</code>\nis closed.</p>"
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "constants",
              "type": "Object",
              "desc": "<p>Returns an object containing commonly used constants for file system\noperations.</p>",
              "modules": [
                {
                  "textRaw": "FS constants",
                  "name": "fs_constants",
                  "type": "module",
                  "desc": "<p>The following constants are exported by <code>fs.constants</code> and <code>fsPromises.constants</code>.</p>\n<p>Not every constant will be available on every operating system;\nthis is especially important for Windows, where many of the POSIX specific\ndefinitions are not available.\nFor portable applications it is recommended to check for their presence\nbefore use.</p>\n<p>To use more than one constant, use the bitwise OR <code>|</code> operator.</p>\n<p>Example:</p>\n<pre><code class=\"language-mjs\">import { open, constants } from 'node:fs';\n\nconst {\n  O_RDWR,\n  O_CREAT,\n  O_EXCL,\n} = constants;\n\nopen('/path/to/my/file', O_RDWR | O_CREAT | O_EXCL, (err, fd) => {\n  // ...\n});\n</code></pre>",
                  "modules": [
                    {
                      "textRaw": "File access constants",
                      "name": "file_access_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use as the <code>mode</code> parameter passed to\n<a href=\"#fspromisesaccesspath-mode\"><code>fsPromises.access()</code></a>, <a href=\"#fsaccesspath-mode-callback\"><code>fs.access()</code></a>, and <a href=\"#fsaccesssyncpath-mode\"><code>fs.accessSync()</code></a>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>F_OK</code></td>\n    <td>Flag indicating that the file is visible to the calling process.\n     This is useful for determining if a file exists, but says nothing\n     about <code>rwx</code> permissions. Default if no mode is specified.</td>\n  </tr>\n  <tr>\n    <td><code>R_OK</code></td>\n    <td>Flag indicating that the file can be read by the calling process.</td>\n  </tr>\n  <tr>\n    <td><code>W_OK</code></td>\n    <td>Flag indicating that the file can be written by the calling\n    process.</td>\n  </tr>\n  <tr>\n    <td><code>X_OK</code></td>\n    <td>Flag indicating that the file can be executed by the calling\n    process. This has no effect on Windows\n    (will behave like <code>fs.constants.F_OK</code>).</td>\n  </tr>\n</table>\n<p>The definitions are also available on Windows.</p>",
                      "displayName": "File access constants"
                    },
                    {
                      "textRaw": "File copy constants",
                      "name": "file_copy_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use with <a href=\"#fscopyfilesrc-dest-mode-callback\"><code>fs.copyFile()</code></a>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>COPYFILE_EXCL</code></td>\n    <td>If present, the copy operation will fail with an error if the\n    destination path already exists.</td>\n  </tr>\n  <tr>\n    <td><code>COPYFILE_FICLONE</code></td>\n    <td>If present, the copy operation will attempt to create a\n    copy-on-write reflink. If the underlying platform does not support\n    copy-on-write, then a fallback copy mechanism is used.</td>\n  </tr>\n  <tr>\n    <td><code>COPYFILE_FICLONE_FORCE</code></td>\n    <td>If present, the copy operation will attempt to create a\n    copy-on-write reflink. If the underlying platform does not support\n    copy-on-write, then the operation will fail with an error.</td>\n  </tr>\n</table>\n<p>The definitions are also available on Windows.</p>",
                      "displayName": "File copy constants"
                    },
                    {
                      "textRaw": "File open constants",
                      "name": "file_open_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use with <code>fs.open()</code>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>O_RDONLY</code></td>\n    <td>Flag indicating to open a file for read-only access.</td>\n  </tr>\n  <tr>\n    <td><code>O_WRONLY</code></td>\n    <td>Flag indicating to open a file for write-only access.</td>\n  </tr>\n  <tr>\n    <td><code>O_RDWR</code></td>\n    <td>Flag indicating to open a file for read-write access.</td>\n  </tr>\n  <tr>\n    <td><code>O_CREAT</code></td>\n    <td>Flag indicating to create the file if it does not already exist.</td>\n  </tr>\n  <tr>\n    <td><code>O_EXCL</code></td>\n    <td>Flag indicating that opening a file should fail if the\n    <code>O_CREAT</code> flag is set and the file already exists.</td>\n  </tr>\n  <tr>\n    <td><code>O_NOCTTY</code></td>\n    <td>Flag indicating that if path identifies a terminal device, opening the\n    path shall not cause that terminal to become the controlling terminal for\n    the process (if the process does not already have one).</td>\n  </tr>\n  <tr>\n    <td><code>O_TRUNC</code></td>\n    <td>Flag indicating that if the file exists and is a regular file, and the\n    file is opened successfully for write access, its length shall be truncated\n    to zero.</td>\n  </tr>\n  <tr>\n    <td><code>O_APPEND</code></td>\n    <td>Flag indicating that data will be appended to the end of the file.</td>\n  </tr>\n  <tr>\n    <td><code>O_DIRECTORY</code></td>\n    <td>Flag indicating that the open should fail if the path is not a\n    directory.</td>\n  </tr>\n  <tr>\n  <td><code>O_NOATIME</code></td>\n    <td>Flag indicating reading accesses to the file system will no longer\n    result in an update to the <code>atime</code> information associated with\n    the file. This flag is available on Linux operating systems only.</td>\n  </tr>\n  <tr>\n    <td><code>O_NOFOLLOW</code></td>\n    <td>Flag indicating that the open should fail if the path is a symbolic\n    link.</td>\n  </tr>\n  <tr>\n    <td><code>O_SYNC</code></td>\n    <td>Flag indicating that the file is opened for synchronized I/O with write\n    operations waiting for file integrity.</td>\n  </tr>\n  <tr>\n    <td><code>O_DSYNC</code></td>\n    <td>Flag indicating that the file is opened for synchronized I/O with write\n    operations waiting for data integrity.</td>\n  </tr>\n  <tr>\n    <td><code>O_SYMLINK</code></td>\n    <td>Flag indicating to open the symbolic link itself rather than the\n    resource it is pointing to.</td>\n  </tr>\n  <tr>\n    <td><code>O_DIRECT</code></td>\n    <td>When set, an attempt will be made to minimize caching effects of file\n    I/O.</td>\n  </tr>\n  <tr>\n    <td><code>O_NONBLOCK</code></td>\n    <td>Flag indicating to open the file in nonblocking mode when possible.</td>\n  </tr>\n  <tr>\n    <td><code>UV_FS_O_FILEMAP</code></td>\n    <td>When set, a memory file mapping is used to access the file. This flag\n    is available on Windows operating systems only. On other operating systems,\n    this flag is ignored.</td>\n  </tr>\n</table>\n<p>On Windows, only <code>O_APPEND</code>, <code>O_CREAT</code>, <code>O_EXCL</code>, <code>O_RDONLY</code>, <code>O_RDWR</code>,\n<code>O_TRUNC</code>, <code>O_WRONLY</code>, and <code>UV_FS_O_FILEMAP</code> are available.</p>",
                      "displayName": "File open constants"
                    },
                    {
                      "textRaw": "File type constants",
                      "name": "file_type_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use with the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object's <code>mode</code> property for determining a file's type.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>S_IFMT</code></td>\n    <td>Bit mask used to extract the file type code.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFREG</code></td>\n    <td>File type constant for a regular file.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFDIR</code></td>\n    <td>File type constant for a directory.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFCHR</code></td>\n    <td>File type constant for a character-oriented device file.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFBLK</code></td>\n    <td>File type constant for a block-oriented device file.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFIFO</code></td>\n    <td>File type constant for a FIFO/pipe.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFLNK</code></td>\n    <td>File type constant for a symbolic link.</td>\n  </tr>\n  <tr>\n    <td><code>S_IFSOCK</code></td>\n    <td>File type constant for a socket.</td>\n  </tr>\n</table>\n<p>On Windows, only <code>S_IFCHR</code>, <code>S_IFDIR</code>, <code>S_IFLNK</code>, <code>S_IFMT</code>, and <code>S_IFREG</code>,\nare available.</p>",
                      "displayName": "File type constants"
                    },
                    {
                      "textRaw": "File mode constants",
                      "name": "file_mode_constants",
                      "type": "module",
                      "desc": "<p>The following constants are meant for use with the <a href=\"fs.html#class-fsstats\"><code>&#x3C;fs.Stats></code></a> object's <code>mode</code> property for determining the access permissions for a file.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>S_IRWXU</code></td>\n    <td>File mode indicating readable, writable, and executable by owner.</td>\n  </tr>\n  <tr>\n    <td><code>S_IRUSR</code></td>\n    <td>File mode indicating readable by owner.</td>\n  </tr>\n  <tr>\n    <td><code>S_IWUSR</code></td>\n    <td>File mode indicating writable by owner.</td>\n  </tr>\n  <tr>\n    <td><code>S_IXUSR</code></td>\n    <td>File mode indicating executable by owner.</td>\n  </tr>\n  <tr>\n    <td><code>S_IRWXG</code></td>\n    <td>File mode indicating readable, writable, and executable by group.</td>\n  </tr>\n  <tr>\n    <td><code>S_IRGRP</code></td>\n    <td>File mode indicating readable by group.</td>\n  </tr>\n  <tr>\n    <td><code>S_IWGRP</code></td>\n    <td>File mode indicating writable by group.</td>\n  </tr>\n  <tr>\n    <td><code>S_IXGRP</code></td>\n    <td>File mode indicating executable by group.</td>\n  </tr>\n  <tr>\n    <td><code>S_IRWXO</code></td>\n    <td>File mode indicating readable, writable, and executable by others.</td>\n  </tr>\n  <tr>\n    <td><code>S_IROTH</code></td>\n    <td>File mode indicating readable by others.</td>\n  </tr>\n  <tr>\n    <td><code>S_IWOTH</code></td>\n    <td>File mode indicating writable by others.</td>\n  </tr>\n  <tr>\n    <td><code>S_IXOTH</code></td>\n    <td>File mode indicating executable by others.</td>\n  </tr>\n</table>\n<p>On Windows, only <code>S_IRUSR</code> and <code>S_IWUSR</code> are available.</p>",
                      "displayName": "File mode constants"
                    }
                  ],
                  "displayName": "FS constants"
                }
              ]
            }
          ],
          "displayName": "Common Objects"
        },
        {
          "textRaw": "Notes",
          "name": "notes",
          "type": "module",
          "modules": [
            {
              "textRaw": "Ordering of callback and promise-based operations",
              "name": "ordering_of_callback_and_promise-based_operations",
              "type": "module",
              "desc": "<p>Because they are executed asynchronously by the underlying thread pool,\nthere is no guaranteed ordering when using either the callback or\npromise-based methods.</p>\n<p>For example, the following is prone to error because the <code>fs.stat()</code>\noperation might complete before the <code>fs.rename()</code> operation:</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\n\nfs.rename('/tmp/hello', '/tmp/world', (err) => {\n  if (err) throw err;\n  console.log('renamed complete');\n});\nfs.stat('/tmp/world', (err, stats) => {\n  if (err) throw err;\n  console.log(`stats: ${JSON.stringify(stats)}`);\n});\n</code></pre>\n<p>It is important to correctly order the operations by awaiting the results\nof one before invoking the other:</p>\n<pre><code class=\"language-mjs\">import { rename, stat } from 'node:fs/promises';\n\nconst oldPath = '/tmp/hello';\nconst newPath = '/tmp/world';\n\ntry {\n  await rename(oldPath, newPath);\n  const stats = await stat(newPath);\n  console.log(`stats: ${JSON.stringify(stats)}`);\n} catch (error) {\n  console.error('there was an error:', error.message);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { rename, stat } = require('node:fs/promises');\n\n(async function(oldPath, newPath) {\n  try {\n    await rename(oldPath, newPath);\n    const stats = await stat(newPath);\n    console.log(`stats: ${JSON.stringify(stats)}`);\n  } catch (error) {\n    console.error('there was an error:', error.message);\n  }\n})('/tmp/hello', '/tmp/world');\n</code></pre>\n<p>Or, when using the callback APIs, move the <code>fs.stat()</code> call into the callback\nof the <code>fs.rename()</code> operation:</p>\n<pre><code class=\"language-mjs\">import { rename, stat } from 'node:fs';\n\nrename('/tmp/hello', '/tmp/world', (err) => {\n  if (err) throw err;\n  stat('/tmp/world', (err, stats) => {\n    if (err) throw err;\n    console.log(`stats: ${JSON.stringify(stats)}`);\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { rename, stat } = require('node:fs/promises');\n\nrename('/tmp/hello', '/tmp/world', (err) => {\n  if (err) throw err;\n  stat('/tmp/world', (err, stats) => {\n    if (err) throw err;\n    console.log(`stats: ${JSON.stringify(stats)}`);\n  });\n});\n</code></pre>",
              "displayName": "Ordering of callback and promise-based operations"
            },
            {
              "textRaw": "File paths",
              "name": "file_paths",
              "type": "module",
              "desc": "<p>Most <code>fs</code> operations accept file paths that may be specified in the form of\na string, a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, or a <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> object using the <code>file:</code> protocol.</p>",
              "modules": [
                {
                  "textRaw": "String paths",
                  "name": "string_paths",
                  "type": "module",
                  "desc": "<p>String paths are interpreted as UTF-8 character sequences identifying\nthe absolute or relative filename. Relative paths will be resolved relative\nto the current working directory as determined by calling <code>process.cwd()</code>.</p>\n<p>Example using an absolute path on POSIX:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet fd;\ntry {\n  fd = await open('/open/some/file.txt', 'r');\n  // Do something with the file\n} finally {\n  await fd?.close();\n}\n</code></pre>\n<p>Example using a relative path on POSIX (relative to <code>process.cwd()</code>):</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet fd;\ntry {\n  fd = await open('file.txt', 'r');\n  // Do something with the file\n} finally {\n  await fd?.close();\n}\n</code></pre>",
                  "displayName": "String paths"
                },
                {
                  "textRaw": "File URL paths",
                  "name": "file_url_paths",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v7.6.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>For most <code>node:fs</code> module functions, the <code>path</code> or <code>filename</code> argument may be\npassed as a <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> object using the <code>file:</code> protocol.</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n\nreadFileSync(new URL('file:///tmp/hello'));\n</code></pre>\n<p><code>file:</code> URLs are always absolute paths.</p>",
                  "modules": [
                    {
                      "textRaw": "Platform-specific considerations",
                      "name": "platform-specific_considerations",
                      "type": "module",
                      "desc": "<p>On Windows, <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s with a host name convert to UNC paths, while <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s with drive letters convert to local absolute paths. <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s\nwith no host name and no drive letter will result in an error:</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n// On Windows :\n\n// - WHATWG file URLs with hostname convert to UNC path\n// file://hostname/p/a/t/h/file => \\\\hostname\\p\\a\\t\\h\\file\nreadFileSync(new URL('file://hostname/p/a/t/h/file'));\n\n// - WHATWG file URLs with drive letters convert to absolute path\n// file:///C:/tmp/hello => C:\\tmp\\hello\nreadFileSync(new URL('file:///C:/tmp/hello'));\n\n// - WHATWG file URLs without hostname must have a drive letters\nreadFileSync(new URL('file:///notdriveletter/p/a/t/h/file'));\nreadFileSync(new URL('file:///c/p/a/t/h/file'));\n// TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must be absolute\n</code></pre>\n<p><code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s with drive letters must use <code>:</code> as a separator just after\nthe drive letter. Using another separator will result in an error.</p>\n<p>On all other platforms, <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s with a host name are unsupported and\nwill result in an error:</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n// On other platforms:\n\n// - WHATWG file URLs with hostname are unsupported\n// file://hostname/p/a/t/h/file => throw!\nreadFileSync(new URL('file://hostname/p/a/t/h/file'));\n// TypeError [ERR_INVALID_FILE_URL_PATH]: must be absolute\n\n// - WHATWG file URLs convert to absolute path\n// file:///tmp/hello => /tmp/hello\nreadFileSync(new URL('file:///tmp/hello'));\n</code></pre>\n<p>A <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a> having encoded slash characters will result in an error on all\nplatforms:</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n\n// On Windows\nreadFileSync(new URL('file:///C:/p/a/t/h/%2F'));\nreadFileSync(new URL('file:///C:/p/a/t/h/%2f'));\n/* TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must not include encoded\n\\ or / characters */\n\n// On POSIX\nreadFileSync(new URL('file:///p/a/t/h/%2F'));\nreadFileSync(new URL('file:///p/a/t/h/%2f'));\n/* TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must not include encoded\n/ characters */\n</code></pre>\n<p>On Windows, <code>file:</code> <a href=\"url.html#the-whatwg-url-api\"><code>&#x3C;URL></code></a>s having encoded backslash will result in an error:</p>\n<pre><code class=\"language-mjs\">import { readFileSync } from 'node:fs';\n\n// On Windows\nreadFileSync(new URL('file:///C:/path/%5C'));\nreadFileSync(new URL('file:///C:/path/%5c'));\n/* TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must not include encoded\n\\ or / characters */\n</code></pre>",
                      "displayName": "Platform-specific considerations"
                    }
                  ],
                  "displayName": "File URL paths"
                },
                {
                  "textRaw": "Buffer paths",
                  "name": "buffer_paths",
                  "type": "module",
                  "desc": "<p>Paths specified using a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> are useful primarily on certain POSIX\noperating systems that treat file paths as opaque byte sequences. On such\nsystems, it is possible for a single file path to contain sub-sequences that\nuse multiple character encodings. As with string paths, <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> paths may\nbe relative or absolute:</p>\n<p>Example using an absolute path on POSIX:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { Buffer } from 'node:buffer';\n\nlet fd;\ntry {\n  fd = await open(Buffer.from('/open/some/file.txt'), 'r');\n  // Do something with the file\n} finally {\n  await fd?.close();\n}\n</code></pre>",
                  "displayName": "Buffer paths"
                },
                {
                  "textRaw": "Per-drive working directories on Windows",
                  "name": "per-drive_working_directories_on_windows",
                  "type": "module",
                  "desc": "<p>On Windows, Node.js follows the concept of per-drive working directory. This\nbehavior can be observed when using a drive path without a backslash. For\nexample <code>fs.readdirSync('C:\\\\')</code> can potentially return a different result than\n<code>fs.readdirSync('C:')</code>. For more information, see\n<a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths\">this MSDN page</a>.</p>",
                  "displayName": "Per-drive working directories on Windows"
                }
              ],
              "displayName": "File paths"
            },
            {
              "textRaw": "File descriptors",
              "name": "file_descriptors",
              "type": "module",
              "desc": "<p>On POSIX systems, for every process, the kernel maintains a table of currently\nopen files and resources. Each open file is assigned a simple numeric\nidentifier called a <em>file descriptor</em>. At the system-level, all file system\noperations use these file descriptors to identify and track each specific\nfile. Windows systems use a different but conceptually similar mechanism for\ntracking resources. To simplify things for users, Node.js abstracts away the\ndifferences between operating systems and assigns all open files a numeric file\ndescriptor.</p>\n<p>The callback-based <code>fs.open()</code>, and synchronous <code>fs.openSync()</code> methods open a\nfile and allocate a new file descriptor. Once allocated, the file descriptor may\nbe used to read data from, write data to, or request information about the file.</p>\n<p>Operating systems limit the number of file descriptors that may be open\nat any given time so it is critical to close the descriptor when operations\nare completed. Failure to do so will result in a memory leak that will\neventually cause an application to crash.</p>\n<pre><code class=\"language-mjs\">import { open, close, fstat } from 'node:fs';\n\nfunction closeFd(fd) {\n  close(fd, (err) => {\n    if (err) throw err;\n  });\n}\n\nopen('/open/some/file.txt', 'r', (err, fd) => {\n  if (err) throw err;\n  try {\n    fstat(fd, (err, stat) => {\n      if (err) {\n        closeFd(fd);\n        throw err;\n      }\n\n      // use stat\n\n      closeFd(fd);\n    });\n  } catch (err) {\n    closeFd(fd);\n    throw err;\n  }\n});\n</code></pre>\n<p>The promise-based APIs use a <a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a> object in place of the numeric\nfile descriptor. These objects are better managed by the system to ensure\nthat resources are not leaked. However, it is still required that they are\nclosed when operations are completed:</p>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\n\nlet file;\ntry {\n  file = await open('/open/some/file.txt', 'r');\n  const stat = await file.stat();\n  // use stat\n} finally {\n  await file.close();\n}\n</code></pre>",
              "displayName": "File descriptors"
            },
            {
              "textRaw": "Threadpool usage",
              "name": "threadpool_usage",
              "type": "module",
              "desc": "<p>All callback and promise-based file system APIs (with the exception of\n<code>fs.FSWatcher()</code>) use libuv's threadpool. This can have surprising and negative\nperformance implications for some applications. See the\n<a href=\"cli.html#uv_threadpool_sizesize\"><code>UV_THREADPOOL_SIZE</code></a> documentation for more information.</p>",
              "displayName": "Threadpool usage"
            },
            {
              "textRaw": "File system flags",
              "name": "file_system_flags",
              "type": "module",
              "desc": "<p>The following flags are available wherever the <code>flag</code> option takes a\nstring.</p>\n<ul>\n<li>\n<p><code>'a'</code>: Open file for appending.\nThe file is created if it does not exist.</p>\n</li>\n<li>\n<p><code>'ax'</code>: Like <code>'a'</code> but fails if the path exists.</p>\n</li>\n<li>\n<p><code>'a+'</code>: Open file for reading and appending.\nThe file is created if it does not exist.</p>\n</li>\n<li>\n<p><code>'ax+'</code>: Like <code>'a+'</code> but fails if the path exists.</p>\n</li>\n<li>\n<p><code>'as'</code>: Open file for appending in synchronous mode.\nThe file is created if it does not exist.</p>\n</li>\n<li>\n<p><code>'as+'</code>: Open file for reading and appending in synchronous mode.\nThe file is created if it does not exist.</p>\n</li>\n<li>\n<p><code>'r'</code>: Open file for reading.\nAn exception occurs if the file does not exist.</p>\n</li>\n<li>\n<p><code>'rs'</code>: Open file for reading in synchronous mode.\nAn exception occurs if the file does not exist.</p>\n</li>\n<li>\n<p><code>'r+'</code>: Open file for reading and writing.\nAn exception occurs if the file does not exist.</p>\n</li>\n<li>\n<p><code>'rs+'</code>: Open file for reading and writing in synchronous mode. Instructs\nthe operating system to bypass the local file system cache.</p>\n<p>This is primarily useful for opening files on NFS mounts as it allows\nskipping the potentially stale local cache. It has a very real impact on\nI/O performance so using this flag is not recommended unless it is needed.</p>\n<p>This doesn't turn <code>fs.open()</code> or <code>fsPromises.open()</code> into a synchronous\nblocking call. If synchronous operation is desired, something like\n<code>fs.openSync()</code> should be used.</p>\n</li>\n<li>\n<p><code>'w'</code>: Open file for writing.\nThe file is created (if it does not exist) or truncated (if it exists).</p>\n</li>\n<li>\n<p><code>'wx'</code>: Like <code>'w'</code> but fails if the path exists.</p>\n</li>\n<li>\n<p><code>'w+'</code>: Open file for reading and writing.\nThe file is created (if it does not exist) or truncated (if it exists).</p>\n</li>\n<li>\n<p><code>'wx+'</code>: Like <code>'w+'</code> but fails if the path exists.</p>\n</li>\n</ul>\n<p><code>flag</code> can also be a number as documented by <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a>; commonly used constants\nare available from <code>fs.constants</code>. On Windows, flags are translated to\ntheir equivalent ones where applicable, e.g. <code>O_WRONLY</code> to <code>FILE_GENERIC_WRITE</code>,\nor <code>O_EXCL|O_CREAT</code> to <code>CREATE_NEW</code>, as accepted by <code>CreateFileW</code>.</p>\n<p>The exclusive flag <code>'x'</code> (<code>O_EXCL</code> flag in <a href=\"http://man7.org/linux/man-pages/man2/open.2.html\"><code>open(2)</code></a>) causes the operation to\nreturn an error if the path already exists. On POSIX, if the path is a symbolic\nlink, using <code>O_EXCL</code> returns an error even if the link is to a path that does\nnot exist. The exclusive flag might not work with network file systems.</p>\n<p>On Linux, positional writes don't work when the file is opened in append mode.\nThe kernel ignores the position argument and always appends the data to\nthe end of the file.</p>\n<p>Modifying a file rather than replacing it may require the <code>flag</code> option to be\nset to <code>'r+'</code> rather than the default <code>'w'</code>.</p>\n<p>The behavior of some flags are platform-specific. As such, opening a directory\non macOS and Linux with the <code>'a+'</code> flag, as in the example below, will return an\nerror. In contrast, on Windows and FreeBSD, a file descriptor or a <code>FileHandle</code>\nwill be returned.</p>\n<pre><code class=\"language-js\">// macOS and Linux\nfs.open('&#x3C;directory>', 'a+', (err, fd) => {\n  // => [Error: EISDIR: illegal operation on a directory, open &#x3C;directory>]\n});\n\n// Windows and FreeBSD\nfs.open('&#x3C;directory>', 'a+', (err, fd) => {\n  // => null, &#x3C;fd>\n});\n</code></pre>\n<p>On Windows, opening an existing hidden file using the <code>'w'</code> flag (either\nthrough <code>fs.open()</code>, <code>fs.writeFile()</code>, or <code>fsPromises.open()</code>) will fail with\n<code>EPERM</code>. Existing hidden files can be opened for writing with the <code>'r+'</code> flag.</p>\n<p>A call to <code>fs.ftruncate()</code> or <code>filehandle.truncate()</code> can be used to reset\nthe file contents.</p>",
              "displayName": "File system flags"
            }
          ],
          "displayName": "Notes"
        }
      ],
      "displayName": "File system",
      "source": "doc/api/fs.md"
    },
    {
      "textRaw": "FFI",
      "name": "ffi",
      "introduced_in": "v26.1.0",
      "type": "module",
      "meta": {
        "added": [
          "v26.1.0"
        ],
        "changes": []
      },
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The <code>node:ffi</code> module provides an experimental foreign function interface for\nloading dynamic libraries and calling native symbols from JavaScript.</p>\n<p>This API is unsafe. Passing invalid pointers, using an incorrect symbol\nsignature, or accessing memory after it has been freed can crash the process\nor corrupt memory.</p>\n<p>To access it:</p>\n<pre><code class=\"language-mjs\">import ffi from 'node:ffi';\n</code></pre>\n<pre><code class=\"language-cjs\">const ffi = require('node:ffi');\n</code></pre>\n<p>This module is only available under the <code>node:</code> scheme in builds with FFI\nsupport and is gated by the <code>--experimental-ffi</code> flag.</p>\n<p>Building Node.js with <code>node:ffi</code> support is available via the bundled <code>libffi</code> on\nplatforms where <code>libffi</code> provides a compatible static backend, or via a\nshared <code>libffi</code> using the <code>--shared-ffi</code> configure flag.\nThe unofficial GN build does not support <code>node:ffi</code>.</p>\n<p>The following targets are not supported by bundled libffi:</p>\n<ul>\n<li><code>s390x</code>.</li>\n<li><code>mips</code>, <code>mipsel</code>, and <code>mips64el</code> on targets other than FreeBSD, Linux, and\nOpenBSD.</li>\n<li><code>ppc64</code> on Android, CloudABI, iOS, OpenHarmony, OS/400, Solaris, and Windows.</li>\n</ul>\n<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, FFI APIs are\nrestricted unless the <a href=\"cli.html#--allow-ffi\"><code>--allow-ffi</code></a> flag is provided.</p>",
      "modules": [
        {
          "textRaw": "Overview",
          "name": "overview",
          "type": "module",
          "desc": "<p>The <code>node:ffi</code> module exposes two groups of APIs:</p>\n<ul>\n<li>Dynamic library APIs for loading libraries, resolving symbols, and creating\ncallable JavaScript wrappers.</li>\n<li>Raw memory helpers for reading and writing primitive values through pointers,\nconverting pointers to JavaScript strings, <code>Buffer</code> instances, and\n<code>ArrayBuffer</code> instances, and for copying data back into native memory.</li>\n</ul>",
          "displayName": "Overview"
        },
        {
          "textRaw": "Type names",
          "name": "type_names",
          "type": "module",
          "desc": "<p>FFI signatures use string type names.</p>\n<p>Supported type names:</p>\n<ul>\n<li><code>void</code></li>\n<li><code>i8</code>, <code>int8</code></li>\n<li><code>u8</code>, <code>uint8</code>, <code>bool</code>, <code>char</code></li>\n<li><code>i16</code>, <code>int16</code></li>\n<li><code>u16</code>, <code>uint16</code></li>\n<li><code>i32</code>, <code>int32</code></li>\n<li><code>u32</code>, <code>uint32</code></li>\n<li><code>i64</code>, <code>int64</code></li>\n<li><code>u64</code>, <code>uint64</code></li>\n<li><code>f32</code>, <code>float</code></li>\n<li><code>f64</code>, <code>double</code></li>\n<li><code>pointer</code>, <code>ptr</code></li>\n<li><code>string</code>, <code>str</code></li>\n<li><code>buffer</code></li>\n<li><code>arraybuffer</code></li>\n<li><code>function</code></li>\n</ul>\n<p>These type names are also exposed as constants on <code>ffi.types</code>:</p>\n<ul>\n<li><code>ffi.types.VOID</code> = <code>'void'</code></li>\n<li><code>ffi.types.POINTER</code> = <code>'pointer'</code></li>\n<li><code>ffi.types.BUFFER</code> = <code>'buffer'</code></li>\n<li><code>ffi.types.ARRAY_BUFFER</code> = <code>'arraybuffer'</code></li>\n<li><code>ffi.types.FUNCTION</code> = <code>'function'</code></li>\n<li><code>ffi.types.BOOL</code> = <code>'bool'</code></li>\n<li><code>ffi.types.CHAR</code> = <code>'char'</code></li>\n<li><code>ffi.types.STRING</code> = <code>'string'</code></li>\n<li><code>ffi.types.FLOAT</code> = <code>'float'</code></li>\n<li><code>ffi.types.DOUBLE</code> = <code>'double'</code></li>\n<li><code>ffi.types.INT_8</code> = <code>'int8'</code></li>\n<li><code>ffi.types.UINT_8</code> = <code>'uint8'</code></li>\n<li><code>ffi.types.INT_16</code> = <code>'int16'</code></li>\n<li><code>ffi.types.UINT_16</code> = <code>'uint16'</code></li>\n<li><code>ffi.types.INT_32</code> = <code>'int32'</code></li>\n<li><code>ffi.types.UINT_32</code> = <code>'uint32'</code></li>\n<li><code>ffi.types.INT_64</code> = <code>'int64'</code></li>\n<li><code>ffi.types.UINT_64</code> = <code>'uint64'</code></li>\n<li><code>ffi.types.FLOAT_32</code> = <code>'float32'</code></li>\n<li><code>ffi.types.FLOAT_64</code> = <code>'float64'</code></li>\n</ul>\n<p>Pointer-like types (<code>pointer</code>, <code>string</code>, <code>buffer</code>, <code>arraybuffer</code>, and\n<code>function</code>) are all passed through the native layer as pointers.</p>\n<p>When <code>Buffer</code>, <code>ArrayBuffer</code>, or typed array values are passed as pointer-like\narguments, Node.js borrows a raw pointer to their backing memory for the\nduration of the native call. The caller must ensure that backing store remains\nvalid and stable for the entire call.</p>\n<p>It is unsupported and dangerous to resize, transfer, detach, or otherwise\ninvalidate that backing store while the native call is active, including\nthrough reentrant JavaScript such as FFI callbacks. Doing so may crash the\nprocess, produce incorrect output, or corrupt memory.</p>\n<p>The <code>char</code> type follows the platform C ABI. On platforms where plain C <code>char</code>\nis signed it behaves like <code>i8</code>; otherwise it behaves like <code>u8</code>.</p>\n<p>The <code>bool</code> type is marshaled as an 8-bit unsigned integer. Pass numeric values\nsuch as <code>0</code> and <code>1</code>; JavaScript <code>true</code> and <code>false</code> are not accepted.</p>",
          "displayName": "Type names"
        },
        {
          "textRaw": "Signature objects",
          "name": "signature_objects",
          "type": "module",
          "desc": "<p>Functions and callbacks are described with signature objects.</p>\n<p>Signature objects may contain the following properties, both of which are\noptional:</p>\n<ul>\n<li><code>return</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> A <a href=\"#type-names\">type name</a> specifying the return type of the\nfunction or callback. <strong>Default:</strong> <code>'void'</code>.</li>\n<li><code>arguments</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> An array of <a href=\"#type-names\">type names</a> specifying the argument\ntype list of the function or callback. <strong>Default:</strong> <code>[]</code>.</li>\n</ul>\n<pre><code class=\"language-js\">const signature = {\n  return: 'i32',\n  arguments: ['i32', 'i32'],\n};\n</code></pre>",
          "displayName": "Signature objects"
        },
        {
          "textRaw": "Calling native functions",
          "name": "calling_native_functions",
          "type": "module",
          "desc": "<p>Argument conversion depends on the declared FFI type.</p>\n<p>For 8-, 16-, and 32-bit integer types and for floating-point types, pass\nJavaScript <code>number</code> values that match the declared type.</p>\n<p>For 64-bit integer types (<code>i64</code> and <code>u64</code>), pass JavaScript <code>bigint</code> values.</p>\n<p>For pointer-like arguments:</p>\n<ul>\n<li><code>null</code> and <code>undefined</code> are passed as null pointers.</li>\n<li><code>string</code> values are copied to temporary NUL-terminated UTF-8 strings for the\nduration of the call.</li>\n<li><code>Buffer</code>, typed arrays, and <code>DataView</code> instances pass a pointer to their\nbacking memory.</li>\n<li><code>ArrayBuffer</code> passes a pointer to its backing memory.</li>\n<li><code>bigint</code> values are passed as raw pointer addresses.</li>\n</ul>\n<p>Pointer return values are exposed as <code>bigint</code> addresses.</p>",
          "displayName": "Calling native functions"
        },
        {
          "textRaw": "Primitive memory access helpers",
          "name": "primitive_memory_access_helpers",
          "type": "module",
          "desc": "<p>The following helpers read and write primitive values at a native pointer,\noptionally with a byte offset:</p>\n<ul>\n<li><code>ffi.getInt8(pointer[, offset])</code></li>\n<li><code>ffi.getUint8(pointer[, offset])</code></li>\n<li><code>ffi.getInt16(pointer[, offset])</code></li>\n<li><code>ffi.getUint16(pointer[, offset])</code></li>\n<li><code>ffi.getInt32(pointer[, offset])</code></li>\n<li><code>ffi.getUint32(pointer[, offset])</code></li>\n<li><code>ffi.getInt64(pointer[, offset])</code></li>\n<li><code>ffi.getUint64(pointer[, offset])</code></li>\n<li><code>ffi.getFloat32(pointer[, offset])</code></li>\n<li><code>ffi.getFloat64(pointer[, offset])</code></li>\n<li><code>ffi.setInt8(pointer, offset, value)</code></li>\n<li><code>ffi.setUint8(pointer, offset, value)</code></li>\n<li><code>ffi.setInt16(pointer, offset, value)</code></li>\n<li><code>ffi.setUint16(pointer, offset, value)</code></li>\n<li><code>ffi.setInt32(pointer, offset, value)</code></li>\n<li><code>ffi.setUint32(pointer, offset, value)</code></li>\n<li><code>ffi.setInt64(pointer, offset, value)</code></li>\n<li><code>ffi.setUint64(pointer, offset, value)</code></li>\n<li><code>ffi.setFloat32(pointer, offset, value)</code></li>\n<li><code>ffi.setFloat64(pointer, offset, value)</code></li>\n</ul>\n<p>These helpers perform direct memory reads and writes. <code>pointer</code> must be a\n<code>bigint</code> referring to valid readable or writable native memory. <code>offset</code>, when\nprovided, is interpreted as a byte offset from <code>pointer</code>.</p>\n<p>The getter helpers return JavaScript <code>number</code> values for 8-, 16-, and 32-bit\ninteger types and for floating-point types. They return <code>bigint</code> values for\n64-bit integer types.</p>\n<p>The setter helpers require an explicit byte offset and validate the supplied\nJavaScript value against the target native type before writing it into memory.\nFor <code>setInt64()</code> and <code>setUint64()</code>, <code>bigint</code> values are accepted directly;\nnumeric inputs must be integers within JavaScript's safe integer range.</p>\n<pre><code class=\"language-cjs\">const {\n  getInt32,\n  setInt32,\n} = require('node:ffi');\n\nsetInt32(ptr, 0, 42);\nconsole.log(getInt32(ptr, 0));\n</code></pre>\n<p>Like the other raw memory helpers in this module, these APIs do not track\nownership, bounds, or lifetime. Passing an invalid pointer, using the wrong\noffset, or writing through a stale pointer can corrupt memory or crash the\nprocess.</p>",
          "displayName": "Primitive memory access helpers"
        },
        {
          "textRaw": "Safety notes",
          "name": "safety_notes",
          "type": "module",
          "desc": "<p>The <code>node:ffi</code> module does not track pointer validity, memory ownership, or\nnative object lifetimes.</p>\n<p>In particular:</p>\n<ul>\n<li>Do not read from or write to freed memory.</li>\n<li>Do not use zero-copy views after the native memory has been released.</li>\n<li>Do not declare incorrect signatures for native symbols.</li>\n<li>Do not unregister callbacks while native code may still call them.</li>\n<li>Do not call callback pointers after <code>library.close()</code> or\n<code>library.unregisterCallback(pointer)</code>.</li>\n<li>Assume undefined callback behavior can crash the process, produce incorrect\noutput, or corrupt memory.</li>\n<li>Do not assume pointer return values imply ownership; whether the caller must\nfree the returned address depends entirely on the native API.</li>\n</ul>\n<p>As a general rule, prefer copied values unless zero-copy access is required,\nand keep callback and pointer lifetimes explicit on the native side.</p>",
          "displayName": "Safety notes"
        }
      ],
      "properties": [
        {
          "textRaw": "{string}",
          "name": "suffix",
          "type": "string",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "desc": "<p>The native shared library suffix for the current platform:</p>\n<ul>\n<li><code>'dylib'</code> on macOS</li>\n<li><code>'so'</code> on Unix-like platforms</li>\n<li><code>'dll'</code> on Windows</li>\n</ul>\n<p>This can be used to build portable library paths:</p>\n<pre><code class=\"language-cjs\">const { suffix } = require('node:ffi');\n\nconst path = `libsqlite3.${suffix}`;\n</code></pre>"
        }
      ],
      "methods": [
        {
          "textRaw": "`ffi.dlopen(path[, definitions])`",
          "name": "dlopen",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string|null} Path to a dynamic library, or `null` to resolve symbols from the current process image.",
                  "name": "path",
                  "type": "string|null",
                  "desc": "Path to a dynamic library, or `null` to resolve symbols from the current process image."
                },
                {
                  "textRaw": "`definitions` {Object} Symbol definitions to resolve immediately.",
                  "name": "definitions",
                  "type": "Object",
                  "desc": "Symbol definitions to resolve immediately.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>Loads a dynamic library and resolves the requested function definitions.</p>\n<p>On Windows passing <code>null</code> is not supported.</p>\n<p>When <code>definitions</code> is omitted, <code>functions</code> is returned as an empty object until\nsymbols are resolved explicitly.</p>\n<p>The returned object contains:</p>\n<ul>\n<li><code>lib</code> {DynamicLibrary} The loaded library handle.</li>\n<li><code>functions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Callable wrappers for the requested symbols.</li>\n</ul>\n<p>The returned object also implements the explicit resource management protocol,\nso it can be used with the <a href=\"https://tc39.es/proposal-explicit-resource-management/#sec-using-declarations\"><code>using</code></a> declaration. Disposing the returned\nobject closes the library handle.</p>\n<pre><code class=\"language-mjs\">import { dlopen } from 'node:ffi';\n\n{\n  using handle = dlopen('./mylib.so', {\n    add_i32: { arguments: ['i32', 'i32'], return: 'i32' },\n  });\n  console.log(handle.functions.add_i32(20, 22));\n} // handle.lib.close() is invoked automatically here.\n</code></pre>\n<pre><code class=\"language-mjs\">import { dlopen } from 'node:ffi';\n\nconst { lib, functions } = dlopen('./mylib.so', {\n  add_i32: { arguments: ['i32', 'i32'], return: 'i32' },\n  string_length: { arguments: ['pointer'], return: 'u64' },\n});\n\nconsole.log(functions.add_i32(20, 22));\n</code></pre>\n<pre><code class=\"language-cjs\">const { dlopen } = require('node:ffi');\n\nconst { lib, functions } = dlopen('./mylib.so', {\n  add_i32: { arguments: ['i32', 'i32'], return: 'i32' },\n  string_length: { arguments: ['pointer'], return: 'u64' },\n});\n\nconsole.log(functions.add_i32(20, 22));\n</code></pre>"
        },
        {
          "textRaw": "`ffi.dlclose(handle)`",
          "name": "dlclose",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "handle"
                }
              ]
            }
          ],
          "desc": "<ul>\n<li><code>handle</code> {DynamicLibrary}</li>\n</ul>\n<p>Closes a dynamic library.</p>\n<p>This is equivalent to calling <code>handle.close()</code>.</p>"
        },
        {
          "textRaw": "`ffi.dlsym(handle, symbol)`",
          "name": "dlsym",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "handle"
                },
                {
                  "name": "symbol"
                }
              ]
            }
          ],
          "desc": "<ul>\n<li><code>handle</code> {DynamicLibrary}</li>\n<li><code>symbol</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a></li>\n</ul>\n<p>Resolves a symbol address from a loaded library.</p>\n<p>This is equivalent to calling <code>handle.getSymbol(symbol)</code>.</p>"
        },
        {
          "textRaw": "`ffi.toString(pointer)`",
          "name": "toString",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pointer` {bigint}",
                  "name": "pointer",
                  "type": "bigint"
                }
              ],
              "return": {
                "textRaw": "Returns: {string|null}",
                "name": "return",
                "type": "string|null"
              }
            }
          ],
          "desc": "<p>Reads a NUL-terminated UTF-8 string from native memory.</p>\n<p>If <code>pointer</code> is <code>0n</code>, <code>null</code> is returned.</p>\n<p>This function does not validate that <code>pointer</code> refers to readable memory or\nthat the pointed-to data is terminated with <code>\\0</code>. Passing an invalid pointer,\na pointer to freed memory, or a pointer to bytes without a terminating NUL can\nread unrelated memory, crash the process, or produce truncated or garbled\noutput.</p>\n<pre><code class=\"language-cjs\">const { toString } = require('node:ffi');\n\nconst value = toString(ptr);\n</code></pre>"
        },
        {
          "textRaw": "`ffi.toBuffer(pointer, length[, copy])`",
          "name": "toBuffer",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pointer` {bigint}",
                  "name": "pointer",
                  "type": "bigint"
                },
                {
                  "textRaw": "`length` {number}",
                  "name": "length",
                  "type": "number"
                },
                {
                  "textRaw": "`copy` {boolean} When `false`, creates a zero-copy view. **Default:** `true`.",
                  "name": "copy",
                  "type": "boolean",
                  "default": "`true`",
                  "desc": "When `false`, creates a zero-copy view.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Buffer}",
                "name": "return",
                "type": "Buffer"
              }
            }
          ],
          "desc": "<p>Creates a <code>Buffer</code> from native memory.</p>\n<p>When <code>copy</code> is <code>true</code>, the returned <code>Buffer</code> owns its own copied memory.\nWhen <code>copy</code> is <code>false</code>, the returned <code>Buffer</code> references the original native\nmemory directly.</p>\n<p>Using <code>copy: false</code> is a zero-copy escape hatch. The returned <code>Buffer</code> is a\nwritable view onto foreign memory, so writes in JavaScript update the original\nnative memory directly. The caller must guarantee that:</p>\n<ul>\n<li><code>pointer</code> remains valid for the entire lifetime of the returned <code>Buffer</code>.</li>\n<li><code>length</code> stays within the allocated native region.</li>\n<li>no native code frees or repurposes that memory while JavaScript still uses\nthe <code>Buffer</code>.</li>\n<li>Memory protection is observed. For example, read-only memory pages must not\nbe written to.</li>\n</ul>\n<p>If these guarantees are not met, reading or writing the <code>Buffer</code> can corrupt\nmemory or crash the process.</p>"
        },
        {
          "textRaw": "`ffi.toArrayBuffer(pointer, length[, copy])`",
          "name": "toArrayBuffer",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pointer` {bigint}",
                  "name": "pointer",
                  "type": "bigint"
                },
                {
                  "textRaw": "`length` {number}",
                  "name": "length",
                  "type": "number"
                },
                {
                  "textRaw": "`copy` {boolean} When `false`, creates a zero-copy view. **Default:** `true`.",
                  "name": "copy",
                  "type": "boolean",
                  "default": "`true`",
                  "desc": "When `false`, creates a zero-copy view.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {ArrayBuffer}",
                "name": "return",
                "type": "ArrayBuffer"
              }
            }
          ],
          "desc": "<p>Creates an <code>ArrayBuffer</code> from native memory.</p>\n<p>When <code>copy</code> is <code>true</code>, the returned <code>ArrayBuffer</code> contains copied bytes.\nWhen <code>copy</code> is <code>false</code>, the returned <code>ArrayBuffer</code> references the original\nnative memory directly.</p>\n<p>The same lifetime and bounds requirements described for\n<a href=\"#ffitobufferpointer-length-copy\"><code>ffi.toBuffer(pointer, length, copy)</code></a> apply\nhere. With <code>copy: false</code>, the\nreturned <code>ArrayBuffer</code> is a zero-copy view of foreign memory and is only safe\nwhile that memory remains allocated, unchanged in layout, and valid for the\nentire exposed range.</p>"
        },
        {
          "textRaw": "`ffi.exportString(string, pointer, length[, encoding])`",
          "name": "exportString",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                },
                {
                  "textRaw": "`pointer` {bigint}",
                  "name": "pointer",
                  "type": "bigint"
                },
                {
                  "textRaw": "`length` {number}",
                  "name": "length",
                  "type": "number"
                },
                {
                  "textRaw": "`encoding` {string} **Default:** `'utf8'`.",
                  "name": "encoding",
                  "type": "string",
                  "default": "`'utf8'`",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Copies a JavaScript string into native memory and appends a trailing NUL\nterminator.</p>\n<p><code>length</code> must be large enough to hold the full encoded string plus the trailing\nNUL terminator. For UTF-16 and UCS-2 encodings, the trailing terminator uses\ntwo zero bytes.</p>\n<p><code>pointer</code> must refer to writable native memory with at least <code>length</code> bytes of\navailable storage. This function does not allocate memory on its own.</p>\n<p><code>string</code> must be a JavaScript string. <code>encoding</code> must be a string.</p>"
        },
        {
          "textRaw": "`ffi.exportBuffer(buffer, pointer, length)`",
          "name": "exportBuffer",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer}",
                  "name": "buffer",
                  "type": "Buffer"
                },
                {
                  "textRaw": "`pointer` {bigint}",
                  "name": "pointer",
                  "type": "bigint"
                },
                {
                  "textRaw": "`length` {number}",
                  "name": "length",
                  "type": "number"
                }
              ]
            }
          ],
          "desc": "<p>Copies bytes from a <code>Buffer</code> into native memory.</p>\n<p><code>length</code> must be at least <code>buffer.length</code>.</p>\n<p><code>pointer</code> must refer to writable native memory with at least <code>length</code> bytes of\navailable storage. This function does not allocate memory on its own.</p>\n<p><code>buffer</code> must be a Node.js <code>Buffer</code>.</p>"
        },
        {
          "textRaw": "`ffi.exportArrayBuffer(arrayBuffer, pointer, length)`",
          "name": "exportArrayBuffer",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`arrayBuffer` {ArrayBuffer}",
                  "name": "arrayBuffer",
                  "type": "ArrayBuffer"
                },
                {
                  "textRaw": "`pointer` {bigint}",
                  "name": "pointer",
                  "type": "bigint"
                },
                {
                  "textRaw": "`length` {number}",
                  "name": "length",
                  "type": "number"
                }
              ]
            }
          ],
          "desc": "<p>Copies bytes from an <code>ArrayBuffer</code> into native memory.</p>\n<p><code>length</code> must be at least <code>arrayBuffer.byteLength</code>.</p>\n<p><code>pointer</code> must refer to writable native memory with at least <code>length</code> bytes of\navailable storage. This function does not allocate memory on its own.</p>"
        },
        {
          "textRaw": "`ffi.exportArrayBufferView(arrayBufferView, pointer, length)`",
          "name": "exportArrayBufferView",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "arrayBufferView"
                },
                {
                  "name": "pointer"
                },
                {
                  "name": "length"
                }
              ]
            }
          ],
          "desc": "<ul>\n<li><code>arrayBufferView</code> {ArrayBufferView}</li>\n<li><code>pointer</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a></li>\n<li><code>length</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n</ul>\n<p>Copies bytes from an <code>ArrayBufferView</code> into native memory.</p>\n<p><code>length</code> must be at least <code>arrayBufferView.byteLength</code>.</p>\n<p><code>pointer</code> must refer to writable native memory with at least <code>length</code> bytes of\navailable storage. This function does not allocate memory on its own.</p>"
        },
        {
          "textRaw": "`ffi.getRawPointer(source)`",
          "name": "getRawPointer",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`source` {Buffer|ArrayBuffer}",
                  "name": "source",
                  "type": "Buffer|ArrayBuffer"
                }
              ],
              "return": {
                "textRaw": "Returns: {bigint}",
                "name": "return",
                "type": "bigint"
              }
            }
          ],
          "desc": "<p>Returns the raw memory address of JavaScript-managed byte storage.</p>\n<p>This is unsafe and dangerous. The returned pointer can become invalid if the\nunderlying memory is detached, resized, transferred, or otherwise invalidated.\nUsing stale pointers can cause memory corruption or process crashes.</p>"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `DynamicLibrary`",
          "name": "DynamicLibrary",
          "type": "class",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "desc": "<p>Represents a loaded dynamic library.</p>",
          "signatures": [
            {
              "textRaw": "`new DynamicLibrary(path)`",
              "name": "DynamicLibrary",
              "type": "ctor",
              "params": [
                {
                  "textRaw": "`path` {string|null} Path to a dynamic library, or `null` to resolve symbols from the current process image.",
                  "name": "path",
                  "type": "string|null",
                  "desc": "Path to a dynamic library, or `null` to resolve symbols from the current process image."
                }
              ],
              "desc": "<p>Loads the dynamic library without resolving any functions eagerly.</p>\n<p>On Windows passing <code>null</code> is not supported.</p>\n<pre><code class=\"language-cjs\">const { DynamicLibrary } = require('node:ffi');\n\nconst lib = new DynamicLibrary('./mylib.so');\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "{string}",
              "name": "path",
              "type": "string",
              "desc": "<p>The path used to load the library.</p>"
            },
            {
              "textRaw": "{Object}",
              "name": "functions",
              "type": "Object",
              "desc": "<p>An object containing previously resolved function wrappers.</p>"
            },
            {
              "textRaw": "{Object}",
              "name": "symbols",
              "type": "Object",
              "desc": "<p>An object containing previously resolved symbol addresses as <code>bigint</code> values.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`library.close()`",
              "name": "close",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes the library handle.</p>\n<p><code>DynamicLibrary</code> implements the explicit resource management protocol, so a\nlibrary instance can be managed with the <a href=\"https://tc39.es/proposal-explicit-resource-management/#sec-using-declarations\"><code>using</code></a> declaration. Leaving the\nenclosing scope invokes <code>library.close()</code> automatically.</p>\n<pre><code class=\"language-mjs\">import { DynamicLibrary } from 'node:ffi';\n\n{\n  using lib = new DynamicLibrary('./mylib.so');\n  // Use `lib` here; `lib.close()` is called when the block exits.\n}\n</code></pre>\n<p>Calling <code>library.close()</code> (or disposing the library) more than once is a no-op.</p>\n<p>After a library has been closed:</p>\n<ul>\n<li>Resolved function wrappers become invalid.</li>\n<li>Further symbol and function resolution throws.</li>\n<li>Registered callbacks are invalidated.</li>\n</ul>\n<p>Closing a library does not make previously exported callback pointers safe to\nreuse. Node.js does not track or revoke callback pointers that have already\nbeen handed to native code.</p>\n<p>If native code still holds a callback pointer after <code>library.close()</code> or after\n<code>library.unregisterCallback(pointer)</code>, invoking that pointer has undefined\nbehavior, is not allowed, and is dangerous: it can crash the process, produce\nincorrect output, or corrupt memory. Native code must stop using callback\naddresses before the library is closed or before the callback is unregistered.</p>\n<p>Calling <code>library.close()</code> from one of the library's active callbacks is\nunsupported and dangerous. The callback must return before the library is\nclosed.</p>"
            },
            {
              "textRaw": "`library[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <code>library.close()</code>. This allows <code>DynamicLibrary</code> instances to be used with\nthe <a href=\"https://tc39.es/proposal-explicit-resource-management/#sec-using-declarations\"><code>using</code></a> declaration for automatic cleanup when the enclosing scope\nexits. It is a no-op on a library that has already been closed.</p>"
            },
            {
              "textRaw": "`library.getFunction(name, signature)`",
              "name": "getFunction",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`signature` {Object}",
                      "name": "signature",
                      "type": "Object"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function}",
                    "name": "return",
                    "type": "Function"
                  }
                }
              ],
              "desc": "<p>Resolves a symbol and returns a callable JavaScript wrapper.</p>\n<p>The returned function has a <code>.pointer</code> property containing the native function\naddress as a <code>bigint</code>.</p>\n<p>If the same symbol has already been resolved, requesting it again with a\ndifferent signature throws.</p>\n<pre><code class=\"language-cjs\">const { DynamicLibrary } = require('node:ffi');\n\nconst lib = new DynamicLibrary('./mylib.so');\nconst add = lib.getFunction('add_i32', {\n  arguments: ['i32', 'i32'],\n  return: 'i32',\n});\n\nconsole.log(add(20, 22));\nconsole.log(add.pointer);\n</code></pre>"
            },
            {
              "textRaw": "`library.getFunctions([definitions])`",
              "name": "getFunctions",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`definitions` {Object}",
                      "name": "definitions",
                      "type": "Object",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>When <code>definitions</code> is provided, resolves each named symbol and returns an\nobject containing callable wrappers.</p>\n<p>When <code>definitions</code> is omitted, returns wrappers for all functions that have\nalready been resolved on the library.</p>"
            },
            {
              "textRaw": "`library.getSymbol(name)`",
              "name": "getSymbol",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  }
                }
              ],
              "desc": "<p>Resolves a symbol and returns its native address as a <code>bigint</code>.</p>"
            },
            {
              "textRaw": "`library.getSymbols()`",
              "name": "getSymbols",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns an object containing all previously resolved symbol addresses.</p>"
            },
            {
              "textRaw": "`library.registerCallback([signature,] callback)`",
              "name": "registerCallback",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`signature` {Object}",
                      "name": "signature",
                      "type": "Object",
                      "optional": true
                    },
                    {
                      "name": " callback"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  }
                }
              ],
              "desc": "<p>Creates a native callback pointer backed by a JavaScript function.</p>\n<p>When <code>signature</code> is omitted, the callback uses a default <code>void ()</code> signature.</p>\n<p>The return value is the callback pointer address as a <code>bigint</code>. It can be\npassed to native functions expecting a callback pointer.</p>\n<pre><code class=\"language-cjs\">const { DynamicLibrary } = require('node:ffi');\n\nconst lib = new DynamicLibrary('./mylib.so');\n\nconst callback = lib.registerCallback(\n  { arguments: ['i32'], return: 'i32' },\n  (value) => value * 2,\n);\n</code></pre>\n<p>Callbacks are subject to the following restrictions:</p>\n<ul>\n<li>They must be invoked on the same system thread where they were created.</li>\n<li>They must not throw exceptions.</li>\n<li>They must not return promises.</li>\n<li>They must return a value compatible with the declared return type.</li>\n<li>They must not call <code>library.close()</code> on their owning library while running.</li>\n<li>They must not unregister themselves while running.</li>\n</ul>\n<p>Closing the owning library or unregistering the currently executing callback\nfrom inside the callback is unsupported and dangerous. Doing so may crash the\nprocess, produce incorrect output, or corrupt memory.</p>"
            },
            {
              "textRaw": "`library.unregisterCallback(pointer)`",
              "name": "unregisterCallback",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pointer` {bigint}",
                      "name": "pointer",
                      "type": "bigint"
                    }
                  ]
                }
              ],
              "desc": "<p>Releases a callback previously created with <code>library.registerCallback()</code>.</p>\n<p>Calling <code>library.unregisterCallback(pointer)</code> for a callback that is currently\nexecuting is unsupported and dangerous. The callback must return before it is\nunregistered.</p>\n<p>After <code>library.unregisterCallback(pointer)</code> returns, invoking that callback\npointer from native code has undefined behavior, is not allowed, and is\ndangerous: it can crash the process, produce incorrect output, or corrupt\nmemory.</p>"
            },
            {
              "textRaw": "`library.refCallback(pointer)`",
              "name": "refCallback",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pointer` {bigint}",
                      "name": "pointer",
                      "type": "bigint"
                    }
                  ]
                }
              ],
              "desc": "<p>Keeps the callback strongly referenced by JavaScript.</p>"
            },
            {
              "textRaw": "`library.unrefCallback(pointer)`",
              "name": "unrefCallback",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pointer` {bigint}",
                      "name": "pointer",
                      "type": "bigint"
                    }
                  ]
                }
              ],
              "desc": "<p>Allows the callback to become weakly referenced by JavaScript.</p>\n<p>If the callback function is later garbage collected, subsequent native\ninvocations become a no-op. Non-void return values are zero-initialized before\nreturning to native code.</p>"
            }
          ]
        }
      ],
      "displayName": "FFI",
      "source": "doc/api/ffi.md"
    },
    {
      "textRaw": "HTTP",
      "name": "http",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>This module, containing both a client and server, can be imported via\n<code>require('node:http')</code> (CommonJS) or <code>import * as http from 'node:http'</code> (ES module).</p>\n<p>The HTTP interfaces in Node.js are designed to support many features\nof the protocol which have been traditionally difficult to use.\nIn particular, large, possibly chunk-encoded, messages. The interface is\ncareful to never buffer entire requests or responses, so the\nuser is able to stream data.</p>\n<p>HTTP message headers are represented by an object like this:</p>\n<pre><code class=\"language-json\">{ \"content-length\": \"123\",\n  \"content-type\": \"text/plain\",\n  \"connection\": \"keep-alive\",\n  \"host\": \"example.com\",\n  \"accept\": \"*/*\" }\n</code></pre>\n<p>Keys are lowercased. Values are not modified.</p>\n<p>In order to support the full spectrum of possible HTTP applications, the Node.js\nHTTP API is very low-level. It deals with stream handling and message\nparsing only. It parses a message into headers and body but it does not\nparse the actual headers or the body.</p>\n<p>See <a href=\"#messageheaders\"><code>message.headers</code></a> for details on how duplicate headers are handled.</p>\n<p>The raw headers as they were received are retained in the <code>rawHeaders</code>\nproperty, which is an array of <code>[key, value, key2, value2, ...]</code>. For\nexample, the previous message header object might have a <code>rawHeaders</code>\nlist like the following:</p>\n<pre><code class=\"language-json\">[ \"ConTent-Length\", \"123456\",\n  \"content-LENGTH\", \"123\",\n  \"content-type\", \"text/plain\",\n  \"CONNECTION\", \"keep-alive\",\n  \"Host\", \"example.com\",\n  \"accepT\", \"*/*\" ]\n</code></pre>",
      "classes": [
        {
          "textRaw": "Class: `http.Agent`",
          "name": "http.Agent",
          "type": "class",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "desc": "<p>An <code>Agent</code> is responsible for managing connection persistence\nand reuse for HTTP clients. It maintains a queue of pending requests\nfor a given host and port, reusing a single socket connection for each\nuntil the queue is empty, at which time the socket is either destroyed\nor put into a pool where it is kept to be used again for requests to the\nsame host and port. Whether it is destroyed or pooled depends on the\n<code>keepAlive</code> <a href=\"#new-agentoptions\">option</a>.</p>\n<p>Pooled connections have TCP Keep-Alive enabled for them, but servers may\nstill close idle connections, in which case they will be removed from the\npool and a new connection will be made when a new HTTP request is made for\nthat host and port. Servers may also refuse to allow multiple requests\nover the same connection, in which case the connection will have to be\nremade for every request and cannot be pooled. The <code>Agent</code> will still make\nthe requests to that server, but each one will occur over a new connection.</p>\n<p>When a connection is closed by the client or the server, it is removed\nfrom the pool. Any unused sockets in the pool will be unrefed so as not\nto keep the Node.js process running when there are no outstanding requests.\n(see <a href=\"net.html#socketunref\"><code>socket.unref()</code></a>).</p>\n<p>It is good practice, to <a href=\"#agentdestroy\"><code>destroy()</code></a> an <code>Agent</code> instance when it is no\nlonger in use, because unused sockets consume OS resources.</p>\n<p>Sockets are removed from an agent when the socket emits either\na <code>'close'</code> event or an <code>'agentRemove'</code> event. When intending to keep one\nHTTP request open for a long time without keeping it in the agent, something\nlike the following may be done:</p>\n<pre><code class=\"language-js\">http.get(options, (res) => {\n  // Do stuff\n}).on('socket', (socket) => {\n  socket.emit('agentRemove');\n});\n</code></pre>\n<p>An agent may also be used for an individual request. By providing\n<code>{agent: false}</code> as an option to the <code>http.get()</code> or <code>http.request()</code>\nfunctions, a one-time use <code>Agent</code> with default options will be used\nfor the client connection.</p>\n<p><code>agent:false</code>:</p>\n<pre><code class=\"language-js\">http.get({\n  hostname: 'localhost',\n  port: 80,\n  path: '/',\n  agent: false,  // Create a new agent just for this one request\n}, (res) => {\n  // Do stuff with response\n});\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new Agent([options])`",
              "name": "Agent",
              "type": "ctor",
              "meta": {
                "added": [
                  "v0.3.4"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.7.0",
                      "v22.20.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59315",
                    "description": "Add support for `agentKeepAliveTimeoutBuffer`."
                  },
                  {
                    "version": [
                      "v24.5.0",
                      "v22.21.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58980",
                    "description": "Add support for `proxyEnv`."
                  },
                  {
                    "version": [
                      "v24.5.0",
                      "v22.21.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58980",
                    "description": "Add support for `defaultPort` and `protocol`."
                  },
                  {
                    "version": [
                      "v15.6.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/36685",
                    "description": "Change the default scheduling from 'fifo' to 'lifo'."
                  },
                  {
                    "version": [
                      "v14.5.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33617",
                    "description": "Add `maxTotalSockets` option to agent constructor."
                  },
                  {
                    "version": [
                      "v14.5.0",
                      "v12.20.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33278",
                    "description": "Add `scheduling` option to specify the free socket scheduling strategy."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`options` {Object} Set of configurable options to set on the agent. Can have the following fields:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Set of configurable options to set on the agent. Can have the following fields:",
                  "options": [
                    {
                      "textRaw": "`keepAlive` {boolean} Keep sockets around even when there are no outstanding requests, so they can be used for future requests without having to reestablish a TCP connection. Not to be confused with the `keep-alive` value of the `Connection` header. The `Connection: keep-alive` header is always sent when using an agent except when the `Connection` header is explicitly specified or when the `keepAlive` and `maxSockets` options are respectively set to `false` and `Infinity`, in which case `Connection: close` will be used. **Default:** `false`.",
                      "name": "keepAlive",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Keep sockets around even when there are no outstanding requests, so they can be used for future requests without having to reestablish a TCP connection. Not to be confused with the `keep-alive` value of the `Connection` header. The `Connection: keep-alive` header is always sent when using an agent except when the `Connection` header is explicitly specified or when the `keepAlive` and `maxSockets` options are respectively set to `false` and `Infinity`, in which case `Connection: close` will be used."
                    },
                    {
                      "textRaw": "`keepAliveMsecs` {number} When using the `keepAlive` option, specifies the initial delay for TCP Keep-Alive packets. Ignored when the `keepAlive` option is `false` or `undefined`. **Default:** `1000`.",
                      "name": "keepAliveMsecs",
                      "type": "number",
                      "default": "`1000`",
                      "desc": "When using the `keepAlive` option, specifies the initial delay for TCP Keep-Alive packets. Ignored when the `keepAlive` option is `false` or `undefined`."
                    },
                    {
                      "textRaw": "`agentKeepAliveTimeoutBuffer` {number} Milliseconds to subtract from the server-provided `keep-alive: timeout=...` hint when determining socket expiration time. This buffer helps ensure the agent closes the socket slightly before the server does, reducing the chance of sending a request on a socket that’s about to be closed by the server. **Default:** `1000`.",
                      "name": "agentKeepAliveTimeoutBuffer",
                      "type": "number",
                      "default": "`1000`",
                      "desc": "Milliseconds to subtract from the server-provided `keep-alive: timeout=...` hint when determining socket expiration time. This buffer helps ensure the agent closes the socket slightly before the server does, reducing the chance of sending a request on a socket that’s about to be closed by the server."
                    },
                    {
                      "textRaw": "`maxSockets` {number} Maximum number of sockets to allow per host. If the same host opens multiple concurrent connections, each request will use new socket until the `maxSockets` value is reached. If the host attempts to open more connections than `maxSockets`, the additional requests will enter into a pending request queue, and will enter active connection state when an existing connection terminates. This makes sure there are at most `maxSockets` active connections at any point in time, from a given host. **Default:** `Infinity`.",
                      "name": "maxSockets",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "Maximum number of sockets to allow per host. If the same host opens multiple concurrent connections, each request will use new socket until the `maxSockets` value is reached. If the host attempts to open more connections than `maxSockets`, the additional requests will enter into a pending request queue, and will enter active connection state when an existing connection terminates. This makes sure there are at most `maxSockets` active connections at any point in time, from a given host."
                    },
                    {
                      "textRaw": "`maxTotalSockets` {number} Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. **Default:** `Infinity`.",
                      "name": "maxTotalSockets",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached."
                    },
                    {
                      "textRaw": "`maxFreeSockets` {number} Maximum number of sockets per host to leave open in a free state. Only relevant if `keepAlive` is set to `true`. **Default:** `256`.",
                      "name": "maxFreeSockets",
                      "type": "number",
                      "default": "`256`",
                      "desc": "Maximum number of sockets per host to leave open in a free state. Only relevant if `keepAlive` is set to `true`."
                    },
                    {
                      "textRaw": "`scheduling` {string} Scheduling strategy to apply when picking the next free socket to use. It can be `'fifo'` or `'lifo'`. The main difference between the two scheduling strategies is that `'lifo'` selects the most recently used socket, while `'fifo'` selects the least recently used socket. In case of a low rate of request per second, the `'lifo'` scheduling will lower the risk of picking a socket that might have been closed by the server due to inactivity. In case of a high rate of request per second, the `'fifo'` scheduling will maximize the number of open sockets, while the `'lifo'` scheduling will keep it as low as possible. **Default:** `'lifo'`.",
                      "name": "scheduling",
                      "type": "string",
                      "default": "`'lifo'`",
                      "desc": "Scheduling strategy to apply when picking the next free socket to use. It can be `'fifo'` or `'lifo'`. The main difference between the two scheduling strategies is that `'lifo'` selects the most recently used socket, while `'fifo'` selects the least recently used socket. In case of a low rate of request per second, the `'lifo'` scheduling will lower the risk of picking a socket that might have been closed by the server due to inactivity. In case of a high rate of request per second, the `'fifo'` scheduling will maximize the number of open sockets, while the `'lifo'` scheduling will keep it as low as possible."
                    },
                    {
                      "textRaw": "`timeout` {number} Socket timeout in milliseconds. This will set the timeout when the socket is created.",
                      "name": "timeout",
                      "type": "number",
                      "desc": "Socket timeout in milliseconds. This will set the timeout when the socket is created."
                    },
                    {
                      "textRaw": "`proxyEnv` {Object|undefined} Environment variables for proxy configuration. See Built-in Proxy Support for details. **Default:** `undefined`",
                      "name": "proxyEnv",
                      "type": "Object|undefined",
                      "default": "`undefined`",
                      "desc": "Environment variables for proxy configuration. See Built-in Proxy Support for details.",
                      "options": [
                        {
                          "textRaw": "`HTTP_PROXY` {string|undefined} URL for the proxy server that HTTP requests should use. If undefined, no proxy is used for HTTP requests.",
                          "name": "HTTP_PROXY",
                          "type": "string|undefined",
                          "desc": "URL for the proxy server that HTTP requests should use. If undefined, no proxy is used for HTTP requests."
                        },
                        {
                          "textRaw": "`HTTPS_PROXY` {string|undefined} URL for the proxy server that HTTPS requests should use. If undefined, no proxy is used for HTTPS requests.",
                          "name": "HTTPS_PROXY",
                          "type": "string|undefined",
                          "desc": "URL for the proxy server that HTTPS requests should use. If undefined, no proxy is used for HTTPS requests."
                        },
                        {
                          "textRaw": "`NO_PROXY` {string|undefined} Patterns specifying the endpoints that should not be routed through a proxy.",
                          "name": "NO_PROXY",
                          "type": "string|undefined",
                          "desc": "Patterns specifying the endpoints that should not be routed through a proxy."
                        },
                        {
                          "textRaw": "`http_proxy` {string|undefined} Same as `HTTP_PROXY`. If both are set, `http_proxy` takes precedence.",
                          "name": "http_proxy",
                          "type": "string|undefined",
                          "desc": "Same as `HTTP_PROXY`. If both are set, `http_proxy` takes precedence."
                        },
                        {
                          "textRaw": "`https_proxy` {string|undefined} Same as `HTTPS_PROXY`. If both are set, `https_proxy` takes precedence.",
                          "name": "https_proxy",
                          "type": "string|undefined",
                          "desc": "Same as `HTTPS_PROXY`. If both are set, `https_proxy` takes precedence."
                        },
                        {
                          "textRaw": "`no_proxy` {string|undefined} Same as `NO_PROXY`. If both are set, `no_proxy` takes precedence.",
                          "name": "no_proxy",
                          "type": "string|undefined",
                          "desc": "Same as `NO_PROXY`. If both are set, `no_proxy` takes precedence."
                        }
                      ]
                    },
                    {
                      "textRaw": "`defaultPort` {number} Default port to use when the port is not specified in requests. **Default:** `80`.",
                      "name": "defaultPort",
                      "type": "number",
                      "default": "`80`",
                      "desc": "Default port to use when the port is not specified in requests."
                    },
                    {
                      "textRaw": "`protocol` {string} The protocol to use for the agent. **Default:** `'http:'`.",
                      "name": "protocol",
                      "type": "string",
                      "default": "`'http:'`",
                      "desc": "The protocol to use for the agent."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p><code>options</code> in <a href=\"net.html#socketconnectoptions-connectlistener\"><code>socket.connect()</code></a> are also supported.</p>\n<p>To configure any of them, a custom <a href=\"#class-httpagent\"><code>http.Agent</code></a> instance must be created.</p>\n<pre><code class=\"language-mjs\">import { Agent, request } from 'node:http';\nconst keepAliveAgent = new Agent({ keepAlive: true });\noptions.agent = keepAliveAgent;\nrequest(options, onResponseCallback);\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst keepAliveAgent = new http.Agent({ keepAlive: true });\noptions.agent = keepAliveAgent;\nhttp.request(options, onResponseCallback);\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`agent.createConnection(options[, callback])`",
              "name": "createConnection",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} Options containing connection details. Check `net.createConnection()` for the format of the options. For custom agents, this object is passed to the custom `createConnection` function.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Options containing connection details. Check `net.createConnection()` for the format of the options. For custom agents, this object is passed to the custom `createConnection` function."
                    },
                    {
                      "textRaw": "`callback` {Function} (Optional, primarily for custom agents) A function to be called by a custom `createConnection` implementation when the socket is created, especially for asynchronous operations.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "(Optional, primarily for custom agents) A function to be called by a custom `createConnection` implementation when the socket is created, especially for asynchronous operations.",
                      "options": [
                        {
                          "textRaw": "`err` {Error|null} An error object if socket creation failed.",
                          "name": "err",
                          "type": "Error|null",
                          "desc": "An error object if socket creation failed."
                        },
                        {
                          "textRaw": "`socket` {stream.Duplex} The created socket.",
                          "name": "socket",
                          "type": "stream.Duplex",
                          "desc": "The created socket."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {stream.Duplex} The created socket. This is returned by the default implementation or by a custom synchronous `createConnection` implementation. If a custom `createConnection` uses the `callback` for asynchronous operation, this return value might not be the primary way to obtain the socket.",
                    "name": "return",
                    "type": "stream.Duplex",
                    "desc": "The created socket. This is returned by the default implementation or by a custom synchronous `createConnection` implementation. If a custom `createConnection` uses the `callback` for asynchronous operation, this return value might not be the primary way to obtain the socket."
                  }
                }
              ],
              "desc": "<p>Produces a socket/stream to be used for HTTP requests.</p>\n<p>By default, this function behaves identically to <a href=\"net.html#netcreateconnectionoptions-connectlistener\"><code>net.createConnection()</code></a>,\nsynchronously returning the created socket. The optional <code>callback</code> parameter in the\nsignature is <strong>not</strong> used by this default implementation.</p>\n<p>However, custom agents may override this method to provide greater flexibility,\nfor example, to create sockets asynchronously. When overriding <code>createConnection</code>:</p>\n<ol>\n<li><strong>Synchronous socket creation</strong>: The overriding method can return the\nsocket/stream directly.</li>\n<li><strong>Asynchronous socket creation</strong>: The overriding method can accept the <code>callback</code>\nand pass the created socket/stream to it (e.g., <code>callback(null, newSocket)</code>).\nIf an error occurs during socket creation, it should be passed as the first\nargument to the <code>callback</code> (e.g., <code>callback(err)</code>).</li>\n</ol>\n<p>The agent will call the provided <code>createConnection</code> function with <code>options</code> and\nthis internal <code>callback</code>. The <code>callback</code> provided by the agent has a signature\nof <code>(err, stream)</code>.</p>"
            },
            {
              "textRaw": "`agent.keepSocketAlive(socket)`",
              "name": "keepSocketAlive",
              "type": "method",
              "meta": {
                "added": [
                  "v8.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`socket` {stream.Duplex}",
                      "name": "socket",
                      "type": "stream.Duplex"
                    }
                  ]
                }
              ],
              "desc": "<p>Called when <code>socket</code> is detached from a request and could be persisted by the\n<code>Agent</code>. Default behavior is to:</p>\n<pre><code class=\"language-js\">socket.setKeepAlive(true, this.keepAliveMsecs);\nsocket.unref();\nreturn true;\n</code></pre>\n<p>This method can be overridden by a particular <code>Agent</code> subclass. If this\nmethod returns a falsy value, the socket will be destroyed instead of persisting\nit for use with the next request.</p>\n<p>The <code>socket</code> argument can be an instance of <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>, a subclass of\n<a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>.</p>"
            },
            {
              "textRaw": "`agent.reuseSocket(socket, request)`",
              "name": "reuseSocket",
              "type": "method",
              "meta": {
                "added": [
                  "v8.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`socket` {stream.Duplex}",
                      "name": "socket",
                      "type": "stream.Duplex"
                    },
                    {
                      "textRaw": "`request` {http.ClientRequest}",
                      "name": "request",
                      "type": "http.ClientRequest"
                    }
                  ]
                }
              ],
              "desc": "<p>Called when <code>socket</code> is attached to <code>request</code> after being persisted because of\nthe keep-alive options. Default behavior is to:</p>\n<pre><code class=\"language-js\">socket.ref();\n</code></pre>\n<p>This method can be overridden by a particular <code>Agent</code> subclass.</p>\n<p>The <code>socket</code> argument can be an instance of <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>, a subclass of\n<a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>.</p>"
            },
            {
              "textRaw": "`agent.destroy()`",
              "name": "destroy",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Destroy any sockets that are currently in use by the agent.</p>\n<p>It is usually not necessary to do this. However, if using an\nagent with <code>keepAlive</code> enabled, then it is best to explicitly shut down\nthe agent when it is no longer needed. Otherwise,\nsockets might stay open for quite a long time before the server\nterminates them.</p>"
            },
            {
              "textRaw": "`agent.getName([options])`",
              "name": "getName",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.7.0",
                      "v16.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41906",
                    "description": "The `options` parameter is now optional."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} A set of options providing information for name generation",
                      "name": "options",
                      "type": "Object",
                      "desc": "A set of options providing information for name generation",
                      "options": [
                        {
                          "textRaw": "`host` {string} A domain name or IP address of the server to issue the request to",
                          "name": "host",
                          "type": "string",
                          "desc": "A domain name or IP address of the server to issue the request to"
                        },
                        {
                          "textRaw": "`port` {number} Port of remote server",
                          "name": "port",
                          "type": "number",
                          "desc": "Port of remote server"
                        },
                        {
                          "textRaw": "`localAddress` {string} Local interface to bind for network connections when issuing the request",
                          "name": "localAddress",
                          "type": "string",
                          "desc": "Local interface to bind for network connections when issuing the request"
                        },
                        {
                          "textRaw": "`family` {integer} Must be 4 or 6 if this doesn't equal `undefined`.",
                          "name": "family",
                          "type": "integer",
                          "desc": "Must be 4 or 6 if this doesn't equal `undefined`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Get a unique name for a set of request options, to determine whether a\nconnection can be reused. For an HTTP agent, this returns\n<code>host:port:localAddress</code> or <code>host:port:localAddress:family</code>. For an HTTPS agent,\nthe name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options\nthat determine socket reusability.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "freeSockets",
              "type": "Object",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36409",
                    "description": "The property now has a `null` prototype."
                  }
                ]
              },
              "desc": "<p>An object which contains arrays of sockets currently awaiting use by\nthe agent when <code>keepAlive</code> is enabled. Do not modify.</p>\n<p>Sockets in the <code>freeSockets</code> list will be automatically destroyed and\nremoved from the array on <code>'timeout'</code>.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "maxFreeSockets",
              "type": "number",
              "meta": {
                "added": [
                  "v0.11.7"
                ],
                "changes": []
              },
              "desc": "<p>By default set to 256. For agents with <code>keepAlive</code> enabled, this\nsets the maximum number of sockets that will be left open in the free\nstate.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "maxSockets",
              "type": "number",
              "meta": {
                "added": [
                  "v0.3.6"
                ],
                "changes": []
              },
              "desc": "<p>By default set to <code>Infinity</code>. Determines how many concurrent sockets the agent\ncan have open per origin. Origin is the returned value of <a href=\"#agentgetnameoptions\"><code>agent.getName()</code></a>.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "maxTotalSockets",
              "type": "number",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "desc": "<p>By default set to <code>Infinity</code>. Determines how many concurrent sockets the agent\ncan have open. Unlike <code>maxSockets</code>, this parameter applies across all origins.</p>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "requests",
              "type": "Object",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36409",
                    "description": "The property now has a `null` prototype."
                  }
                ]
              },
              "desc": "<p>An object which contains queues of requests that have not yet been assigned to\nsockets. Do not modify.</p>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "sockets",
              "type": "Object",
              "meta": {
                "added": [
                  "v0.3.6"
                ],
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36409",
                    "description": "The property now has a `null` prototype."
                  }
                ]
              },
              "desc": "<p>An object which contains arrays of sockets currently in use by the\nagent. Do not modify.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `http.ClientRequest`",
          "name": "http.ClientRequest",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"http.html#class-httpoutgoingmessage\"><code>&#x3C;http.OutgoingMessage></code></a></li>\n</ul>\n<p>This object is created internally and returned from <a href=\"#httprequestoptions-callback\"><code>http.request()</code></a>. It\nrepresents an <em>in-progress</em> request whose header has already been queued. The\nheader is still mutable using the <a href=\"#requestsetheadername-value\"><code>setHeader(name, value)</code></a>,\n<a href=\"#requestgetheadername\"><code>getHeader(name)</code></a>, <a href=\"#requestremoveheadername\"><code>removeHeader(name)</code></a> API. The actual header will\nbe sent along with the first data chunk or when calling <a href=\"#requestenddata-encoding-callback\"><code>request.end()</code></a>.</p>\n<p>To get the response, add a listener for <a href=\"#event-response\"><code>'response'</code></a> to the request object.\n<a href=\"#event-response\"><code>'response'</code></a> will be emitted from the request object when the response\nheaders have been received. The <a href=\"#event-response\"><code>'response'</code></a> event is executed with one\nargument which is an instance of <a href=\"#class-httpincomingmessage\"><code>http.IncomingMessage</code></a>.</p>\n<p>During the <a href=\"#event-response\"><code>'response'</code></a> event, one can add listeners to the\nresponse object; particularly to listen for the <code>'data'</code> event.</p>\n<p>If no <a href=\"#event-response\"><code>'response'</code></a> handler is added, then the response will be\nentirely discarded. However, if a <a href=\"#event-response\"><code>'response'</code></a> event handler is added,\nthen the data from the response object <strong>must</strong> be consumed, either by\ncalling <code>response.read()</code> whenever there is a <code>'readable'</code> event, or\nby adding a <code>'data'</code> handler, or by calling the <code>.resume()</code> method.\nUntil the data is consumed, the <code>'end'</code> event will not fire. Also, until\nthe data is read it will consume memory that can eventually lead to a\n'process out of memory' error.</p>\n<p>For backward compatibility, <code>res</code> will only emit <code>'error'</code> if there is an\n<code>'error'</code> listener registered.</p>\n<p>Set <code>Content-Length</code> header to limit the response body size.\nIf <a href=\"#responsestrictcontentlength\"><code>response.strictContentLength</code></a> is set to <code>true</code>, mismatching the\n<code>Content-Length</code> header value will result in an <code>Error</code> being thrown,\nidentified by <code>code:</code> <a href=\"errors.html#err_http_content_length_mismatch\"><code>'ERR_HTTP_CONTENT_LENGTH_MISMATCH'</code></a>.</p>\n<p><code>Content-Length</code> value should be in bytes, not characters. Use\n<a href=\"buffer.html#static-method-bufferbytelengthstring-encoding\"><code>Buffer.byteLength()</code></a> to determine the length of the body in bytes.</p>",
          "events": [
            {
              "textRaw": "Event: `'abort'`",
              "name": "abort",
              "type": "event",
              "meta": {
                "added": [
                  "v1.4.1"
                ],
                "changes": [],
                "deprecated": [
                  "v17.0.0",
                  "v16.12.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Listen for the `'close'` event instead.",
              "params": [],
              "desc": "<p>Emitted when the request has been aborted by the client. This event is only\nemitted on the first call to <code>abort()</code>.</p>"
            },
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.5.4"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Indicates that the request is completed, or its underlying connection was\nterminated prematurely (before the response completion).</p>"
            },
            {
              "textRaw": "Event: `'connect'`",
              "name": "connect",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`response` {http.IncomingMessage}",
                  "name": "response",
                  "type": "http.IncomingMessage"
                },
                {
                  "textRaw": "`socket` {stream.Duplex}",
                  "name": "socket",
                  "type": "stream.Duplex"
                },
                {
                  "textRaw": "`head` {Buffer}",
                  "name": "head",
                  "type": "Buffer"
                }
              ],
              "desc": "<p>Emitted each time a server responds to a request with a <code>CONNECT</code> method. If\nthis event is not being listened for, clients receiving a <code>CONNECT</code> method will\nhave their connections closed.</p>\n<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specifies a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>\n<p>A client and server pair demonstrating how to listen for the <code>'connect'</code> event:</p>\n<pre><code class=\"language-mjs\">import { createServer, request } from 'node:http';\nimport { connect } from 'node:net';\nimport { URL } from 'node:url';\n\n// Create an HTTP tunneling proxy\nconst proxy = createServer((req, res) => {\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('okay');\n});\nproxy.on('connect', (req, clientSocket, head) => {\n  // Connect to an origin server\n  const { port, hostname } = new URL(`http://${req.url}`);\n  const serverSocket = connect(port || 80, hostname, () => {\n    clientSocket.write('HTTP/1.1 200 Connection Established\\r\\n' +\n                    'Proxy-agent: Node.js-Proxy\\r\\n' +\n                    '\\r\\n');\n    serverSocket.write(head);\n    serverSocket.pipe(clientSocket);\n    clientSocket.pipe(serverSocket);\n  });\n});\n\n// Now that proxy is running\nproxy.listen(1337, '127.0.0.1', () => {\n\n  // Make a request to a tunneling proxy\n  const options = {\n    port: 1337,\n    host: '127.0.0.1',\n    method: 'CONNECT',\n    path: 'www.google.com:80',\n  };\n\n  const req = request(options);\n  req.end();\n\n  req.on('connect', (res, socket, head) => {\n    console.log('got connected!');\n\n    // Make a request over an HTTP tunnel\n    socket.write('GET / HTTP/1.1\\r\\n' +\n                 'Host: www.google.com:80\\r\\n' +\n                 'Connection: close\\r\\n' +\n                 '\\r\\n');\n    socket.on('data', (chunk) => {\n      console.log(chunk.toString());\n    });\n    socket.on('end', () => {\n      proxy.close();\n    });\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst net = require('node:net');\nconst { URL } = require('node:url');\n\n// Create an HTTP tunneling proxy\nconst proxy = http.createServer((req, res) => {\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('okay');\n});\nproxy.on('connect', (req, clientSocket, head) => {\n  // Connect to an origin server\n  const { port, hostname } = new URL(`http://${req.url}`);\n  const serverSocket = net.connect(port || 80, hostname, () => {\n    clientSocket.write('HTTP/1.1 200 Connection Established\\r\\n' +\n                    'Proxy-agent: Node.js-Proxy\\r\\n' +\n                    '\\r\\n');\n    serverSocket.write(head);\n    serverSocket.pipe(clientSocket);\n    clientSocket.pipe(serverSocket);\n  });\n});\n\n// Now that proxy is running\nproxy.listen(1337, '127.0.0.1', () => {\n\n  // Make a request to a tunneling proxy\n  const options = {\n    port: 1337,\n    host: '127.0.0.1',\n    method: 'CONNECT',\n    path: 'www.google.com:80',\n  };\n\n  const req = http.request(options);\n  req.end();\n\n  req.on('connect', (res, socket, head) => {\n    console.log('got connected!');\n\n    // Make a request over an HTTP tunnel\n    socket.write('GET / HTTP/1.1\\r\\n' +\n                 'Host: www.google.com:80\\r\\n' +\n                 'Connection: close\\r\\n' +\n                 '\\r\\n');\n    socket.on('data', (chunk) => {\n      console.log(chunk.toString());\n    });\n    socket.on('end', () => {\n      proxy.close();\n    });\n  });\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'continue'`",
              "name": "continue",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the server sends a '100 Continue' HTTP response, usually because\nthe request contained 'Expect: 100-continue'. This is an instruction that\nthe client should send the request body.</p>"
            },
            {
              "textRaw": "Event: `'finish'`",
              "name": "finish",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.6"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the request has been sent. More specifically, this event is emitted\nwhen the last segment of the request headers and body have been handed off to\nthe operating system for transmission over the network. It does not imply that\nthe server has received anything yet.</p>"
            },
            {
              "textRaw": "Event: `'information'`",
              "name": "information",
              "type": "event",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`info` {Object}",
                  "name": "info",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`httpVersion` {string}",
                      "name": "httpVersion",
                      "type": "string"
                    },
                    {
                      "textRaw": "`httpVersionMajor` {integer}",
                      "name": "httpVersionMajor",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`httpVersionMinor` {integer}",
                      "name": "httpVersionMinor",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`statusCode` {integer}",
                      "name": "statusCode",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`statusMessage` {string}",
                      "name": "statusMessage",
                      "type": "string"
                    },
                    {
                      "textRaw": "`headers` {Object}",
                      "name": "headers",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`rawHeaders` {string[]}",
                      "name": "rawHeaders",
                      "type": "string[]"
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when the server sends a 1xx intermediate response (excluding 101\nUpgrade). The listeners of this event will receive an object containing the\nHTTP version, status code, status message, key-value headers object,\nand array with the raw header names followed by their respective values.</p>\n<pre><code class=\"language-mjs\">import { request } from 'node:http';\n\nconst options = {\n  host: '127.0.0.1',\n  port: 8080,\n  path: '/length_request',\n};\n\n// Make a request\nconst req = request(options);\nreq.end();\n\nreq.on('information', (info) => {\n  console.log(`Got information prior to main response: ${info.statusCode}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\nconst options = {\n  host: '127.0.0.1',\n  port: 8080,\n  path: '/length_request',\n};\n\n// Make a request\nconst req = http.request(options);\nreq.end();\n\nreq.on('information', (info) => {\n  console.log(`Got information prior to main response: ${info.statusCode}`);\n});\n</code></pre>\n<p>101 Upgrade statuses do not fire this event due to their break from the\ntraditional HTTP request/response chain, such as web sockets, in-place TLS\nupgrades, or HTTP 2.0. To be notified of 101 Upgrade notices, listen for the\n<a href=\"#event-upgrade\"><code>'upgrade'</code></a> event instead.</p>"
            },
            {
              "textRaw": "Event: `'response'`",
              "name": "response",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`response` {http.IncomingMessage}",
                  "name": "response",
                  "type": "http.IncomingMessage"
                }
              ],
              "desc": "<p>Emitted when a response is received to this request. This event is emitted only\nonce.</p>"
            },
            {
              "textRaw": "Event: `'socket'`",
              "name": "socket",
              "type": "event",
              "meta": {
                "added": [
                  "v0.5.3"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`socket` {stream.Duplex}",
                  "name": "socket",
                  "type": "stream.Duplex"
                }
              ],
              "desc": "<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specifies a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>"
            },
            {
              "textRaw": "Event: `'timeout'`",
              "name": "timeout",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.8"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the underlying socket times out from inactivity. This only notifies\nthat the socket has been idle. The request must be destroyed manually.</p>\n<p>See also: <a href=\"#requestsettimeouttimeout-callback\"><code>request.setTimeout()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'upgrade'`",
              "name": "upgrade",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`response` {http.IncomingMessage}",
                  "name": "response",
                  "type": "http.IncomingMessage"
                },
                {
                  "textRaw": "`stream` {stream.Duplex}",
                  "name": "stream",
                  "type": "stream.Duplex"
                },
                {
                  "textRaw": "`head` {Buffer}",
                  "name": "head",
                  "type": "Buffer"
                }
              ],
              "desc": "<p>Emitted each time a server responds to a request with an upgrade. If this\nevent is not being listened for and the response status code is 101 Switching\nProtocols, clients receiving an upgrade header will have their connections\nclosed.</p>\n<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specifies a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>\n<p>A client server pair demonstrating how to listen for the <code>'upgrade'</code> event.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\nimport process from 'node:process';\n\n// Create an HTTP server\nconst server = http.createServer((req, res) => {\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('okay');\n});\nserver.on('upgrade', (req, stream, head) => {\n  stream.write('HTTP/1.1 101 Web Socket Protocol Handshake\\r\\n' +\n               'Upgrade: WebSocket\\r\\n' +\n               'Connection: Upgrade\\r\\n' +\n               '\\r\\n');\n\n  stream.pipe(stream); // echo back\n});\n\n// Now that server is running\nserver.listen(1337, '127.0.0.1', () => {\n\n  // make a request\n  const options = {\n    port: 1337,\n    host: '127.0.0.1',\n    headers: {\n      'Connection': 'Upgrade',\n      'Upgrade': 'websocket',\n    },\n  };\n\n  const req = http.request(options);\n  req.end();\n\n  req.on('upgrade', (res, stream, upgradeHead) => {\n    console.log('got upgraded!');\n    stream.end();\n    process.exit(0);\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\n// Create an HTTP server\nconst server = http.createServer((req, res) => {\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('okay');\n});\nserver.on('upgrade', (req, stream, head) => {\n  stream.write('HTTP/1.1 101 Web Socket Protocol Handshake\\r\\n' +\n               'Upgrade: WebSocket\\r\\n' +\n               'Connection: Upgrade\\r\\n' +\n               '\\r\\n');\n\n  stream.pipe(stream); // echo back\n});\n\n// Now that server is running\nserver.listen(1337, '127.0.0.1', () => {\n\n  // make a request\n  const options = {\n    port: 1337,\n    host: '127.0.0.1',\n    headers: {\n      'Connection': 'Upgrade',\n      'Upgrade': 'websocket',\n    },\n  };\n\n  const req = http.request(options);\n  req.end();\n\n  req.on('upgrade', (res, stream, upgradeHead) => {\n    console.log('got upgraded!');\n    stream.end();\n    process.exit(0);\n  });\n});\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`request.abort()`",
              "name": "abort",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.8"
                ],
                "changes": [],
                "deprecated": [
                  "v14.1.0",
                  "v13.14.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `request.destroy()` instead.",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Marks the request as aborting. Calling this will cause remaining data\nin the response to be dropped and the socket to be destroyed.</p>"
            },
            {
              "textRaw": "`request.cork()`",
              "name": "cork",
              "type": "method",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"stream.html#writablecork\"><code>writable.cork()</code></a>.</p>"
            },
            {
              "textRaw": "`request.end([data[, encoding]][, callback])`",
              "name": "end",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33155",
                    "description": "The `data` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18780",
                    "description": "This method now returns a reference to `ClientRequest`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|Uint8Array}",
                      "name": "data",
                      "type": "string|Buffer|Uint8Array",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Finishes sending the request. If any parts of the body are\nunsent, it will flush them to the stream. If the request is\nchunked, this will send the terminating <code>'0\\r\\n\\r\\n'</code>.</p>\n<p>If <code>data</code> is specified, it is equivalent to calling\n<a href=\"#requestwritechunk-encoding-callback\"><code>request.write(data, encoding)</code></a> followed by <code>request.end(callback)</code>.</p>\n<p>If <code>callback</code> is specified, it will be called when the request stream\nis finished.</p>"
            },
            {
              "textRaw": "`request.destroy([error])`",
              "name": "destroy",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": [
                  {
                    "version": "v14.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32789",
                    "description": "The function returns `this` for consistency with other Readable streams."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`error` {Error} Optional, an error to emit with `'error'` event.",
                      "name": "error",
                      "type": "Error",
                      "desc": "Optional, an error to emit with `'error'` event.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Destroy the request. Optionally emit an <code>'error'</code> event,\nand emit a <code>'close'</code> event. Calling this will cause remaining data\nin the response to be dropped, and the socket to be destroyed if used,\nor returned to the corresponding Agent pool otherwise if possible.</p>\n<p>See <a href=\"stream.html#writabledestroyerror\"><code>writable.destroy()</code></a> for further details.</p>",
              "properties": [
                {
                  "textRaw": "Type: {boolean}",
                  "name": "destroyed",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v14.1.0",
                      "v13.14.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Is <code>true</code> after <a href=\"#requestdestroyerror\"><code>request.destroy()</code></a> has been called.</p>\n<p>See <a href=\"stream.html#writabledestroyed\"><code>writable.destroyed</code></a> for further details.</p>"
                }
              ]
            },
            {
              "textRaw": "`request.flushHeaders()`",
              "name": "flushHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Flushes the request headers.</p>\n<p>For efficiency reasons, Node.js normally buffers the request headers until\n<code>request.end()</code> is called or the first chunk of request data is written. It\nthen tries to pack the request headers and data into a single TCP packet.</p>\n<p>That's usually desired (it saves a TCP round-trip), but not when the first\ndata is not sent until possibly much later. <code>request.flushHeaders()</code> bypasses\nthe optimization and kickstarts the request.</p>"
            },
            {
              "textRaw": "`request.getHeader(name)`",
              "name": "getHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {any}",
                    "name": "return",
                    "type": "any"
                  }
                }
              ],
              "desc": "<p>Reads out a header on the request. The name is case-insensitive.\nThe type of the return value depends on the arguments provided to\n<a href=\"#requestsetheadername-value\"><code>request.setHeader()</code></a>.</p>\n<pre><code class=\"language-js\">request.setHeader('content-type', 'text/html');\nrequest.setHeader('Content-Length', Buffer.byteLength(body));\nrequest.setHeader('Cookie', ['type=ninja', 'language=javascript']);\nconst contentType = request.getHeader('Content-Type');\n// 'contentType' is 'text/html'\nconst contentLength = request.getHeader('Content-Length');\n// 'contentLength' is of type number\nconst cookie = request.getHeader('Cookie');\n// 'cookie' is of type string[]\n</code></pre>"
            },
            {
              "textRaw": "`request.getHeaderNames()`",
              "name": "getHeaderNames",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]}",
                    "name": "return",
                    "type": "string[]"
                  }
                }
              ],
              "desc": "<p>Returns an array containing the unique names of the current outgoing headers.\nAll header names are lowercase.</p>\n<pre><code class=\"language-js\">request.setHeader('Foo', 'bar');\nrequest.setHeader('Cookie', ['foo=bar', 'bar=baz']);\n\nconst headerNames = request.getHeaderNames();\n// headerNames === ['foo', 'cookie']\n</code></pre>"
            },
            {
              "textRaw": "`request.getHeaders()`",
              "name": "getHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns a shallow copy of the current outgoing headers. Since a shallow copy\nis used, array values may be mutated without additional calls to various\nheader-related http module methods. The keys of the returned object are the\nheader names and the values are the respective header values. All header names\nare lowercase.</p>\n<p>The object returned by the <code>request.getHeaders()</code> method <em>does not</em>\nprototypically inherit from the JavaScript <code>Object</code>. This means that typical\n<code>Object</code> methods such as <code>obj.toString()</code>, <code>obj.hasOwnProperty()</code>, and others\nare not defined and <em>will not work</em>.</p>\n<pre><code class=\"language-js\">request.setHeader('Foo', 'bar');\nrequest.setHeader('Cookie', ['foo=bar', 'bar=baz']);\n\nconst headers = request.getHeaders();\n// headers === { foo: 'bar', 'cookie': ['foo=bar', 'bar=baz'] }\n</code></pre>"
            },
            {
              "textRaw": "`request.getRawHeaderNames()`",
              "name": "getRawHeaderNames",
              "type": "method",
              "meta": {
                "added": [
                  "v15.13.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]}",
                    "name": "return",
                    "type": "string[]"
                  }
                }
              ],
              "desc": "<p>Returns an array containing the unique names of the current outgoing raw\nheaders. Header names are returned with their exact casing being set.</p>\n<pre><code class=\"language-js\">request.setHeader('Foo', 'bar');\nrequest.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);\n\nconst headerNames = request.getRawHeaderNames();\n// headerNames === ['Foo', 'Set-Cookie']\n</code></pre>"
            },
            {
              "textRaw": "`request.hasHeader(name)`",
              "name": "hasHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the header identified by <code>name</code> is currently set in the\noutgoing headers. The header name matching is case-insensitive.</p>\n<pre><code class=\"language-js\">const hasContentType = request.hasHeader('content-type');\n</code></pre>"
            },
            {
              "textRaw": "`request.removeHeader(name)`",
              "name": "removeHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Removes a header that's already defined into headers object.</p>\n<pre><code class=\"language-js\">request.removeHeader('Content-Type');\n</code></pre>"
            },
            {
              "textRaw": "`request.setHeader(name, value)`",
              "name": "setHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets a single header value for headers object. If this header already exists in\nthe to-be-sent headers, its value will be replaced. Use an array of strings\nhere to send multiple headers with the same name. Non-string values will be\nstored without modification. Therefore, <a href=\"#requestgetheadername\"><code>request.getHeader()</code></a> may return\nnon-string values. However, the non-string values will be converted to strings\nfor network transmission.</p>\n<pre><code class=\"language-js\">request.setHeader('Content-Type', 'application/json');\n</code></pre>\n<p>or</p>\n<pre><code class=\"language-js\">request.setHeader('Cookie', ['type=ninja', 'language=javascript']);\n</code></pre>\n<p>When the value is a string an exception will be thrown if it contains\ncharacters outside the <code>latin1</code> encoding.</p>\n<p>If you need to pass UTF-8 characters in the value please encode the value\nusing the <a href=\"https://www.rfc-editor.org/rfc/rfc8187.txt\">RFC 8187</a> standard.</p>\n<pre><code class=\"language-js\">const filename = 'Rock 🎵.txt';\nrequest.setHeader('Content-Disposition', `attachment; filename*=utf-8''${encodeURIComponent(filename)}`);\n</code></pre>"
            },
            {
              "textRaw": "`request.setNoDelay([noDelay])`",
              "name": "setNoDelay",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`noDelay` {boolean}",
                      "name": "noDelay",
                      "type": "boolean",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Once a socket is assigned to this request and is connected\n<a href=\"net.html#socketsetnodelaynodelay\"><code>socket.setNoDelay()</code></a> will be called.</p>"
            },
            {
              "textRaw": "`request.setSocketKeepAlive([enable][, initialDelay])`",
              "name": "setSocketKeepAlive",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enable` {boolean}",
                      "name": "enable",
                      "type": "boolean",
                      "optional": true
                    },
                    {
                      "textRaw": "`initialDelay` {number}",
                      "name": "initialDelay",
                      "type": "number",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Once a socket is assigned to this request and is connected\n<a href=\"net.html#socketsetkeepaliveenable-initialdelay\"><code>socket.setKeepAlive()</code></a> will be called.</p>"
            },
            {
              "textRaw": "`request.setTimeout(timeout[, callback])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": [
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8895",
                    "description": "Consistently set socket timeout only when the socket connects."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`timeout` {number} Milliseconds before a request times out.",
                      "name": "timeout",
                      "type": "number",
                      "desc": "Milliseconds before a request times out."
                    },
                    {
                      "textRaw": "`callback` {Function} Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Optional function to be called when a timeout occurs. Same as binding to the `'timeout'` event.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {http.ClientRequest}",
                    "name": "return",
                    "type": "http.ClientRequest"
                  }
                }
              ],
              "desc": "<p>Once a socket is assigned to this request and is connected\n<a href=\"net.html#socketsettimeouttimeout-callback\"><code>socket.setTimeout()</code></a> will be called.</p>"
            },
            {
              "textRaw": "`request.uncork()`",
              "name": "uncork",
              "type": "method",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"stream.html#writableuncork\"><code>writable.uncork()</code></a>.</p>"
            },
            {
              "textRaw": "`request.write(chunk[, encoding][, callback])`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33155",
                    "description": "The `chunk` parameter can now be a `Uint8Array`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`chunk` {string|Buffer|Uint8Array}",
                      "name": "chunk",
                      "type": "string|Buffer|Uint8Array"
                    },
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Sends a chunk of the body. This method can be called multiple times. If no\n<code>Content-Length</code> is set, data will automatically be encoded in HTTP Chunked\ntransfer encoding, so that server knows when the data ends. The\n<code>Transfer-Encoding: chunked</code> header is added. Calling <a href=\"#requestenddata-encoding-callback\"><code>request.end()</code></a>\nis necessary to finish sending the request.</p>\n<p>The <code>encoding</code> argument is optional and only applies when <code>chunk</code> is a string.\nDefaults to <code>'utf8'</code>.</p>\n<p>The <code>callback</code> argument is optional and will be called when this chunk of data\nis flushed, but only if the chunk is non-empty.</p>\n<p>Returns <code>true</code> if the entire data was flushed successfully to the kernel\nbuffer. Returns <code>false</code> if all or part of the data was queued in user memory.\n<code>'drain'</code> will be emitted when the buffer is free again.</p>\n<p>When <code>write</code> function is called with empty string or buffer, it does\nnothing and waits for more input.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean}",
              "name": "aborted",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": [
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20230",
                    "description": "The `aborted` property is no longer a timestamp number."
                  }
                ],
                "deprecated": [
                  "v17.0.0",
                  "v16.12.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Check `request.destroyed` instead.",
              "desc": "<p>The <code>request.aborted</code> property will be <code>true</code> if the request has\nbeen aborted.</p>"
            },
            {
              "textRaw": "Type: {stream.Duplex}",
              "name": "connection",
              "type": "stream.Duplex",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": [],
                "deprecated": [
                  "v13.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Use `request.socket`.",
              "desc": "<p>See <a href=\"#requestsocket\"><code>request.socket</code></a>.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "finished",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": [],
                "deprecated": [
                  "v13.4.0",
                  "v12.16.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Use `request.writableEnded`.",
              "desc": "<p>The <code>request.finished</code> property will be <code>true</code> if <a href=\"#requestenddata-encoding-callback\"><code>request.end()</code></a>\nhas been called. <code>request.end()</code> will automatically be called if the\nrequest was initiated via <a href=\"#httpgetoptions-callback\"><code>http.get()</code></a>.</p>"
            },
            {
              "textRaw": "Type: {number} **Default:** `2000`",
              "name": "maxHeadersCount",
              "type": "number",
              "default": "`2000`",
              "desc": "<p>Limits maximum response headers count. If set to 0, no limit will be applied.</p>"
            },
            {
              "textRaw": "Type: {string} The request path.",
              "name": "path",
              "type": "string",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "desc": "The request path."
            },
            {
              "textRaw": "Type: {string} The request method.",
              "name": "method",
              "type": "string",
              "meta": {
                "added": [
                  "v0.1.97"
                ],
                "changes": []
              },
              "desc": "The request method."
            },
            {
              "textRaw": "Type: {string} The request host.",
              "name": "host",
              "type": "string",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "desc": "The request host."
            },
            {
              "textRaw": "Type: {string} The request protocol.",
              "name": "protocol",
              "type": "string",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "desc": "The request protocol."
            },
            {
              "textRaw": "Type: {boolean} Whether the request is send through a reused socket.",
              "name": "reusedSocket",
              "type": "boolean",
              "meta": {
                "added": [
                  "v13.0.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>When sending request through a keep-alive enabled agent, the underlying socket\nmight be reused. But if server closes connection at unfortunate time, client\nmay run into a 'ECONNRESET' error.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\nconst agent = new http.Agent({ keepAlive: true });\n\n// Server has a 5 seconds keep-alive timeout by default\nhttp\n  .createServer((req, res) => {\n    res.write('hello\\n');\n    res.end();\n  })\n  .listen(3000);\n\nsetInterval(() => {\n  // Adapting a keep-alive agent\n  http.get('http://localhost:3000', { agent }, (res) => {\n    res.on('data', (data) => {\n      // Do nothing\n    });\n  });\n}, 5000); // Sending request on 5s interval so it's easy to hit idle timeout\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst agent = new http.Agent({ keepAlive: true });\n\n// Server has a 5 seconds keep-alive timeout by default\nhttp\n  .createServer((req, res) => {\n    res.write('hello\\n');\n    res.end();\n  })\n  .listen(3000);\n\nsetInterval(() => {\n  // Adapting a keep-alive agent\n  http.get('http://localhost:3000', { agent }, (res) => {\n    res.on('data', (data) => {\n      // Do nothing\n    });\n  });\n}, 5000); // Sending request on 5s interval so it's easy to hit idle timeout\n</code></pre>\n<p>By marking a request whether it reused socket or not, we can do\nautomatic error retry base on it.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\nconst agent = new http.Agent({ keepAlive: true });\n\nfunction retriableRequest() {\n  const req = http\n    .get('http://localhost:3000', { agent }, (res) => {\n      // ...\n    })\n    .on('error', (err) => {\n      // Check if retry is needed\n      if (req.reusedSocket &#x26;&#x26; err.code === 'ECONNRESET') {\n        retriableRequest();\n      }\n    });\n}\n\nretriableRequest();\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst agent = new http.Agent({ keepAlive: true });\n\nfunction retriableRequest() {\n  const req = http\n    .get('http://localhost:3000', { agent }, (res) => {\n      // ...\n    })\n    .on('error', (err) => {\n      // Check if retry is needed\n      if (req.reusedSocket &#x26;&#x26; err.code === 'ECONNRESET') {\n        retriableRequest();\n      }\n    });\n}\n\nretriableRequest();\n</code></pre>",
              "shortDesc": "Whether the request is send through a reused socket."
            },
            {
              "textRaw": "Type: {stream.Duplex}",
              "name": "socket",
              "type": "stream.Duplex",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>Reference to the underlying socket. Usually users will not want to access\nthis property. In particular, the socket will not emit <code>'readable'</code> events\nbecause of how the protocol parser attaches to the socket.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\nconst options = {\n  host: 'www.google.com',\n};\nconst req = http.get(options);\nreq.end();\nreq.once('response', (res) => {\n  const ip = req.socket.localAddress;\n  const port = req.socket.localPort;\n  console.log(`Your IP address is ${ip} and your source port is ${port}.`);\n  // Consume response object\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst options = {\n  host: 'www.google.com',\n};\nconst req = http.get(options);\nreq.end();\nreq.once('response', (res) => {\n  const ip = req.socket.localAddress;\n  const port = req.socket.localPort;\n  console.log(`Your IP address is ${ip} and your source port is ${port}.`);\n  // Consume response object\n});\n</code></pre>\n<p>This property is guaranteed to be an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specified a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "writableEnded",
              "type": "boolean",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Is <code>true</code> after <a href=\"#requestenddata-encoding-callback\"><code>request.end()</code></a> has been called. This property\ndoes not indicate whether the data has been flushed, for this use\n<a href=\"#requestwritablefinished\"><code>request.writableFinished</code></a> instead.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "writableFinished",
              "type": "boolean",
              "meta": {
                "added": [
                  "v12.7.0"
                ],
                "changes": []
              },
              "desc": "<p>Is <code>true</code> if all data has been flushed to the underlying system, immediately\nbefore the <a href=\"#event-finish\"><code>'finish'</code></a> event is emitted.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `http.Server`",
          "name": "http.Server",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#class-netserver\"><code>&#x3C;net.Server></code></a></li>\n</ul>",
          "events": [
            {
              "textRaw": "Event: `'checkContinue'`",
              "name": "checkContinue",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`request` {http.IncomingMessage}",
                  "name": "request",
                  "type": "http.IncomingMessage"
                },
                {
                  "textRaw": "`response` {http.ServerResponse}",
                  "name": "response",
                  "type": "http.ServerResponse"
                }
              ],
              "desc": "<p>Emitted each time a request with an HTTP <code>Expect: 100-continue</code> is received.\nIf this event is not listened for, the server will automatically respond\nwith a <code>100 Continue</code> as appropriate.</p>\n<p>Handling this event involves calling <a href=\"#responsewritecontinue\"><code>response.writeContinue()</code></a> if the\nclient should continue to send the request body, or generating an appropriate\nHTTP response (e.g. 400 Bad Request) if the client should not continue to send\nthe request body.</p>\n<p>When this event is emitted and handled, the <a href=\"#event-request\"><code>'request'</code></a> event will\nnot be emitted.</p>"
            },
            {
              "textRaw": "Event: `'checkExpectation'`",
              "name": "checkExpectation",
              "type": "event",
              "meta": {
                "added": [
                  "v5.5.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`request` {http.IncomingMessage}",
                  "name": "request",
                  "type": "http.IncomingMessage"
                },
                {
                  "textRaw": "`response` {http.ServerResponse}",
                  "name": "response",
                  "type": "http.ServerResponse"
                }
              ],
              "desc": "<p>Emitted each time a request with an HTTP <code>Expect</code> header is received, where the\nvalue is not <code>100-continue</code>. If this event is not listened for, the server will\nautomatically respond with a <code>417 Expectation Failed</code> as appropriate.</p>\n<p>When this event is emitted and handled, the <a href=\"#event-request\"><code>'request'</code></a> event will\nnot be emitted.</p>"
            },
            {
              "textRaw": "Event: `'clientError'`",
              "name": "clientError",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25605",
                    "description": "The default behavior will return a 431 Request Header Fields Too Large if an HPE_HEADER_OVERFLOW error occurs."
                  },
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/17672",
                    "description": "The `rawPacket` is the current buffer that just parsed. Adding this buffer to the error object of `'clientError'` event is to make it possible that developers can log the broken packet."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4557",
                    "description": "The default action of calling `.destroy()` on the `socket` will no longer take place if there are listeners attached for `'clientError'`."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`exception` {Error}",
                  "name": "exception",
                  "type": "Error"
                },
                {
                  "textRaw": "`socket` {stream.Duplex}",
                  "name": "socket",
                  "type": "stream.Duplex"
                }
              ],
              "desc": "<p>If a client connection emits an <code>'error'</code> event, it will be forwarded here.\nListener of this event is responsible for closing/destroying the underlying\nsocket. For example, one may wish to more gracefully close the socket with a\ncustom HTTP response instead of abruptly severing the connection. The socket\n<strong>must be closed or destroyed</strong> before the listener ends.</p>\n<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specifies a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>\n<p>Default behavior is to try close the socket with an HTTP '400 Bad Request',\nor an HTTP '431 Request Header Fields Too Large' in the case of an\n<a href=\"errors.html#hpe_header_overflow\"><code>HPE_HEADER_OVERFLOW</code></a> error. If the socket is not writable or headers\nof the current attached <a href=\"#class-httpserverresponse\"><code>http.ServerResponse</code></a> has been sent, it is\nimmediately destroyed.</p>\n<p><code>socket</code> is the <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a> object that the error originated from.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\n\nconst server = http.createServer((req, res) => {\n  res.end();\n});\nserver.on('clientError', (err, socket) => {\n  socket.end('HTTP/1.1 400 Bad Request\\r\\n\\r\\n');\n});\nserver.listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\nconst server = http.createServer((req, res) => {\n  res.end();\n});\nserver.on('clientError', (err, socket) => {\n  socket.end('HTTP/1.1 400 Bad Request\\r\\n\\r\\n');\n});\nserver.listen(8000);\n</code></pre>\n<p>When the <code>'clientError'</code> event occurs, there is no <code>request</code> or <code>response</code>\nobject, so any HTTP response sent, including response headers and payload,\n<em>must</em> be written directly to the <code>socket</code> object. Care must be taken to\nensure the response is a properly formatted HTTP response message.</p>\n<p><code>err</code> is an instance of <code>Error</code> with two extra columns:</p>\n<ul>\n<li><code>bytesParsed</code>: the bytes count of request packet that Node.js may have parsed\ncorrectly;</li>\n<li><code>rawPacket</code>: the raw packet of current request.</li>\n</ul>\n<p>In some cases, the client has already received the response and/or the socket\nhas already been destroyed, like in case of <code>ECONNRESET</code> errors. Before\ntrying to send data to the socket, it is better to check that it is still\nwritable.</p>\n<pre><code class=\"language-js\">server.on('clientError', (err, socket) => {\n  if (err.code === 'ECONNRESET' || !socket.writable) {\n    return;\n  }\n\n  socket.end('HTTP/1.1 400 Bad Request\\r\\n\\r\\n');\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.4"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the server closes.</p>"
            },
            {
              "textRaw": "Event: `'connect'`",
              "name": "connect",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`request` {http.IncomingMessage} Arguments for the HTTP request, as it is in the `'request'` event",
                  "name": "request",
                  "type": "http.IncomingMessage",
                  "desc": "Arguments for the HTTP request, as it is in the `'request'` event"
                },
                {
                  "textRaw": "`socket` {stream.Duplex} Network socket between the server and client",
                  "name": "socket",
                  "type": "stream.Duplex",
                  "desc": "Network socket between the server and client"
                },
                {
                  "textRaw": "`head` {Buffer} The first packet of the tunneling stream (may be empty)",
                  "name": "head",
                  "type": "Buffer",
                  "desc": "The first packet of the tunneling stream (may be empty)"
                }
              ],
              "desc": "<p>Emitted each time a client requests an HTTP <code>CONNECT</code> method. If this event is\nnot listened for, then clients requesting a <code>CONNECT</code> method will have their\nconnections closed.</p>\n<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specifies a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>\n<p>After this event is emitted, the request's socket will not have a <code>'data'</code>\nevent listener, meaning it will need to be bound in order to handle data\nsent to the server on that socket.</p>"
            },
            {
              "textRaw": "Event: `'connection'`",
              "name": "connection",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`socket` {stream.Duplex}",
                  "name": "socket",
                  "type": "stream.Duplex"
                }
              ],
              "desc": "<p>This event is emitted when a new TCP stream is established. <code>socket</code> is\ntypically an object of type <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a>. Usually users will not want to\naccess this event. In particular, the socket will not emit <code>'readable'</code> events\nbecause of how the protocol parser attaches to the socket. The <code>socket</code> can\nalso be accessed at <code>request.socket</code>.</p>\n<p>This event can also be explicitly emitted by users to inject connections\ninto the HTTP server. In that case, any <a href=\"stream.html#class-streamduplex\"><code>Duplex</code></a> stream can be passed.</p>\n<p>If <code>socket.setTimeout()</code> is called here, the timeout will be replaced with\n<code>server.keepAliveTimeout</code> when the socket has served a request (if\n<code>server.keepAliveTimeout</code> is non-zero).</p>\n<p>This event is guaranteed to be passed an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specifies a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>"
            },
            {
              "textRaw": "Event: `'dropRequest'`",
              "name": "dropRequest",
              "type": "event",
              "meta": {
                "added": [
                  "v18.7.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`request` {http.IncomingMessage} Arguments for the HTTP request, as it is in the `'request'` event",
                  "name": "request",
                  "type": "http.IncomingMessage",
                  "desc": "Arguments for the HTTP request, as it is in the `'request'` event"
                },
                {
                  "textRaw": "`socket` {stream.Duplex} Network socket between the server and client",
                  "name": "socket",
                  "type": "stream.Duplex",
                  "desc": "Network socket between the server and client"
                }
              ],
              "desc": "<p>When the number of requests on a socket reaches the threshold of\n<code>server.maxRequestsPerSocket</code>, the server will drop new requests\nand emit <code>'dropRequest'</code> event instead, then send <code>503</code> to client.</p>"
            },
            {
              "textRaw": "Event: `'request'`",
              "name": "request",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`request` {http.IncomingMessage}",
                  "name": "request",
                  "type": "http.IncomingMessage"
                },
                {
                  "textRaw": "`response` {http.ServerResponse}",
                  "name": "response",
                  "type": "http.ServerResponse"
                }
              ],
              "desc": "<p>Emitted each time there is a request. There may be multiple requests\nper connection (in the case of HTTP Keep-Alive connections).</p>"
            },
            {
              "textRaw": "Event: `'upgrade'`",
              "name": "upgrade",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.94"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60016",
                    "description": "Request bodies are no longer exposed raw (unparsed) on the socket argument. Instead, if a body is received, the stream argument will be a duplex that emits socket content only after the request body, while the parsed request body data will be emitted from the request, just as in normal server `'request'` events."
                  },
                  {
                    "version": [
                      "v24.9.0",
                      "v22.21.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59824",
                    "description": "Whether this event is fired can now be controlled by the `shouldUpgradeCallback` and sockets will be destroyed if upgraded while no event handler is listening."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19981",
                    "description": "Not listening to this event no longer causes the socket to be destroyed if a client sends an Upgrade header."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`request` {http.IncomingMessage} Arguments for the HTTP request, as it is in the `'request'` event",
                  "name": "request",
                  "type": "http.IncomingMessage",
                  "desc": "Arguments for the HTTP request, as it is in the `'request'` event"
                },
                {
                  "textRaw": "`stream` {stream.Duplex} The upgraded stream between the server and client",
                  "name": "stream",
                  "type": "stream.Duplex",
                  "desc": "The upgraded stream between the server and client"
                },
                {
                  "textRaw": "`head` {Buffer} The first packet of the upgraded stream (may be empty)",
                  "name": "head",
                  "type": "Buffer",
                  "desc": "The first packet of the upgraded stream (may be empty)"
                }
              ],
              "desc": "<p>Emitted each time a client's HTTP upgrade request is accepted. By default\nall HTTP upgrade requests are ignored (i.e. only regular <code>'request'</code> events\nare emitted, sticking with the normal HTTP request/response flow) unless you\nlisten to this event, in which case they are all accepted (i.e. the <code>'upgrade'</code>\nevent is emitted instead, and future communication must handled directly\nthrough the raw stream). You can control this more precisely by using the\nserver <code>shouldUpgradeCallback</code> option.</p>\n<p>Listening to this event is optional and clients cannot insist on a protocol\nchange.</p>\n<p>If an upgrade is accepted by <code>shouldUpgradeCallback</code> but no event handler\nis registered then the socket will be destroyed, resulting in an immediate\nconnection closure for the client.</p>\n<p>In the uncommon case that the incoming request has a body, this body will be\nparsed as normal, separate to the upgrade stream, and the raw stream data will\nonly begin after it has completed. To ensure that reading from the stream isn't\nblocked by waiting for the request body to be read, any reads on the stream\nwill start the request body flowing automatically. If you want to read the\nrequest body, ensure that you do so (i.e. you attach <code>'data'</code> listeners)\nbefore starting to read from the upgraded stream.</p>\n<p>The stream argument will typically be the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> instance used by the\nrequest, but in some cases (such as with a request body) it may be a duplex\nstream. If required, you can access the raw connection underlying the request\nvia <a href=\"#requestsocket\"><code>request.socket</code></a>, which is guaranteed to be an instance of <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>\nunless the user specified another socket type.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`server.close([callback])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/43522",
                    "description": "The method closes idle connections before returning."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Stops the server from accepting new connections and closes all connections\nconnected to this server which are not sending a request or waiting for\na response.\nSee <a href=\"net.html#serverclosecallback\"><code>net.Server.close()</code></a>.</p>\n<pre><code class=\"language-js\">const http = require('node:http');\n\nconst server = http.createServer({ keepAliveTimeout: 60000 }, (req, res) => {\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(JSON.stringify({\n    data: 'Hello World!',\n  }));\n});\n\nserver.listen(8000);\n// Close the server after 10 seconds\nsetTimeout(() => {\n  server.close(() => {\n    console.log('server on port 8000 closed successfully');\n  });\n}, 10000);\n</code></pre>"
            },
            {
              "textRaw": "`server.closeAllConnections()`",
              "name": "closeAllConnections",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes all established HTTP(S) connections connected to this server, including\nactive connections connected to this server which are sending a request or\nwaiting for a response. This does <em>not</em> destroy sockets upgraded to a different\nprotocol, such as WebSocket or HTTP/2.</p>\n<blockquote>\n<p>This is a forceful way of closing all connections and should be used with\ncaution. Whenever using this in conjunction with <code>server.close</code>, calling this\n<em>after</em> <code>server.close</code> is recommended as to avoid race conditions where new\nconnections are created between a call to this and a call to <code>server.close</code>.</p>\n</blockquote>\n<pre><code class=\"language-js\">const http = require('node:http');\n\nconst server = http.createServer({ keepAliveTimeout: 60000 }, (req, res) => {\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(JSON.stringify({\n    data: 'Hello World!',\n  }));\n});\n\nserver.listen(8000);\n// Close the server after 10 seconds\nsetTimeout(() => {\n  server.close(() => {\n    console.log('server on port 8000 closed successfully');\n  });\n  // Closes all connections, ensuring the server closes successfully\n  server.closeAllConnections();\n}, 10000);\n</code></pre>"
            },
            {
              "textRaw": "`server.closeIdleConnections()`",
              "name": "closeIdleConnections",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes all connections connected to this server which are not sending a request\nor waiting for a response.</p>\n<blockquote>\n<p>Starting with Node.js 19.0.0, there's no need for calling this method in\nconjunction with <code>server.close</code> to reap <code>keep-alive</code> connections. Using it\nwon't cause any harm though, and it can be useful to ensure backwards\ncompatibility for libraries and applications that need to support versions\nolder than 19.0.0. Whenever using this in conjunction with <code>server.close</code>,\ncalling this <em>after</em> <code>server.close</code> is recommended as to avoid race\nconditions where new connections are created between a call to this and a\ncall to <code>server.close</code>.</p>\n</blockquote>\n<pre><code class=\"language-js\">const http = require('node:http');\n\nconst server = http.createServer({ keepAliveTimeout: 60000 }, (req, res) => {\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(JSON.stringify({\n    data: 'Hello World!',\n  }));\n});\n\nserver.listen(8000);\n// Close the server after 10 seconds\nsetTimeout(() => {\n  server.close(() => {\n    console.log('server on port 8000 closed successfully');\n  });\n  // Closes idle connections, such as keep-alive connections. Server will close\n  // once remaining active connections are terminated\n  server.closeIdleConnections();\n}, 10000);\n</code></pre>"
            },
            {
              "textRaw": "`server.listen()`",
              "name": "listen",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Starts the HTTP server listening for connections.\nThis method is identical to <a href=\"net.html#serverlisten\"><code>server.listen()</code></a> from <a href=\"net.html#class-netserver\"><code>net.Server</code></a>.</p>"
            },
            {
              "textRaw": "`server.setTimeout([msecs][, callback])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "changes": [
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27558",
                    "description": "The default timeout changed from 120s to 0 (no timeout)."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`msecs` {number} **Default:** 0 (no timeout)",
                      "name": "msecs",
                      "type": "number",
                      "default": "0 (no timeout)",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {http.Server}",
                    "name": "return",
                    "type": "http.Server"
                  }
                }
              ],
              "desc": "<p>Sets the timeout value for sockets, and emits a <code>'timeout'</code> event on\nthe Server object, passing the socket as an argument, if a timeout\noccurs.</p>\n<p>If there is a <code>'timeout'</code> event listener on the Server object, then it\nwill be called with the timed-out socket as an argument.</p>\n<p>By default, the Server does not timeout sockets. However, if a callback\nis assigned to the Server's <code>'timeout'</code> event, timeouts must be handled\nexplicitly.</p>"
            },
            {
              "textRaw": "`server[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v20.4.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58467",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <a href=\"#serverclosecallback\"><code>server.close()</code></a> and returns a promise that fulfills when the\nserver has closed.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {number} **Default:** The minimum between `server.requestTimeout` or `60000`.",
              "name": "headersTimeout",
              "type": "number",
              "meta": {
                "added": [
                  "v11.3.0",
                  "v10.14.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.4.0",
                      "v18.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/45778",
                    "description": "The default is now set to the minimum between 60000 (60 seconds) or `requestTimeout`."
                  }
                ]
              },
              "default": "The minimum between `server.requestTimeout` or `60000`",
              "desc": "<p>Limit the amount of time the parser will wait to receive the complete HTTP\nheaders.</p>\n<p>If the timeout expires, the server responds with status 408 without\nforwarding the request to the request listener and then closes the connection.</p>\n<p>It must be set to a non-zero value (e.g. 120 seconds) to protect against\npotential Denial-of-Service attacks in case the server is deployed without a\nreverse proxy in front.</p>"
            },
            {
              "textRaw": "Type: {boolean} Indicates whether or not the server is listening for connections.",
              "name": "listening",
              "type": "boolean",
              "meta": {
                "added": [
                  "v5.7.0"
                ],
                "changes": []
              },
              "desc": "Indicates whether or not the server is listening for connections."
            },
            {
              "textRaw": "Type: {number} **Default:** `2000`",
              "name": "maxHeadersCount",
              "type": "number",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "default": "`2000`",
              "desc": "<p>Limits maximum incoming headers count. If set to 0, no limit will be applied.</p>"
            },
            {
              "textRaw": "Type: {number} **Default:** `300000`",
              "name": "requestTimeout",
              "type": "number",
              "meta": {
                "added": [
                  "v14.11.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41263",
                    "description": "The default request timeout changed from no timeout to 300s (5 minutes)."
                  }
                ]
              },
              "default": "`300000`",
              "desc": "<p>Sets the timeout value in milliseconds for receiving the entire request from\nthe client.</p>\n<p>If the timeout expires, the server responds with status 408 without\nforwarding the request to the request listener and then closes the connection.</p>\n<p>It must be set to a non-zero value (e.g. 120 seconds) to protect against\npotential Denial-of-Service attacks in case the server is deployed without a\nreverse proxy in front.</p>"
            },
            {
              "textRaw": "Type: {number} Requests per socket. **Default:** 0 (no limit)",
              "name": "maxRequestsPerSocket",
              "type": "number",
              "meta": {
                "added": [
                  "v16.10.0"
                ],
                "changes": []
              },
              "default": "0 (no limit)",
              "desc": "<p>The maximum number of requests socket can handle\nbefore closing keep alive connection.</p>\n<p>A value of <code>0</code> will disable the limit.</p>\n<p>When the limit is reached it will set the <code>Connection</code> header value to <code>close</code>,\nbut will not actually close the connection, subsequent requests sent\nafter the limit is reached will get <code>503 Service Unavailable</code> as a response.</p>",
              "shortDesc": "Requests per socket."
            },
            {
              "textRaw": "Type: {number} Timeout in milliseconds. **Default:** 0 (no timeout)",
              "name": "timeout",
              "type": "number",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "changes": [
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27558",
                    "description": "The default timeout changed from 120s to 0 (no timeout)."
                  }
                ]
              },
              "default": "0 (no timeout)",
              "desc": "<p>The number of milliseconds of inactivity before a socket is presumed\nto have timed out.</p>\n<p>A value of <code>0</code> will disable the timeout behavior on incoming connections.</p>\n<p>The socket timeout logic is set up on connection, so changing this\nvalue only affects new connections to the server, not any existing connections.</p>",
              "shortDesc": "Timeout in milliseconds."
            },
            {
              "textRaw": "Type: {number} Timeout in milliseconds. **Default:** `5000` (5 seconds).",
              "name": "keepAliveTimeout",
              "type": "number",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "default": "`5000` (5 seconds)",
              "desc": "<p>The number of milliseconds of inactivity a server needs to wait for additional\nincoming data, after it has finished writing the last response, before a socket\nwill be destroyed.</p>\n<p>This timeout value is combined with the\n<a href=\"#serverkeepalivetimeoutbuffer\"><code>server.keepAliveTimeoutBuffer</code></a> option to determine the actual socket\ntimeout, calculated as:\nsocketTimeout = keepAliveTimeout + keepAliveTimeoutBuffer\nIf the server receives new data before the keep-alive timeout has fired, it\nwill reset the regular inactivity timeout, i.e., <a href=\"#servertimeout\"><code>server.timeout</code></a>.</p>\n<p>A value of <code>0</code> will disable the keep-alive timeout behavior on incoming\nconnections.\nA value of <code>0</code> makes the HTTP server behave similarly to Node.js versions prior\nto 8.0.0, which did not have a keep-alive timeout.</p>\n<p>The socket timeout logic is set up on connection, so changing this value only\naffects new connections to the server, not any existing connections.</p>",
              "shortDesc": "Timeout in milliseconds."
            },
            {
              "textRaw": "Type: {number} Timeout in milliseconds. **Default:** `1000` (1 second).",
              "name": "keepAliveTimeoutBuffer",
              "type": "number",
              "meta": {
                "added": [
                  "v24.6.0",
                  "v22.19.0"
                ],
                "changes": []
              },
              "default": "`1000` (1 second)",
              "desc": "<p>An additional buffer time added to the\n<a href=\"#serverkeepalivetimeout\"><code>server.keepAliveTimeout</code></a> to extend the internal socket timeout.</p>\n<p>This buffer helps reduce connection reset (<code>ECONNRESET</code>) errors by increasing\nthe socket timeout slightly beyond the advertised keep-alive timeout.</p>\n<p>This option applies only to new incoming connections.</p>",
              "shortDesc": "Timeout in milliseconds."
            }
          ]
        },
        {
          "textRaw": "Class: `http.ServerResponse`",
          "name": "http.ServerResponse",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"http.html#class-httpoutgoingmessage\"><code>&#x3C;http.OutgoingMessage></code></a></li>\n</ul>\n<p>This object is created internally by an HTTP server, not by the user. It is\npassed as the second parameter to the <a href=\"#event-request\"><code>'request'</code></a> event.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.6.7"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Indicates that the response is completed, or its underlying connection was\nterminated prematurely (before the response completion).</p>"
            },
            {
              "textRaw": "Event: `'finish'`",
              "name": "finish",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.6"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the response has been sent. More specifically, this event is\nemitted when the last segment of the response headers and body have been\nhanded off to the operating system for transmission over the network. It\ndoes not imply that the client has received anything yet.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`response.addTrailers(headers)`",
              "name": "addTrailers",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`headers` {Object}",
                      "name": "headers",
                      "type": "Object"
                    }
                  ]
                }
              ],
              "desc": "<p>This method adds HTTP trailing headers (a header but at the end of the\nmessage) to the response.</p>\n<p>Trailers will <strong>only</strong> be emitted if chunked encoding is used for the\nresponse; if it is not (e.g. if the request was HTTP/1.0), they will\nbe silently discarded.</p>\n<p>HTTP requires the <code>Trailer</code> header to be sent in order to\nemit trailers, with a list of the header fields in its value. E.g.,</p>\n<pre><code class=\"language-js\">response.writeHead(200, { 'Content-Type': 'text/plain',\n                          'Trailer': 'Content-MD5' });\nresponse.write(fileData);\nresponse.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' });\nresponse.end();\n</code></pre>\n<p>Attempting to set a header field name or value that contains invalid characters\nwill result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown.</p>"
            },
            {
              "textRaw": "`response.cork()`",
              "name": "cork",
              "type": "method",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"stream.html#writablecork\"><code>writable.cork()</code></a>.</p>"
            },
            {
              "textRaw": "`response.end([data[, encoding]][, callback])`",
              "name": "end",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33155",
                    "description": "The `data` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18780",
                    "description": "This method now returns a reference to `ServerResponse`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|Uint8Array}",
                      "name": "data",
                      "type": "string|Buffer|Uint8Array",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>This method signals to the server that all of the response headers and body\nhave been sent; that server should consider this message complete.\nThe method, <code>response.end()</code>, MUST be called on each response.</p>\n<p>If <code>data</code> is specified, it is similar in effect to calling\n<a href=\"#responsewritechunk-encoding-callback\"><code>response.write(data, encoding)</code></a> followed by <code>response.end(callback)</code>.</p>\n<p>If <code>callback</code> is specified, it will be called when the response stream\nis finished.</p>"
            },
            {
              "textRaw": "`response.flushHeaders()`",
              "name": "flushHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Flushes the response headers. See also: <a href=\"#requestflushheaders\"><code>request.flushHeaders()</code></a>.</p>"
            },
            {
              "textRaw": "`response.getHeader(name)`",
              "name": "getHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number|string|string[]|undefined}",
                    "name": "return",
                    "type": "number|string|string[]|undefined"
                  }
                }
              ],
              "desc": "<p>Reads out a header that's already been queued but not sent to the client.\nThe name is case-insensitive. The type of the return value depends\non the arguments provided to <a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a>.</p>\n<pre><code class=\"language-js\">response.setHeader('Content-Type', 'text/html');\nresponse.setHeader('Content-Length', Buffer.byteLength(body));\nresponse.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']);\nconst contentType = response.getHeader('content-type');\n// contentType is 'text/html'\nconst contentLength = response.getHeader('Content-Length');\n// contentLength is of type number\nconst setCookie = response.getHeader('set-cookie');\n// setCookie is of type string[]\n</code></pre>"
            },
            {
              "textRaw": "`response.getHeaderNames()`",
              "name": "getHeaderNames",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]}",
                    "name": "return",
                    "type": "string[]"
                  }
                }
              ],
              "desc": "<p>Returns an array containing the unique names of the current outgoing headers.\nAll header names are lowercase.</p>\n<pre><code class=\"language-js\">response.setHeader('Foo', 'bar');\nresponse.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);\n\nconst headerNames = response.getHeaderNames();\n// headerNames === ['foo', 'set-cookie']\n</code></pre>"
            },
            {
              "textRaw": "`response.getHeaders()`",
              "name": "getHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns a shallow copy of the current outgoing headers. Since a shallow copy\nis used, array values may be mutated without additional calls to various\nheader-related http module methods. The keys of the returned object are the\nheader names and the values are the respective header values. All header names\nare lowercase.</p>\n<p>The object returned by the <code>response.getHeaders()</code> method <em>does not</em>\nprototypically inherit from the JavaScript <code>Object</code>. This means that typical\n<code>Object</code> methods such as <code>obj.toString()</code>, <code>obj.hasOwnProperty()</code>, and others\nare not defined and <em>will not work</em>.</p>\n<pre><code class=\"language-js\">response.setHeader('Foo', 'bar');\nresponse.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);\n\nconst headers = response.getHeaders();\n// headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }\n</code></pre>"
            },
            {
              "textRaw": "`response.hasHeader(name)`",
              "name": "hasHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the header identified by <code>name</code> is currently set in the\noutgoing headers. The header name matching is case-insensitive.</p>\n<pre><code class=\"language-js\">const hasContentType = response.hasHeader('content-type');\n</code></pre>"
            },
            {
              "textRaw": "`response.removeHeader(name)`",
              "name": "removeHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Removes a header that's queued for implicit sending.</p>\n<pre><code class=\"language-js\">response.removeHeader('Content-Encoding');\n</code></pre>"
            },
            {
              "textRaw": "`response.setHeader(name, value)`",
              "name": "setHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`value` {number|string|string[]}",
                      "name": "value",
                      "type": "number|string|string[]"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {http.ServerResponse}",
                    "name": "return",
                    "type": "http.ServerResponse"
                  }
                }
              ],
              "desc": "<p>Returns the response object.</p>\n<p>Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value will be replaced. Use an array of strings\nhere to send multiple headers with the same name. Non-string values will be\nstored without modification. Therefore, <a href=\"#responsegetheadername\"><code>response.getHeader()</code></a> may return\nnon-string values. However, the non-string values will be converted to strings\nfor network transmission. The same response object is returned to the caller,\nto enable call chaining.</p>\n<pre><code class=\"language-js\">response.setHeader('Content-Type', 'text/html');\n</code></pre>\n<p>or</p>\n<pre><code class=\"language-js\">response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']);\n</code></pre>\n<p>Attempting to set a header field name or value that contains invalid characters\nwill result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown.</p>\n<p>When headers have been set with <a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a>, they will be merged\nwith any headers passed to <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a>, with the headers passed\nto <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> given precedence.</p>\n<pre><code class=\"language-js\">// Returns content-type = text/plain\nconst server = http.createServer((req, res) => {\n  res.setHeader('Content-Type', 'text/html');\n  res.setHeader('X-Foo', 'bar');\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('ok');\n});\n</code></pre>\n<p>If <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> method is called and this method has not been\ncalled, it will directly write the supplied header values onto the network\nchannel without caching internally, and the <a href=\"#responsegetheadername\"><code>response.getHeader()</code></a> on the\nheader will not yield the expected result. If progressive population of headers\nis desired with potential future retrieval and modification, use\n<a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a> instead of <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a>.</p>"
            },
            {
              "textRaw": "`response.setTimeout(msecs[, callback])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`msecs` {number}",
                      "name": "msecs",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {http.ServerResponse}",
                    "name": "return",
                    "type": "http.ServerResponse"
                  }
                }
              ],
              "desc": "<p>Sets the Socket's timeout value to <code>msecs</code>. If a callback is\nprovided, then it is added as a listener on the <code>'timeout'</code> event on\nthe response object.</p>\n<p>If no <code>'timeout'</code> listener is added to the request, the response, or\nthe server, then sockets are destroyed when they time out. If a handler is\nassigned to the request, the response, or the server's <code>'timeout'</code> events,\ntimed out sockets must be handled explicitly.</p>"
            },
            {
              "textRaw": "`response.uncork()`",
              "name": "uncork",
              "type": "method",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"stream.html#writableuncork\"><code>writable.uncork()</code></a>.</p>"
            },
            {
              "textRaw": "`response.write(chunk[, encoding][, callback])`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33155",
                    "description": "The `chunk` parameter can now be a `Uint8Array`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`chunk` {string|Buffer|Uint8Array}",
                      "name": "chunk",
                      "type": "string|Buffer|Uint8Array"
                    },
                    {
                      "textRaw": "`encoding` {string} **Default:** `'utf8'`",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>If this method is called and <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> has not been called,\nit will switch to implicit header mode and flush the implicit headers.</p>\n<p>This sends a chunk of the response body. This method may\nbe called multiple times to provide successive parts of the body.</p>\n<p>If <code>rejectNonStandardBodyWrites</code> is set to true in <code>createServer</code>\nthen writing to the body is not allowed when the request method or response\nstatus do not support content. If an attempt is made to write to the body for a\nHEAD request or as part of a <code>204</code> or <code>304</code>response, a synchronous <code>Error</code>\nwith the code <code>ERR_HTTP_BODY_NOT_ALLOWED</code> is thrown.</p>\n<p><code>chunk</code> can be a string or a buffer. If <code>chunk</code> is a string,\nthe second parameter specifies how to encode it into a byte stream.\n<code>callback</code> will be called when this chunk of data is flushed.</p>\n<p>This is the raw HTTP body and has nothing to do with higher-level multi-part\nbody encodings that may be used.</p>\n<p>The first time <a href=\"#responsewritechunk-encoding-callback\"><code>response.write()</code></a> is called, it will send the buffered\nheader information and the first chunk of the body to the client. The second\ntime <a href=\"#responsewritechunk-encoding-callback\"><code>response.write()</code></a> is called, Node.js assumes data will be streamed,\nand sends the new data separately. That is, the response is buffered up to the\nfirst chunk of the body.</p>\n<p>Returns <code>true</code> if the entire data was flushed successfully to the kernel\nbuffer. Returns <code>false</code> if all or part of the data was queued in user memory.\n<code>'drain'</code> will be emitted when the buffer is free again.</p>"
            },
            {
              "textRaw": "`response.writeContinue()`",
              "name": "writeContinue",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Sends an HTTP/1.1 100 Continue message to the client, indicating that\nthe request body should be sent. See the <a href=\"#event-checkcontinue\"><code>'checkContinue'</code></a> event on\n<code>Server</code>.</p>"
            },
            {
              "textRaw": "`response.writeEarlyHints(hints[, callback])`",
              "name": "writeEarlyHints",
              "type": "method",
              "meta": {
                "added": [
                  "v18.11.0"
                ],
                "changes": [
                  {
                    "version": "v18.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44820",
                    "description": "Allow passing hints as an object."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hints` {Object}",
                      "name": "hints",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sends an HTTP/1.1 103 Early Hints message to the client with a Link header,\nindicating that the user agent can preload/preconnect the linked resources.\nThe <code>hints</code> is an object containing the values of headers to be sent with\nearly hints message. The optional <code>callback</code> argument will be called when\nthe response message has been written.</p>\n<p><strong>Example</strong></p>\n<pre><code class=\"language-js\">const earlyHintsLink = '&#x3C;/styles.css>; rel=preload; as=style';\nresponse.writeEarlyHints({\n  'link': earlyHintsLink,\n});\n\nconst earlyHintsLinks = [\n  '&#x3C;/styles.css>; rel=preload; as=style',\n  '&#x3C;/scripts.js>; rel=preload; as=script',\n];\nresponse.writeEarlyHints({\n  'link': earlyHintsLinks,\n  'x-trace-id': 'id for diagnostics',\n});\n\nconst earlyHintsCallback = () => console.log('early hints message sent');\nresponse.writeEarlyHints({\n  'link': earlyHintsLinks,\n}, earlyHintsCallback);\n</code></pre>"
            },
            {
              "textRaw": "`response.writeHead(statusCode[, statusMessage][, headers])`",
              "name": "writeHead",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.30"
                ],
                "changes": [
                  {
                    "version": "v14.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35274",
                    "description": "Allow passing headers as an array."
                  },
                  {
                    "version": [
                      "v11.10.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/25974",
                    "description": "Return `this` from `writeHead()` to allow chaining with `end()`."
                  },
                  {
                    "version": [
                      "v5.11.0",
                      "v4.4.5"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/6291",
                    "description": "A `RangeError` is thrown if `statusCode` is not a number in the range `[100, 999]`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`statusCode` {number}",
                      "name": "statusCode",
                      "type": "number"
                    },
                    {
                      "textRaw": "`statusMessage` {string}",
                      "name": "statusMessage",
                      "type": "string",
                      "optional": true
                    },
                    {
                      "textRaw": "`headers` {Object|Array}",
                      "name": "headers",
                      "type": "Object|Array",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {http.ServerResponse}",
                    "name": "return",
                    "type": "http.ServerResponse"
                  }
                }
              ],
              "desc": "<p>Sends a response header to the request. The status code is a 3-digit HTTP\nstatus code, like <code>404</code>. The last argument, <code>headers</code>, are the response headers.\nOptionally one can give a human-readable <code>statusMessage</code> as the second\nargument.</p>\n<p><code>headers</code> may be an <code>Array</code> where the keys and values are in the same list.\nIt is <em>not</em> a list of tuples. So, the even-numbered offsets are key values,\nand the odd-numbered offsets are the associated values. The array is in the same\nformat as <code>request.rawHeaders</code>.</p>\n<p>Returns a reference to the <code>ServerResponse</code>, so that calls can be chained.</p>\n<pre><code class=\"language-js\">const body = 'hello world';\nresponse\n  .writeHead(200, {\n    'Content-Length': Buffer.byteLength(body),\n    'Content-Type': 'text/plain',\n  })\n  .end(body);\n</code></pre>\n<p>This method must only be called once on a message and it must\nbe called before <a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a> is called.</p>\n<p>If <a href=\"#responsewritechunk-encoding-callback\"><code>response.write()</code></a> or <a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a> are called before calling\nthis, the implicit/mutable headers will be calculated and call this function.</p>\n<p>When headers have been set with <a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a>, they will be merged\nwith any headers passed to <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a>, with the headers passed\nto <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> given precedence.</p>\n<p>If this method is called and <a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a> has not been called,\nit will directly write the supplied header values onto the network channel\nwithout caching internally, and the <a href=\"#responsegetheadername\"><code>response.getHeader()</code></a> on the header\nwill not yield the expected result. If progressive population of headers is\ndesired with potential future retrieval and modification, use\n<a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a> instead.</p>\n<pre><code class=\"language-js\">// Returns content-type = text/plain\nconst server = http.createServer((req, res) => {\n  res.setHeader('Content-Type', 'text/html');\n  res.setHeader('X-Foo', 'bar');\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('ok');\n});\n</code></pre>\n<p><code>Content-Length</code> is read in bytes, not characters. Use\n<a href=\"buffer.html#static-method-bufferbytelengthstring-encoding\"><code>Buffer.byteLength()</code></a> to determine the length of the body in bytes. Node.js\nwill check whether <code>Content-Length</code> and the length of the body which has\nbeen transmitted are equal or not.</p>\n<p>Attempting to set a header field name or value that contains invalid characters\nwill result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown.</p>"
            },
            {
              "textRaw": "`response.writeInformation(statusCode[, headers][, callback])`",
              "name": "writeInformation",
              "type": "method",
              "meta": {
                "added": [
                  "v26.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`statusCode` {number} An HTTP 1xx informational status code, between `100` and `199` inclusive, excluding `101` (Switching Protocols) which is only available through the `'upgrade'` event.",
                      "name": "statusCode",
                      "type": "number",
                      "desc": "An HTTP 1xx informational status code, between `100` and `199` inclusive, excluding `101` (Switching Protocols) which is only available through the `'upgrade'` event."
                    },
                    {
                      "textRaw": "`headers` {Object|Array} An optional set of headers to send with the informational response. Accepts the same shapes as `response.writeHead()`.",
                      "name": "headers",
                      "type": "Object|Array",
                      "desc": "An optional set of headers to send with the informational response. Accepts the same shapes as `response.writeHead()`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} Optional, called once the message has been written to the socket.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Optional, called once the message has been written to the socket.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sends an arbitrary HTTP/1.1 1xx informational response to the client. This\nis a generic equivalent of <a href=\"#responsewritecontinue\"><code>response.writeContinue()</code></a>,\n<a href=\"#responsewriteprocessing\"><code>response.writeProcessing()</code></a> and <a href=\"#responsewriteearlyhintshints-callback\"><code>response.writeEarlyHints()</code></a>, and\ncan be called multiple times before the final response. After the final\nresponse headers have been sent (via <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> or an\nimplicit header), calling this method throws <code>ERR_HTTP_HEADERS_SENT</code>.</p>\n<p>Clients receive these responses via the <a href=\"#event-information\"><code>'information'</code></a>\nevent on <code>http.ClientRequest</code>.</p>\n<pre><code class=\"language-js\">response.writeInformation(110, { 'X-Progress': '50%' });\n</code></pre>"
            },
            {
              "textRaw": "`response.writeProcessing()`",
              "name": "writeProcessing",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Sends an HTTP/1.1 102 Processing message to the client, indicating that\nthe request body should be sent.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {stream.Duplex}",
              "name": "connection",
              "type": "stream.Duplex",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": [],
                "deprecated": [
                  "v13.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Use `response.socket`.",
              "desc": "<p>See <a href=\"#responsesocket\"><code>response.socket</code></a>.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "finished",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.0.2"
                ],
                "changes": [],
                "deprecated": [
                  "v13.4.0",
                  "v12.16.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Use `response.writableEnded`.",
              "desc": "<p>The <code>response.finished</code> property will be <code>true</code> if <a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a>\nhas been called.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "headersSent",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "desc": "<p>Boolean (read-only). True if headers were sent, false otherwise.</p>"
            },
            {
              "textRaw": "Type: {http.IncomingMessage}",
              "name": "req",
              "type": "http.IncomingMessage",
              "meta": {
                "added": [
                  "v15.7.0"
                ],
                "changes": []
              },
              "desc": "<p>A reference to the original HTTP <code>request</code> object.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "sendDate",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "desc": "<p>When true, the Date header will be automatically generated and sent in\nthe response if it is not already present in the headers. Defaults to true.</p>\n<p>This should only be disabled for testing; the Date header is required in\nmost HTTP responses (see <a href=\"https://www.rfc-editor.org/rfc/rfc9110#section-6.6.1\">RFC 9110 Section 6.6.1</a> for details).</p>"
            },
            {
              "textRaw": "Type: {stream.Duplex}",
              "name": "socket",
              "type": "stream.Duplex",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>Reference to the underlying socket. Usually users will not want to access\nthis property. In particular, the socket will not emit <code>'readable'</code> events\nbecause of how the protocol parser attaches to the socket. After\n<code>response.end()</code>, the property is nulled.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\nconst server = http.createServer((req, res) => {\n  const ip = res.socket.remoteAddress;\n  const port = res.socket.remotePort;\n  res.end(`Your IP address is ${ip} and your source port is ${port}.`);\n}).listen(3000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst server = http.createServer((req, res) => {\n  const ip = res.socket.remoteAddress;\n  const port = res.socket.remotePort;\n  res.end(`Your IP address is ${ip} and your source port is ${port}.`);\n}).listen(3000);\n</code></pre>\n<p>This property is guaranteed to be an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specified a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a>.</p>"
            },
            {
              "textRaw": "Type: {number} **Default:** `200`",
              "name": "statusCode",
              "type": "number",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "default": "`200`",
              "desc": "<p>When using implicit headers (not calling <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> explicitly),\nthis property controls the status code that will be sent to the client when\nthe headers get flushed.</p>\n<pre><code class=\"language-js\">response.statusCode = 404;\n</code></pre>\n<p>After response header was sent to the client, this property indicates the\nstatus code which was sent out.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "statusMessage",
              "type": "string",
              "meta": {
                "added": [
                  "v0.11.8"
                ],
                "changes": []
              },
              "desc": "<p>When using implicit headers (not calling <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> explicitly),\nthis property controls the status message that will be sent to the client when\nthe headers get flushed. If this is left as <code>undefined</code> then the standard\nmessage for the status code will be used.</p>\n<pre><code class=\"language-js\">response.statusMessage = 'Not found';\n</code></pre>\n<p>After response header was sent to the client, this property indicates the\nstatus message which was sent out.</p>"
            },
            {
              "textRaw": "Type: {boolean} **Default:** `false`",
              "name": "strictContentLength",
              "type": "boolean",
              "meta": {
                "added": [
                  "v18.10.0",
                  "v16.18.0"
                ],
                "changes": []
              },
              "default": "`false`",
              "desc": "<p>If set to <code>true</code>, Node.js will check whether the <code>Content-Length</code>\nheader value and the size of the body, in bytes, are equal.\nMismatching the <code>Content-Length</code> header value will result\nin an <code>Error</code> being thrown, identified by <code>code:</code> <a href=\"errors.html#err_http_content_length_mismatch\"><code>'ERR_HTTP_CONTENT_LENGTH_MISMATCH'</code></a>.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "writableEnded",
              "type": "boolean",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Is <code>true</code> after <a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a> has been called. This property\ndoes not indicate whether the data has been flushed, for this use\n<a href=\"#responsewritablefinished\"><code>response.writableFinished</code></a> instead.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "writableFinished",
              "type": "boolean",
              "meta": {
                "added": [
                  "v12.7.0"
                ],
                "changes": []
              },
              "desc": "<p>Is <code>true</code> if all data has been flushed to the underlying system, immediately\nbefore the <a href=\"#event-finish\"><code>'finish'</code></a> event is emitted.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `http.IncomingMessage`",
          "name": "http.IncomingMessage",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": [
              {
                "version": "v15.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/33035",
                "description": "The `destroyed` value returns `true` after the incoming data is consumed."
              },
              {
                "version": [
                  "v13.1.0",
                  "v12.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/30135",
                "description": "The `readableHighWaterMark` value mirrors that of the socket."
              }
            ]
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamreadable\"><code>&#x3C;stream.Readable></code></a></li>\n</ul>\n<p>An <code>IncomingMessage</code> object is created by <a href=\"#class-httpserver\"><code>http.Server</code></a> or\n<a href=\"#class-httpclientrequest\"><code>http.ClientRequest</code></a> and passed as the first argument to the <a href=\"#event-request\"><code>'request'</code></a>\nand <a href=\"#event-response\"><code>'response'</code></a> event respectively. It may be used to access response\nstatus, headers, and data.</p>\n<p>Different from its <code>socket</code> value which is a subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, the <code>IncomingMessage</code> itself extends <a href=\"stream.html#class-streamreadable\"><code>&#x3C;stream.Readable></code></a> and is created separately to\nparse and emit the incoming HTTP headers and payload, as the underlying socket\nmay be reused multiple times in case of keep-alive.</p>",
          "events": [
            {
              "textRaw": "Event: `'aborted'`",
              "name": "aborted",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.8"
                ],
                "changes": [],
                "deprecated": [
                  "v17.0.0",
                  "v16.12.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Listen for `'close'` event instead.",
              "params": [],
              "desc": "<p>Emitted when the request has been aborted.</p>"
            },
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.4.2"
                ],
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33035",
                    "description": "The close event is now emitted when the request has been completed and not when the underlying socket is closed."
                  }
                ]
              },
              "params": [],
              "desc": "<p>Emitted when the request has been completed.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean}",
              "name": "aborted",
              "type": "boolean",
              "meta": {
                "added": [
                  "v10.1.0"
                ],
                "changes": [],
                "deprecated": [
                  "v17.0.0",
                  "v16.12.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Check `message.destroyed` from {stream.Readable}.",
              "desc": "<p>The <code>message.aborted</code> property will be <code>true</code> if the request has\nbeen aborted.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "complete",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>message.complete</code> property will be <code>true</code> if a complete HTTP message has\nbeen received and successfully parsed.</p>\n<p>This property is particularly useful as a means of determining if a client or\nserver fully transmitted a message before a connection was terminated:</p>\n<pre><code class=\"language-js\">const req = http.request({\n  host: '127.0.0.1',\n  port: 8080,\n  method: 'POST',\n}, (res) => {\n  res.resume();\n  res.on('end', () => {\n    if (!res.complete)\n      console.error(\n        'The connection was terminated while the message was still being sent');\n  });\n});\n</code></pre>"
            },
            {
              "textRaw": "`message.connection`",
              "name": "connection",
              "type": "property",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [],
                "deprecated": [
                  "v16.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated. Use `message.socket`.",
              "desc": "<p>Alias for <a href=\"#messagesocket\"><code>message.socket</code></a>.</p>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "headers",
              "type": "Object",
              "meta": {
                "added": [
                  "v0.1.5"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.5.0",
                      "v18.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/45982",
                    "description": "The `joinDuplicateHeaders` option in the `http.request()` and `http.createServer()` functions ensures that duplicate headers are not discarded, but rather combined using a comma separator, in accordance with RFC 9110 Section 5.3."
                  },
                  {
                    "version": "v15.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35281",
                    "description": "`message.headers` is now lazily computed using an accessor property on the prototype and is no longer enumerable."
                  }
                ]
              },
              "desc": "<p>The request/response headers object.</p>\n<p>Key-value pairs of header names and values. Header names are lower-cased.</p>\n<pre><code class=\"language-js\">// Prints something like:\n//\n// { 'user-agent': 'curl/7.22.0',\n//   host: '127.0.0.1:8000',\n//   accept: '*/*' }\nconsole.log(request.headers);\n</code></pre>\n<p>Duplicates in raw headers are handled in the following ways, depending on the\nheader name:</p>\n<ul>\n<li>Duplicates of <code>age</code>, <code>authorization</code>, <code>content-length</code>, <code>content-type</code>,\n<code>etag</code>, <code>expires</code>, <code>from</code>, <code>host</code>, <code>if-modified-since</code>, <code>if-unmodified-since</code>,\n<code>last-modified</code>, <code>location</code>, <code>max-forwards</code>, <code>proxy-authorization</code>, <code>referer</code>,\n<code>retry-after</code>, <code>server</code>, or <code>user-agent</code> are discarded.\nTo allow duplicate values of the headers listed above to be joined,\nuse the option <code>joinDuplicateHeaders</code> in <a href=\"#httprequestoptions-callback\"><code>http.request()</code></a>\nand <a href=\"#httpcreateserveroptions-requestlistener\"><code>http.createServer()</code></a>. See RFC 9110 Section 5.3 for more\ninformation.</li>\n<li><code>set-cookie</code> is always an array. Duplicates are added to the array.</li>\n<li>For duplicate <code>cookie</code> headers, the values are joined together with <code>; </code>.</li>\n<li>For all other headers, the values are joined together with <code>, </code>.</li>\n</ul>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "headersDistinct",
              "type": "Object",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Similar to <a href=\"#messageheaders\"><code>message.headers</code></a>, but there is no join logic and the values are\nalways arrays of strings, even for headers received just once.</p>\n<pre><code class=\"language-js\">// Prints something like:\n//\n// { 'user-agent': ['curl/7.22.0'],\n//   host: ['127.0.0.1:8000'],\n//   accept: ['*/*'] }\nconsole.log(request.headersDistinct);\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "httpVersion",
              "type": "string",
              "meta": {
                "added": [
                  "v0.1.1"
                ],
                "changes": []
              },
              "desc": "<p>In case of server request, the HTTP version sent by the client. In the case of\nclient response, the HTTP version of the connected-to server.\nProbably either <code>'1.1'</code> or <code>'1.0'</code>.</p>\n<p>Also <code>message.httpVersionMajor</code> is the first integer and\n<code>message.httpVersionMinor</code> is the second.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "method",
              "type": "string",
              "meta": {
                "added": [
                  "v0.1.1"
                ],
                "changes": []
              },
              "desc": "<p><strong>Only valid for request obtained from <a href=\"#class-httpserver\"><code>http.Server</code></a>.</strong></p>\n<p>The request method as a string. Read only. Examples: <code>'GET'</code>, <code>'DELETE'</code>.</p>"
            },
            {
              "textRaw": "Type: {string[]}",
              "name": "rawHeaders",
              "type": "string[]",
              "meta": {
                "added": [
                  "v0.11.6"
                ],
                "changes": []
              },
              "desc": "<p>The raw request/response headers list exactly as they were received.</p>\n<p>The keys and values are in the same list. It is <em>not</em> a\nlist of tuples. So, the even-numbered offsets are key values, and the\nodd-numbered offsets are the associated values.</p>\n<p>Header names are not lowercased, and duplicates are not merged.</p>\n<pre><code class=\"language-js\">// Prints something like:\n//\n// [ 'user-agent',\n//   'this is invalid because there can be only one',\n//   'User-Agent',\n//   'curl/7.22.0',\n//   'Host',\n//   '127.0.0.1:8000',\n//   'ACCEPT',\n//   '*/*' ]\nconsole.log(request.rawHeaders);\n</code></pre>"
            },
            {
              "textRaw": "Type: {string[]}",
              "name": "rawTrailers",
              "type": "string[]",
              "meta": {
                "added": [
                  "v0.11.6"
                ],
                "changes": []
              },
              "desc": "<p>The raw request/response trailer keys and values exactly as they were\nreceived. Only populated at the <code>'end'</code> event.</p>"
            },
            {
              "textRaw": "Type: {AbortSignal}",
              "name": "signal",
              "type": "AbortSignal",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "desc": "<p>An <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> that is aborted when the underlying socket closes or the\nrequest is destroyed. The signal is created lazily on first access — no\n<a href=\"globals.html#class-abortcontroller\"><code>&#x3C;AbortController></code></a> is allocated for requests that never use this property.</p>\n<p>This is useful for cancelling downstream asynchronous work such as database\nqueries or <code>fetch</code> calls when a client disconnects mid-request.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\n\nhttp.createServer(async (req, res) => {\n  try {\n    const data = await fetch('https://example.com/api', { signal: req.signal });\n    res.end(JSON.stringify(await data.json()));\n  } catch (err) {\n    if (err.name === 'AbortError') return;\n    res.statusCode = 500;\n    res.end('Internal Server Error');\n  }\n}).listen(3000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\nhttp.createServer(async (req, res) => {\n  try {\n    const data = await fetch('https://example.com/api', { signal: req.signal });\n    res.end(JSON.stringify(await data.json()));\n  } catch (err) {\n    if (err.name === 'AbortError') return;\n    res.statusCode = 500;\n    res.end('Internal Server Error');\n  }\n}).listen(3000);\n</code></pre>"
            },
            {
              "textRaw": "Type: {stream.Duplex}",
              "name": "socket",
              "type": "stream.Duplex",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>The <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a> object associated with the connection.</p>\n<p>With HTTPS support, use <a href=\"tls.html#tlssocketgetpeercertificatedetailed\"><code>request.socket.getPeerCertificate()</code></a> to obtain the\nclient's authentication details.</p>\n<p>This property is guaranteed to be an instance of the <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> class,\na subclass of <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a>, unless the user specified a socket\ntype other than <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> or internally nulled.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "statusCode",
              "type": "number",
              "meta": {
                "added": [
                  "v0.1.1"
                ],
                "changes": []
              },
              "desc": "<p><strong>Only valid for response obtained from <a href=\"#class-httpclientrequest\"><code>http.ClientRequest</code></a>.</strong></p>\n<p>The 3-digit HTTP response status code. E.G. <code>404</code>.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "statusMessage",
              "type": "string",
              "meta": {
                "added": [
                  "v0.11.10"
                ],
                "changes": []
              },
              "desc": "<p><strong>Only valid for response obtained from <a href=\"#class-httpclientrequest\"><code>http.ClientRequest</code></a>.</strong></p>\n<p>The HTTP response status message (reason phrase). E.G. <code>OK</code> or <code>Internal Server Error</code>.</p>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "trailers",
              "type": "Object",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>The request/response trailers object. Only populated at the <code>'end'</code> event.</p>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "trailersDistinct",
              "type": "Object",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Similar to <a href=\"#messagetrailers\"><code>message.trailers</code></a>, but there is no join logic and the values are\nalways arrays of strings, even for headers received just once.\nOnly populated at the <code>'end'</code> event.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "url",
              "type": "string",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "desc": "<p><strong>Only valid for request obtained from <a href=\"#class-httpserver\"><code>http.Server</code></a>.</strong></p>\n<p>Request URL string. This contains only the URL that is present in the actual\nHTTP request. Take the following request:</p>\n<pre><code class=\"language-http\">GET /status?name=ryan HTTP/1.1\nAccept: text/plain\n</code></pre>\n<p>To parse the URL into its parts:</p>\n<pre><code class=\"language-js\">new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`);\n</code></pre>\n<p>When <code>request.url</code> is <code>'/status?name=ryan'</code> and <code>process.env.HOST</code> is undefined:</p>\n<pre><code class=\"language-console\">$ node\n> new URL(`http://${process.env.HOST ?? 'localhost'}${request.url}`);\nURL {\n  href: 'http://localhost/status?name=ryan',\n  origin: 'http://localhost',\n  protocol: 'http:',\n  username: '',\n  password: '',\n  host: 'localhost',\n  hostname: 'localhost',\n  port: '',\n  pathname: '/status',\n  search: '?name=ryan',\n  searchParams: URLSearchParams { 'name' => 'ryan' },\n  hash: ''\n}\n</code></pre>\n<p>Ensure that you set <code>process.env.HOST</code> to the server's host name, or consider\nreplacing this part entirely. If using <code>req.headers.host</code>, ensure proper\nvalidation is used, as clients may specify a custom <code>Host</code> header.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`message.destroy([error])`",
              "name": "destroy",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v14.5.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32789",
                    "description": "The function returns `this` for consistency with other Readable streams."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Calls <code>destroy()</code> on the socket that received the <code>IncomingMessage</code>. If <code>error</code>\nis provided, an <code>'error'</code> event is emitted on the socket and <code>error</code> is passed\nas an argument to any listeners on the event.</p>"
            },
            {
              "textRaw": "`message.setTimeout(msecs[, callback])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`msecs` {number}",
                      "name": "msecs",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {http.IncomingMessage}",
                    "name": "return",
                    "type": "http.IncomingMessage"
                  }
                }
              ],
              "desc": "<p>Calls <code>message.socket.setTimeout(msecs, callback)</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `http.OutgoingMessage`",
          "name": "http.OutgoingMessage",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream\"><code>&#x3C;Stream></code></a></li>\n</ul>\n<p>This class serves as the parent class of <a href=\"#class-httpclientrequest\"><code>http.ClientRequest</code></a>\nand <a href=\"#class-httpserverresponse\"><code>http.ServerResponse</code></a>. It is an abstract outgoing message from\nthe perspective of the participants of an HTTP transaction.</p>",
          "events": [
            {
              "textRaw": "Event: `'drain'`",
              "name": "drain",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.6"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the buffer of the message is free again.</p>"
            },
            {
              "textRaw": "Event: `'finish'`",
              "name": "finish",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.17"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the transmission is finished successfully.</p>"
            },
            {
              "textRaw": "Event: `'prefinish'`",
              "name": "prefinish",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.6"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted after <code>outgoingMessage.end()</code> is called.\nWhen the event is emitted, all data has been processed but not necessarily\ncompletely flushed.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`outgoingMessage.addTrailers(headers)`",
              "name": "addTrailers",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`headers` {Object}",
                      "name": "headers",
                      "type": "Object"
                    }
                  ]
                }
              ],
              "desc": "<p>Adds HTTP trailers (headers but at the end of the message) to the message.</p>\n<p>Trailers will <strong>only</strong> be emitted if the message is chunked encoded. If not,\nthe trailers will be silently discarded.</p>\n<p>HTTP requires the <code>Trailer</code> header to be sent to emit trailers,\nwith a list of header field names in its value, e.g.</p>\n<pre><code class=\"language-js\">message.writeHead(200, { 'Content-Type': 'text/plain',\n                         'Trailer': 'Content-MD5' });\nmessage.write(fileData);\nmessage.addTrailers({ 'Content-MD5': '7895bf4b8828b55ceaf47747b4bca667' });\nmessage.end();\n</code></pre>\n<p>Attempting to set a header field name or value that contains invalid characters\nwill result in a <code>TypeError</code> being thrown.</p>"
            },
            {
              "textRaw": "`outgoingMessage.appendHeader(name, value)`",
              "name": "appendHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} Header name",
                      "name": "name",
                      "type": "string",
                      "desc": "Header name"
                    },
                    {
                      "textRaw": "`value` {string|string[]} Header value",
                      "name": "value",
                      "type": "string|string[]",
                      "desc": "Header value"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Append a single header value to the header object.</p>\n<p>If the value is an array, this is equivalent to calling this method multiple\ntimes.</p>\n<p>If there were no previous values for the header, this is equivalent to calling\n<a href=\"#outgoingmessagesetheadername-value\"><code>outgoingMessage.setHeader(name, value)</code></a>.</p>\n<p>Depending of the value of <code>options.uniqueHeaders</code> when the client request or the\nserver were created, this will end up in the header being sent multiple times or\na single time with values joined using <code>; </code>.</p>"
            },
            {
              "textRaw": "`outgoingMessage.cork()`",
              "name": "cork",
              "type": "method",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"stream.html#writablecork\"><code>writable.cork()</code></a>.</p>"
            },
            {
              "textRaw": "`outgoingMessage.destroy([error])`",
              "name": "destroy",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`error` {Error} Optional, an error to emit with `error` event",
                      "name": "error",
                      "type": "Error",
                      "desc": "Optional, an error to emit with `error` event",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Destroys the message. Once a socket is associated with the message\nand is connected, that socket will be destroyed as well.</p>"
            },
            {
              "textRaw": "`outgoingMessage.end(chunk[, encoding][, callback])`",
              "name": "end",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33155",
                    "description": "The `chunk` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v0.11.6",
                    "description": "add `callback` argument."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`chunk` {string|Buffer|Uint8Array}",
                      "name": "chunk",
                      "type": "string|Buffer|Uint8Array"
                    },
                    {
                      "textRaw": "`encoding` {string} Optional, **Default**: `utf8`",
                      "name": "encoding",
                      "type": "string",
                      "desc": "Optional, **Default**: `utf8`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} Optional",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Optional",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Finishes the outgoing message. If any parts of the body are unsent, it will\nflush them to the underlying system. If the message is chunked, it will\nsend the terminating chunk <code>0\\r\\n\\r\\n</code>, and send the trailers (if any).</p>\n<p>If <code>chunk</code> is specified, it is equivalent to calling\n<code>outgoingMessage.write(chunk, encoding)</code>, followed by\n<code>outgoingMessage.end(callback)</code>.</p>\n<p>If <code>callback</code> is provided, it will be called when the message is finished\n(equivalent to a listener of the <code>'finish'</code> event).</p>"
            },
            {
              "textRaw": "`outgoingMessage.flushHeaders()`",
              "name": "flushHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "v1.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Flushes the message headers.</p>\n<p>For efficiency reason, Node.js normally buffers the message headers\nuntil <code>outgoingMessage.end()</code> is called or the first chunk of message data\nis written. It then tries to pack the headers and data into a single TCP\npacket.</p>\n<p>It is usually desired (it saves a TCP round-trip), but not when the first\ndata is not sent until possibly much later. <code>outgoingMessage.flushHeaders()</code>\nbypasses the optimization and kickstarts the message.</p>"
            },
            {
              "textRaw": "`outgoingMessage.getHeader(name)`",
              "name": "getHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} Name of header",
                      "name": "name",
                      "type": "string",
                      "desc": "Name of header"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number|string|string[]|undefined}",
                    "name": "return",
                    "type": "number|string|string[]|undefined"
                  }
                }
              ],
              "desc": "<p>Gets the value of the HTTP header with the given name. If that header is not\nset, the returned value will be <code>undefined</code>.</p>"
            },
            {
              "textRaw": "`outgoingMessage.getHeaderNames()`",
              "name": "getHeaderNames",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string[]}",
                    "name": "return",
                    "type": "string[]"
                  }
                }
              ],
              "desc": "<p>Returns an array containing the unique names of the current outgoing headers.\nAll names are lowercase.</p>"
            },
            {
              "textRaw": "`outgoingMessage.getHeaders()`",
              "name": "getHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns a shallow copy of the current outgoing headers. Since a shallow\ncopy is used, array values may be mutated without additional calls to\nvarious header-related HTTP module methods. The keys of the returned\nobject are the header names and the values are the respective header\nvalues. All header names are lowercase.</p>\n<p>The object returned by the <code>outgoingMessage.getHeaders()</code> method does\nnot prototypically inherit from the JavaScript <code>Object</code>. This means that\ntypical <code>Object</code> methods such as <code>obj.toString()</code>, <code>obj.hasOwnProperty()</code>,\nand others are not defined and will not work.</p>\n<pre><code class=\"language-js\">outgoingMessage.setHeader('Foo', 'bar');\noutgoingMessage.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);\n\nconst headers = outgoingMessage.getHeaders();\n// headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }\n</code></pre>"
            },
            {
              "textRaw": "`outgoingMessage.hasHeader(name)`",
              "name": "hasHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v7.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the header identified by <code>name</code> is currently set in the\noutgoing headers. The header name is case-insensitive.</p>\n<pre><code class=\"language-js\">const hasContentType = outgoingMessage.hasHeader('content-type');\n</code></pre>"
            },
            {
              "textRaw": "`outgoingMessage.pipe()`",
              "name": "pipe",
              "type": "method",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Overrides the <code>stream.pipe()</code> method inherited from the legacy <code>Stream</code> class\nwhich is the parent class of <code>http.OutgoingMessage</code>.</p>\n<p>Calling this method will throw an <code>Error</code> because <code>outgoingMessage</code> is a\nwrite-only stream.</p>"
            },
            {
              "textRaw": "`outgoingMessage.removeHeader(name)`",
              "name": "removeHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} Header name",
                      "name": "name",
                      "type": "string",
                      "desc": "Header name"
                    }
                  ]
                }
              ],
              "desc": "<p>Removes a header that is queued for implicit sending.</p>\n<pre><code class=\"language-js\">outgoingMessage.removeHeader('Content-Encoding');\n</code></pre>"
            },
            {
              "textRaw": "`outgoingMessage.setHeader(name, value)`",
              "name": "setHeader",
              "type": "method",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} Header name",
                      "name": "name",
                      "type": "string",
                      "desc": "Header name"
                    },
                    {
                      "textRaw": "`value` {number|string|string[]} Header value",
                      "name": "value",
                      "type": "number|string|string[]",
                      "desc": "Header value"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Sets a single header value. If the header already exists in the to-be-sent\nheaders, its value will be replaced. Use an array of strings to send multiple\nheaders with the same name.</p>"
            },
            {
              "textRaw": "`outgoingMessage.setHeaders(headers)`",
              "name": "setHeaders",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`headers` {Headers|Map}",
                      "name": "headers",
                      "type": "Headers|Map"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Sets multiple header values for implicit headers.\n<code>headers</code> must be an instance of <a href=\"globals.html#class-headers\"><code>Headers</code></a> or <code>Map</code>,\nif a header already exists in the to-be-sent headers,\nits value will be replaced.</p>\n<pre><code class=\"language-js\">const headers = new Headers({ foo: 'bar' });\noutgoingMessage.setHeaders(headers);\n</code></pre>\n<p>or</p>\n<pre><code class=\"language-js\">const headers = new Map([['foo', 'bar']]);\noutgoingMessage.setHeaders(headers);\n</code></pre>\n<p>When headers have been set with <a href=\"#outgoingmessagesetheadersheaders\"><code>outgoingMessage.setHeaders()</code></a>,\nthey will be merged with any headers passed to <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a>,\nwith the headers passed to <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> given precedence.</p>\n<pre><code class=\"language-js\">// Returns content-type = text/plain\nconst server = http.createServer((req, res) => {\n  const headers = new Headers({ 'Content-Type': 'text/html' });\n  res.setHeaders(headers);\n  res.writeHead(200, { 'Content-Type': 'text/plain' });\n  res.end('ok');\n});\n</code></pre>"
            },
            {
              "textRaw": "`outgoingMessage.setTimeout(msecs[, callback])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.12"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`msecs` {number}",
                      "name": "msecs",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function} Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Optional function to be called when a timeout occurs. Same as binding to the `timeout` event.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this}",
                    "name": "return",
                    "type": "this"
                  }
                }
              ],
              "desc": "<p>Once a socket is associated with the message and is connected,\n<a href=\"net.html#socketsettimeouttimeout-callback\"><code>socket.setTimeout()</code></a> will be called with <code>msecs</code> as the first parameter.</p>"
            },
            {
              "textRaw": "`outgoingMessage.uncork()`",
              "name": "uncork",
              "type": "method",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"stream.html#writableuncork\"><code>writable.uncork()</code></a></p>"
            },
            {
              "textRaw": "`outgoingMessage.write(chunk[, encoding][, callback])`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.29"
                ],
                "changes": [
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/33155",
                    "description": "The `chunk` parameter can now be a `Uint8Array`."
                  },
                  {
                    "version": "v0.11.6",
                    "description": "The `callback` argument was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`chunk` {string|Buffer|Uint8Array}",
                      "name": "chunk",
                      "type": "string|Buffer|Uint8Array"
                    },
                    {
                      "textRaw": "`encoding` {string} **Default**: `utf8`",
                      "name": "encoding",
                      "type": "string",
                      "desc": "**Default**: `utf8`",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Sends a chunk of the body. This method can be called multiple times.</p>\n<p>The <code>encoding</code> argument is only relevant when <code>chunk</code> is a string. Defaults to\n<code>'utf8'</code>.</p>\n<p>The <code>callback</code> argument is optional and will be called when this chunk of data\nis flushed.</p>\n<p>Returns <code>true</code> if the entire data was flushed successfully to the kernel\nbuffer. Returns <code>false</code> if all or part of the data was queued in the user\nmemory. The <code>'drain'</code> event will be emitted when the buffer is free again.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`outgoingMessage.connection`",
              "name": "connection",
              "type": "property",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": [],
                "deprecated": [
                  "v15.12.0",
                  "v14.17.1"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `outgoingMessage.socket` instead.",
              "desc": "<p>Alias of <a href=\"#outgoingmessagesocket\"><code>outgoingMessage.socket</code></a>.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "headersSent",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "desc": "<p>Read-only. <code>true</code> if the headers were sent, otherwise <code>false</code>.</p>"
            },
            {
              "textRaw": "Type: {stream.Duplex}",
              "name": "socket",
              "type": "stream.Duplex",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "desc": "<p>Reference to the underlying socket. Usually, users will not want to access\nthis property.</p>\n<p>After calling <code>outgoingMessage.end()</code>, this property will be nulled.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "writableCorked",
              "type": "number",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>The number of times <code>outgoingMessage.cork()</code> has been called.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "writableEnded",
              "type": "boolean",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Is <code>true</code> if <code>outgoingMessage.end()</code> has been called. This property does\nnot indicate whether the data has been flushed. For that purpose, use\n<code>message.writableFinished</code> instead.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "writableFinished",
              "type": "boolean",
              "meta": {
                "added": [
                  "v12.7.0"
                ],
                "changes": []
              },
              "desc": "<p>Is <code>true</code> if all data has been flushed to the underlying system.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "writableHighWaterMark",
              "type": "number",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>highWaterMark</code> of the underlying socket if assigned. Otherwise, the default\nbuffer level when <a href=\"stream.html#writablewritechunk-encoding-callback\"><code>writable.write()</code></a> starts returning false (<code>16384</code>).</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "writableLength",
              "type": "number",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>The number of buffered bytes.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "writableObjectMode",
              "type": "boolean",
              "meta": {
                "added": [
                  "v12.9.0"
                ],
                "changes": []
              },
              "desc": "<p>Always <code>false</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `WebSocket`",
          "name": "WebSocket",
          "type": "class",
          "meta": {
            "added": [
              "v22.5.0"
            ],
            "changes": []
          },
          "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/WebSocket\"><code>&#x3C;WebSocket></code></a>.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {string[]}",
          "name": "METHODS",
          "type": "string[]",
          "meta": {
            "added": [
              "v0.11.8"
            ],
            "changes": []
          },
          "desc": "<p>A list of the HTTP methods that are supported by the parser.</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "STATUS_CODES",
          "type": "Object",
          "meta": {
            "added": [
              "v0.1.22"
            ],
            "changes": []
          },
          "desc": "<p>A collection of all the standard HTTP response status codes, and the\nshort description of each. For example, <code>http.STATUS_CODES[404] === 'Not Found'</code>.</p>"
        },
        {
          "textRaw": "Type: {http.Agent}",
          "name": "globalAgent",
          "type": "http.Agent",
          "meta": {
            "added": [
              "v0.5.9"
            ],
            "changes": [
              {
                "version": [
                  "v19.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/43522",
                "description": "The agent now uses HTTP Keep-Alive and a 5 second timeout by default."
              }
            ]
          },
          "desc": "<p>Global instance of <code>Agent</code> which is used as the default for all HTTP client\nrequests. Diverges from a default <code>Agent</code> configuration by having <code>keepAlive</code>\nenabled and a <code>timeout</code> of 5 seconds.</p>"
        },
        {
          "textRaw": "Type: {number}",
          "name": "maxHeaderSize",
          "type": "number",
          "meta": {
            "added": [
              "v11.6.0",
              "v10.15.0"
            ],
            "changes": []
          },
          "desc": "<p>Read-only property specifying the maximum allowed size of HTTP headers in bytes.\nDefaults to 16 KiB. Configurable using the <a href=\"cli.html#--max-http-header-sizesize\"><code>--max-http-header-size</code></a> CLI\noption.</p>\n<p>This can be overridden for servers and client requests by passing the\n<code>maxHeaderSize</code> option.</p>"
        }
      ],
      "methods": [
        {
          "textRaw": "`http.createServer([options][, requestListener])`",
          "name": "createServer",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.13"
            ],
            "changes": [
              {
                "version": "v26.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/61597",
                "description": "The `httpValidation` option is supported now."
              },
              {
                "version": [
                  "v25.1.0",
                  "v24.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59778",
                "description": "Add optimizeEmptyRequests option."
              },
              {
                "version": [
                  "v24.9.0",
                  "v22.21.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59824",
                "description": "The `shouldUpgradeCallback` option is now supported."
              },
              {
                "version": [
                  "v20.1.0",
                  "v18.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/47405",
                "description": "The `highWaterMark` option is supported now."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41263",
                "description": "The `requestTimeout`, `headersTimeout`, `keepAliveTimeout`, and `connectionsCheckingInterval` options are supported now."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/42163",
                "description": "The `noDelay` option now defaults to `true`."
              },
              {
                "version": [
                  "v17.7.0",
                  "v16.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41310",
                "description": "The `noDelay`, `keepAlive` and `keepAliveInitialDelay` options are supported now."
              },
              {
                "version": [
                  "v13.8.0",
                  "v12.15.0",
                  "v10.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/31448",
                "description": "The `insecureHTTPParser` option is supported now."
              },
              {
                "version": "v13.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/30570",
                "description": "The `maxHeaderSize` option is supported now."
              },
              {
                "version": [
                  "v9.6.0",
                  "v8.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/15752",
                "description": "The `options` argument is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`connectionsCheckingInterval`: Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests. **Default:** `30000`.",
                      "name": "connectionsCheckingInterval",
                      "default": "`30000`",
                      "desc": "Sets the interval value in milliseconds to check for request and headers timeout in incomplete requests."
                    },
                    {
                      "textRaw": "`headersTimeout`: Sets the timeout value in milliseconds for receiving the complete HTTP headers from the client. See `server.headersTimeout` for more information. **Default:** `60000`.",
                      "name": "headersTimeout",
                      "default": "`60000`",
                      "desc": "Sets the timeout value in milliseconds for receiving the complete HTTP headers from the client. See `server.headersTimeout` for more information."
                    },
                    {
                      "textRaw": "`highWaterMark` {number} Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`. **Default:** See `stream.getDefaultHighWaterMark()`.",
                      "name": "highWaterMark",
                      "type": "number",
                      "default": "See `stream.getDefaultHighWaterMark()`",
                      "desc": "Optionally overrides all `socket`s' `readableHighWaterMark` and `writableHighWaterMark`. This affects `highWaterMark` property of both `IncomingMessage` and `ServerResponse`."
                    },
                    {
                      "textRaw": "`httpValidation` {string} Controls HTTP header value validation strictness for incoming requests. Accepted values are:",
                      "name": "httpValidation",
                      "type": "string",
                      "desc": "Controls HTTP header value validation strictness for incoming requests. Accepted values are:",
                      "options": [
                        {
                          "textRaw": "`'strict'`: Strictest validation; rejects any non-ASCII or control characters in header values.",
                          "desc": "`'strict'`: Strictest validation; rejects any non-ASCII or control characters in header values."
                        },
                        {
                          "textRaw": "`'relaxed'`: Allows a limited set of non-ASCII characters in header values, aligning with the Fetch specification.",
                          "desc": "`'relaxed'`: Allows a limited set of non-ASCII characters in header values, aligning with the Fetch specification."
                        },
                        {
                          "textRaw": "`'insecure'`: Disables all header value validation (equivalent to `insecureHTTPParser: true`). Cannot be used together with `insecureHTTPParser`. **Default:** `'strict'`.",
                          "default": "`'strict'`",
                          "desc": "`'insecure'`: Disables all header value validation (equivalent to `insecureHTTPParser: true`). Cannot be used together with `insecureHTTPParser`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`insecureHTTPParser` {boolean} If set to `true`, it will use an HTTP parser with leniency flags enabled. Using the insecure parser should be avoided. See `--insecure-http-parser` for more information. **Default:** `false`.",
                      "name": "insecureHTTPParser",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, it will use an HTTP parser with leniency flags enabled. Using the insecure parser should be avoided. See `--insecure-http-parser` for more information."
                    },
                    {
                      "textRaw": "`IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`. **Default:** `IncomingMessage`.",
                      "name": "IncomingMessage",
                      "type": "http.IncomingMessage",
                      "default": "`IncomingMessage`",
                      "desc": "Specifies the `IncomingMessage` class to be used. Useful for extending the original `IncomingMessage`."
                    },
                    {
                      "textRaw": "`joinDuplicateHeaders` {boolean} If set to `true`, this option allows joining the field line values of multiple headers in a request with a comma (`, `) instead of discarding the duplicates. For more information, refer to `message.headers`. **Default:** `false`.",
                      "name": "joinDuplicateHeaders",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, this option allows joining the field line values of multiple headers in a request with a comma (`, `) instead of discarding the duplicates. For more information, refer to `message.headers`."
                    },
                    {
                      "textRaw": "`keepAlive` {boolean} If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, similarly on what is done in [`socket.setKeepAlive([enable][, initialDelay])`][`socket.setKeepAlive(enable, initialDelay)`]. **Default:** `false`.",
                      "name": "keepAlive",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, similarly on what is done in [`socket.setKeepAlive([enable][, initialDelay])`][`socket.setKeepAlive(enable, initialDelay)`]."
                    },
                    {
                      "textRaw": "`keepAliveInitialDelay` {number} If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. **Default:** `0`.",
                      "name": "keepAliveInitialDelay",
                      "type": "number",
                      "default": "`0`",
                      "desc": "If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket."
                    },
                    {
                      "textRaw": "`keepAliveTimeout`: The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. See `server.keepAliveTimeout` for more information. **Default:** `5000`.",
                      "name": "keepAliveTimeout",
                      "default": "`5000`",
                      "desc": "The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. See `server.keepAliveTimeout` for more information."
                    },
                    {
                      "textRaw": "`maxHeaderSize` {number} Optionally overrides the value of `--max-http-header-size` for requests received by this server, i.e. the maximum length of request headers in bytes. **Default:** 16384 (16 KiB).",
                      "name": "maxHeaderSize",
                      "type": "number",
                      "default": "16384 (16 KiB)",
                      "desc": "Optionally overrides the value of `--max-http-header-size` for requests received by this server, i.e. the maximum length of request headers in bytes."
                    },
                    {
                      "textRaw": "`noDelay` {boolean} If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. **Default:** `true`.",
                      "name": "noDelay",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received."
                    },
                    {
                      "textRaw": "`requestTimeout`: Sets the timeout value in milliseconds for receiving the entire request from the client. See `server.requestTimeout` for more information. **Default:** `300000`.",
                      "name": "requestTimeout",
                      "default": "`300000`",
                      "desc": "Sets the timeout value in milliseconds for receiving the entire request from the client. See `server.requestTimeout` for more information."
                    },
                    {
                      "textRaw": "`requireHostHeader` {boolean} If set to `true`, it forces the server to respond with a 400 (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header (as mandated by the specification). **Default:** `true`.",
                      "name": "requireHostHeader",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If set to `true`, it forces the server to respond with a 400 (Bad Request) status code to any HTTP/1.1 request message that lacks a Host header (as mandated by the specification)."
                    },
                    {
                      "textRaw": "`ServerResponse` {http.ServerResponse} Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`. **Default:** `ServerResponse`.",
                      "name": "ServerResponse",
                      "type": "http.ServerResponse",
                      "default": "`ServerResponse`",
                      "desc": "Specifies the `ServerResponse` class to be used. Useful for extending the original `ServerResponse`."
                    },
                    {
                      "textRaw": "`shouldUpgradeCallback(request)` {Function} A callback which receives an incoming request and returns a boolean, to control which upgrade attempts should be accepted. Accepted upgrades will fire an `'upgrade'` event (or their sockets will be destroyed, if no listener is registered) while rejected upgrades will fire a `'request'` event like any non-upgrade request. This options defaults to `() => server.listenerCount('upgrade') > 0`.",
                      "name": "shouldUpgradeCallback(request)",
                      "type": "Function",
                      "desc": "A callback which receives an incoming request and returns a boolean, to control which upgrade attempts should be accepted. Accepted upgrades will fire an `'upgrade'` event (or their sockets will be destroyed, if no listener is registered) while rejected upgrades will fire a `'request'` event like any non-upgrade request. This options defaults to `() => server.listenerCount('upgrade') > 0`."
                    },
                    {
                      "textRaw": "`uniqueHeaders` {Array} A list of response headers that should be sent only once. If the header's value is an array, the items will be joined using `; `.",
                      "name": "uniqueHeaders",
                      "type": "Array",
                      "desc": "A list of response headers that should be sent only once. If the header's value is an array, the items will be joined using `; `."
                    },
                    {
                      "textRaw": "`rejectNonStandardBodyWrites` {boolean} If set to `true`, an error is thrown when writing to an HTTP response which does not have a body. **Default:** `false`.",
                      "name": "rejectNonStandardBodyWrites",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, an error is thrown when writing to an HTTP response which does not have a body."
                    },
                    {
                      "textRaw": "`optimizeEmptyRequests` {boolean} If set to `true`, requests without `Content-Length` or `Transfer-Encoding` headers (indicating no body) will be initialized with an already-ended body stream, so they will never emit any stream events (like `'data'` or `'end'`). You can use `req.readableEnded` to detect this case. **Default:** `false`.",
                      "name": "optimizeEmptyRequests",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, requests without `Content-Length` or `Transfer-Encoding` headers (indicating no body) will be initialized with an already-ended body stream, so they will never emit any stream events (like `'data'` or `'end'`). You can use `req.readableEnded` to detect this case."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`requestListener` {Function}",
                  "name": "requestListener",
                  "type": "Function",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {http.Server}",
                "name": "return",
                "type": "http.Server"
              }
            }
          ],
          "desc": "<p>Returns a new instance of <a href=\"#class-httpserver\"><code>http.Server</code></a>.</p>\n<p>The <code>requestListener</code> is a function which is automatically\nadded to the <a href=\"#event-request\"><code>'request'</code></a> event.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\n\n// Create a local server to receive data from\nconst server = http.createServer((req, res) => {\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(JSON.stringify({\n    data: 'Hello World!',\n  }));\n});\n\nserver.listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\n// Create a local server to receive data from\nconst server = http.createServer((req, res) => {\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(JSON.stringify({\n    data: 'Hello World!',\n  }));\n});\n\nserver.listen(8000);\n</code></pre>\n<pre><code class=\"language-mjs\">import http from 'node:http';\n\n// Create a local server to receive data from\nconst server = http.createServer();\n\n// Listen to the request event\nserver.on('request', (request, res) => {\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(JSON.stringify({\n    data: 'Hello World!',\n  }));\n});\n\nserver.listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\n// Create a local server to receive data from\nconst server = http.createServer();\n\n// Listen to the request event\nserver.on('request', (request, res) => {\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(JSON.stringify({\n    data: 'Hello World!',\n  }));\n});\n\nserver.listen(8000);\n</code></pre>"
        },
        {
          "textRaw": "`http.get(options[, callback])`",
          "name": "get",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "options"
                },
                {
                  "name": "callback",
                  "optional": true
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`http.get(url[, options][, callback])`",
          "name": "get",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.6"
            ],
            "changes": [
              {
                "version": "v10.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/21616",
                "description": "The `url` parameter can now be passed along with a separate `options` object."
              },
              {
                "version": "v7.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/10638",
                "description": "The `options` parameter can be a WHATWG `URL` object."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`url` {string|URL}",
                  "name": "url",
                  "type": "string|URL"
                },
                {
                  "textRaw": "`options` {Object} Accepts the same `options` as `http.request()`, with the method set to GET by default.",
                  "name": "options",
                  "type": "Object",
                  "desc": "Accepts the same `options` as `http.request()`, with the method set to GET by default.",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {http.ClientRequest}",
                "name": "return",
                "type": "http.ClientRequest"
              }
            }
          ],
          "desc": "<p>Since most requests are GET requests without bodies, Node.js provides this\nconvenience method. The only difference between this method and\n<a href=\"#httprequestoptions-callback\"><code>http.request()</code></a> is that it sets the method to GET by default and calls <code>req.end()</code>\nautomatically. The callback must take care to consume the response\ndata for reasons stated in <a href=\"#class-httpclientrequest\"><code>http.ClientRequest</code></a> section.</p>\n<p>The <code>callback</code> is invoked with a single argument that is an instance of\n<a href=\"#class-httpincomingmessage\"><code>http.IncomingMessage</code></a>.</p>\n<p>JSON fetching example:</p>\n<pre><code class=\"language-js\">http.get('http://localhost:8000/', (res) => {\n  const { statusCode } = res;\n  const contentType = res.headers['content-type'];\n\n  let error;\n  // Any 2xx status code signals a successful response but\n  // here we're only checking for 200.\n  if (statusCode !== 200) {\n    error = new Error('Request Failed.\\n' +\n                      `Status Code: ${statusCode}`);\n  } else if (!/^application\\/json/.test(contentType)) {\n    error = new Error('Invalid content-type.\\n' +\n                      `Expected application/json but received ${contentType}`);\n  }\n  if (error) {\n    console.error(error.message);\n    // Consume response data to free up memory\n    res.resume();\n    return;\n  }\n\n  res.setEncoding('utf8');\n  let rawData = '';\n  res.on('data', (chunk) => { rawData += chunk; });\n  res.on('end', () => {\n    try {\n      const parsedData = JSON.parse(rawData);\n      console.log(parsedData);\n    } catch (e) {\n      console.error(e.message);\n    }\n  });\n}).on('error', (e) => {\n  console.error(`Got error: ${e.message}`);\n});\n\n// Create a local server to receive data from\nconst server = http.createServer((req, res) => {\n  res.writeHead(200, { 'Content-Type': 'application/json' });\n  res.end(JSON.stringify({\n    data: 'Hello World!',\n  }));\n});\n\nserver.listen(8000);\n</code></pre>"
        },
        {
          "textRaw": "`http.request(options[, callback])`",
          "name": "request",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "options"
                },
                {
                  "name": "callback",
                  "optional": true
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`http.request(url[, options][, callback])`",
          "name": "request",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.6"
            ],
            "changes": [
              {
                "version": "v26.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/61597",
                "description": "The `httpValidation` option is supported now."
              },
              {
                "version": [
                  "v16.7.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/39310",
                "description": "When using a `URL` object parsed username and password will now be properly URI decoded."
              },
              {
                "version": [
                  "v15.3.0",
                  "v14.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/36048",
                "description": "It is possible to abort a request with an AbortSignal."
              },
              {
                "version": [
                  "v13.8.0",
                  "v12.15.0",
                  "v10.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/31448",
                "description": "The `insecureHTTPParser` option is supported now."
              },
              {
                "version": "v13.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/30570",
                "description": "The `maxHeaderSize` option is supported now."
              },
              {
                "version": "v10.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/21616",
                "description": "The `url` parameter can now be passed along with a separate `options` object."
              },
              {
                "version": "v7.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/10638",
                "description": "The `options` parameter can be a WHATWG `URL` object."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`url` {string|URL}",
                  "name": "url",
                  "type": "string|URL"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`agent` {http.Agent|boolean} Controls `Agent` behavior. Possible values:",
                      "name": "agent",
                      "type": "http.Agent|boolean",
                      "desc": "Controls `Agent` behavior. Possible values:",
                      "options": [
                        {
                          "textRaw": "`undefined` (default): use `http.globalAgent` for this host and port.",
                          "name": "undefined",
                          "desc": "(default): use `http.globalAgent` for this host and port."
                        },
                        {
                          "textRaw": "`Agent` object: explicitly use the passed in `Agent`.",
                          "name": "Agent",
                          "desc": "object: explicitly use the passed in `Agent`."
                        },
                        {
                          "textRaw": "`false`: causes a new `Agent` with default values to be used.",
                          "name": "false",
                          "desc": "causes a new `Agent` with default values to be used."
                        }
                      ]
                    },
                    {
                      "textRaw": "`auth` {string} Basic authentication (`'user:password'`) to compute an Authorization header.",
                      "name": "auth",
                      "type": "string",
                      "desc": "Basic authentication (`'user:password'`) to compute an Authorization header."
                    },
                    {
                      "textRaw": "`createConnection` {Function} A function that produces a socket/stream to use for the request when the `agent` option is not used. This can be used to avoid creating a custom `Agent` class just to override the default `createConnection` function. See `agent.createConnection()` for more details. Any `Duplex` stream is a valid return value.",
                      "name": "createConnection",
                      "type": "Function",
                      "desc": "A function that produces a socket/stream to use for the request when the `agent` option is not used. This can be used to avoid creating a custom `Agent` class just to override the default `createConnection` function. See `agent.createConnection()` for more details. Any `Duplex` stream is a valid return value."
                    },
                    {
                      "textRaw": "`defaultPort` {number} Default port for the protocol. **Default:** `agent.defaultPort` if an `Agent` is used, else `undefined`.",
                      "name": "defaultPort",
                      "type": "number",
                      "default": "`agent.defaultPort` if an `Agent` is used, else `undefined`",
                      "desc": "Default port for the protocol."
                    },
                    {
                      "textRaw": "`family` {number} IP address family to use when resolving `host` or `hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be used.",
                      "name": "family",
                      "type": "number",
                      "desc": "IP address family to use when resolving `host` or `hostname`. Valid values are `4` or `6`. When unspecified, both IP v4 and v6 will be used."
                    },
                    {
                      "textRaw": "`headers` {Object|Array} An object or an array of strings containing request headers. The array is in the same format as `message.rawHeaders`.",
                      "name": "headers",
                      "type": "Object|Array",
                      "desc": "An object or an array of strings containing request headers. The array is in the same format as `message.rawHeaders`."
                    },
                    {
                      "textRaw": "`hints` {number} Optional `dns.lookup()` hints.",
                      "name": "hints",
                      "type": "number",
                      "desc": "Optional `dns.lookup()` hints."
                    },
                    {
                      "textRaw": "`host` {string} A domain name or IP address of the server to issue the request to. **Default:** `'localhost'`.",
                      "name": "host",
                      "type": "string",
                      "default": "`'localhost'`",
                      "desc": "A domain name or IP address of the server to issue the request to."
                    },
                    {
                      "textRaw": "`hostname` {string} Alias for `host`. To support `url.parse()`, `hostname` will be used if both `host` and `hostname` are specified.",
                      "name": "hostname",
                      "type": "string",
                      "desc": "Alias for `host`. To support `url.parse()`, `hostname` will be used if both `host` and `hostname` are specified."
                    },
                    {
                      "textRaw": "`httpValidation` {string} Controls HTTP header value validation strictness for outgoing requests. Accepted values are:",
                      "name": "httpValidation",
                      "type": "string",
                      "desc": "Controls HTTP header value validation strictness for outgoing requests. Accepted values are:",
                      "options": [
                        {
                          "textRaw": "`'strict'`: Strictest validation; rejects any non-ASCII or control characters in header values.",
                          "desc": "`'strict'`: Strictest validation; rejects any non-ASCII or control characters in header values."
                        },
                        {
                          "textRaw": "`'relaxed'`: Allows a limited set of non-ASCII characters in header values, aligning with the Fetch specification.",
                          "desc": "`'relaxed'`: Allows a limited set of non-ASCII characters in header values, aligning with the Fetch specification."
                        },
                        {
                          "textRaw": "`'insecure'`: Disables all header value validation (equivalent to `insecureHTTPParser: true`). Cannot be used together with `insecureHTTPParser`. **Default:** `'strict'`.",
                          "default": "`'strict'`",
                          "desc": "`'insecure'`: Disables all header value validation (equivalent to `insecureHTTPParser: true`). Cannot be used together with `insecureHTTPParser`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`insecureHTTPParser` {boolean} If set to `true`, it will use an HTTP parser with leniency flags enabled. Using the insecure parser should be avoided. See `--insecure-http-parser` for more information. **Default:** `false`",
                      "name": "insecureHTTPParser",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, it will use an HTTP parser with leniency flags enabled. Using the insecure parser should be avoided. See `--insecure-http-parser` for more information."
                    },
                    {
                      "textRaw": "`joinDuplicateHeaders` {boolean} It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. See `message.headers` for more information. **Default:** `false`.",
                      "name": "joinDuplicateHeaders",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "It joins the field line values of multiple headers in a request with `, ` instead of discarding the duplicates. See `message.headers` for more information."
                    },
                    {
                      "textRaw": "`localAddress` {string} Local interface to bind for network connections.",
                      "name": "localAddress",
                      "type": "string",
                      "desc": "Local interface to bind for network connections."
                    },
                    {
                      "textRaw": "`localPort` {number} Local port to connect from.",
                      "name": "localPort",
                      "type": "number",
                      "desc": "Local port to connect from."
                    },
                    {
                      "textRaw": "`lookup` {Function} Custom lookup function. **Default:** `dns.lookup()`.",
                      "name": "lookup",
                      "type": "Function",
                      "default": "`dns.lookup()`",
                      "desc": "Custom lookup function."
                    },
                    {
                      "textRaw": "`maxHeaderSize` {number} Optionally overrides the value of `--max-http-header-size` (the maximum length of response headers in bytes) for responses received from the server. **Default:** 16384 (16 KiB).",
                      "name": "maxHeaderSize",
                      "type": "number",
                      "default": "16384 (16 KiB)",
                      "desc": "Optionally overrides the value of `--max-http-header-size` (the maximum length of response headers in bytes) for responses received from the server."
                    },
                    {
                      "textRaw": "`method` {string} A string specifying the HTTP request method. **Default:** `'GET'`.",
                      "name": "method",
                      "type": "string",
                      "default": "`'GET'`",
                      "desc": "A string specifying the HTTP request method."
                    },
                    {
                      "textRaw": "`path` {string} Request path. Should include query string if any. E.G. `'/index.html?page=12'`. An exception is thrown when the request path contains illegal characters. Currently, only spaces are rejected but that may change in the future. **Default:** `'/'`.",
                      "name": "path",
                      "type": "string",
                      "default": "`'/'`",
                      "desc": "Request path. Should include query string if any. E.G. `'/index.html?page=12'`. An exception is thrown when the request path contains illegal characters. Currently, only spaces are rejected but that may change in the future."
                    },
                    {
                      "textRaw": "`port` {number} Port of remote server. **Default:** `defaultPort` if set, else `80`.",
                      "name": "port",
                      "type": "number",
                      "default": "`defaultPort` if set, else `80`",
                      "desc": "Port of remote server."
                    },
                    {
                      "textRaw": "`protocol` {string} Protocol to use. **Default:** `'http:'`.",
                      "name": "protocol",
                      "type": "string",
                      "default": "`'http:'`",
                      "desc": "Protocol to use."
                    },
                    {
                      "textRaw": "`setDefaultHeaders` {boolean}: Specifies whether or not to automatically add default headers such as `Connection`, `Content-Length`, `Transfer-Encoding`, and `Host`. If set to `false` then all necessary headers must be added manually. Defaults to `true`.",
                      "name": "setDefaultHeaders",
                      "type": "boolean",
                      "desc": ": Specifies whether or not to automatically add default headers such as `Connection`, `Content-Length`, `Transfer-Encoding`, and `Host`. If set to `false` then all necessary headers must be added manually. Defaults to `true`."
                    },
                    {
                      "textRaw": "`setHost` {boolean}: Specifies whether or not to automatically add the `Host` header. If provided, this overrides `setDefaultHeaders`. Defaults to `true`.",
                      "name": "setHost",
                      "type": "boolean",
                      "desc": ": Specifies whether or not to automatically add the `Host` header. If provided, this overrides `setDefaultHeaders`. Defaults to `true`."
                    },
                    {
                      "textRaw": "`signal` {AbortSignal}: An AbortSignal that may be used to abort an ongoing request.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": ": An AbortSignal that may be used to abort an ongoing request."
                    },
                    {
                      "textRaw": "`socketPath` {string} Unix domain socket. Cannot be used if one of `host` or `port` is specified, as those specify a TCP Socket.",
                      "name": "socketPath",
                      "type": "string",
                      "desc": "Unix domain socket. Cannot be used if one of `host` or `port` is specified, as those specify a TCP Socket."
                    },
                    {
                      "textRaw": "`timeout` {number}: A number specifying the socket timeout in milliseconds. This will set the timeout before the socket is connected.",
                      "name": "timeout",
                      "type": "number",
                      "desc": ": A number specifying the socket timeout in milliseconds. This will set the timeout before the socket is connected."
                    },
                    {
                      "textRaw": "`uniqueHeaders` {Array} A list of request headers that should be sent only once. If the header's value is an array, the items will be joined using `; `.",
                      "name": "uniqueHeaders",
                      "type": "Array",
                      "desc": "A list of request headers that should be sent only once. If the header's value is an array, the items will be joined using `; `."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {http.ClientRequest}",
                "name": "return",
                "type": "http.ClientRequest"
              }
            }
          ],
          "desc": "<p><code>options</code> in <a href=\"net.html#socketconnectoptions-connectlistener\"><code>socket.connect()</code></a> are also supported.</p>\n<p>Node.js maintains several connections per server to make HTTP requests.\nThis function allows one to transparently issue requests.</p>\n<p><code>url</code> can be a string or a <a href=\"url.html#the-whatwg-url-api\"><code>URL</code></a> object. If <code>url</code> is a\nstring, it is automatically parsed with <a href=\"url.html#new-urlinput-base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#the-whatwg-url-api\"><code>URL</code></a>\nobject, it will be automatically converted to an ordinary <code>options</code> object.</p>\n<p>If both <code>url</code> and <code>options</code> are specified, the objects are merged, with the\n<code>options</code> properties taking precedence.</p>\n<p>The optional <code>callback</code> parameter will be added as a one-time listener for\nthe <a href=\"#event-response\"><code>'response'</code></a> event.</p>\n<p><code>http.request()</code> returns an instance of the <a href=\"#class-httpclientrequest\"><code>http.ClientRequest</code></a>\nclass. The <code>ClientRequest</code> instance is a writable stream. If one needs to\nupload a file with a POST request, then write to the <code>ClientRequest</code> object.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\nimport { Buffer } from 'node:buffer';\n\nconst postData = JSON.stringify({\n  'msg': 'Hello World!',\n});\n\nconst options = {\n  hostname: 'www.google.com',\n  port: 80,\n  path: '/upload',\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json',\n    'Content-Length': Buffer.byteLength(postData),\n  },\n};\n\nconst req = http.request(options, (res) => {\n  console.log(`STATUS: ${res.statusCode}`);\n  console.log(`HEADERS: ${JSON.stringify(res.headers)}`);\n  res.setEncoding('utf8');\n  res.on('data', (chunk) => {\n    console.log(`BODY: ${chunk}`);\n  });\n  res.on('end', () => {\n    console.log('No more data in response.');\n  });\n});\n\nreq.on('error', (e) => {\n  console.error(`problem with request: ${e.message}`);\n});\n\n// Write data to request body\nreq.write(postData);\nreq.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\nconst postData = JSON.stringify({\n  'msg': 'Hello World!',\n});\n\nconst options = {\n  hostname: 'www.google.com',\n  port: 80,\n  path: '/upload',\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json',\n    'Content-Length': Buffer.byteLength(postData),\n  },\n};\n\nconst req = http.request(options, (res) => {\n  console.log(`STATUS: ${res.statusCode}`);\n  console.log(`HEADERS: ${JSON.stringify(res.headers)}`);\n  res.setEncoding('utf8');\n  res.on('data', (chunk) => {\n    console.log(`BODY: ${chunk}`);\n  });\n  res.on('end', () => {\n    console.log('No more data in response.');\n  });\n});\n\nreq.on('error', (e) => {\n  console.error(`problem with request: ${e.message}`);\n});\n\n// Write data to request body\nreq.write(postData);\nreq.end();\n</code></pre>\n<p>In the example <code>req.end()</code> was called. With <code>http.request()</code> one\nmust always call <code>req.end()</code> to signify the end of the request -\neven if there is no data being written to the request body.</p>\n<p>If any error is encountered during the request (be that with DNS resolution,\nTCP level errors, or actual HTTP parse errors) an <code>'error'</code> event is emitted\non the returned request object. As with all <code>'error'</code> events, if no listeners\nare registered the error will be thrown.</p>\n<p>There are a few special headers that should be noted.</p>\n<ul>\n<li>\n<p>Sending a 'Connection: keep-alive' will notify Node.js that the connection to\nthe server should be persisted until the next request.</p>\n</li>\n<li>\n<p>Sending a 'Content-Length' header will disable the default chunked encoding.</p>\n</li>\n<li>\n<p>Sending an 'Expect' header will immediately send the request headers.\nUsually, when sending 'Expect: 100-continue', both a timeout and a listener\nfor the <code>'continue'</code> event should be set. See RFC 2616 Section 8.2.3 for more\ninformation.</p>\n</li>\n<li>\n<p>Sending an Authorization header will override using the <code>auth</code> option\nto compute basic authentication.</p>\n</li>\n</ul>\n<p>Example using a <a href=\"url.html#the-whatwg-url-api\"><code>URL</code></a> as <code>options</code>:</p>\n<pre><code class=\"language-js\">const options = new URL('http://abc:xyz@example.com');\n\nconst req = http.request(options, (res) => {\n  // ...\n});\n</code></pre>\n<p>In a successful request, the following events will be emitted in the following\norder:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li><code>'response'</code>\n<ul>\n<li><code>'data'</code> any number of times, on the <code>res</code> object\n(<code>'data'</code> will not be emitted at all if the response body is empty, for\ninstance, in most redirects)</li>\n<li><code>'end'</code> on the <code>res</code> object</li>\n</ul>\n</li>\n<li><code>'close'</code></li>\n</ul>\n<p>In the case of a connection error, the following events will be emitted:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li><code>'error'</code></li>\n<li><code>'close'</code></li>\n</ul>\n<p>In the case of a premature connection close before the response is received,\nthe following events will be emitted in the following order:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li><code>'error'</code> with an error with message <code>'Error: socket hang up'</code> and code\n<code>'ECONNRESET'</code></li>\n<li><code>'close'</code></li>\n</ul>\n<p>In the case of a premature connection close after the response is received,\nthe following events will be emitted in the following order:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li><code>'response'</code>\n<ul>\n<li><code>'data'</code> any number of times, on the <code>res</code> object</li>\n</ul>\n</li>\n<li>(connection closed here)</li>\n<li><code>'aborted'</code> on the <code>res</code> object</li>\n<li><code>'close'</code></li>\n<li><code>'error'</code> on the <code>res</code> object with an error with message\n<code>'Error: aborted'</code> and code <code>'ECONNRESET'</code></li>\n<li><code>'close'</code> on the <code>res</code> object</li>\n</ul>\n<p>If <code>req.destroy()</code> is called before a socket is assigned, the following\nevents will be emitted in the following order:</p>\n<ul>\n<li>(<code>req.destroy()</code> called here)</li>\n<li><code>'error'</code> with an error with message <code>'Error: socket hang up'</code> and code\n<code>'ECONNRESET'</code>, or the error with which <code>req.destroy()</code> was called</li>\n<li><code>'close'</code></li>\n</ul>\n<p>If <code>req.destroy()</code> is called before the connection succeeds, the following\nevents will be emitted in the following order:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li>(<code>req.destroy()</code> called here)</li>\n<li><code>'error'</code> with an error with message <code>'Error: socket hang up'</code> and code\n<code>'ECONNRESET'</code>, or the error with which <code>req.destroy()</code> was called</li>\n<li><code>'close'</code></li>\n</ul>\n<p>If <code>req.destroy()</code> is called after the response is received, the following\nevents will be emitted in the following order:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li><code>'response'</code>\n<ul>\n<li><code>'data'</code> any number of times, on the <code>res</code> object</li>\n</ul>\n</li>\n<li>(<code>req.destroy()</code> called here)</li>\n<li><code>'aborted'</code> on the <code>res</code> object</li>\n<li><code>'close'</code></li>\n<li><code>'error'</code> on the <code>res</code> object with an error with message <code>'Error: aborted'</code>\nand code <code>'ECONNRESET'</code>, or the error with which <code>req.destroy()</code> was called</li>\n<li><code>'close'</code> on the <code>res</code> object</li>\n</ul>\n<p>If <code>req.abort()</code> is called before a socket is assigned, the following\nevents will be emitted in the following order:</p>\n<ul>\n<li>(<code>req.abort()</code> called here)</li>\n<li><code>'abort'</code></li>\n<li><code>'close'</code></li>\n</ul>\n<p>If <code>req.abort()</code> is called before the connection succeeds, the following\nevents will be emitted in the following order:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li>(<code>req.abort()</code> called here)</li>\n<li><code>'abort'</code></li>\n<li><code>'error'</code> with an error with message <code>'Error: socket hang up'</code> and code\n<code>'ECONNRESET'</code></li>\n<li><code>'close'</code></li>\n</ul>\n<p>If <code>req.abort()</code> is called after the response is received, the following\nevents will be emitted in the following order:</p>\n<ul>\n<li><code>'socket'</code></li>\n<li><code>'response'</code>\n<ul>\n<li><code>'data'</code> any number of times, on the <code>res</code> object</li>\n</ul>\n</li>\n<li>(<code>req.abort()</code> called here)</li>\n<li><code>'abort'</code></li>\n<li><code>'aborted'</code> on the <code>res</code> object</li>\n<li><code>'error'</code> on the <code>res</code> object with an error with message\n<code>'Error: aborted'</code> and code <code>'ECONNRESET'</code>.</li>\n<li><code>'close'</code></li>\n<li><code>'close'</code> on the <code>res</code> object</li>\n</ul>\n<p>Setting the <code>timeout</code> option or using the <code>setTimeout()</code> function will\nnot abort the request or do anything besides add a <code>'timeout'</code> event.</p>\n<p>Passing an <code>AbortSignal</code> and then calling <code>abort()</code> on the corresponding\n<code>AbortController</code> will behave the same way as calling <code>.destroy()</code> on the\nrequest. Specifically, the <code>'error'</code> event will be emitted with an error with\nthe message <code>'AbortError: The operation was aborted'</code>, the code <code>'ABORT_ERR'</code>\nand the <code>cause</code>, if one was provided.</p>"
        },
        {
          "textRaw": "`http.validateHeaderName(name[, label])`",
          "name": "validateHeaderName",
          "type": "method",
          "meta": {
            "added": [
              "v14.3.0"
            ],
            "changes": [
              {
                "version": [
                  "v19.5.0",
                  "v18.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46143",
                "description": "The `label` parameter is added."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`name` {string}",
                  "name": "name",
                  "type": "string"
                },
                {
                  "textRaw": "`label` {string} Label for error message. **Default:** `'Header name'`.",
                  "name": "label",
                  "type": "string",
                  "default": "`'Header name'`",
                  "desc": "Label for error message.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Performs the low-level validations on the provided <code>name</code> that are done when\n<code>res.setHeader(name, value)</code> is called.</p>\n<p>Passing illegal value as <code>name</code> will result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown,\nidentified by <code>code: 'ERR_INVALID_HTTP_TOKEN'</code>.</p>\n<p>It is not necessary to use this method before passing headers to an HTTP request\nor response. The HTTP module will automatically validate such headers.</p>\n<p>Example:</p>\n<pre><code class=\"language-mjs\">import { validateHeaderName } from 'node:http';\n\ntry {\n  validateHeaderName('');\n} catch (err) {\n  console.error(err instanceof TypeError); // --> true\n  console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN'\n  console.error(err.message); // --> 'Header name must be a valid HTTP token [\"\"]'\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { validateHeaderName } = require('node:http');\n\ntry {\n  validateHeaderName('');\n} catch (err) {\n  console.error(err instanceof TypeError); // --> true\n  console.error(err.code); // --> 'ERR_INVALID_HTTP_TOKEN'\n  console.error(err.message); // --> 'Header name must be a valid HTTP token [\"\"]'\n}\n</code></pre>"
        },
        {
          "textRaw": "`http.validateHeaderValue(name, value)`",
          "name": "validateHeaderValue",
          "type": "method",
          "meta": {
            "added": [
              "v14.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`name` {string}",
                  "name": "name",
                  "type": "string"
                },
                {
                  "textRaw": "`value` {any}",
                  "name": "value",
                  "type": "any"
                }
              ]
            }
          ],
          "desc": "<p>Performs the low-level validations on the provided <code>value</code> that are done when\n<code>res.setHeader(name, value)</code> is called.</p>\n<p>Passing illegal value as <code>value</code> will result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown.</p>\n<ul>\n<li>Undefined value error is identified by <code>code: 'ERR_HTTP_INVALID_HEADER_VALUE'</code>.</li>\n<li>Invalid value character error is identified by <code>code: 'ERR_INVALID_CHAR'</code>.</li>\n</ul>\n<p>It is not necessary to use this method before passing headers to an HTTP request\nor response. The HTTP module will automatically validate such headers.</p>\n<p>Examples:</p>\n<pre><code class=\"language-mjs\">import { validateHeaderValue } from 'node:http';\n\ntry {\n  validateHeaderValue('x-my-header', undefined);\n} catch (err) {\n  console.error(err instanceof TypeError); // --> true\n  console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true\n  console.error(err.message); // --> 'Invalid value \"undefined\" for header \"x-my-header\"'\n}\n\ntry {\n  validateHeaderValue('x-my-header', 'oʊmɪɡə');\n} catch (err) {\n  console.error(err instanceof TypeError); // --> true\n  console.error(err.code === 'ERR_INVALID_CHAR'); // --> true\n  console.error(err.message); // --> 'Invalid character in header content [\"x-my-header\"]'\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { validateHeaderValue } = require('node:http');\n\ntry {\n  validateHeaderValue('x-my-header', undefined);\n} catch (err) {\n  console.error(err instanceof TypeError); // --> true\n  console.error(err.code === 'ERR_HTTP_INVALID_HEADER_VALUE'); // --> true\n  console.error(err.message); // --> 'Invalid value \"undefined\" for header \"x-my-header\"'\n}\n\ntry {\n  validateHeaderValue('x-my-header', 'oʊmɪɡə');\n} catch (err) {\n  console.error(err instanceof TypeError); // --> true\n  console.error(err.code === 'ERR_INVALID_CHAR'); // --> true\n  console.error(err.message); // --> 'Invalid character in header content [\"x-my-header\"]'\n}\n</code></pre>"
        },
        {
          "textRaw": "`http.setMaxIdleHTTPParsers(max)`",
          "name": "setMaxIdleHTTPParsers",
          "type": "method",
          "meta": {
            "added": [
              "v18.8.0",
              "v16.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`max` {number} **Default:** `1000`.",
                  "name": "max",
                  "type": "number",
                  "default": "`1000`"
                }
              ]
            }
          ],
          "desc": "<p>Set the maximum number of idle HTTP parsers.</p>"
        },
        {
          "textRaw": "`http.setGlobalProxyFromEnv([proxyEnv])`",
          "name": "setGlobalProxyFromEnv",
          "type": "method",
          "meta": {
            "added": [
              "v25.4.0",
              "v24.14.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`proxyEnv` {Object} An object containing proxy configuration. This accepts the same options as the `proxyEnv` option accepted by `Agent`. **Default:** `process.env`.",
                  "name": "proxyEnv",
                  "type": "Object",
                  "default": "`process.env`",
                  "desc": "An object containing proxy configuration. This accepts the same options as the `proxyEnv` option accepted by `Agent`.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Function} A function that restores the original agent and dispatcher settings to the state before this `http.setGlobalProxyFromEnv()` is invoked.",
                "name": "return",
                "type": "Function",
                "desc": "A function that restores the original agent and dispatcher settings to the state before this `http.setGlobalProxyFromEnv()` is invoked."
              }
            }
          ],
          "desc": "<p>Dynamically resets the global configurations to enable built-in proxy support for\n<code>fetch()</code> and <code>http.request()</code>/<code>https.request()</code> at runtime, as an alternative\nto using the <code>--use-env-proxy</code> flag or <code>NODE_USE_ENV_PROXY</code> environment variable.\nIt can also be used to override settings configured from the environment variables.</p>\n<p>As this function resets the global configurations, any previously configured\n<code>http.globalAgent</code>, <code>https.globalAgent</code> or undici global dispatcher would be\noverridden after this function is invoked. It's recommended to invoke it before any\nrequests are made and avoid invoking it in the middle of any requests.</p>\n<p>See <a href=\"#built-in-proxy-support\">Built-in Proxy Support</a> for details on proxy URL formats and <code>NO_PROXY</code>\nsyntax.</p>"
        }
      ],
      "modules": [
        {
          "textRaw": "Built-in Proxy Support",
          "name": "built-in_proxy_support",
          "type": "module",
          "meta": {
            "added": [
              "v24.5.0",
              "v22.21.0"
            ],
            "changes": []
          },
          "stability": 1.1,
          "stabilityText": "Active development",
          "desc": "<p>When Node.js creates the global agent, if the <code>NODE_USE_ENV_PROXY</code> environment variable is\nset to <code>1</code> or <code>--use-env-proxy</code> is enabled, the global agent will be constructed\nwith <code>proxyEnv: process.env</code>, enabling proxy support based on the environment variables.</p>\n<p>To enable proxy support dynamically and globally, use <a href=\"#httpsetglobalproxyfromenvproxyenv\"><code>http.setGlobalProxyFromEnv()</code></a>.</p>\n<p>Custom agents can also be created with proxy support by passing a\n<code>proxyEnv</code> option when constructing the agent. The value can be <code>process.env</code>\nif they just want to inherit the configuration from the environment variables,\nor an object with specific setting overriding the environment.</p>\n<p>The following properties of the <code>proxyEnv</code> are checked to configure proxy\nsupport.</p>\n<ul>\n<li><code>HTTP_PROXY</code> or <code>http_proxy</code>: Proxy server URL for HTTP requests. If both are set,\n<code>http_proxy</code> takes precedence.</li>\n<li><code>HTTPS_PROXY</code> or <code>https_proxy</code>: Proxy server URL for HTTPS requests. If both are set,\n<code>https_proxy</code> takes precedence.</li>\n<li><code>NO_PROXY</code> or <code>no_proxy</code>: Comma-separated list of hosts to bypass the proxy. If both are set,\n<code>no_proxy</code> takes precedence.</li>\n</ul>\n<p>If the request is made to a Unix domain socket, the proxy settings will be ignored.</p>",
          "modules": [
            {
              "textRaw": "Proxy URL Format",
              "name": "proxy_url_format",
              "type": "module",
              "desc": "<p>Proxy URLs can use either HTTP or HTTPS protocols:</p>\n<ul>\n<li>HTTP proxy: <code>http://proxy.example.com:8080</code></li>\n<li>HTTPS proxy: <code>https://proxy.example.com:8080</code></li>\n<li>Proxy with authentication: <code>http://username:password@proxy.example.com:8080</code></li>\n</ul>",
              "displayName": "Proxy URL Format"
            },
            {
              "textRaw": "`NO_PROXY` Format",
              "name": "`no_proxy`_format",
              "type": "module",
              "desc": "<p>The <code>NO_PROXY</code> environment variable supports several formats:</p>\n<ul>\n<li><code>*</code> - Bypass proxy for all hosts</li>\n<li><code>example.com</code> - Exact host name match</li>\n<li><code>.example.com</code> - Domain suffix match (matches <code>sub.example.com</code>)</li>\n<li><code>*.example.com</code> - Wildcard domain match</li>\n<li><code>192.168.1.100</code> - Exact IP address match</li>\n<li><code>192.168.1.1-192.168.1.100</code> - IP address range</li>\n<li><code>example.com:8080</code> - Hostname with specific port</li>\n</ul>\n<p>Multiple entries should be separated by commas.</p>",
              "displayName": "`NO_PROXY` Format"
            },
            {
              "textRaw": "Example",
              "name": "example",
              "type": "module",
              "desc": "<p>To start a Node.js process with proxy support enabled for all requests sent\nthrough the default global agent, either use the <code>NODE_USE_ENV_PROXY</code> environment\nvariable:</p>\n<pre><code class=\"language-console\">NODE_USE_ENV_PROXY=1 HTTP_PROXY=http://proxy.example.com:8080 NO_PROXY=localhost,127.0.0.1 node client.js\n</code></pre>\n<p>Or the <code>--use-env-proxy</code> flag.</p>\n<pre><code class=\"language-console\">HTTP_PROXY=http://proxy.example.com:8080 NO_PROXY=localhost,127.0.0.1 node --use-env-proxy client.js\n</code></pre>\n<p>To enable proxy support dynamically and globally with <code>process.env</code> (the default option of <code>http.setGlobalProxyFromEnv()</code>):</p>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\n// Reads proxy-related environment variables from process.env\nconst restore = http.setGlobalProxyFromEnv();\n\n// Subsequent requests will use the configured proxies from environment variables\nhttp.get('http://www.example.com', (res) => {\n  // This request will be proxied if HTTP_PROXY or http_proxy is set\n});\n\nfetch('https://www.example.com', (res) => {\n  // This request will be proxied if HTTPS_PROXY or https_proxy is set\n});\n\n// To restore the original global agent and dispatcher settings, call the returned function.\n// restore();\n</code></pre>\n<pre><code class=\"language-mjs\">import http from 'node:http';\n\n// Reads proxy-related environment variables from process.env\nhttp.setGlobalProxyFromEnv();\n\n// Subsequent requests will use the configured proxies from environment variables\nhttp.get('http://www.example.com', (res) => {\n  // This request will be proxied if HTTP_PROXY or http_proxy is set\n});\n\nfetch('https://www.example.com', (res) => {\n  // This request will be proxied if HTTPS_PROXY or https_proxy is set\n});\n\n// To restore the original global agent and dispatcher settings, call the returned function.\n// restore();\n</code></pre>\n<p>To enable proxy support dynamically and globally with custom settings:</p>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\nconst restore = http.setGlobalProxyFromEnv({\n  http_proxy: 'http://proxy.example.com:8080',\n  https_proxy: 'https://proxy.example.com:8443',\n  no_proxy: 'localhost,127.0.0.1,.internal.example.com',\n});\n\n// Subsequent requests will use the configured proxies\nhttp.get('http://www.example.com', (res) => {\n  // This request will be proxied through proxy.example.com:8080\n});\n\nfetch('https://www.example.com', (res) => {\n  // This request will be proxied through proxy.example.com:8443\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import http from 'node:http';\n\nhttp.setGlobalProxyFromEnv({\n  http_proxy: 'http://proxy.example.com:8080',\n  https_proxy: 'https://proxy.example.com:8443',\n  no_proxy: 'localhost,127.0.0.1,.internal.example.com',\n});\n\n// Subsequent requests will use the configured proxies\nhttp.get('http://www.example.com', (res) => {\n  // This request will be proxied through proxy.example.com:8080\n});\n\nfetch('https://www.example.com', (res) => {\n  // This request will be proxied through proxy.example.com:8443\n});\n</code></pre>\n<p>To create a custom agent with built-in proxy support:</p>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n\n// Creating a custom agent with custom proxy support.\nconst agent = new http.Agent({ proxyEnv: { HTTP_PROXY: 'http://proxy.example.com:8080' } });\n\nhttp.request({\n  hostname: 'www.example.com',\n  port: 80,\n  path: '/',\n  agent,\n}, (res) => {\n  // This request will be proxied through proxy.example.com:8080 using the HTTP protocol.\n  console.log(`STATUS: ${res.statusCode}`);\n});\n</code></pre>\n<p>Alternatively, the following also works:</p>\n<pre><code class=\"language-cjs\">const http = require('node:http');\n// Use lower-cased option name.\nconst agent1 = new http.Agent({ proxyEnv: { http_proxy: 'http://proxy.example.com:8080' } });\n// Use values inherited from the environment variables, if the process is started with\n// HTTP_PROXY=http://proxy.example.com:8080 this will use the proxy server specified\n// in process.env.HTTP_PROXY.\nconst agent2 = new http.Agent({ proxyEnv: process.env });\n</code></pre>",
              "displayName": "Example"
            }
          ],
          "displayName": "Built-in Proxy Support"
        }
      ],
      "displayName": "HTTP",
      "source": "doc/api/http.md"
    },
    {
      "textRaw": "HTTP/2",
      "name": "http/2",
      "introduced_in": "v8.4.0",
      "type": "module",
      "meta": {
        "added": [
          "v8.4.0"
        ],
        "changes": [
          {
            "version": [
              "v15.3.0",
              "v14.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/36070",
            "description": "It is possible to abort a request with an AbortSignal."
          },
          {
            "version": "v15.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/34664",
            "description": "Requests with the `host` header (with or without `:authority`) can now be sent/received."
          },
          {
            "version": "v10.10.0",
            "pr-url": "https://github.com/nodejs/node/pull/22466",
            "description": "HTTP/2 is now Stable. Previously, it had been Experimental."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:http2</code> module provides an implementation of the <a href=\"https://tools.ietf.org/html/rfc7540\">HTTP/2</a> protocol.\nIt can be accessed using:</p>\n<pre><code class=\"language-js\">const http2 = require('node:http2');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Determining if crypto support is unavailable",
          "name": "determining_if_crypto_support_is_unavailable",
          "type": "module",
          "desc": "<p>It is possible for Node.js to be built without including support for the\n<code>node:crypto</code> module. In such cases, attempting to <code>import</code> from <code>node:http2</code> or\ncalling <code>require('node:http2')</code> will result in an error being thrown.</p>\n<p>When using CommonJS, the error thrown can be caught using try/catch:</p>\n<pre><code class=\"language-cjs\">let http2;\ntry {\n  http2 = require('node:http2');\n} catch (err) {\n  console.error('http2 support is disabled!');\n}\n</code></pre>\n<p>When using the lexical ESM <code>import</code> keyword, the error can only be\ncaught if a handler for <code>process.on('uncaughtException')</code> is registered\n<em>before</em> any attempt to load the module is made (using, for instance,\na preload module).</p>\n<p>When using ESM, if there is a chance that the code may be run on a build\nof Node.js where crypto support is not enabled, consider using the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import\"><code>import()</code></a> function instead of the lexical <code>import</code> keyword:</p>\n<pre><code class=\"language-mjs\">let http2;\ntry {\n  http2 = await import('node:http2');\n} catch (err) {\n  console.error('http2 support is disabled!');\n}\n</code></pre>",
          "displayName": "Determining if crypto support is unavailable"
        },
        {
          "textRaw": "Core API",
          "name": "core_api",
          "type": "module",
          "desc": "<p>The Core API provides a low-level interface designed specifically around\nsupport for HTTP/2 protocol features. It is specifically <em>not</em> designed for\ncompatibility with the existing <a href=\"http.html\">HTTP/1</a> module API. However,\nthe <a href=\"#compatibility-api\">Compatibility API</a> is.</p>\n<p>The <code>http2</code> Core API is much more symmetric between client and server than the\n<code>http</code> API. For instance, most events, like <code>'error'</code>, <code>'connect'</code> and\n<code>'stream'</code>, can be emitted either by client-side code or server-side code.</p>",
          "modules": [
            {
              "textRaw": "Server-side example",
              "name": "server-side_example",
              "type": "module",
              "desc": "<p>The following illustrates a simple HTTP/2 server using the Core API.\nSince there are no browsers known that support\n<a href=\"https://http2.github.io/faq/#does-http2-require-encryption\">unencrypted HTTP/2</a>, the use of\n<a href=\"#http2createsecureserveroptions-onrequesthandler\"><code>http2.createSecureServer()</code></a> is necessary when communicating\nwith browser clients.</p>\n<pre><code class=\"language-mjs\">import { createSecureServer } from 'node:http2';\nimport { readFileSync } from 'node:fs';\n\nconst server = createSecureServer({\n  key: readFileSync('localhost-privkey.pem'),\n  cert: readFileSync('localhost-cert.pem'),\n});\n\nserver.on('error', (err) => console.error(err));\n\nserver.on('stream', (stream, headers) => {\n  // stream is a Duplex\n  stream.respond({\n    'content-type': 'text/html; charset=utf-8',\n    ':status': 200,\n  });\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(8443);\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst fs = require('node:fs');\n\nconst server = http2.createSecureServer({\n  key: fs.readFileSync('localhost-privkey.pem'),\n  cert: fs.readFileSync('localhost-cert.pem'),\n});\nserver.on('error', (err) => console.error(err));\n\nserver.on('stream', (stream, headers) => {\n  // stream is a Duplex\n  stream.respond({\n    'content-type': 'text/html; charset=utf-8',\n    ':status': 200,\n  });\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(8443);\n</code></pre>\n<p>To generate the certificate and key for this example, run:</p>\n<pre><code class=\"language-bash\">openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \\\n  -keyout localhost-privkey.pem -out localhost-cert.pem\n</code></pre>",
              "displayName": "Server-side example"
            },
            {
              "textRaw": "Client-side example",
              "name": "client-side_example",
              "type": "module",
              "desc": "<p>The following illustrates an HTTP/2 client:</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:http2';\nimport { readFileSync } from 'node:fs';\n\nconst client = connect('https://localhost:8443', {\n  ca: readFileSync('localhost-cert.pem'),\n});\nclient.on('error', (err) => console.error(err));\n\nconst req = client.request({ ':path': '/' });\n\nreq.on('response', (headers, flags) => {\n  for (const name in headers) {\n    console.log(`${name}: ${headers[name]}`);\n  }\n});\n\nreq.setEncoding('utf8');\nlet data = '';\nreq.on('data', (chunk) => { data += chunk; });\nreq.on('end', () => {\n  console.log(`\\n${data}`);\n  client.close();\n});\nreq.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst fs = require('node:fs');\n\nconst client = http2.connect('https://localhost:8443', {\n  ca: fs.readFileSync('localhost-cert.pem'),\n});\nclient.on('error', (err) => console.error(err));\n\nconst req = client.request({ ':path': '/' });\n\nreq.on('response', (headers, flags) => {\n  for (const name in headers) {\n    console.log(`${name}: ${headers[name]}`);\n  }\n});\n\nreq.setEncoding('utf8');\nlet data = '';\nreq.on('data', (chunk) => { data += chunk; });\nreq.on('end', () => {\n  console.log(`\\n${data}`);\n  client.close();\n});\nreq.end();\n</code></pre>",
              "displayName": "Client-side example"
            },
            {
              "textRaw": "Headers object",
              "name": "headers_object",
              "type": "module",
              "desc": "<p>Headers are represented as own-properties on JavaScript objects. The property\nkeys will be serialized to lower-case. Property values should be strings (if\nthey are not they will be coerced to strings) or an <code>Array</code> of strings (in order\nto send more than one value per header field).</p>\n<pre><code class=\"language-js\">const headers = {\n  ':status': '200',\n  'content-type': 'text-plain',\n  'ABC': ['has', 'more', 'than', 'one', 'value'],\n};\n\nstream.respond(headers);\n</code></pre>\n<p>Header objects passed to callback functions will have a <code>null</code> prototype. This\nmeans that normal JavaScript object methods such as\n<code>Object.prototype.toString()</code> and <code>Object.prototype.hasOwnProperty()</code> will\nnot work.</p>\n<p>For incoming headers:</p>\n<ul>\n<li>The <code>:status</code> header is converted to <code>number</code>.</li>\n<li>Duplicates of <code>:status</code>, <code>:method</code>, <code>:authority</code>, <code>:scheme</code>, <code>:path</code>,\n<code>:protocol</code>, <code>age</code>, <code>authorization</code>, <code>access-control-allow-credentials</code>,\n<code>access-control-max-age</code>, <code>access-control-request-method</code>, <code>content-encoding</code>,\n<code>content-language</code>, <code>content-length</code>, <code>content-location</code>, <code>content-md5</code>,\n<code>content-range</code>, <code>content-type</code>, <code>date</code>, <code>dnt</code>, <code>etag</code>, <code>expires</code>, <code>from</code>,\n<code>host</code>, <code>if-match</code>, <code>if-modified-since</code>, <code>if-none-match</code>, <code>if-range</code>,\n<code>if-unmodified-since</code>, <code>last-modified</code>, <code>location</code>, <code>max-forwards</code>,\n<code>proxy-authorization</code>, <code>range</code>, <code>referer</code>,<code>retry-after</code>, <code>tk</code>,\n<code>upgrade-insecure-requests</code>, <code>user-agent</code> or <code>x-content-type-options</code> are\ndiscarded.</li>\n<li><code>set-cookie</code> is always an array. Duplicates are added to the array.</li>\n<li>For duplicate <code>cookie</code> headers, the values are joined together with '; '.</li>\n<li>For all other headers, the values are joined together with ', '.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer();\nserver.on('stream', (stream, headers) => {\n  console.log(headers[':path']);\n  console.log(headers.ABC);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream, headers) => {\n  console.log(headers[':path']);\n  console.log(headers.ABC);\n});\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Raw headers",
                  "name": "raw_headers",
                  "type": "module",
                  "desc": "<p>In some APIs, in addition to object format, headers can also be passed or\naccessed as a raw flat array, preserving details of ordering and\nduplicate keys to match the raw transmission format.</p>\n<p>In this format the keys and values are in the same list. It is <em>not</em> a\nlist of tuples. So, the even-numbered offsets are key values, and the\nodd-numbered offsets are the associated values. Duplicate headers are\nnot merged and so each key-value pair will appear separately.</p>\n<p>This can be useful for cases such as proxies, where existing headers\nshould be exactly forwarded as received, or as a performance\noptimization when the headers are already available in raw format.</p>\n<pre><code class=\"language-js\">const rawHeaders = [\n  ':status',\n  '404',\n  'content-type',\n  'text/plain',\n];\n\nstream.respond(rawHeaders);\n</code></pre>",
                  "displayName": "Raw headers"
                },
                {
                  "textRaw": "Sensitive headers",
                  "name": "sensitive_headers",
                  "type": "module",
                  "desc": "<p>HTTP2 headers can be marked as sensitive, which means that the HTTP/2\nheader compression algorithm will never index them. This can make sense for\nheader values with low entropy and that may be considered valuable to an\nattacker, for example <code>Cookie</code> or <code>Authorization</code>. To achieve this, add\nthe header name to the <code>[http2.sensitiveHeaders]</code> property as an array:</p>\n<pre><code class=\"language-js\">const headers = {\n  ':status': '200',\n  'content-type': 'text-plain',\n  'cookie': 'some-cookie',\n  'other-sensitive-header': 'very secret data',\n  [http2.sensitiveHeaders]: ['cookie', 'other-sensitive-header'],\n};\n\nstream.respond(headers);\n</code></pre>\n<p>For some headers, such as <code>Authorization</code> and short <code>Cookie</code> headers,\nthis flag is set automatically.</p>\n<p>This property is also set for received headers. It will contain the names of\nall headers marked as sensitive, including ones marked that way automatically.</p>\n<p>For raw headers, this should still be set as a property on the array, like\n<code>rawHeadersArray[http2.sensitiveHeaders] = ['cookie']</code>, not as a separate key\nand value pair within the array itself.</p>",
                  "displayName": "Sensitive headers"
                }
              ],
              "displayName": "Headers object"
            },
            {
              "textRaw": "Settings object",
              "name": "settings_object",
              "type": "module",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": [
                  {
                    "version": "v12.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29833",
                    "description": "The `maxConcurrentStreams` setting is stricter."
                  },
                  {
                    "version": "v8.9.3",
                    "pr-url": "https://github.com/nodejs/node/pull/16676",
                    "description": "The `maxHeaderListSize` setting is now strictly enforced."
                  }
                ]
              },
              "desc": "<p>The <code>http2.getDefaultSettings()</code>, <code>http2.getPackedSettings()</code>,\n<code>http2.createServer()</code>, <code>http2.createSecureServer()</code>,\n<code>http2session.settings()</code>, <code>http2session.localSettings</code>, and\n<code>http2session.remoteSettings</code> APIs either return or receive as input an\nobject that defines configuration settings for an <code>Http2Session</code> object.\nThese objects are ordinary JavaScript objects containing the following\nproperties.</p>\n<ul>\n<li><code>headerTableSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Specifies the maximum number of bytes used for\nheader compression. The minimum allowed value is 0. The maximum allowed value\nis 2<sup>32</sup>-1. <strong>Default:</strong> <code>4096</code>.</li>\n<li><code>enablePush</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Specifies <code>true</code> if HTTP/2 Push Streams are to be\npermitted on the <code>Http2Session</code> instances. <strong>Default:</strong> <code>true</code>.</li>\n<li><code>initialWindowSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Specifies the <em>sender's</em> initial window size in\nbytes for stream-level flow control. The minimum allowed value is 0. The\nmaximum allowed value is 2<sup>32</sup>-1. <strong>Default:</strong> <code>65535</code>.</li>\n<li><code>maxFrameSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Specifies the size in bytes of the largest frame\npayload. The minimum allowed value is 16,384. The maximum allowed value is\n2<sup>24</sup>-1. <strong>Default:</strong> <code>16384</code>.</li>\n<li><code>maxConcurrentStreams</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Specifies the maximum number of concurrent\nstreams permitted on an <code>Http2Session</code>. There is no default value which\nimplies, at least theoretically, 2<sup>32</sup>-1 streams may be open\nconcurrently at any given time in an <code>Http2Session</code>. The minimum value\nis 0. The maximum allowed value is 2<sup>32</sup>-1. <strong>Default:</strong>\n<code>4294967295</code>.</li>\n<li><code>maxHeaderListSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Specifies the maximum size (uncompressed octets)\nof header list that will be accepted. The minimum allowed value is 0. The\nmaximum allowed value is 2<sup>32</sup>-1. <strong>Default:</strong> <code>65535</code>.</li>\n<li><code>maxHeaderSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Alias for <code>maxHeaderListSize</code>.</li>\n<li><code>enableConnectProtocol</code><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> Specifies <code>true</code> if the \"Extended Connect\nProtocol\" defined by <a href=\"https://tools.ietf.org/html/rfc8441\">RFC 8441</a> is to be enabled. This setting is only\nmeaningful if sent by the server. Once the <code>enableConnectProtocol</code> setting\nhas been enabled for a given <code>Http2Session</code>, it cannot be disabled.\n<strong>Default:</strong> <code>false</code>.</li>\n<li><code>customSettings</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Specifies additional settings, yet not implemented\nin node and the underlying libraries. The key of the object defines the\nnumeric value of the settings type (as defined in the \"HTTP/2 SETTINGS\"\nregistry established by [RFC 7540]) and the values the actual numeric value\nof the settings.\nThe settings type has to be an integer in the range from 1 to 2^16-1.\nIt should not be a settings type already handled by node, i.e. currently\nit should be greater than 6, although it is not an error.\nThe values need to be unsigned integers in the range from 0 to 2^32-1.\nCurrently, a maximum of up 10 custom settings is supported.\nIt is only supported for sending SETTINGS, or for receiving settings values\nspecified in the <code>remoteCustomSettings</code> options of the server or client\nobject. Do not mix the <code>customSettings</code>-mechanism for a settings id with\ninterfaces for the natively handled settings, in case a setting becomes\nnatively supported in a future node version.</li>\n</ul>\n<p>All additional properties on the settings object are ignored.</p>",
              "displayName": "Settings object"
            },
            {
              "textRaw": "Error handling",
              "name": "error_handling",
              "type": "module",
              "desc": "<p>There are several types of error conditions that may arise when using the\n<code>node:http2</code> module:</p>\n<p>Validation errors occur when an incorrect argument, option, or setting value is\npassed in. These will always be reported by a synchronous <code>throw</code>.</p>\n<p>State errors occur when an action is attempted at an incorrect time (for\ninstance, attempting to send data on a stream after it has closed). These will\nbe reported using either a synchronous <code>throw</code> or via an <code>'error'</code> event on\nthe <code>Http2Stream</code>, <code>Http2Session</code> or HTTP/2 Server objects, depending on where\nand when the error occurs.</p>\n<p>Internal errors occur when an HTTP/2 session fails unexpectedly. These will be\nreported via an <code>'error'</code> event on the <code>Http2Session</code> or HTTP/2 Server objects.</p>\n<p>Protocol errors occur when various HTTP/2 protocol constraints are violated.\nThese will be reported using either a synchronous <code>throw</code> or via an <code>'error'</code>\nevent on the <code>Http2Stream</code>, <code>Http2Session</code> or HTTP/2 Server objects, depending\non where and when the error occurs.</p>",
              "displayName": "Error handling"
            },
            {
              "textRaw": "Invalid character handling in header names and values",
              "name": "invalid_character_handling_in_header_names_and_values",
              "type": "module",
              "desc": "<p>The HTTP/2 implementation applies stricter handling of invalid characters in\nHTTP header names and values than the HTTP/1 implementation.</p>\n<p>Header field names are <em>case-insensitive</em> and are transmitted over the wire\nstrictly as lower-case strings. The API provided by Node.js allows header\nnames to be set as mixed-case strings (e.g. <code>Content-Type</code>) but will convert\nthose to lower-case (e.g. <code>content-type</code>) upon transmission.</p>\n<p>Header field-names <em>must only</em> contain one or more of the following ASCII\ncharacters: <code>a</code>-<code>z</code>, <code>A</code>-<code>Z</code>, <code>0</code>-<code>9</code>, <code>!</code>, <code>#</code>, <code>$</code>, <code>%</code>, <code>&#x26;</code>, <code>'</code>, <code>*</code>, <code>+</code>,\n<code>-</code>, <code>.</code>, <code>^</code>, <code>_</code>, <code>`</code> (backtick), <code>|</code>, and <code>~</code>.</p>\n<p>Using invalid characters within an HTTP header field name will cause the\nstream to be closed with a protocol error being reported.</p>\n<p>Header field values are handled with more leniency but <em>should</em> not contain\nnew-line or carriage return characters and <em>should</em> be limited to US-ASCII\ncharacters, per the requirements of the HTTP specification.</p>",
              "displayName": "Invalid character handling in header names and values"
            },
            {
              "textRaw": "Push streams on the client",
              "name": "push_streams_on_the_client",
              "type": "module",
              "desc": "<p>To receive pushed streams on the client, set a listener for the <code>'stream'</code>\nevent on the <code>ClientHttp2Session</code>:</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:http2';\n\nconst client = connect('http://localhost');\n\nclient.on('stream', (pushedStream, requestHeaders) => {\n  pushedStream.on('push', (responseHeaders) => {\n    // Process response headers\n  });\n  pushedStream.on('data', (chunk) => { /* handle pushed data */ });\n});\n\nconst req = client.request({ ':path': '/' });\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\n\nconst client = http2.connect('http://localhost');\n\nclient.on('stream', (pushedStream, requestHeaders) => {\n  pushedStream.on('push', (responseHeaders) => {\n    // Process response headers\n  });\n  pushedStream.on('data', (chunk) => { /* handle pushed data */ });\n});\n\nconst req = client.request({ ':path': '/' });\n</code></pre>",
              "displayName": "Push streams on the client"
            },
            {
              "textRaw": "Supporting the `CONNECT` method",
              "name": "supporting_the_`connect`_method",
              "type": "module",
              "desc": "<p>The <code>CONNECT</code> method is used to allow an HTTP/2 server to be used as a proxy\nfor TCP/IP connections.</p>\n<p>A simple TCP Server:</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:net';\n\nconst server = createServer((socket) => {\n  let name = '';\n  socket.setEncoding('utf8');\n  socket.on('data', (chunk) => name += chunk);\n  socket.on('end', () => socket.end(`hello ${name}`));\n});\n\nserver.listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">const net = require('node:net');\n\nconst server = net.createServer((socket) => {\n  let name = '';\n  socket.setEncoding('utf8');\n  socket.on('data', (chunk) => name += chunk);\n  socket.on('end', () => socket.end(`hello ${name}`));\n});\n\nserver.listen(8000);\n</code></pre>\n<p>An HTTP/2 CONNECT proxy:</p>\n<pre><code class=\"language-mjs\">import { createServer, constants } from 'node:http2';\nconst { NGHTTP2_REFUSED_STREAM, NGHTTP2_CONNECT_ERROR } = constants;\nimport { connect } from 'node:net';\n\nconst proxy = createServer();\nproxy.on('stream', (stream, headers) => {\n  if (headers[':method'] !== 'CONNECT') {\n    // Only accept CONNECT requests\n    stream.close(NGHTTP2_REFUSED_STREAM);\n    return;\n  }\n  const auth = new URL(`tcp://${headers[':authority']}`);\n  // It's a very good idea to verify that hostname and port are\n  // things this proxy should be connecting to.\n  const socket = connect(auth.port, auth.hostname, () => {\n    stream.respond();\n    socket.pipe(stream);\n    stream.pipe(socket);\n  });\n  socket.on('error', (error) => {\n    stream.close(NGHTTP2_CONNECT_ERROR);\n  });\n});\n\nproxy.listen(8001);\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst { NGHTTP2_REFUSED_STREAM } = http2.constants;\nconst net = require('node:net');\n\nconst proxy = http2.createServer();\nproxy.on('stream', (stream, headers) => {\n  if (headers[':method'] !== 'CONNECT') {\n    // Only accept CONNECT requests\n    stream.close(NGHTTP2_REFUSED_STREAM);\n    return;\n  }\n  const auth = new URL(`tcp://${headers[':authority']}`);\n  // It's a very good idea to verify that hostname and port are\n  // things this proxy should be connecting to.\n  const socket = net.connect(auth.port, auth.hostname, () => {\n    stream.respond();\n    socket.pipe(stream);\n    stream.pipe(socket);\n  });\n  socket.on('error', (error) => {\n    stream.close(http2.constants.NGHTTP2_CONNECT_ERROR);\n  });\n});\n\nproxy.listen(8001);\n</code></pre>\n<p>An HTTP/2 CONNECT client:</p>\n<pre><code class=\"language-mjs\">import { connect, constants } from 'node:http2';\n\nconst client = connect('http://localhost:8001');\n\n// Must not specify the ':path' and ':scheme' headers\n// for CONNECT requests or an error will be thrown.\nconst req = client.request({\n  ':method': 'CONNECT',\n  ':authority': 'localhost:8000',\n});\n\nreq.on('response', (headers) => {\n  console.log(headers[constants.HTTP2_HEADER_STATUS]);\n});\nlet data = '';\nreq.setEncoding('utf8');\nreq.on('data', (chunk) => data += chunk);\nreq.on('end', () => {\n  console.log(`The server says: ${data}`);\n  client.close();\n});\nreq.end('Jane');\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\n\nconst client = http2.connect('http://localhost:8001');\n\n// Must not specify the ':path' and ':scheme' headers\n// for CONNECT requests or an error will be thrown.\nconst req = client.request({\n  ':method': 'CONNECT',\n  ':authority': 'localhost:8000',\n});\n\nreq.on('response', (headers) => {\n  console.log(headers[http2.constants.HTTP2_HEADER_STATUS]);\n});\nlet data = '';\nreq.setEncoding('utf8');\nreq.on('data', (chunk) => data += chunk);\nreq.on('end', () => {\n  console.log(`The server says: ${data}`);\n  client.close();\n});\nreq.end('Jane');\n</code></pre>",
              "displayName": "Supporting the `CONNECT` method"
            },
            {
              "textRaw": "The extended `CONNECT` protocol",
              "name": "the_extended_`connect`_protocol",
              "type": "module",
              "desc": "<p><a href=\"https://tools.ietf.org/html/rfc8441\">RFC 8441</a> defines an \"Extended CONNECT Protocol\" extension to HTTP/2 that\nmay be used to bootstrap the use of an <code>Http2Stream</code> using the <code>CONNECT</code>\nmethod as a tunnel for other communication protocols (such as WebSockets).</p>\n<p>The use of the Extended CONNECT Protocol is enabled by HTTP/2 servers by using\nthe <code>enableConnectProtocol</code> setting:</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst settings = { enableConnectProtocol: true };\nconst server = createServer({ settings });\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst settings = { enableConnectProtocol: true };\nconst server = http2.createServer({ settings });\n</code></pre>\n<p>Once the client receives the <code>SETTINGS</code> frame from the server indicating that\nthe extended CONNECT may be used, it may send <code>CONNECT</code> requests that use the\n<code>':protocol'</code> HTTP/2 pseudo-header:</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:http2';\nconst client = connect('http://localhost:8080');\nclient.on('remoteSettings', (settings) => {\n  if (settings.enableConnectProtocol) {\n    const req = client.request({ ':method': 'CONNECT', ':protocol': 'foo' });\n    // ...\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst client = http2.connect('http://localhost:8080');\nclient.on('remoteSettings', (settings) => {\n  if (settings.enableConnectProtocol) {\n    const req = client.request({ ':method': 'CONNECT', ':protocol': 'foo' });\n    // ...\n  }\n});\n</code></pre>",
              "displayName": "The extended `CONNECT` protocol"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `Http2Session`",
              "name": "Http2Session",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>Instances of the <code>http2.Http2Session</code> class represent an active communications\nsession between an HTTP/2 client and server. Instances of this class are <em>not</em>\nintended to be constructed directly by user code.</p>\n<p>Each <code>Http2Session</code> instance will exhibit slightly different behaviors\ndepending on whether it is operating as a server or a client. The\n<code>http2session.type</code> property can be used to determine the mode in which an\n<code>Http2Session</code> is operating. On the server side, user code should rarely\nhave occasion to work with the <code>Http2Session</code> object directly, with most\nactions typically taken through interactions with either the <code>Http2Server</code> or\n<code>Http2Stream</code> objects.</p>\n<p>User code will not create <code>Http2Session</code> instances directly. Server-side\n<code>Http2Session</code> instances are created by the <code>Http2Server</code> instance when a\nnew HTTP/2 connection is received. Client-side <code>Http2Session</code> instances are\ncreated using the <code>http2.connect()</code> method.</p>",
              "modules": [
                {
                  "textRaw": "`Http2Session` and sockets",
                  "name": "`http2session`_and_sockets",
                  "type": "module",
                  "desc": "<p>Every <code>Http2Session</code> instance is associated with exactly one <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a> or\n<a href=\"tls.html#class-tlstlssocket\"><code>tls.TLSSocket</code></a> when it is created. When either the <code>Socket</code> or the\n<code>Http2Session</code> are destroyed, both will be destroyed.</p>\n<p>Because of the specific serialization and processing requirements imposed\nby the HTTP/2 protocol, it is not recommended for user code to read data from\nor write data to a <code>Socket</code> instance bound to a <code>Http2Session</code>. Doing so can\nput the HTTP/2 session into an indeterminate state causing the session and\nthe socket to become unusable.</p>\n<p>Once a <code>Socket</code> has been bound to an <code>Http2Session</code>, user code should rely\nsolely on the API of the <code>Http2Session</code>.</p>",
                  "displayName": "`Http2Session` and sockets"
                }
              ],
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'close'</code> event is emitted once the <code>Http2Session</code> has been destroyed. Its\nlistener does not expect any arguments.</p>"
                },
                {
                  "textRaw": "Event: `'connect'`",
                  "name": "connect",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`session` {Http2Session}",
                      "name": "session",
                      "type": "Http2Session"
                    },
                    {
                      "textRaw": "`socket` {net.Socket}",
                      "name": "socket",
                      "type": "net.Socket"
                    }
                  ],
                  "desc": "<p>The <code>'connect'</code> event is emitted once the <code>Http2Session</code> has been successfully\nconnected to the remote peer and communication may begin.</p>\n<p>User code will typically not listen for this event directly.</p>"
                },
                {
                  "textRaw": "Event: `'error'`",
                  "name": "error",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    }
                  ],
                  "desc": "<p>The <code>'error'</code> event is emitted when an error occurs during the processing of\nan <code>Http2Session</code>.</p>"
                },
                {
                  "textRaw": "Event: `'frameError'`",
                  "name": "frameError",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`type` {integer} The frame type.",
                      "name": "type",
                      "type": "integer",
                      "desc": "The frame type."
                    },
                    {
                      "textRaw": "`code` {integer} The error code.",
                      "name": "code",
                      "type": "integer",
                      "desc": "The error code."
                    },
                    {
                      "textRaw": "`id` {integer} The stream id (or `0` if the frame isn't associated with a stream).",
                      "name": "id",
                      "type": "integer",
                      "desc": "The stream id (or `0` if the frame isn't associated with a stream)."
                    }
                  ],
                  "desc": "<p>The <code>'frameError'</code> event is emitted when an error occurs while attempting to\nsend a frame on the session. If the frame that could not be sent is associated\nwith a specific <code>Http2Stream</code>, an attempt to emit a <code>'frameError'</code> event on the\n<code>Http2Stream</code> is made.</p>\n<p>If the <code>'frameError'</code> event is associated with a stream, the stream will be\nclosed and destroyed immediately following the <code>'frameError'</code> event. If the\nevent is not associated with a stream, the <code>Http2Session</code> will be shut down\nimmediately following the <code>'frameError'</code> event.</p>"
                },
                {
                  "textRaw": "Event: `'goaway'`",
                  "name": "goaway",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`errorCode` {number} The HTTP/2 error code specified in the `GOAWAY` frame.",
                      "name": "errorCode",
                      "type": "number",
                      "desc": "The HTTP/2 error code specified in the `GOAWAY` frame."
                    },
                    {
                      "textRaw": "`lastStreamID` {number} The ID of the last stream the remote peer successfully processed (or `0` if no ID is specified).",
                      "name": "lastStreamID",
                      "type": "number",
                      "desc": "The ID of the last stream the remote peer successfully processed (or `0` if no ID is specified)."
                    },
                    {
                      "textRaw": "`opaqueData` {Buffer} If additional opaque data was included in the `GOAWAY` frame, a `Buffer` instance will be passed containing that data.",
                      "name": "opaqueData",
                      "type": "Buffer",
                      "desc": "If additional opaque data was included in the `GOAWAY` frame, a `Buffer` instance will be passed containing that data."
                    }
                  ],
                  "desc": "<p>The <code>'goaway'</code> event is emitted when a <code>GOAWAY</code> frame is received.</p>\n<p>The <code>Http2Session</code> instance will be shut down automatically when the <code>'goaway'</code>\nevent is emitted.</p>"
                },
                {
                  "textRaw": "Event: `'localSettings'`",
                  "name": "localSettings",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`settings` {HTTP/2 Settings Object} A copy of the `SETTINGS` frame received.",
                      "name": "settings",
                      "type": "HTTP/2 Settings Object",
                      "desc": "A copy of the `SETTINGS` frame received."
                    }
                  ],
                  "desc": "<p>The <code>'localSettings'</code> event is emitted when an acknowledgment <code>SETTINGS</code> frame\nhas been received.</p>\n<p>When using <code>http2session.settings()</code> to submit new settings, the modified\nsettings do not take effect until the <code>'localSettings'</code> event is emitted.</p>\n<pre><code class=\"language-js\">session.settings({ enablePush: false });\n\nsession.on('localSettings', (settings) => {\n  /* Use the new settings */\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'ping'`",
                  "name": "ping",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v10.12.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`payload` {Buffer} The `PING` frame 8-byte payload",
                      "name": "payload",
                      "type": "Buffer",
                      "desc": "The `PING` frame 8-byte payload"
                    }
                  ],
                  "desc": "<p>The <code>'ping'</code> event is emitted whenever a <code>PING</code> frame is received from the\nconnected peer.</p>"
                },
                {
                  "textRaw": "Event: `'remoteSettings'`",
                  "name": "remoteSettings",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`settings` {HTTP/2 Settings Object} A copy of the `SETTINGS` frame received.",
                      "name": "settings",
                      "type": "HTTP/2 Settings Object",
                      "desc": "A copy of the `SETTINGS` frame received."
                    }
                  ],
                  "desc": "<p>The <code>'remoteSettings'</code> event is emitted when a new <code>SETTINGS</code> frame is received\nfrom the connected peer.</p>\n<pre><code class=\"language-js\">session.on('remoteSettings', (settings) => {\n  /* Use the new settings */\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'stream'`",
                  "name": "stream",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`stream` {Http2Stream} A reference to the stream",
                      "name": "stream",
                      "type": "Http2Stream",
                      "desc": "A reference to the stream"
                    },
                    {
                      "textRaw": "`headers` {HTTP/2 Headers Object} An object describing the headers",
                      "name": "headers",
                      "type": "HTTP/2 Headers Object",
                      "desc": "An object describing the headers"
                    },
                    {
                      "textRaw": "`flags` {number} The associated numeric flags",
                      "name": "flags",
                      "type": "number",
                      "desc": "The associated numeric flags"
                    },
                    {
                      "textRaw": "`rawHeaders` {HTTP/2 Raw Headers} An array containing the raw headers",
                      "name": "rawHeaders",
                      "type": "HTTP/2 Raw Headers",
                      "desc": "An array containing the raw headers"
                    }
                  ],
                  "desc": "<p>The <code>'stream'</code> event is emitted when a new <code>Http2Stream</code> is created.</p>\n<pre><code class=\"language-js\">session.on('stream', (stream, headers, flags) => {\n  const method = headers[':method'];\n  const path = headers[':path'];\n  // ...\n  stream.respond({\n    ':status': 200,\n    'content-type': 'text/plain; charset=utf-8',\n  });\n  stream.write('hello ');\n  stream.end('world');\n});\n</code></pre>\n<p>On the server side, user code will typically not listen for this event directly,\nand would instead register a handler for the <code>'stream'</code> event emitted by the\n<code>net.Server</code> or <code>tls.Server</code> instances returned by <code>http2.createServer()</code> and\n<code>http2.createSecureServer()</code>, respectively, as in the example below:</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\n\n// Create an unencrypted HTTP/2 server\nconst server = createServer();\n\nserver.on('stream', (stream, headers) => {\n  stream.respond({\n    'content-type': 'text/html; charset=utf-8',\n    ':status': 200,\n  });\n  stream.on('error', (error) => console.error(error));\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\n\n// Create an unencrypted HTTP/2 server\nconst server = http2.createServer();\n\nserver.on('stream', (stream, headers) => {\n  stream.respond({\n    'content-type': 'text/html; charset=utf-8',\n    ':status': 200,\n  });\n  stream.on('error', (error) => console.error(error));\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(8000);\n</code></pre>\n<p>Even though HTTP/2 streams and network sockets are not in a 1:1 correspondence,\na network error will destroy each individual stream and must be handled on the\nstream level, as shown above.</p>"
                },
                {
                  "textRaw": "Event: `'timeout'`",
                  "name": "timeout",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>After the <code>http2session.setTimeout()</code> method is used to set the timeout period\nfor this <code>Http2Session</code>, the <code>'timeout'</code> event is emitted if there is no\nactivity on the <code>Http2Session</code> after the configured number of milliseconds.\nIts listener does not expect any arguments.</p>\n<pre><code class=\"language-js\">session.setTimeout(2000);\nsession.on('timeout', () => { /* .. */ });\n</code></pre>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {string|undefined}",
                  "name": "alpnProtocol",
                  "type": "string|undefined",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Value will be <code>undefined</code> if the <code>Http2Session</code> is not yet connected to a\nsocket, <code>h2c</code> if the <code>Http2Session</code> is not connected to a <code>TLSSocket</code>, or\nwill return the value of the connected <code>TLSSocket</code>'s own <code>alpnProtocol</code>\nproperty.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "closed",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Will be <code>true</code> if this <code>Http2Session</code> instance has been closed, otherwise\n<code>false</code>.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "connecting",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Will be <code>true</code> if this <code>Http2Session</code> instance is still connecting, will be set\nto <code>false</code> before emitting <code>connect</code> event and/or calling the <code>http2.connect</code>\ncallback.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "destroyed",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Will be <code>true</code> if this <code>Http2Session</code> instance has been destroyed and must no\nlonger be used, otherwise <code>false</code>.</p>"
                },
                {
                  "textRaw": "Type: {boolean|undefined}",
                  "name": "encrypted",
                  "type": "boolean|undefined",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Value is <code>undefined</code> if the <code>Http2Session</code> session socket has not yet been\nconnected, <code>true</code> if the <code>Http2Session</code> is connected with a <code>TLSSocket</code>,\nand <code>false</code> if the <code>Http2Session</code> is connected to any other kind of socket\nor stream.</p>"
                },
                {
                  "textRaw": "Type: {HTTP/2 Settings Object}",
                  "name": "localSettings",
                  "type": "HTTP/2 Settings Object",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>A prototype-less object describing the current local settings of this\n<code>Http2Session</code>. The local settings are local to <em>this</em> <code>Http2Session</code> instance.</p>"
                },
                {
                  "textRaw": "Type: {string[]|undefined}",
                  "name": "originSet",
                  "type": "string[]|undefined",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>If the <code>Http2Session</code> is connected to a <code>TLSSocket</code>, the <code>originSet</code> property\nwill return an <code>Array</code> of origins for which the <code>Http2Session</code> may be\nconsidered authoritative.</p>\n<p>The <code>originSet</code> property is only available when using a secure TLS connection.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "pendingSettingsAck",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Indicates whether the <code>Http2Session</code> is currently waiting for acknowledgment of\na sent <code>SETTINGS</code> frame. Will be <code>true</code> after calling the\n<code>http2session.settings()</code> method. Will be <code>false</code> once all sent <code>SETTINGS</code>\nframes have been acknowledged.</p>"
                },
                {
                  "textRaw": "Type: {HTTP/2 Settings Object}",
                  "name": "remoteSettings",
                  "type": "HTTP/2 Settings Object",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>A prototype-less object describing the current remote settings of this\n<code>Http2Session</code>. The remote settings are set by the <em>connected</em> HTTP/2 peer.</p>"
                },
                {
                  "textRaw": "Type: {net.Socket|tls.TLSSocket}",
                  "name": "socket",
                  "type": "net.Socket|tls.TLSSocket",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Returns a <code>Proxy</code> object that acts as a <code>net.Socket</code> (or <code>tls.TLSSocket</code>) but\nlimits available methods to ones safe to use with HTTP/2.</p>\n<p><code>destroy</code>, <code>emit</code>, <code>end</code>, <code>pause</code>, <code>read</code>, <code>resume</code>, and <code>write</code> will throw\nan error with code <code>ERR_HTTP2_NO_SOCKET_MANIPULATION</code>. See\n<a href=\"#http2session-and-sockets\"><code>Http2Session</code> and Sockets</a> for more information.</p>\n<p><code>setTimeout</code> method will be called on this <code>Http2Session</code>.</p>\n<p>All other interactions will be routed directly to the socket.</p>"
                },
                {
                  "textRaw": "Type: {Object}",
                  "name": "state",
                  "type": "Object",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Provides miscellaneous information about the current state of the\n<code>Http2Session</code>.</p>\n<p>An object describing the current status of this <code>Http2Session</code>.</p>",
                  "options": [
                    {
                      "textRaw": "`effectiveLocalWindowSize` {number} The current local (receive) flow control window size for the `Http2Session`.",
                      "name": "effectiveLocalWindowSize",
                      "type": "number",
                      "desc": "The current local (receive) flow control window size for the `Http2Session`."
                    },
                    {
                      "textRaw": "`effectiveRecvDataLength` {number} The current number of bytes that have been received since the last flow control `WINDOW_UPDATE`.",
                      "name": "effectiveRecvDataLength",
                      "type": "number",
                      "desc": "The current number of bytes that have been received since the last flow control `WINDOW_UPDATE`."
                    },
                    {
                      "textRaw": "`nextStreamID` {number} The numeric identifier to be used the next time a new `Http2Stream` is created by this `Http2Session`.",
                      "name": "nextStreamID",
                      "type": "number",
                      "desc": "The numeric identifier to be used the next time a new `Http2Stream` is created by this `Http2Session`."
                    },
                    {
                      "textRaw": "`localWindowSize` {number} The number of bytes that the remote peer can send without receiving a `WINDOW_UPDATE`.",
                      "name": "localWindowSize",
                      "type": "number",
                      "desc": "The number of bytes that the remote peer can send without receiving a `WINDOW_UPDATE`."
                    },
                    {
                      "textRaw": "`lastProcStreamID` {number} The numeric id of the `Http2Stream` for which a `HEADERS` or `DATA` frame was most recently received.",
                      "name": "lastProcStreamID",
                      "type": "number",
                      "desc": "The numeric id of the `Http2Stream` for which a `HEADERS` or `DATA` frame was most recently received."
                    },
                    {
                      "textRaw": "`remoteWindowSize` {number} The number of bytes that this `Http2Session` may send without receiving a `WINDOW_UPDATE`.",
                      "name": "remoteWindowSize",
                      "type": "number",
                      "desc": "The number of bytes that this `Http2Session` may send without receiving a `WINDOW_UPDATE`."
                    },
                    {
                      "textRaw": "`outboundQueueSize` {number} The number of frames currently within the outbound queue for this `Http2Session`.",
                      "name": "outboundQueueSize",
                      "type": "number",
                      "desc": "The number of frames currently within the outbound queue for this `Http2Session`."
                    },
                    {
                      "textRaw": "`deflateDynamicTableSize` {number} The current size in bytes of the outbound header compression state table.",
                      "name": "deflateDynamicTableSize",
                      "type": "number",
                      "desc": "The current size in bytes of the outbound header compression state table."
                    },
                    {
                      "textRaw": "`inflateDynamicTableSize` {number} The current size in bytes of the inbound header compression state table.",
                      "name": "inflateDynamicTableSize",
                      "type": "number",
                      "desc": "The current size in bytes of the inbound header compression state table."
                    }
                  ]
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "type",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>http2session.type</code> will be equal to\n<code>http2.constants.NGHTTP2_SESSION_SERVER</code> if this <code>Http2Session</code> instance is a\nserver, and <code>http2.constants.NGHTTP2_SESSION_CLIENT</code> if the instance is a\nclient.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`http2session.close([callback])`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Gracefully closes the <code>Http2Session</code>, allowing any existing streams to\ncomplete on their own and preventing new <code>Http2Stream</code> instances from being\ncreated. Once closed, <code>http2session.destroy()</code> <em>might</em> be called if there\nare no open <code>Http2Stream</code> instances.</p>\n<p>If specified, the <code>callback</code> function is registered as a handler for the\n<code>'close'</code> event.</p>"
                },
                {
                  "textRaw": "`http2session.destroy([error][, code])`",
                  "name": "destroy",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`error` {Error} An `Error` object if the `Http2Session` is being destroyed due to an error.",
                          "name": "error",
                          "type": "Error",
                          "desc": "An `Error` object if the `Http2Session` is being destroyed due to an error.",
                          "optional": true
                        },
                        {
                          "textRaw": "`code` {number} The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`.",
                          "name": "code",
                          "type": "number",
                          "desc": "The HTTP/2 error code to send in the final `GOAWAY` frame. If unspecified, and `error` is not undefined, the default is `INTERNAL_ERROR`, otherwise defaults to `NO_ERROR`.",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Immediately terminates the <code>Http2Session</code> and the associated <code>net.Socket</code> or\n<code>tls.TLSSocket</code>.</p>\n<p>Once destroyed, the <code>Http2Session</code> will emit the <code>'close'</code> event. If <code>error</code>\nis not undefined, an <code>'error'</code> event will be emitted immediately before the\n<code>'close'</code> event.</p>\n<p>If there are any remaining open <code>Http2Streams</code> associated with the\n<code>Http2Session</code>, those will also be destroyed.</p>"
                },
                {
                  "textRaw": "`http2session.goaway([code[, lastStreamID[, opaqueData]]])`",
                  "name": "goaway",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`code` {number} An HTTP/2 error code",
                          "name": "code",
                          "type": "number",
                          "desc": "An HTTP/2 error code",
                          "optional": true
                        },
                        {
                          "textRaw": "`lastStreamID` {number} The numeric ID of the last processed `Http2Stream`",
                          "name": "lastStreamID",
                          "type": "number",
                          "desc": "The numeric ID of the last processed `Http2Stream`",
                          "optional": true
                        },
                        {
                          "textRaw": "`opaqueData` {Buffer|TypedArray|DataView} A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame.",
                          "name": "opaqueData",
                          "type": "Buffer|TypedArray|DataView",
                          "desc": "A `TypedArray` or `DataView` instance containing additional data to be carried within the `GOAWAY` frame.",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Transmits a <code>GOAWAY</code> frame to the connected peer <em>without</em> shutting down the\n<code>Http2Session</code>.</p>"
                },
                {
                  "textRaw": "`http2session.ping([payload, ]callback)`",
                  "name": "ping",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.9.3"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`payload` {Buffer|TypedArray|DataView} Optional ping payload.",
                          "name": "payload",
                          "type": "Buffer|TypedArray|DataView",
                          "desc": "Optional ping payload.",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Sends a <code>PING</code> frame to the connected HTTP/2 peer. A <code>callback</code> function must\nbe provided. The method will return <code>true</code> if the <code>PING</code> was sent, <code>false</code>\notherwise.</p>\n<p>The maximum number of outstanding (unacknowledged) pings is determined by the\n<code>maxOutstandingPings</code> configuration option. The default maximum is 10.</p>\n<p>If provided, the <code>payload</code> must be a <code>Buffer</code>, <code>TypedArray</code>, or <code>DataView</code>\ncontaining 8 bytes of data that will be transmitted with the <code>PING</code> and\nreturned with the ping acknowledgment.</p>\n<p>The callback will be invoked with three arguments: an error argument that will\nbe <code>null</code> if the <code>PING</code> was successfully acknowledged, a <code>duration</code> argument\nthat reports the number of milliseconds elapsed since the ping was sent and the\nacknowledgment was received, and a <code>Buffer</code> containing the 8-byte <code>PING</code>\npayload.</p>\n<pre><code class=\"language-js\">session.ping(Buffer.from('abcdefgh'), (err, duration, payload) => {\n  if (!err) {\n    console.log(`Ping acknowledged in ${duration} milliseconds`);\n    console.log(`With payload '${payload.toString()}'`);\n  }\n});\n</code></pre>\n<p>If the <code>payload</code> argument is not specified, the default payload will be the\n64-bit timestamp (little endian) marking the start of the <code>PING</code> duration.</p>"
                },
                {
                  "textRaw": "`http2session.ref()`",
                  "name": "ref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <a href=\"net.html#socketref\"><code>ref()</code></a> on this <code>Http2Session</code>\ninstance's underlying <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a>.</p>"
                },
                {
                  "textRaw": "`http2session.setLocalWindowSize(windowSize)`",
                  "name": "setLocalWindowSize",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.3.0",
                      "v14.18.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`windowSize` {number}",
                          "name": "windowSize",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sets the local endpoint's window size.\nThe <code>windowSize</code> is the total window size to set, not\nthe delta.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\n\nconst server = createServer();\nconst expectedWindowSize = 2 ** 20;\nserver.on('session', (session) => {\n\n  // Set local window size to be 2 ** 20\n  session.setLocalWindowSize(expectedWindowSize);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\n\nconst server = http2.createServer();\nconst expectedWindowSize = 2 ** 20;\nserver.on('session', (session) => {\n\n  // Set local window size to be 2 ** 20\n  session.setLocalWindowSize(expectedWindowSize);\n});\n</code></pre>\n<p>For http2 clients the proper event is either <code>'connect'</code> or <code>'remoteSettings'</code>.</p>"
                },
                {
                  "textRaw": "`http2session.setTimeout(msecs, callback)`",
                  "name": "setTimeout",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`msecs` {number}",
                          "name": "msecs",
                          "type": "number"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Used to set a callback function that is called when there is no activity on\nthe <code>Http2Session</code> after <code>msecs</code> milliseconds. The given <code>callback</code> is\nregistered as a listener on the <code>'timeout'</code> event.</p>"
                },
                {
                  "textRaw": "`http2session.settings([settings][, callback])`",
                  "name": "settings",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`settings` {HTTP/2 Settings Object}",
                          "name": "settings",
                          "type": "HTTP/2 Settings Object",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function} Callback that is called once the session is connected or right away if the session is already connected.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "Callback that is called once the session is connected or right away if the session is already connected.",
                          "options": [
                            {
                              "textRaw": "`err` {Error|null}",
                              "name": "err",
                              "type": "Error|null"
                            },
                            {
                              "textRaw": "`settings` {HTTP/2 Settings Object} The updated `settings` object.",
                              "name": "settings",
                              "type": "HTTP/2 Settings Object",
                              "desc": "The updated `settings` object."
                            },
                            {
                              "textRaw": "`duration` {integer}",
                              "name": "duration",
                              "type": "integer"
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Updates the current local settings for this <code>Http2Session</code> and sends a new\n<code>SETTINGS</code> frame to the connected HTTP/2 peer.</p>\n<p>Once called, the <code>http2session.pendingSettingsAck</code> property will be <code>true</code>\nwhile the session is waiting for the remote peer to acknowledge the new\nsettings.</p>\n<p>The new settings will not become effective until the <code>SETTINGS</code> acknowledgment\nis received and the <code>'localSettings'</code> event is emitted. It is possible to send\nmultiple <code>SETTINGS</code> frames while acknowledgment is still pending.</p>"
                },
                {
                  "textRaw": "`http2session.unref()`",
                  "name": "unref",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <a href=\"net.html#socketunref\"><code>unref()</code></a> on this <code>Http2Session</code>\ninstance's underlying <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `ServerHttp2Session`",
              "name": "ServerHttp2Session",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"http2.html#class-http2session\"><code>&#x3C;Http2Session></code></a></li>\n</ul>",
              "methods": [
                {
                  "textRaw": "`serverhttp2session.altsvc(alt, originOrStream)`",
                  "name": "altsvc",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`alt` {string} A description of the alternative service configuration as defined by RFC 7838.",
                          "name": "alt",
                          "type": "string",
                          "desc": "A description of the alternative service configuration as defined by RFC 7838."
                        },
                        {
                          "textRaw": "`originOrStream` {number|string|URL|Object} Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the `http2stream.id` property.",
                          "name": "originOrStream",
                          "type": "number|string|URL|Object",
                          "desc": "Either a URL string specifying the origin (or an `Object` with an `origin` property) or the numeric identifier of an active `Http2Stream` as given by the `http2stream.id` property."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Submits an <code>ALTSVC</code> frame (as defined by <a href=\"https://tools.ietf.org/html/rfc7838\">RFC 7838</a>) to the connected client.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\n\nconst server = createServer();\nserver.on('session', (session) => {\n  // Set altsvc for origin https://example.org:80\n  session.altsvc('h2=\":8000\"', 'https://example.org:80');\n});\n\nserver.on('stream', (stream) => {\n  // Set altsvc for a specific stream\n  stream.session.altsvc('h2=\":8000\"', stream.id);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\n\nconst server = http2.createServer();\nserver.on('session', (session) => {\n  // Set altsvc for origin https://example.org:80\n  session.altsvc('h2=\":8000\"', 'https://example.org:80');\n});\n\nserver.on('stream', (stream) => {\n  // Set altsvc for a specific stream\n  stream.session.altsvc('h2=\":8000\"', stream.id);\n});\n</code></pre>\n<p>Sending an <code>ALTSVC</code> frame with a specific stream ID indicates that the alternate\nservice is associated with the origin of the given <code>Http2Stream</code>.</p>\n<p>The <code>alt</code> and origin string <em>must</em> contain only ASCII bytes and are\nstrictly interpreted as a sequence of ASCII bytes. The special value <code>'clear'</code>\nmay be passed to clear any previously set alternative service for a given\ndomain.</p>\n<p>When a string is passed for the <code>originOrStream</code> argument, it will be parsed as\na URL and the origin will be derived. For instance, the origin for the\nHTTP URL <code>'https://example.org/foo/bar'</code> is the ASCII string\n<code>'https://example.org'</code>. An error will be thrown if either the given string\ncannot be parsed as a URL or if a valid origin cannot be derived.</p>\n<p>A <code>URL</code> object, or any object with an <code>origin</code> property, may be passed as\n<code>originOrStream</code>, in which case the value of the <code>origin</code> property will be\nused. The value of the <code>origin</code> property <em>must</em> be a properly serialized\nASCII origin.</p>"
                },
                {
                  "textRaw": "`serverhttp2session.origin(...origins)`",
                  "name": "origin",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "...origins"
                        }
                      ]
                    }
                  ],
                  "desc": "<ul>\n<li><code>origins</code> { string | URL | Object } One or more URL Strings passed as\nseparate arguments.</li>\n</ul>\n<p>Submits an <code>ORIGIN</code> frame (as defined by <a href=\"https://tools.ietf.org/html/rfc8336\">RFC 8336</a>) to the connected client\nto advertise the set of origins for which the server is capable of providing\nauthoritative responses.</p>\n<pre><code class=\"language-mjs\">import { createSecureServer } from 'node:http2';\nconst options = getSecureOptionsSomehow();\nconst server = createSecureServer(options);\nserver.on('stream', (stream) => {\n  stream.respond();\n  stream.end('ok');\n});\nserver.on('session', (session) => {\n  session.origin('https://example.com', 'https://example.org');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst options = getSecureOptionsSomehow();\nconst server = http2.createSecureServer(options);\nserver.on('stream', (stream) => {\n  stream.respond();\n  stream.end('ok');\n});\nserver.on('session', (session) => {\n  session.origin('https://example.com', 'https://example.org');\n});\n</code></pre>\n<p>When a string is passed as an <code>origin</code>, it will be parsed as a URL and the\norigin will be derived. For instance, the origin for the HTTP URL\n<code>'https://example.org/foo/bar'</code> is the ASCII string\n<code>'https://example.org'</code>. An error will be thrown if either the given string\ncannot be parsed as a URL or if a valid origin cannot be derived.</p>\n<p>A <code>URL</code> object, or any object with an <code>origin</code> property, may be passed as\nan <code>origin</code>, in which case the value of the <code>origin</code> property will be\nused. The value of the <code>origin</code> property <em>must</em> be a properly serialized\nASCII origin.</p>\n<p>Alternatively, the <code>origins</code> option may be used when creating a new HTTP/2\nserver using the <code>http2.createSecureServer()</code> method:</p>\n<pre><code class=\"language-mjs\">import { createSecureServer } from 'node:http2';\nconst options = getSecureOptionsSomehow();\noptions.origins = ['https://example.com', 'https://example.org'];\nconst server = createSecureServer(options);\nserver.on('stream', (stream) => {\n  stream.respond();\n  stream.end('ok');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst options = getSecureOptionsSomehow();\noptions.origins = ['https://example.com', 'https://example.org'];\nconst server = http2.createSecureServer(options);\nserver.on('stream', (stream) => {\n  stream.respond();\n  stream.end('ok');\n});\n</code></pre>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Specifying alternative services",
                  "name": "specifying_alternative_services",
                  "type": "module",
                  "desc": "<p>The format of the <code>alt</code> parameter is strictly defined by <a href=\"https://tools.ietf.org/html/rfc7838\">RFC 7838</a> as an\nASCII string containing a comma-delimited list of \"alternative\" protocols\nassociated with a specific host and port.</p>\n<p>For example, the value <code>'h2=\"example.org:81\"'</code> indicates that the HTTP/2\nprotocol is available on the host <code>'example.org'</code> on TCP/IP port 81. The\nhost and port <em>must</em> be contained within the quote (<code>\"</code>) characters.</p>\n<p>Multiple alternatives may be specified, for instance: <code>'h2=\"example.org:81\", h2=\":82\"'</code>.</p>\n<p>The protocol identifier (<code>'h2'</code> in the examples) may be any valid\n<a href=\"https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml#alpn-protocol-ids\">ALPN Protocol ID</a>.</p>\n<p>The syntax of these values is not validated by the Node.js implementation and\nare passed through as provided by the user or received from the peer.</p>",
                  "displayName": "Specifying alternative services"
                }
              ]
            },
            {
              "textRaw": "Class: `ClientHttp2Session`",
              "name": "ClientHttp2Session",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"http2.html#class-http2session\"><code>&#x3C;Http2Session></code></a></li>\n</ul>",
              "events": [
                {
                  "textRaw": "Event: `'altsvc'`",
                  "name": "altsvc",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`alt` {string}",
                      "name": "alt",
                      "type": "string"
                    },
                    {
                      "textRaw": "`origin` {string}",
                      "name": "origin",
                      "type": "string"
                    },
                    {
                      "textRaw": "`streamId` {number}",
                      "name": "streamId",
                      "type": "number"
                    }
                  ],
                  "desc": "<p>The <code>'altsvc'</code> event is emitted whenever an <code>ALTSVC</code> frame is received by\nthe client. The event is emitted with the <code>ALTSVC</code> value, origin, and stream\nID. If no <code>origin</code> is provided in the <code>ALTSVC</code> frame, <code>origin</code> will\nbe an empty string.</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:http2';\nconst client = connect('https://example.org');\n\nclient.on('altsvc', (alt, origin, streamId) => {\n  console.log(alt);\n  console.log(origin);\n  console.log(streamId);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst client = http2.connect('https://example.org');\n\nclient.on('altsvc', (alt, origin, streamId) => {\n  console.log(alt);\n  console.log(origin);\n  console.log(streamId);\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'origin'`",
                  "name": "origin",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v10.12.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`origins` {string[]}",
                      "name": "origins",
                      "type": "string[]"
                    }
                  ],
                  "desc": "<p>The <code>'origin'</code> event is emitted whenever an <code>ORIGIN</code> frame is received by\nthe client. The event is emitted with an array of <code>origin</code> strings. The\n<code>http2session.originSet</code> will be updated to include the received\norigins.</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:http2';\nconst client = connect('https://example.org');\n\nclient.on('origin', (origins) => {\n  for (let n = 0; n &#x3C; origins.length; n++)\n    console.log(origins[n]);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst client = http2.connect('https://example.org');\n\nclient.on('origin', (origins) => {\n  for (let n = 0; n &#x3C; origins.length; n++)\n    console.log(origins[n]);\n});\n</code></pre>\n<p>The <code>'origin'</code> event is only emitted when using a secure TLS connection.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`clienthttp2session.request(headers[, options])`",
                  "name": "request",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58293",
                        "description": "The `weight` option is now ignored, setting it will trigger a runtime warning."
                      },
                      {
                        "version": [
                          "v24.2.0",
                          "v22.17.0",
                          "v20.19.6"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/58313",
                        "description": "Following the deprecation of priority signaling as of RFC 9113, `weight` option is deprecated."
                      },
                      {
                        "version": [
                          "v24.0.0",
                          "v22.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/57917",
                        "description": "Allow passing headers in raw array format."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`endStream` {boolean} `true` if the `Http2Stream` _writable_ side should be closed initially, such as when sending a `GET` request that should not expect a payload body.",
                              "name": "endStream",
                              "type": "boolean",
                              "desc": "`true` if the `Http2Stream` _writable_ side should be closed initially, such as when sending a `GET` request that should not expect a payload body."
                            },
                            {
                              "textRaw": "`exclusive` {boolean} When `true` and `parent` identifies a parent Stream, the created stream is made the sole direct dependency of the parent, with all other existing dependents made a dependent of the newly created stream. **Default:** `false`.",
                              "name": "exclusive",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "When `true` and `parent` identifies a parent Stream, the created stream is made the sole direct dependency of the parent, with all other existing dependents made a dependent of the newly created stream."
                            },
                            {
                              "textRaw": "`parent` {number} Specifies the numeric identifier of a stream the newly created stream is dependent on.",
                              "name": "parent",
                              "type": "number",
                              "desc": "Specifies the numeric identifier of a stream the newly created stream is dependent on."
                            },
                            {
                              "textRaw": "`waitForTrailers` {boolean} When `true`, the `Http2Stream` will emit the `'wantTrailers'` event after the final `DATA` frame has been sent.",
                              "name": "waitForTrailers",
                              "type": "boolean",
                              "desc": "When `true`, the `Http2Stream` will emit the `'wantTrailers'` event after the final `DATA` frame has been sent."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} An AbortSignal that may be used to abort an ongoing request.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "An AbortSignal that may be used to abort an ongoing request."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {ClientHttp2Stream}",
                        "name": "return",
                        "type": "ClientHttp2Stream"
                      }
                    }
                  ],
                  "desc": "<p>For HTTP/2 Client <code>Http2Session</code> instances only, the <code>http2session.request()</code>\ncreates and returns an <code>Http2Stream</code> instance that can be used to send an\nHTTP/2 request to the connected server.</p>\n<p>When a <code>ClientHttp2Session</code> is first created, the socket may not yet be\nconnected. If <code>clienthttp2session.request()</code> is called during this time, the\nactual request will be deferred until the socket is ready to go.</p>\n<p>If the session becomes unavailable before the request can be created, the\nreturned stream will emit <code>ERR_HTTP2_GOAWAY_SESSION</code> or\n<code>ERR_HTTP2_INVALID_SESSION</code> asynchronously.</p>\n<p>This method is only available if <code>http2session.type</code> is equal to\n<code>http2.constants.NGHTTP2_SESSION_CLIENT</code>.</p>\n<pre><code class=\"language-mjs\">import { connect, constants } from 'node:http2';\nconst clientSession = connect('https://localhost:1234');\nconst {\n  HTTP2_HEADER_PATH,\n  HTTP2_HEADER_STATUS,\n} = constants;\n\nconst req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });\nreq.on('response', (headers) => {\n  console.log(headers[HTTP2_HEADER_STATUS]);\n  req.on('data', (chunk) => { /* .. */ });\n  req.on('end', () => { /* .. */ });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst clientSession = http2.connect('https://localhost:1234');\nconst {\n  HTTP2_HEADER_PATH,\n  HTTP2_HEADER_STATUS,\n} = http2.constants;\n\nconst req = clientSession.request({ [HTTP2_HEADER_PATH]: '/' });\nreq.on('response', (headers) => {\n  console.log(headers[HTTP2_HEADER_STATUS]);\n  req.on('data', (chunk) => { /* .. */ });\n  req.on('end', () => { /* .. */ });\n});\n</code></pre>\n<p>When the <code>options.waitForTrailers</code> option is set, the <code>'wantTrailers'</code> event\nis emitted immediately after queuing the last chunk of payload data to be sent.\nThe <code>http2stream.sendTrailers()</code> method can then be called to send trailing\nheaders to the peer.</p>\n<p>When <code>options.waitForTrailers</code> is set, the <code>Http2Stream</code> will not automatically\nclose when the final <code>DATA</code> frame is transmitted. User code must call either\n<code>http2stream.sendTrailers()</code> or <code>http2stream.close()</code> to close the\n<code>Http2Stream</code>.</p>\n<p>When <code>options.signal</code> is set with an <code>AbortSignal</code> and then <code>abort</code> on the\ncorresponding <code>AbortController</code> is called, the request will emit an <code>'error'</code>\nevent with an <code>AbortError</code> error.</p>\n<p>The <code>:method</code> and <code>:path</code> pseudo-headers are not specified within <code>headers</code>,\nthey respectively default to:</p>\n<ul>\n<li><code>:method</code> = <code>'GET'</code></li>\n<li><code>:path</code> = <code>/</code></li>\n</ul>"
                }
              ]
            },
            {
              "textRaw": "Class: `Http2Stream`",
              "name": "Http2Stream",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a></li>\n</ul>\n<p>Each instance of the <code>Http2Stream</code> class represents a bidirectional HTTP/2\ncommunications stream over an <code>Http2Session</code> instance. Any single <code>Http2Session</code>\nmay have up to 2<sup>31</sup>-1 <code>Http2Stream</code> instances over its lifetime.</p>\n<p>User code will not construct <code>Http2Stream</code> instances directly. Rather, these\nare created, managed, and provided to user code through the <code>Http2Session</code>\ninstance. On the server, <code>Http2Stream</code> instances are created either in response\nto an incoming HTTP request (and handed off to user code via the <code>'stream'</code>\nevent), or in response to a call to the <code>http2stream.pushStream()</code> method.\nOn the client, <code>Http2Stream</code> instances are created and returned when either the\n<code>http2session.request()</code> method is called, or in response to an incoming\n<code>'push'</code> event.</p>\n<p>The <code>Http2Stream</code> class is a base for the <a href=\"#class-serverhttp2stream\"><code>ServerHttp2Stream</code></a> and\n<a href=\"#class-clienthttp2stream\"><code>ClientHttp2Stream</code></a> classes, each of which is used specifically by either\nthe Server or Client side, respectively.</p>\n<p>All <code>Http2Stream</code> instances are <a href=\"stream.html#class-streamduplex\"><code>Duplex</code></a> streams. The <code>Writable</code> side of the\n<code>Duplex</code> is used to send data to the connected peer, while the <code>Readable</code> side\nis used to receive data sent by the connected peer.</p>\n<p>The default text character encoding for an <code>Http2Stream</code> is UTF-8. When using an\n<code>Http2Stream</code> to send text, use the <code>'content-type'</code> header to set the character\nencoding.</p>\n<pre><code class=\"language-js\">stream.respond({\n  'content-type': 'text/html; charset=utf-8',\n  ':status': 200,\n});\n</code></pre>",
              "modules": [
                {
                  "textRaw": "`Http2Stream` Lifecycle",
                  "name": "`http2stream`_lifecycle",
                  "type": "module",
                  "modules": [
                    {
                      "textRaw": "Creation",
                      "name": "creation",
                      "type": "module",
                      "desc": "<p>On the server side, instances of <a href=\"#class-serverhttp2stream\"><code>ServerHttp2Stream</code></a> are created either\nwhen:</p>\n<ul>\n<li>A new HTTP/2 <code>HEADERS</code> frame with a previously unused stream ID is received;</li>\n<li>The <code>http2stream.pushStream()</code> method is called.</li>\n</ul>\n<p>On the client side, instances of <a href=\"#class-clienthttp2stream\"><code>ClientHttp2Stream</code></a> are created when the\n<code>http2session.request()</code> method is called.</p>\n<p>On the client, the <code>Http2Stream</code> instance returned by <code>http2session.request()</code>\nmay not be immediately ready for use if the parent <code>Http2Session</code> has not yet\nbeen fully established. In such cases, operations called on the <code>Http2Stream</code>\nwill be buffered until the <code>'ready'</code> event is emitted. User code should rarely,\nif ever, need to handle the <code>'ready'</code> event directly. The ready status of an\n<code>Http2Stream</code> can be determined by checking the value of <code>http2stream.id</code>. If\nthe value is <code>undefined</code>, the stream is not yet ready for use.</p>",
                      "displayName": "Creation"
                    },
                    {
                      "textRaw": "Destruction",
                      "name": "destruction",
                      "type": "module",
                      "desc": "<p>All <a href=\"#class-http2stream\"><code>Http2Stream</code></a> instances are destroyed either when:</p>\n<ul>\n<li>An <code>RST_STREAM</code> frame for the stream is received by the connected peer,\nand (for client streams only) pending data has been read.</li>\n<li>The <code>http2stream.close()</code> method is called, and (for client streams only)\npending data has been read.</li>\n<li>The <code>http2stream.destroy()</code> or <code>http2session.destroy()</code> methods are called.</li>\n</ul>\n<p>When an <code>Http2Stream</code> instance is destroyed, an attempt will be made to send an\n<code>RST_STREAM</code> frame to the connected peer.</p>\n<p>When the <code>Http2Stream</code> instance is destroyed, the <code>'close'</code> event will\nbe emitted. Because <code>Http2Stream</code> is an instance of <code>stream.Duplex</code>, the\n<code>'end'</code> event will also be emitted if the stream data is currently flowing.\nThe <code>'error'</code> event may also be emitted if <code>http2stream.destroy()</code> was called\nwith an <code>Error</code> passed as the first argument.</p>\n<p>After the <code>Http2Stream</code> has been destroyed, the <code>http2stream.destroyed</code>\nproperty will be <code>true</code> and the <code>http2stream.rstCode</code> property will specify the\n<code>RST_STREAM</code> error code. The <code>Http2Stream</code> instance is no longer usable once\ndestroyed.</p>",
                      "displayName": "Destruction"
                    }
                  ],
                  "displayName": "`Http2Stream` Lifecycle"
                }
              ],
              "events": [
                {
                  "textRaw": "Event: `'aborted'`",
                  "name": "aborted",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'aborted'</code> event is emitted whenever a <code>Http2Stream</code> instance is\nabnormally aborted in mid-communication.\nIts listener does not expect any arguments.</p>\n<p>The <code>'aborted'</code> event will only be emitted if the <code>Http2Stream</code> writable side\nhas not been ended.</p>"
                },
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'close'</code> event is emitted when the <code>Http2Stream</code> is destroyed. Once\nthis event is emitted, the <code>Http2Stream</code> instance is no longer usable.</p>\n<p>The HTTP/2 error code used when closing the stream can be retrieved using\nthe <code>http2stream.rstCode</code> property. If the code is any value other than\n<code>NGHTTP2_NO_ERROR</code> (<code>0</code>), an <code>'error'</code> event will have also been emitted.</p>"
                },
                {
                  "textRaw": "Event: `'error'`",
                  "name": "error",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    }
                  ],
                  "desc": "<p>The <code>'error'</code> event is emitted when an error occurs during the processing of\nan <code>Http2Stream</code>.</p>"
                },
                {
                  "textRaw": "Event: `'frameError'`",
                  "name": "frameError",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`type` {integer} The frame type.",
                      "name": "type",
                      "type": "integer",
                      "desc": "The frame type."
                    },
                    {
                      "textRaw": "`code` {integer} The error code.",
                      "name": "code",
                      "type": "integer",
                      "desc": "The error code."
                    },
                    {
                      "textRaw": "`id` {integer} The stream id (or `0` if the frame isn't associated with a stream).",
                      "name": "id",
                      "type": "integer",
                      "desc": "The stream id (or `0` if the frame isn't associated with a stream)."
                    }
                  ],
                  "desc": "<p>The <code>'frameError'</code> event is emitted when an error occurs while attempting to\nsend a frame. When invoked, the handler function will receive an integer\nargument identifying the frame type, and an integer argument identifying the\nerror code. The <code>Http2Stream</code> instance will be destroyed immediately after the\n<code>'frameError'</code> event is emitted.</p>"
                },
                {
                  "textRaw": "Event: `'ready'`",
                  "name": "ready",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'ready'</code> event is emitted when the <code>Http2Stream</code> has been opened, has\nbeen assigned an <code>id</code>, and can be used. The listener does not expect any\narguments.</p>"
                },
                {
                  "textRaw": "Event: `'timeout'`",
                  "name": "timeout",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'timeout'</code> event is emitted after no activity is received for this\n<code>Http2Stream</code> within the number of milliseconds set using\n<code>http2stream.setTimeout()</code>.\nIts listener does not expect any arguments.</p>"
                },
                {
                  "textRaw": "Event: `'trailers'`",
                  "name": "trailers",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`headers` {HTTP/2 Headers Object} An object describing the headers",
                      "name": "headers",
                      "type": "HTTP/2 Headers Object",
                      "desc": "An object describing the headers"
                    },
                    {
                      "textRaw": "`flags` {number} The associated numeric flags",
                      "name": "flags",
                      "type": "number",
                      "desc": "The associated numeric flags"
                    },
                    {
                      "textRaw": "`rawHeaders` {HTTP/2 Raw Headers}",
                      "name": "rawHeaders",
                      "type": "HTTP/2 Raw Headers"
                    }
                  ],
                  "desc": "<p>The <code>'trailers'</code> event is emitted when a block of headers associated with\ntrailing header fields is received. The listener callback is passed the <a href=\"#headers-object\">HTTP/2 Headers Object</a>, flags associated\nwith the headers, and the headers in raw format (see <a href=\"#raw-headers\">HTTP/2 Raw Headers</a>).</p>\n<p>This event might not be emitted if <code>http2stream.end()</code> is called\nbefore trailers are received and the incoming data is not being read or\nlistened for.</p>\n<pre><code class=\"language-js\">stream.on('trailers', (headers, flags) => {\n  console.log(headers);\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'wantTrailers'`",
                  "name": "wantTrailers",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'wantTrailers'</code> event is emitted when the <code>Http2Stream</code> has queued the\nfinal <code>DATA</code> frame to be sent on a frame and the <code>Http2Stream</code> is ready to send\ntrailing headers. When initiating a request or response, the <code>waitForTrailers</code>\noption must be set for this event to be emitted.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {boolean}",
                  "name": "aborted",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set to <code>true</code> if the <code>Http2Stream</code> instance was aborted abnormally. When set,\nthe <code>'aborted'</code> event will have been emitted.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "bufferSize",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v11.2.0",
                      "v10.16.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>This property shows the number of characters currently buffered to be written.\nSee <a href=\"net.html#socketbuffersize\"><code>net.Socket.bufferSize</code></a> for details.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "closed",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set to <code>true</code> if the <code>Http2Stream</code> instance has been closed.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "destroyed",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set to <code>true</code> if the <code>Http2Stream</code> instance has been destroyed and is no longer\nusable.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "endAfterHeaders",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v10.11.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set to <code>true</code> if the <code>END_STREAM</code> flag was set in the request or response\nHEADERS frame received, indicating that no additional data should be received\nand the readable side of the <code>Http2Stream</code> will be closed.</p>"
                },
                {
                  "textRaw": "Type: {number|undefined}",
                  "name": "id",
                  "type": "number|undefined",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The numeric stream identifier of this <code>Http2Stream</code> instance. Set to <code>undefined</code>\nif the stream identifier has not yet been assigned.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "pending",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v9.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set to <code>true</code> if the <code>Http2Stream</code> instance has not yet been assigned a\nnumeric stream identifier.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "rstCode",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Set to the <code>RST_STREAM</code> <a href=\"#error-codes-for-rst_stream-and-goaway\">error code</a> reported when the <code>Http2Stream</code> is\ndestroyed after either receiving an <code>RST_STREAM</code> frame from the connected peer,\ncalling <code>http2stream.close()</code>, or <code>http2stream.destroy()</code>. Will be\n<code>undefined</code> if the <code>Http2Stream</code> has not been closed.</p>"
                },
                {
                  "textRaw": "Type: {HTTP/2 Headers Object}",
                  "name": "sentHeaders",
                  "type": "HTTP/2 Headers Object",
                  "meta": {
                    "added": [
                      "v9.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>An object containing the outbound headers sent for this <code>Http2Stream</code>.</p>"
                },
                {
                  "textRaw": "Type: {HTTP/2 Headers Object[]}",
                  "name": "sentInfoHeaders",
                  "type": "HTTP/2 Headers Object[]",
                  "meta": {
                    "added": [
                      "v9.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>An array of objects containing the outbound informational (additional) headers\nsent for this <code>Http2Stream</code>.</p>"
                },
                {
                  "textRaw": "Type: {HTTP/2 Headers Object}",
                  "name": "sentTrailers",
                  "type": "HTTP/2 Headers Object",
                  "meta": {
                    "added": [
                      "v9.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>An object containing the outbound trailers sent for this <code>HttpStream</code>.</p>"
                },
                {
                  "textRaw": "Type: {Http2Session}",
                  "name": "session",
                  "type": "Http2Session",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>A reference to the <code>Http2Session</code> instance that owns this <code>Http2Stream</code>. The\nvalue will be <code>undefined</code> after the <code>Http2Stream</code> instance is destroyed.</p>"
                },
                {
                  "textRaw": "Type: {Object}",
                  "name": "state",
                  "type": "Object",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58293",
                        "description": "The `state.weight` property is now always set to 16 and `sumDependencyWeight` is always set to 0."
                      },
                      {
                        "version": [
                          "v24.2.0",
                          "v22.17.0",
                          "v20.19.6"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/58313",
                        "description": "Following the deprecation of priority signaling as of RFC 9113, `weight` and `sumDependencyWeight` options are deprecated."
                      }
                    ]
                  },
                  "desc": "<p>Provides miscellaneous information about the current state of the\n<code>Http2Stream</code>.</p>\n<p>A current state of this <code>Http2Stream</code>.</p>",
                  "options": [
                    {
                      "textRaw": "`localWindowSize` {number} The number of bytes the connected peer may send for this `Http2Stream` without receiving a `WINDOW_UPDATE`.",
                      "name": "localWindowSize",
                      "type": "number",
                      "desc": "The number of bytes the connected peer may send for this `Http2Stream` without receiving a `WINDOW_UPDATE`."
                    },
                    {
                      "textRaw": "`state` {number} A flag indicating the low-level current state of the `Http2Stream` as determined by `nghttp2`.",
                      "name": "state",
                      "type": "number",
                      "desc": "A flag indicating the low-level current state of the `Http2Stream` as determined by `nghttp2`."
                    },
                    {
                      "textRaw": "`localClose` {number} `1` if this `Http2Stream` has been closed locally.",
                      "name": "localClose",
                      "type": "number",
                      "desc": "`1` if this `Http2Stream` has been closed locally."
                    },
                    {
                      "textRaw": "`remoteClose` {number} `1` if this `Http2Stream` has been closed remotely.",
                      "name": "remoteClose",
                      "type": "number",
                      "desc": "`1` if this `Http2Stream` has been closed remotely."
                    },
                    {
                      "textRaw": "`sumDependencyWeight` {number} Legacy property, always set to `0`.",
                      "name": "sumDependencyWeight",
                      "type": "number",
                      "desc": "Legacy property, always set to `0`."
                    },
                    {
                      "textRaw": "`weight` {number} Legacy property, always set to `16`.",
                      "name": "weight",
                      "type": "number",
                      "desc": "Legacy property, always set to `16`."
                    }
                  ]
                }
              ],
              "methods": [
                {
                  "textRaw": "`http2stream.close(code[, callback])`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`code` {number} Unsigned 32-bit integer identifying the error code. **Default:** `http2.constants.NGHTTP2_NO_ERROR` (`0x00`).",
                          "name": "code",
                          "type": "number",
                          "default": "`http2.constants.NGHTTP2_NO_ERROR` (`0x00`)",
                          "desc": "Unsigned 32-bit integer identifying the error code."
                        },
                        {
                          "textRaw": "`callback` {Function} An optional function registered to listen for the `'close'` event.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "An optional function registered to listen for the `'close'` event.",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Closes the <code>Http2Stream</code> instance by sending an <code>RST_STREAM</code> frame to the\nconnected HTTP/2 peer.</p>"
                },
                {
                  "textRaw": "`http2stream.priority(options)`",
                  "name": "priority",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58293",
                        "description": "This method no longer sets the priority of the stream. Using it now triggers a runtime warning."
                      }
                    ],
                    "deprecated": [
                      "v24.2.0",
                      "v22.17.0",
                      "v20.19.6"
                    ]
                  },
                  "stability": 0,
                  "stabilityText": "Deprecated: support for priority signaling has been deprecated in the RFC 9113 and is no longer supported in Node.js.",
                  "signatures": [
                    {
                      "params": [
                        {
                          "name": "options"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Empty method, only there to maintain some backward compatibility.</p>"
                },
                {
                  "textRaw": "`http2stream.setTimeout(msecs, callback)`",
                  "name": "setTimeout",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`msecs` {number}",
                          "name": "msecs",
                          "type": "number"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ]
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { connect, constants } from 'node:http2';\nconst client = connect('http://example.org:8000');\nconst { NGHTTP2_CANCEL } = constants;\nconst req = client.request({ ':path': '/' });\n\n// Cancel the stream if there's no activity after 5 seconds\nreq.setTimeout(5000, () => req.close(NGHTTP2_CANCEL));\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst client = http2.connect('http://example.org:8000');\nconst { NGHTTP2_CANCEL } = http2.constants;\nconst req = client.request({ ':path': '/' });\n\n// Cancel the stream if there's no activity after 5 seconds\nreq.setTimeout(5000, () => req.close(NGHTTP2_CANCEL));\n</code></pre>"
                },
                {
                  "textRaw": "`http2stream.sendTrailers(headers)`",
                  "name": "sendTrailers",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sends a trailing <code>HEADERS</code> frame to the connected HTTP/2 peer. This method\nwill cause the <code>Http2Stream</code> to be immediately closed and must only be\ncalled after the <code>'wantTrailers'</code> event has been emitted. When sending a\nrequest or sending a response, the <code>options.waitForTrailers</code> option must be set\nin order to keep the <code>Http2Stream</code> open after the final <code>DATA</code> frame so that\ntrailers can be sent.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer();\nserver.on('stream', (stream) => {\n  stream.respond(undefined, { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ xyz: 'abc' });\n  });\n  stream.end('Hello World');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  stream.respond(undefined, { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ xyz: 'abc' });\n  });\n  stream.end('Hello World');\n});\n</code></pre>\n<p>The HTTP/1 specification forbids trailers from containing HTTP/2 pseudo-header\nfields (e.g. <code>':method'</code>, <code>':path'</code>, etc).</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `ClientHttp2Stream`",
              "name": "ClientHttp2Stream",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends <a href=\"http2.html#class-http2stream\"><code>&#x3C;Http2Stream></code></a></li>\n</ul>\n<p>The <code>ClientHttp2Stream</code> class is an extension of <code>Http2Stream</code> that is\nused exclusively on HTTP/2 Clients. <code>Http2Stream</code> instances on the client\nprovide events such as <code>'response'</code> and <code>'push'</code> that are only relevant on\nthe client.</p>",
              "events": [
                {
                  "textRaw": "Event: `'continue'`",
                  "name": "continue",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.5.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the server sends a <code>100 Continue</code> status, usually because\nthe request contained <code>Expect: 100-continue</code>. This is an instruction that\nthe client should send the request body.</p>"
                },
                {
                  "textRaw": "Event: `'headers'`",
                  "name": "headers",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`headers` {HTTP/2 Headers Object}",
                      "name": "headers",
                      "type": "HTTP/2 Headers Object"
                    },
                    {
                      "textRaw": "`flags` {number}",
                      "name": "flags",
                      "type": "number"
                    },
                    {
                      "textRaw": "`rawHeaders` {HTTP/2 Raw Headers}",
                      "name": "rawHeaders",
                      "type": "HTTP/2 Raw Headers"
                    }
                  ],
                  "desc": "<p>The <code>'headers'</code> event is emitted when an additional block of headers is received\nfor a stream, such as when a block of <code>1xx</code> informational headers is received.\nThe listener callback is passed the <a href=\"#headers-object\">HTTP/2 Headers Object</a>, flags associated\nwith the headers, and the headers in raw format (see <a href=\"#raw-headers\">HTTP/2 Raw Headers</a>).</p>\n<pre><code class=\"language-js\">stream.on('headers', (headers, flags) => {\n  console.log(headers);\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'push'`",
                  "name": "push",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`headers` {HTTP/2 Headers Object}",
                      "name": "headers",
                      "type": "HTTP/2 Headers Object"
                    },
                    {
                      "textRaw": "`flags` {number}",
                      "name": "flags",
                      "type": "number"
                    },
                    {
                      "textRaw": "`rawHeaders` {HTTP/2 Raw Headers}",
                      "name": "rawHeaders",
                      "type": "HTTP/2 Raw Headers"
                    }
                  ],
                  "desc": "<p>The <code>'push'</code> event is emitted when response headers for a Server Push stream\nare received. The listener callback is passed the <a href=\"#headers-object\">HTTP/2 Headers Object</a>, flags associated\nwith the headers, and the headers in raw format (see <a href=\"#raw-headers\">HTTP/2 Raw Headers</a>).</p>\n<pre><code class=\"language-js\">stream.on('push', (headers, flags) => {\n  console.log(headers);\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'response'`",
                  "name": "response",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`headers` {HTTP/2 Headers Object}",
                      "name": "headers",
                      "type": "HTTP/2 Headers Object"
                    },
                    {
                      "textRaw": "`flags` {number}",
                      "name": "flags",
                      "type": "number"
                    },
                    {
                      "textRaw": "`rawHeaders` {HTTP/2 Raw Headers}",
                      "name": "rawHeaders",
                      "type": "HTTP/2 Raw Headers"
                    }
                  ],
                  "desc": "<p>The <code>'response'</code> event is emitted when a response <code>HEADERS</code> frame has been\nreceived for this stream from the connected HTTP/2 server. The listener is\ninvoked with three arguments: an <code>Object</code> containing the received\n<a href=\"#headers-object\">HTTP/2 Headers Object</a>, flags associated with the headers, and the headers\nin raw format (see <a href=\"#raw-headers\">HTTP/2 Raw Headers</a>).</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:http2';\nconst client = connect('https://localhost');\nconst req = client.request({ ':path': '/' });\nreq.on('response', (headers, flags) => {\n  console.log(headers[':status']);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst client = http2.connect('https://localhost');\nconst req = client.request({ ':path': '/' });\nreq.on('response', (headers, flags) => {\n  console.log(headers[':status']);\n});\n</code></pre>"
                }
              ]
            },
            {
              "textRaw": "Class: `ServerHttp2Stream`",
              "name": "ServerHttp2Stream",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"http2.html#class-http2stream\"><code>&#x3C;Http2Stream></code></a></li>\n</ul>\n<p>The <code>ServerHttp2Stream</code> class is an extension of <a href=\"#class-http2stream\"><code>Http2Stream</code></a> that is\nused exclusively on HTTP/2 Servers. <code>Http2Stream</code> instances on the server\nprovide additional methods such as <code>http2stream.pushStream()</code> and\n<code>http2stream.respond()</code> that are only relevant on the server.</p>",
              "methods": [
                {
                  "textRaw": "`http2stream.additionalHeaders(headers)`",
                  "name": "additionalHeaders",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sends an additional informational <code>HEADERS</code> frame to the connected HTTP/2 peer.</p>"
                },
                {
                  "textRaw": "`http2stream.pushStream(headers[, options], callback)`",
                  "name": "pushStream",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`exclusive` {boolean} When `true` and `parent` identifies a parent Stream, the created stream is made the sole direct dependency of the parent, with all other existing dependents made a dependent of the newly created stream. **Default:** `false`.",
                              "name": "exclusive",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "When `true` and `parent` identifies a parent Stream, the created stream is made the sole direct dependency of the parent, with all other existing dependents made a dependent of the newly created stream."
                            },
                            {
                              "textRaw": "`parent` {number} Specifies the numeric identifier of a stream the newly created stream is dependent on.",
                              "name": "parent",
                              "type": "number",
                              "desc": "Specifies the numeric identifier of a stream the newly created stream is dependent on."
                            }
                          ],
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function} Callback that is called once the push stream has been initiated.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "Callback that is called once the push stream has been initiated.",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            },
                            {
                              "textRaw": "`pushStream` {ServerHttp2Stream} The returned `pushStream` object.",
                              "name": "pushStream",
                              "type": "ServerHttp2Stream",
                              "desc": "The returned `pushStream` object."
                            },
                            {
                              "textRaw": "`headers` {HTTP/2 Headers Object} Headers object the `pushStream` was initiated with.",
                              "name": "headers",
                              "type": "HTTP/2 Headers Object",
                              "desc": "Headers object the `pushStream` was initiated with."
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Initiates a push stream. The callback is invoked with the new <code>Http2Stream</code>\ninstance created for the push stream passed as the second argument, or an\n<code>Error</code> passed as the first argument.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer();\nserver.on('stream', (stream) => {\n  stream.respond({ ':status': 200 });\n  stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => {\n    if (err) throw err;\n    pushStream.respond({ ':status': 200 });\n    pushStream.end('some pushed data');\n  });\n  stream.end('some data');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  stream.respond({ ':status': 200 });\n  stream.pushStream({ ':path': '/' }, (err, pushStream, headers) => {\n    if (err) throw err;\n    pushStream.respond({ ':status': 200 });\n    pushStream.end('some pushed data');\n  });\n  stream.end('some data');\n});\n</code></pre>\n<p>Setting the weight of a push stream is not allowed in the <code>HEADERS</code> frame. Pass\na <code>weight</code> value to <code>http2stream.priority</code> with the <code>silent</code> option set to\n<code>true</code> to enable server-side bandwidth balancing between concurrent streams.</p>\n<p>Calling <code>http2stream.pushStream()</code> from within a pushed stream is not permitted\nand will throw an error.</p>"
                },
                {
                  "textRaw": "`http2stream.respond([headers[, options]])`",
                  "name": "respond",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.7.0",
                          "v22.20.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/59455",
                        "description": "Allow passing headers in raw array format."
                      },
                      {
                        "version": [
                          "v14.5.0",
                          "v12.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/33160",
                        "description": "Allow explicitly setting date headers."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`endStream` {boolean} Set to `true` to indicate that the response will not include payload data.",
                              "name": "endStream",
                              "type": "boolean",
                              "desc": "Set to `true` to indicate that the response will not include payload data."
                            },
                            {
                              "textRaw": "`waitForTrailers` {boolean} When `true`, the `Http2Stream` will emit the `'wantTrailers'` event after the final `DATA` frame has been sent.",
                              "name": "waitForTrailers",
                              "type": "boolean",
                              "desc": "When `true`, the `Http2Stream` will emit the `'wantTrailers'` event after the final `DATA` frame has been sent."
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer();\nserver.on('stream', (stream) => {\n  stream.respond({ ':status': 200 });\n  stream.end('some data');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  stream.respond({ ':status': 200 });\n  stream.end('some data');\n});\n</code></pre>\n<p>Initiates a response. When the <code>options.waitForTrailers</code> option is set, the\n<code>'wantTrailers'</code> event will be emitted immediately after queuing the last chunk\nof payload data to be sent. The <code>http2stream.sendTrailers()</code> method can then be\nused to sent trailing header fields to the peer.</p>\n<p>When <code>options.waitForTrailers</code> is set, the <code>Http2Stream</code> will not automatically\nclose when the final <code>DATA</code> frame is transmitted. User code must call either\n<code>http2stream.sendTrailers()</code> or <code>http2stream.close()</code> to close the\n<code>Http2Stream</code>.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer();\nserver.on('stream', (stream) => {\n  stream.respond({ ':status': 200 }, { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ ABC: 'some value to send' });\n  });\n  stream.end('some data');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  stream.respond({ ':status': 200 }, { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ ABC: 'some value to send' });\n  });\n  stream.end('some data');\n});\n</code></pre>"
                },
                {
                  "textRaw": "`http2stream.respondWithFD(fd[, headers[, options]])`",
                  "name": "respondWithFD",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v14.5.0",
                          "v12.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/33160",
                        "description": "Allow explicitly setting date headers."
                      },
                      {
                        "version": "v12.12.0",
                        "pr-url": "https://github.com/nodejs/node/pull/29876",
                        "description": "The `fd` option may now be a `FileHandle`."
                      },
                      {
                        "version": "v10.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/18936",
                        "description": "Any readable file descriptor, not necessarily for a regular file, is supported now."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`fd` {number|FileHandle} A readable file descriptor.",
                          "name": "fd",
                          "type": "number|FileHandle",
                          "desc": "A readable file descriptor."
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`statCheck` {Function}",
                              "name": "statCheck",
                              "type": "Function"
                            },
                            {
                              "textRaw": "`waitForTrailers` {boolean} When `true`, the `Http2Stream` will emit the `'wantTrailers'` event after the final `DATA` frame has been sent.",
                              "name": "waitForTrailers",
                              "type": "boolean",
                              "desc": "When `true`, the `Http2Stream` will emit the `'wantTrailers'` event after the final `DATA` frame has been sent."
                            },
                            {
                              "textRaw": "`offset` {number} The offset position at which to begin reading.",
                              "name": "offset",
                              "type": "number",
                              "desc": "The offset position at which to begin reading."
                            },
                            {
                              "textRaw": "`length` {number} The amount of data from the fd to send.",
                              "name": "length",
                              "type": "number",
                              "desc": "The amount of data from the fd to send."
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Initiates a response whose data is read from the given file descriptor. No\nvalidation is performed on the given file descriptor. If an error occurs while\nattempting to read data using the file descriptor, the <code>Http2Stream</code> will be\nclosed using an <code>RST_STREAM</code> frame using the standard <code>INTERNAL_ERROR</code> code.</p>\n<p>When used, the <code>Http2Stream</code> object's <code>Duplex</code> interface will be closed\nautomatically.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nimport { openSync, fstatSync, closeSync } from 'node:fs';\n\nconst server = createServer();\nserver.on('stream', (stream) => {\n  const fd = openSync('/some/file', 'r');\n\n  const stat = fstatSync(fd);\n  const headers = {\n    'content-length': stat.size,\n    'last-modified': stat.mtime.toUTCString(),\n    'content-type': 'text/plain; charset=utf-8',\n  };\n  stream.respondWithFD(fd, headers);\n  stream.on('close', () => closeSync(fd));\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst fs = require('node:fs');\n\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  const fd = fs.openSync('/some/file', 'r');\n\n  const stat = fs.fstatSync(fd);\n  const headers = {\n    'content-length': stat.size,\n    'last-modified': stat.mtime.toUTCString(),\n    'content-type': 'text/plain; charset=utf-8',\n  };\n  stream.respondWithFD(fd, headers);\n  stream.on('close', () => fs.closeSync(fd));\n});\n</code></pre>\n<p>The optional <code>options.statCheck</code> function may be specified to give user code\nan opportunity to set additional content headers based on the <code>fs.Stat</code> details\nof the given fd. If the <code>statCheck</code> function is provided, the\n<code>http2stream.respondWithFD()</code> method will perform an <code>fs.fstat()</code> call to\ncollect details on the provided file descriptor.</p>\n<p>The <code>offset</code> and <code>length</code> options may be used to limit the response to a\nspecific range subset. This can be used, for instance, to support HTTP Range\nrequests.</p>\n<p>The file descriptor or <code>FileHandle</code> is not closed when the stream is closed,\nso it will need to be closed manually once it is no longer needed.\nUsing the same file descriptor concurrently for multiple streams\nis not supported and may result in data loss. Re-using a file descriptor\nafter a stream has finished is supported.</p>\n<p>When the <code>options.waitForTrailers</code> option is set, the <code>'wantTrailers'</code> event\nwill be emitted immediately after queuing the last chunk of payload data to be\nsent. The <code>http2stream.sendTrailers()</code> method can then be used to sent trailing\nheader fields to the peer.</p>\n<p>When <code>options.waitForTrailers</code> is set, the <code>Http2Stream</code> will not automatically\nclose when the final <code>DATA</code> frame is transmitted. User code <em>must</em> call either\n<code>http2stream.sendTrailers()</code> or <code>http2stream.close()</code> to close the\n<code>Http2Stream</code>.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nimport { openSync, fstatSync, closeSync } from 'node:fs';\n\nconst server = createServer();\nserver.on('stream', (stream) => {\n  const fd = openSync('/some/file', 'r');\n\n  const stat = fstatSync(fd);\n  const headers = {\n    'content-length': stat.size,\n    'last-modified': stat.mtime.toUTCString(),\n    'content-type': 'text/plain; charset=utf-8',\n  };\n  stream.respondWithFD(fd, headers, { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ ABC: 'some value to send' });\n  });\n\n  stream.on('close', () => closeSync(fd));\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst fs = require('node:fs');\n\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  const fd = fs.openSync('/some/file', 'r');\n\n  const stat = fs.fstatSync(fd);\n  const headers = {\n    'content-length': stat.size,\n    'last-modified': stat.mtime.toUTCString(),\n    'content-type': 'text/plain; charset=utf-8',\n  };\n  stream.respondWithFD(fd, headers, { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ ABC: 'some value to send' });\n  });\n\n  stream.on('close', () => fs.closeSync(fd));\n});\n</code></pre>"
                },
                {
                  "textRaw": "`http2stream.respondWithFile(path[, headers[, options]])`",
                  "name": "respondWithFile",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v14.5.0",
                          "v12.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/33160",
                        "description": "Allow explicitly setting date headers."
                      },
                      {
                        "version": "v10.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/18936",
                        "description": "Any readable file, not necessarily a regular file, is supported now."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`path` {string|Buffer|URL}",
                          "name": "path",
                          "type": "string|Buffer|URL"
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`statCheck` {Function}",
                              "name": "statCheck",
                              "type": "Function"
                            },
                            {
                              "textRaw": "`onError` {Function} Callback function invoked in the case of an error before send.",
                              "name": "onError",
                              "type": "Function",
                              "desc": "Callback function invoked in the case of an error before send."
                            },
                            {
                              "textRaw": "`waitForTrailers` {boolean} When `true`, the `Http2Stream` will emit the `'wantTrailers'` event after the final `DATA` frame has been sent.",
                              "name": "waitForTrailers",
                              "type": "boolean",
                              "desc": "When `true`, the `Http2Stream` will emit the `'wantTrailers'` event after the final `DATA` frame has been sent."
                            },
                            {
                              "textRaw": "`offset` {number} The offset position at which to begin reading.",
                              "name": "offset",
                              "type": "number",
                              "desc": "The offset position at which to begin reading."
                            },
                            {
                              "textRaw": "`length` {number} The amount of data from the fd to send.",
                              "name": "length",
                              "type": "number",
                              "desc": "The amount of data from the fd to send."
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sends a regular file as the response. The <code>path</code> must specify a regular file\nor an <code>'error'</code> event will be emitted on the <code>Http2Stream</code> object.</p>\n<p>When used, the <code>Http2Stream</code> object's <code>Duplex</code> interface will be closed\nautomatically.</p>\n<p>The optional <code>options.statCheck</code> function may be specified to give user code\nan opportunity to set additional content headers based on the <code>fs.Stat</code> details\nof the given file:</p>\n<p>If an error occurs while attempting to read the file data, the <code>Http2Stream</code>\nwill be closed using an <code>RST_STREAM</code> frame using the standard <code>INTERNAL_ERROR</code>\ncode. If the <code>onError</code> callback is defined, then it will be called. Otherwise\nthe stream will be destroyed.</p>\n<p>Example using a file path:</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer();\nserver.on('stream', (stream) => {\n  function statCheck(stat, headers) {\n    headers['last-modified'] = stat.mtime.toUTCString();\n  }\n\n  function onError(err) {\n    // stream.respond() can throw if the stream has been destroyed by\n    // the other side.\n    try {\n      if (err.code === 'ENOENT') {\n        stream.respond({ ':status': 404 });\n      } else {\n        stream.respond({ ':status': 500 });\n      }\n    } catch (err) {\n      // Perform actual error handling.\n      console.error(err);\n    }\n    stream.end();\n  }\n\n  stream.respondWithFile('/some/file',\n                         { 'content-type': 'text/plain; charset=utf-8' },\n                         { statCheck, onError });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  function statCheck(stat, headers) {\n    headers['last-modified'] = stat.mtime.toUTCString();\n  }\n\n  function onError(err) {\n    // stream.respond() can throw if the stream has been destroyed by\n    // the other side.\n    try {\n      if (err.code === 'ENOENT') {\n        stream.respond({ ':status': 404 });\n      } else {\n        stream.respond({ ':status': 500 });\n      }\n    } catch (err) {\n      // Perform actual error handling.\n      console.error(err);\n    }\n    stream.end();\n  }\n\n  stream.respondWithFile('/some/file',\n                         { 'content-type': 'text/plain; charset=utf-8' },\n                         { statCheck, onError });\n});\n</code></pre>\n<p>The <code>options.statCheck</code> function may also be used to cancel the send operation\nby returning <code>false</code>. For instance, a conditional request may check the stat\nresults to determine if the file has been modified to return an appropriate\n<code>304</code> response:</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer();\nserver.on('stream', (stream) => {\n  function statCheck(stat, headers) {\n    // Check the stat here...\n    stream.respond({ ':status': 304 });\n    return false; // Cancel the send operation\n  }\n  stream.respondWithFile('/some/file',\n                         { 'content-type': 'text/plain; charset=utf-8' },\n                         { statCheck });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  function statCheck(stat, headers) {\n    // Check the stat here...\n    stream.respond({ ':status': 304 });\n    return false; // Cancel the send operation\n  }\n  stream.respondWithFile('/some/file',\n                         { 'content-type': 'text/plain; charset=utf-8' },\n                         { statCheck });\n});\n</code></pre>\n<p>The <code>content-length</code> header field will be automatically set.</p>\n<p>The <code>offset</code> and <code>length</code> options may be used to limit the response to a\nspecific range subset. This can be used, for instance, to support HTTP Range\nrequests.</p>\n<p>The <code>options.onError</code> function may also be used to handle all the errors\nthat could happen before the delivery of the file is initiated. The\ndefault behavior is to destroy the stream.</p>\n<p>When the <code>options.waitForTrailers</code> option is set, the <code>'wantTrailers'</code> event\nwill be emitted immediately after queuing the last chunk of payload data to be\nsent. The <code>http2stream.sendTrailers()</code> method can then be used to sent trailing\nheader fields to the peer.</p>\n<p>When <code>options.waitForTrailers</code> is set, the <code>Http2Stream</code> will not automatically\nclose when the final <code>DATA</code> frame is transmitted. User code must call either\n<code>http2stream.sendTrailers()</code> or <code>http2stream.close()</code> to close the\n<code>Http2Stream</code>.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer();\nserver.on('stream', (stream) => {\n  stream.respondWithFile('/some/file',\n                         { 'content-type': 'text/plain; charset=utf-8' },\n                         { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ ABC: 'some value to send' });\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer();\nserver.on('stream', (stream) => {\n  stream.respondWithFile('/some/file',\n                         { 'content-type': 'text/plain; charset=utf-8' },\n                         { waitForTrailers: true });\n  stream.on('wantTrailers', () => {\n    stream.sendTrailers({ ABC: 'some value to send' });\n  });\n});\n</code></pre>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {boolean}",
                  "name": "headersSent",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>True if headers were sent, false otherwise (read-only).</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "pushAllowed",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Read-only property mapped to the <code>SETTINGS_ENABLE_PUSH</code> flag of the remote\nclient's most recent <code>SETTINGS</code> frame. Will be <code>true</code> if the remote peer\naccepts push streams, <code>false</code> otherwise. Settings are the same for every\n<code>Http2Stream</code> in the same <code>Http2Session</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `Http2Server`",
              "name": "Http2Server",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"net.html#class-netserver\"><code>&#x3C;net.Server></code></a></li>\n</ul>\n<p>Instances of <code>Http2Server</code> are created using the <code>http2.createServer()</code>\nfunction. The <code>Http2Server</code> class is not exported directly by the\n<code>node:http2</code> module.</p>",
              "events": [
                {
                  "textRaw": "Event: `'checkContinue'`",
                  "name": "checkContinue",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`request` {http2.Http2ServerRequest}",
                      "name": "request",
                      "type": "http2.Http2ServerRequest"
                    },
                    {
                      "textRaw": "`response` {http2.Http2ServerResponse}",
                      "name": "response",
                      "type": "http2.Http2ServerResponse"
                    }
                  ],
                  "desc": "<p>If a <a href=\"#event-request\"><code>'request'</code></a> listener is registered or <a href=\"#http2createserveroptions-onrequesthandler\"><code>http2.createServer()</code></a> is\nsupplied a callback function, the <code>'checkContinue'</code> event is emitted each time\na request with an HTTP <code>Expect: 100-continue</code> is received. If this event is\nnot listened for, the server will automatically respond with a status\n<code>100 Continue</code> as appropriate.</p>\n<p>Handling this event involves calling <a href=\"#responsewritecontinue\"><code>response.writeContinue()</code></a> if the\nclient should continue to send the request body, or generating an appropriate\nHTTP response (e.g. 400 Bad Request) if the client should not continue to send\nthe request body.</p>\n<p>When this event is emitted and handled, the <a href=\"#event-request\"><code>'request'</code></a> event will\nnot be emitted.</p>"
                },
                {
                  "textRaw": "Event: `'connection'`",
                  "name": "connection",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`socket` {stream.Duplex}",
                      "name": "socket",
                      "type": "stream.Duplex"
                    }
                  ],
                  "desc": "<p>This event is emitted when a new TCP stream is established. <code>socket</code> is\ntypically an object of type <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a>. Usually users will not want to\naccess this event.</p>\n<p>This event can also be explicitly emitted by users to inject connections\ninto the HTTP server. In that case, any <a href=\"stream.html#class-streamduplex\"><code>Duplex</code></a> stream can be passed.</p>"
                },
                {
                  "textRaw": "Event: `'request'`",
                  "name": "request",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`request` {http2.Http2ServerRequest}",
                      "name": "request",
                      "type": "http2.Http2ServerRequest"
                    },
                    {
                      "textRaw": "`response` {http2.Http2ServerResponse}",
                      "name": "response",
                      "type": "http2.Http2ServerResponse"
                    }
                  ],
                  "desc": "<p>Emitted each time there is a request. There may be multiple requests\nper session. See the <a href=\"#compatibility-api\">Compatibility API</a>.</p>"
                },
                {
                  "textRaw": "Event: `'session'`",
                  "name": "session",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`session` {ServerHttp2Session}",
                      "name": "session",
                      "type": "ServerHttp2Session"
                    }
                  ],
                  "desc": "<p>The <code>'session'</code> event is emitted when a new <code>Http2Session</code> is created by the\n<code>Http2Server</code>.</p>"
                },
                {
                  "textRaw": "Event: `'sessionError'`",
                  "name": "sessionError",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`session` {ServerHttp2Session}",
                      "name": "session",
                      "type": "ServerHttp2Session"
                    }
                  ],
                  "desc": "<p>The <code>'sessionError'</code> event is emitted when an <code>'error'</code> event is emitted by\nan <code>Http2Session</code> object associated with the <code>Http2Server</code>.</p>"
                },
                {
                  "textRaw": "Event: `'stream'`",
                  "name": "stream",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`stream` {Http2Stream} A reference to the stream",
                      "name": "stream",
                      "type": "Http2Stream",
                      "desc": "A reference to the stream"
                    },
                    {
                      "textRaw": "`headers` {HTTP/2 Headers Object} An object describing the headers",
                      "name": "headers",
                      "type": "HTTP/2 Headers Object",
                      "desc": "An object describing the headers"
                    },
                    {
                      "textRaw": "`flags` {number} The associated numeric flags",
                      "name": "flags",
                      "type": "number",
                      "desc": "The associated numeric flags"
                    },
                    {
                      "textRaw": "`rawHeaders` {HTTP/2 Raw Headers} An array containing the raw headers",
                      "name": "rawHeaders",
                      "type": "HTTP/2 Raw Headers",
                      "desc": "An array containing the raw headers"
                    }
                  ],
                  "desc": "<p>The <code>'stream'</code> event is emitted when a <code>'stream'</code> event has been emitted by\nan <code>Http2Session</code> associated with the server.</p>\n<p>See also <a href=\"#event-stream\"><code>Http2Session</code>'s <code>'stream'</code> event</a>.</p>\n<pre><code class=\"language-mjs\">import { createServer, constants } from 'node:http2';\nconst {\n  HTTP2_HEADER_METHOD,\n  HTTP2_HEADER_PATH,\n  HTTP2_HEADER_STATUS,\n  HTTP2_HEADER_CONTENT_TYPE,\n} = constants;\n\nconst server = createServer();\nserver.on('stream', (stream, headers, flags) => {\n  const method = headers[HTTP2_HEADER_METHOD];\n  const path = headers[HTTP2_HEADER_PATH];\n  // ...\n  stream.respond({\n    [HTTP2_HEADER_STATUS]: 200,\n    [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain; charset=utf-8',\n  });\n  stream.write('hello ');\n  stream.end('world');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst {\n  HTTP2_HEADER_METHOD,\n  HTTP2_HEADER_PATH,\n  HTTP2_HEADER_STATUS,\n  HTTP2_HEADER_CONTENT_TYPE,\n} = http2.constants;\n\nconst server = http2.createServer();\nserver.on('stream', (stream, headers, flags) => {\n  const method = headers[HTTP2_HEADER_METHOD];\n  const path = headers[HTTP2_HEADER_PATH];\n  // ...\n  stream.respond({\n    [HTTP2_HEADER_STATUS]: 200,\n    [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain; charset=utf-8',\n  });\n  stream.write('hello ');\n  stream.end('world');\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'timeout'`",
                  "name": "timeout",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v13.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/27558",
                        "description": "The default timeout changed from 120s to 0 (no timeout)."
                      }
                    ]
                  },
                  "params": [],
                  "desc": "<p>The <code>'timeout'</code> event is emitted when there is no activity on the Server for\na given number of milliseconds set using <code>http2server.setTimeout()</code>.\n<strong>Default:</strong> 0 (no timeout)</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`server.close([callback])`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Stops the server from establishing new sessions. This does not prevent new\nrequest streams from being created due to the persistent nature of HTTP/2\nsessions. To gracefully shut down the server, call <a href=\"#http2sessionclosecallback\"><code>http2session.close()</code></a> on\nall active sessions.</p>\n<p>If <code>callback</code> is provided, it is not invoked until all active sessions have been\nclosed, although the server has already stopped allowing new sessions. See\n<a href=\"net.html#serverclosecallback\"><code>net.Server.close()</code></a> for more details.</p>"
                },
                {
                  "textRaw": "`server[Symbol.asyncDispose]()`",
                  "name": "[Symbol.asyncDispose]",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v20.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.2.0",
                        "pr-url": "https://github.com/nodejs/node/pull/58467",
                        "description": "No longer experimental."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Calls <a href=\"#serverclosecallback\"><code>server.close()</code></a> and returns a promise that fulfills when the\nserver has closed.</p>"
                },
                {
                  "textRaw": "`server.setTimeout([msecs][, callback])`",
                  "name": "setTimeout",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      },
                      {
                        "version": "v13.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/27558",
                        "description": "The default timeout changed from 120s to 0 (no timeout)."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`msecs` {number} **Default:** 0 (no timeout)",
                          "name": "msecs",
                          "type": "number",
                          "default": "0 (no timeout)",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Http2Server}",
                        "name": "return",
                        "type": "Http2Server"
                      }
                    }
                  ],
                  "desc": "<p>Used to set the timeout value for http2 server requests,\nand sets a callback function that is called when there is no activity\non the <code>Http2Server</code> after <code>msecs</code> milliseconds.</p>\n<p>The given callback is registered as a listener on the <code>'timeout'</code> event.</p>\n<p>In case if <code>callback</code> is not a function, a new <code>ERR_INVALID_ARG_TYPE</code>\nerror will be thrown.</p>"
                },
                {
                  "textRaw": "`server.updateSettings([settings])`",
                  "name": "updateSettings",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`settings` {HTTP/2 Settings Object}",
                          "name": "settings",
                          "type": "HTTP/2 Settings Object",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Used to update the server with the provided settings.</p>\n<p>Throws <code>ERR_HTTP2_INVALID_SETTING_VALUE</code> for invalid <code>settings</code> values.</p>\n<p>Throws <code>ERR_INVALID_ARG_TYPE</code> for invalid <code>settings</code> argument.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number} Timeout in milliseconds. **Default:** 0 (no timeout)",
                  "name": "timeout",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v13.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/27558",
                        "description": "The default timeout changed from 120s to 0 (no timeout)."
                      }
                    ]
                  },
                  "default": "0 (no timeout)",
                  "desc": "<p>The number of milliseconds of inactivity before a socket is presumed\nto have timed out.</p>\n<p>A value of <code>0</code> will disable the timeout behavior on incoming connections.</p>\n<p>The socket timeout logic is set up on connection, so changing this\nvalue only affects new connections to the server, not any existing connections.</p>",
                  "shortDesc": "Timeout in milliseconds."
                }
              ]
            },
            {
              "textRaw": "Class: `Http2SecureServer`",
              "name": "Http2SecureServer",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"tls.html#class-tlsserver\"><code>&#x3C;tls.Server></code></a></li>\n</ul>\n<p>Instances of <code>Http2SecureServer</code> are created using the\n<code>http2.createSecureServer()</code> function. The <code>Http2SecureServer</code> class is not\nexported directly by the <code>node:http2</code> module.</p>",
              "events": [
                {
                  "textRaw": "Event: `'checkContinue'`",
                  "name": "checkContinue",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`request` {http2.Http2ServerRequest}",
                      "name": "request",
                      "type": "http2.Http2ServerRequest"
                    },
                    {
                      "textRaw": "`response` {http2.Http2ServerResponse}",
                      "name": "response",
                      "type": "http2.Http2ServerResponse"
                    }
                  ],
                  "desc": "<p>If a <a href=\"#event-request\"><code>'request'</code></a> listener is registered or <a href=\"#http2createsecureserveroptions-onrequesthandler\"><code>http2.createSecureServer()</code></a>\nis supplied a callback function, the <code>'checkContinue'</code> event is emitted each\ntime a request with an HTTP <code>Expect: 100-continue</code> is received. If this event\nis not listened for, the server will automatically respond with a status\n<code>100 Continue</code> as appropriate.</p>\n<p>Handling this event involves calling <a href=\"#responsewritecontinue\"><code>response.writeContinue()</code></a> if the\nclient should continue to send the request body, or generating an appropriate\nHTTP response (e.g. 400 Bad Request) if the client should not continue to send\nthe request body.</p>\n<p>When this event is emitted and handled, the <a href=\"#event-request\"><code>'request'</code></a> event will\nnot be emitted.</p>"
                },
                {
                  "textRaw": "Event: `'connection'`",
                  "name": "connection",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`socket` {stream.Duplex}",
                      "name": "socket",
                      "type": "stream.Duplex"
                    }
                  ],
                  "desc": "<p>This event is emitted when a new TCP stream is established, before the TLS\nhandshake begins. <code>socket</code> is typically an object of type <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a>.\nUsually users will not want to access this event.</p>\n<p>This event can also be explicitly emitted by users to inject connections\ninto the HTTP server. In that case, any <a href=\"stream.html#class-streamduplex\"><code>Duplex</code></a> stream can be passed.</p>"
                },
                {
                  "textRaw": "Event: `'request'`",
                  "name": "request",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`request` {http2.Http2ServerRequest}",
                      "name": "request",
                      "type": "http2.Http2ServerRequest"
                    },
                    {
                      "textRaw": "`response` {http2.Http2ServerResponse}",
                      "name": "response",
                      "type": "http2.Http2ServerResponse"
                    }
                  ],
                  "desc": "<p>Emitted each time there is a request. There may be multiple requests\nper session. See the <a href=\"#compatibility-api\">Compatibility API</a>.</p>"
                },
                {
                  "textRaw": "Event: `'session'`",
                  "name": "session",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`session` {ServerHttp2Session}",
                      "name": "session",
                      "type": "ServerHttp2Session"
                    }
                  ],
                  "desc": "<p>The <code>'session'</code> event is emitted when a new <code>Http2Session</code> is created by the\n<code>Http2SecureServer</code>.</p>"
                },
                {
                  "textRaw": "Event: `'sessionError'`",
                  "name": "sessionError",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`session` {ServerHttp2Session}",
                      "name": "session",
                      "type": "ServerHttp2Session"
                    }
                  ],
                  "desc": "<p>The <code>'sessionError'</code> event is emitted when an <code>'error'</code> event is emitted by\nan <code>Http2Session</code> object associated with the <code>Http2SecureServer</code>.</p>"
                },
                {
                  "textRaw": "Event: `'stream'`",
                  "name": "stream",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`stream` {Http2Stream} A reference to the stream",
                      "name": "stream",
                      "type": "Http2Stream",
                      "desc": "A reference to the stream"
                    },
                    {
                      "textRaw": "`headers` {HTTP/2 Headers Object} An object describing the headers",
                      "name": "headers",
                      "type": "HTTP/2 Headers Object",
                      "desc": "An object describing the headers"
                    },
                    {
                      "textRaw": "`flags` {number} The associated numeric flags",
                      "name": "flags",
                      "type": "number",
                      "desc": "The associated numeric flags"
                    },
                    {
                      "textRaw": "`rawHeaders` {HTTP/2 Raw Headers} An array containing the raw headers",
                      "name": "rawHeaders",
                      "type": "HTTP/2 Raw Headers",
                      "desc": "An array containing the raw headers"
                    }
                  ],
                  "desc": "<p>The <code>'stream'</code> event is emitted when a <code>'stream'</code> event has been emitted by\nan <code>Http2Session</code> associated with the server.</p>\n<p>See also <a href=\"#event-stream\"><code>Http2Session</code>'s <code>'stream'</code> event</a>.</p>\n<pre><code class=\"language-mjs\">import { createSecureServer, constants } from 'node:http2';\nconst {\n  HTTP2_HEADER_METHOD,\n  HTTP2_HEADER_PATH,\n  HTTP2_HEADER_STATUS,\n  HTTP2_HEADER_CONTENT_TYPE,\n} = constants;\n\nconst options = getOptionsSomehow();\n\nconst server = createSecureServer(options);\nserver.on('stream', (stream, headers, flags) => {\n  const method = headers[HTTP2_HEADER_METHOD];\n  const path = headers[HTTP2_HEADER_PATH];\n  // ...\n  stream.respond({\n    [HTTP2_HEADER_STATUS]: 200,\n    [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain; charset=utf-8',\n  });\n  stream.write('hello ');\n  stream.end('world');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst {\n  HTTP2_HEADER_METHOD,\n  HTTP2_HEADER_PATH,\n  HTTP2_HEADER_STATUS,\n  HTTP2_HEADER_CONTENT_TYPE,\n} = http2.constants;\n\nconst options = getOptionsSomehow();\n\nconst server = http2.createSecureServer(options);\nserver.on('stream', (stream, headers, flags) => {\n  const method = headers[HTTP2_HEADER_METHOD];\n  const path = headers[HTTP2_HEADER_PATH];\n  // ...\n  stream.respond({\n    [HTTP2_HEADER_STATUS]: 200,\n    [HTTP2_HEADER_CONTENT_TYPE]: 'text/plain; charset=utf-8',\n  });\n  stream.write('hello ');\n  stream.end('world');\n});\n</code></pre>"
                },
                {
                  "textRaw": "Event: `'timeout'`",
                  "name": "timeout",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'timeout'</code> event is emitted when there is no activity on the Server for\na given number of milliseconds set using <code>http2secureServer.setTimeout()</code>.\n<strong>Default:</strong> 2 minutes.</p>"
                },
                {
                  "textRaw": "Event: `'unknownProtocol'`",
                  "name": "unknownProtocol",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v19.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/44031",
                        "description": "This event will only be emitted if the client did not transmit an ALPN extension during the TLS handshake."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`socket` {stream.Duplex}",
                      "name": "socket",
                      "type": "stream.Duplex"
                    }
                  ],
                  "desc": "<p>The <code>'unknownProtocol'</code> event is emitted when a connecting client fails to\nnegotiate an allowed protocol (i.e. HTTP/2 or HTTP/1.1). The event handler\nreceives the socket for handling. If no listener is registered for this event,\nthe connection is terminated. A timeout may be specified using the\n<code>'unknownProtocolTimeout'</code> option passed to <a href=\"#http2createsecureserveroptions-onrequesthandler\"><code>http2.createSecureServer()</code></a>.</p>\n<p>In earlier versions of Node.js, this event would be emitted if <code>allowHTTP1</code> is\n<code>false</code> and, during the TLS handshake, the client either does not send an ALPN\nextension or sends an ALPN extension that does not include HTTP/2 (<code>h2</code>). Newer\nversions of Node.js only emit this event if <code>allowHTTP1</code> is <code>false</code> and the\nclient does not send an ALPN extension. If the client sends an ALPN extension\nthat does not include HTTP/2 (or HTTP/1.1 if <code>allowHTTP1</code> is <code>true</code>), the TLS\nhandshake will fail and no secure connection will be established.</p>\n<p>See the <a href=\"#compatibility-api\">Compatibility API</a>.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`server.close([callback])`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Stops the server from establishing new sessions. This does not prevent new\nrequest streams from being created due to the persistent nature of HTTP/2\nsessions. To gracefully shut down the server, call <a href=\"#http2sessionclosecallback\"><code>http2session.close()</code></a> on\nall active sessions.</p>\n<p>If <code>callback</code> is provided, it is not invoked until all active sessions have been\nclosed, although the server has already stopped allowing new sessions. See\n<a href=\"tls.html#serverclosecallback\"><code>tls.Server.close()</code></a> for more details.</p>"
                },
                {
                  "textRaw": "`server.setTimeout([msecs][, callback])`",
                  "name": "setTimeout",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`msecs` {number} **Default:** `120000` (2 minutes)",
                          "name": "msecs",
                          "type": "number",
                          "default": "`120000` (2 minutes)",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Http2SecureServer}",
                        "name": "return",
                        "type": "Http2SecureServer"
                      }
                    }
                  ],
                  "desc": "<p>Used to set the timeout value for http2 secure server requests,\nand sets a callback function that is called when there is no activity\non the <code>Http2SecureServer</code> after <code>msecs</code> milliseconds.</p>\n<p>The given callback is registered as a listener on the <code>'timeout'</code> event.</p>\n<p>In case if <code>callback</code> is not a function, a new <code>ERR_INVALID_ARG_TYPE</code>\nerror will be thrown.</p>"
                },
                {
                  "textRaw": "`server.updateSettings([settings])`",
                  "name": "updateSettings",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`settings` {HTTP/2 Settings Object}",
                          "name": "settings",
                          "type": "HTTP/2 Settings Object",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Used to update the server with the provided settings.</p>\n<p>Throws <code>ERR_HTTP2_INVALID_SETTING_VALUE</code> for invalid <code>settings</code> values.</p>\n<p>Throws <code>ERR_INVALID_ARG_TYPE</code> for invalid <code>settings</code> argument.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number} Timeout in milliseconds. **Default:** 0 (no timeout)",
                  "name": "timeout",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v13.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/27558",
                        "description": "The default timeout changed from 120s to 0 (no timeout)."
                      }
                    ]
                  },
                  "default": "0 (no timeout)",
                  "desc": "<p>The number of milliseconds of inactivity before a socket is presumed\nto have timed out.</p>\n<p>A value of <code>0</code> will disable the timeout behavior on incoming connections.</p>\n<p>The socket timeout logic is set up on connection, so changing this\nvalue only affects new connections to the server, not any existing connections.</p>",
                  "shortDesc": "Timeout in milliseconds."
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`http2.createServer([options][, onRequestHandler])`",
              "name": "createServer",
              "type": "method",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": [
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59917",
                    "description": "Added the `strictSingleValueFields` option."
                  },
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61713",
                    "description": "Added `http1Options` option. The `Http1IncomingMessage` and `Http1ServerResponse` options are now deprecated."
                  },
                  {
                    "version": [
                      "v23.0.0",
                      "v22.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/54875",
                    "description": "Added `streamResetBurst` and `streamResetRate`."
                  },
                  {
                    "version": [
                      "v15.10.0",
                      "v14.16.0",
                      "v12.21.0",
                      "v10.24.0"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/246",
                    "description": "Added `unknownProtocolTimeout` option with a default of 10000."
                  },
                  {
                    "version": [
                      "v14.4.0",
                      "v12.18.0",
                      "v10.21.0"
                    ],
                    "commit": "3948830ce6408be620b09a70bf66158623022af0",
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/204",
                    "description": "Added `maxSettings` option with a default of 32."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30534",
                    "description": "Added `maxSessionRejectedStreams` option with a default of 100."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30534",
                    "description": "Added `maxSessionInvalidFrames` option with a default of 1000."
                  },
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29144",
                    "description": "The `PADDING_STRATEGY_CALLBACK` has been made equivalent to providing `PADDING_STRATEGY_ALIGNED` and `selectPadding` has been removed."
                  },
                  {
                    "version": "v12.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27782",
                    "description": "The `options` parameter now supports `net.createServer()` options."
                  },
                  {
                    "version": "v9.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/15752",
                    "description": "Added the `Http1IncomingMessage` and `Http1ServerResponse` option."
                  },
                  {
                    "version": "v8.9.3",
                    "pr-url": "https://github.com/nodejs/node/pull/17105",
                    "description": "Added the `maxOutstandingPings` option with a default limit of 10."
                  },
                  {
                    "version": "v8.9.3",
                    "pr-url": "https://github.com/nodejs/node/pull/16676",
                    "description": "Added the `maxHeaderListPairs` option with a default limit of 128 header pairs."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`maxDeflateDynamicTableSize` {number} Sets the maximum dynamic table size for deflating header fields. **Default:** `4Kib`.",
                          "name": "maxDeflateDynamicTableSize",
                          "type": "number",
                          "default": "`4Kib`",
                          "desc": "Sets the maximum dynamic table size for deflating header fields."
                        },
                        {
                          "textRaw": "`maxSettings` {number} Sets the maximum number of settings entries per `SETTINGS` frame. The minimum value allowed is `1`. **Default:** `32`.",
                          "name": "maxSettings",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Sets the maximum number of settings entries per `SETTINGS` frame. The minimum value allowed is `1`."
                        },
                        {
                          "textRaw": "`maxSessionMemory`{number} Sets the maximum memory that the `Http2Session` is permitted to use. The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte. The minimum value allowed is `1`. This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded, but new `Http2Stream` instances will be rejected while this limit is exceeded. The current number of `Http2Stream` sessions, the current memory use of the header compression tables, current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit. **Default:** `10`.",
                          "name": "maxSessionMemory",
                          "type": "number",
                          "default": "`10`",
                          "desc": "Sets the maximum memory that the `Http2Session` is permitted to use. The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte. The minimum value allowed is `1`. This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded, but new `Http2Stream` instances will be rejected while this limit is exceeded. The current number of `Http2Stream` sessions, the current memory use of the header compression tables, current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit."
                        },
                        {
                          "textRaw": "`maxHeaderListPairs` {number} Sets the maximum number of header entries. This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module. The minimum value is `4`. **Default:** `128`.",
                          "name": "maxHeaderListPairs",
                          "type": "number",
                          "default": "`128`",
                          "desc": "Sets the maximum number of header entries. This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module. The minimum value is `4`."
                        },
                        {
                          "textRaw": "`maxOutstandingPings` {number} Sets the maximum number of outstanding, unacknowledged pings. **Default:** `10`.",
                          "name": "maxOutstandingPings",
                          "type": "number",
                          "default": "`10`",
                          "desc": "Sets the maximum number of outstanding, unacknowledged pings."
                        },
                        {
                          "textRaw": "`maxSendHeaderBlockLength` {number} Sets the maximum allowed size for a serialized, compressed block of headers. Attempts to send headers that exceed this limit will result in a `'frameError'` event being emitted and the stream being closed and destroyed. While this sets the maximum allowed size to the entire block of headers, `nghttp2` (the internal http2 library) has a limit of `65536` for each decompressed key/value pair.",
                          "name": "maxSendHeaderBlockLength",
                          "type": "number",
                          "desc": "Sets the maximum allowed size for a serialized, compressed block of headers. Attempts to send headers that exceed this limit will result in a `'frameError'` event being emitted and the stream being closed and destroyed. While this sets the maximum allowed size to the entire block of headers, `nghttp2` (the internal http2 library) has a limit of `65536` for each decompressed key/value pair."
                        },
                        {
                          "textRaw": "`paddingStrategy` {number} The strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames. **Default:** `http2.constants.PADDING_STRATEGY_NONE`. Value may be one of:",
                          "name": "paddingStrategy",
                          "type": "number",
                          "default": "`http2.constants.PADDING_STRATEGY_NONE`. Value may be one of:",
                          "desc": "The strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames.",
                          "options": [
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_NONE`: No padding is applied.",
                              "name": "http2.constants.PADDING_STRATEGY_NONE",
                              "desc": "No padding is applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_MAX`: The maximum amount of padding, determined by the internal implementation, is applied.",
                              "name": "http2.constants.PADDING_STRATEGY_MAX",
                              "desc": "The maximum amount of padding, determined by the internal implementation, is applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_ALIGNED`: Attempts to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, there is a maximum allowed number of padding bytes that is determined by current flow control state and settings. If this maximum is less than the calculated amount needed to ensure alignment, the maximum is used and the total frame length is not necessarily aligned at 8 bytes.",
                              "name": "http2.constants.PADDING_STRATEGY_ALIGNED",
                              "desc": "Attempts to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, there is a maximum allowed number of padding bytes that is determined by current flow control state and settings. If this maximum is less than the calculated amount needed to ensure alignment, the maximum is used and the total frame length is not necessarily aligned at 8 bytes."
                            }
                          ]
                        },
                        {
                          "textRaw": "`peerMaxConcurrentStreams` {number} Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received. Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`. **Default:** `100`.",
                          "name": "peerMaxConcurrentStreams",
                          "type": "number",
                          "default": "`100`",
                          "desc": "Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received. Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`."
                        },
                        {
                          "textRaw": "`maxSessionInvalidFrames` {integer} Sets the maximum number of invalid frames that will be tolerated before the session is closed. **Default:** `1000`.",
                          "name": "maxSessionInvalidFrames",
                          "type": "integer",
                          "default": "`1000`",
                          "desc": "Sets the maximum number of invalid frames that will be tolerated before the session is closed."
                        },
                        {
                          "textRaw": "`maxSessionRejectedStreams` {integer} Sets the maximum number of rejected upon creation streams that will be tolerated before the session is closed. Each rejection is associated with an `NGHTTP2_ENHANCE_YOUR_CALM` error that should tell the peer to not open any more streams, continuing to open streams is therefore regarded as a sign of a misbehaving peer. **Default:** `100`.",
                          "name": "maxSessionRejectedStreams",
                          "type": "integer",
                          "default": "`100`",
                          "desc": "Sets the maximum number of rejected upon creation streams that will be tolerated before the session is closed. Each rejection is associated with an `NGHTTP2_ENHANCE_YOUR_CALM` error that should tell the peer to not open any more streams, continuing to open streams is therefore regarded as a sign of a misbehaving peer."
                        },
                        {
                          "textRaw": "`settings` {HTTP/2 Settings Object} The initial settings to send to the remote peer upon connection.",
                          "name": "settings",
                          "type": "HTTP/2 Settings Object",
                          "desc": "The initial settings to send to the remote peer upon connection."
                        },
                        {
                          "textRaw": "`streamResetBurst` {number} and `streamResetRate` {number} Sets the rate limit for the incoming stream reset (RST_STREAM frame). Both settings must be set to have any effect, and default to 1000 and 33 respectively.",
                          "name": "streamResetBurst",
                          "type": "number",
                          "desc": "and `streamResetRate` {number} Sets the rate limit for the incoming stream reset (RST_STREAM frame). Both settings must be set to have any effect, and default to 1000 and 33 respectively."
                        },
                        {
                          "textRaw": "`remoteCustomSettings` {Array} The array of integer values determines the settings types, which are included in the `CustomSettings`-property of the received remoteSettings. Please see the `CustomSettings`-property of the `Http2Settings` object for more information, on the allowed setting types.",
                          "name": "remoteCustomSettings",
                          "type": "Array",
                          "desc": "The array of integer values determines the settings types, which are included in the `CustomSettings`-property of the received remoteSettings. Please see the `CustomSettings`-property of the `Http2Settings` object for more information, on the allowed setting types."
                        },
                        {
                          "textRaw": "`Http1IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage` class to used for HTTP/1 fallback. Useful for extending the original `http.IncomingMessage`. **Default:** `http.IncomingMessage`. **Deprecated.** Use `http1Options.IncomingMessage` instead. See DEP0202.",
                          "name": "Http1IncomingMessage",
                          "type": "http.IncomingMessage",
                          "default": "`http.IncomingMessage`. **Deprecated.** Use `http1Options.IncomingMessage` instead. See DEP0202",
                          "desc": "Specifies the `IncomingMessage` class to used for HTTP/1 fallback. Useful for extending the original `http.IncomingMessage`."
                        },
                        {
                          "textRaw": "`Http1ServerResponse` {http.ServerResponse} Specifies the `ServerResponse` class to used for HTTP/1 fallback. Useful for extending the original `http.ServerResponse`. **Default:** `http.ServerResponse`. **Deprecated.** Use `http1Options.ServerResponse` instead. See DEP0202.",
                          "name": "Http1ServerResponse",
                          "type": "http.ServerResponse",
                          "default": "`http.ServerResponse`. **Deprecated.** Use `http1Options.ServerResponse` instead. See DEP0202",
                          "desc": "Specifies the `ServerResponse` class to used for HTTP/1 fallback. Useful for extending the original `http.ServerResponse`."
                        },
                        {
                          "textRaw": "`http1Options` {Object} An options object for configuring the HTTP/1 fallback when `allowHTTP1` is `true`. These options are passed to the underlying HTTP/1 server. See `http.createServer()` for available options. Among others, the following are supported:",
                          "name": "http1Options",
                          "type": "Object",
                          "desc": "An options object for configuring the HTTP/1 fallback when `allowHTTP1` is `true`. These options are passed to the underlying HTTP/1 server. See `http.createServer()` for available options. Among others, the following are supported:",
                          "options": [
                            {
                              "textRaw": "`IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage` class to use for HTTP/1 fallback. **Default:** `http.IncomingMessage`.",
                              "name": "IncomingMessage",
                              "type": "http.IncomingMessage",
                              "default": "`http.IncomingMessage`",
                              "desc": "Specifies the `IncomingMessage` class to use for HTTP/1 fallback."
                            },
                            {
                              "textRaw": "`ServerResponse` {http.ServerResponse} Specifies the `ServerResponse` class to use for HTTP/1 fallback. **Default:** `http.ServerResponse`.",
                              "name": "ServerResponse",
                              "type": "http.ServerResponse",
                              "default": "`http.ServerResponse`",
                              "desc": "Specifies the `ServerResponse` class to use for HTTP/1 fallback."
                            },
                            {
                              "textRaw": "`keepAliveTimeout` {number} The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. **Default:** `5000`.",
                              "name": "keepAliveTimeout",
                              "type": "number",
                              "default": "`5000`",
                              "desc": "The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed."
                            }
                          ]
                        },
                        {
                          "textRaw": "`Http2ServerRequest` {http2.Http2ServerRequest} Specifies the `Http2ServerRequest` class to use. Useful for extending the original `Http2ServerRequest`. **Default:** `Http2ServerRequest`.",
                          "name": "Http2ServerRequest",
                          "type": "http2.Http2ServerRequest",
                          "default": "`Http2ServerRequest`",
                          "desc": "Specifies the `Http2ServerRequest` class to use. Useful for extending the original `Http2ServerRequest`."
                        },
                        {
                          "textRaw": "`Http2ServerResponse` {http2.Http2ServerResponse} Specifies the `Http2ServerResponse` class to use. Useful for extending the original `Http2ServerResponse`. **Default:** `Http2ServerResponse`.",
                          "name": "Http2ServerResponse",
                          "type": "http2.Http2ServerResponse",
                          "default": "`Http2ServerResponse`",
                          "desc": "Specifies the `Http2ServerResponse` class to use. Useful for extending the original `Http2ServerResponse`."
                        },
                        {
                          "textRaw": "`unknownProtocolTimeout` {number} Specifies a timeout in milliseconds that a server should wait when an `'unknownProtocol'` is emitted. If the socket has not been destroyed by that time the server will destroy it. **Default:** `10000`.",
                          "name": "unknownProtocolTimeout",
                          "type": "number",
                          "default": "`10000`",
                          "desc": "Specifies a timeout in milliseconds that a server should wait when an `'unknownProtocol'` is emitted. If the socket has not been destroyed by that time the server will destroy it."
                        },
                        {
                          "textRaw": "`strictFieldWhitespaceValidation` {boolean} If `true`, it turns on strict leading and trailing whitespace validation for HTTP/2 header field names and values as per RFC-9113. **Default:** `true`.",
                          "name": "strictFieldWhitespaceValidation",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If `true`, it turns on strict leading and trailing whitespace validation for HTTP/2 header field names and values as per RFC-9113."
                        },
                        {
                          "textRaw": "`strictSingleValueFields` {boolean} If `true`, strict validation is used for headers and trailers defined as having only a single value, such that an error is thrown if multiple values are provided. **Default:** `true`.",
                          "name": "strictSingleValueFields",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If `true`, strict validation is used for headers and trailers defined as having only a single value, such that an error is thrown if multiple values are provided."
                        },
                        {
                          "textRaw": "`...options` {Object} Any `net.createServer()` option can be provided.",
                          "name": "...options",
                          "type": "Object",
                          "desc": "Any `net.createServer()` option can be provided."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`onRequestHandler` {Function} See Compatibility API",
                      "name": "onRequestHandler",
                      "type": "Function",
                      "desc": "See Compatibility API",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Http2Server}",
                    "name": "return",
                    "type": "Http2Server"
                  }
                }
              ],
              "desc": "<p>Returns a <code>net.Server</code> instance that creates and manages <code>Http2Session</code>\ninstances.</p>\n<p>Since there are no browsers known that support\n<a href=\"https://http2.github.io/faq/#does-http2-require-encryption\">unencrypted HTTP/2</a>, the use of\n<a href=\"#http2createsecureserveroptions-onrequesthandler\"><code>http2.createSecureServer()</code></a> is necessary when communicating\nwith browser clients.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\n\n// Create an unencrypted HTTP/2 server.\n// Since there are no browsers known that support\n// unencrypted HTTP/2, the use of `createSecureServer()`\n// is necessary when communicating with browser clients.\nconst server = createServer();\n\nserver.on('stream', (stream, headers) => {\n  stream.respond({\n    'content-type': 'text/html; charset=utf-8',\n    ':status': 200,\n  });\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\n\n// Create an unencrypted HTTP/2 server.\n// Since there are no browsers known that support\n// unencrypted HTTP/2, the use of `http2.createSecureServer()`\n// is necessary when communicating with browser clients.\nconst server = http2.createServer();\n\nserver.on('stream', (stream, headers) => {\n  stream.respond({\n    'content-type': 'text/html; charset=utf-8',\n    ':status': 200,\n  });\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(8000);\n</code></pre>"
            },
            {
              "textRaw": "`http2.createSecureServer(options[, onRequestHandler])`",
              "name": "createSecureServer",
              "type": "method",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": [
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59917",
                    "description": "Added the `strictSingleValueFields` option."
                  },
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61713",
                    "description": "Added `http1Options` option."
                  },
                  {
                    "version": [
                      "v15.10.0",
                      "v14.16.0",
                      "v12.21.0",
                      "v10.24.0"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/246",
                    "description": "Added `unknownProtocolTimeout` option with a default of 10000."
                  },
                  {
                    "version": [
                      "v14.4.0",
                      "v12.18.0",
                      "v10.21.0"
                    ],
                    "commit": "3948830ce6408be620b09a70bf66158623022af0",
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/204",
                    "description": "Added `maxSettings` option with a default of 32."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30534",
                    "description": "Added `maxSessionRejectedStreams` option with a default of 100."
                  },
                  {
                    "version": [
                      "v13.3.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30534",
                    "description": "Added `maxSessionInvalidFrames` option with a default of 1000."
                  },
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29144",
                    "description": "The `PADDING_STRATEGY_CALLBACK` has been made equivalent to providing `PADDING_STRATEGY_ALIGNED` and `selectPadding` has been removed."
                  },
                  {
                    "version": "v10.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22956",
                    "description": "Added the `origins` option to automatically send an `ORIGIN` frame on `Http2Session` startup."
                  },
                  {
                    "version": "v8.9.3",
                    "pr-url": "https://github.com/nodejs/node/pull/17105",
                    "description": "Added the `maxOutstandingPings` option with a default limit of 10."
                  },
                  {
                    "version": "v8.9.3",
                    "pr-url": "https://github.com/nodejs/node/pull/16676",
                    "description": "Added the `maxHeaderListPairs` option with a default limit of 128 header pairs."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`allowHTTP1` {boolean} Incoming client connections that do not support HTTP/2 will be downgraded to HTTP/1.x when set to `true`. See the `'unknownProtocol'` event. See ALPN negotiation. **Default:** `false`.",
                          "name": "allowHTTP1",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Incoming client connections that do not support HTTP/2 will be downgraded to HTTP/1.x when set to `true`. See the `'unknownProtocol'` event. See ALPN negotiation."
                        },
                        {
                          "textRaw": "`maxDeflateDynamicTableSize` {number} Sets the maximum dynamic table size for deflating header fields. **Default:** `4Kib`.",
                          "name": "maxDeflateDynamicTableSize",
                          "type": "number",
                          "default": "`4Kib`",
                          "desc": "Sets the maximum dynamic table size for deflating header fields."
                        },
                        {
                          "textRaw": "`maxSettings` {number} Sets the maximum number of settings entries per `SETTINGS` frame. The minimum value allowed is `1`. **Default:** `32`.",
                          "name": "maxSettings",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Sets the maximum number of settings entries per `SETTINGS` frame. The minimum value allowed is `1`."
                        },
                        {
                          "textRaw": "`maxSessionMemory`{number} Sets the maximum memory that the `Http2Session` is permitted to use. The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte. The minimum value allowed is `1`. This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded, but new `Http2Stream` instances will be rejected while this limit is exceeded. The current number of `Http2Stream` sessions, the current memory use of the header compression tables, current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit. **Default:** `10`.",
                          "name": "maxSessionMemory",
                          "type": "number",
                          "default": "`10`",
                          "desc": "Sets the maximum memory that the `Http2Session` is permitted to use. The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte. The minimum value allowed is `1`. This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded, but new `Http2Stream` instances will be rejected while this limit is exceeded. The current number of `Http2Stream` sessions, the current memory use of the header compression tables, current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit."
                        },
                        {
                          "textRaw": "`maxHeaderListPairs` {number} Sets the maximum number of header entries. This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module. The minimum value is `4`. **Default:** `128`.",
                          "name": "maxHeaderListPairs",
                          "type": "number",
                          "default": "`128`",
                          "desc": "Sets the maximum number of header entries. This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module. The minimum value is `4`."
                        },
                        {
                          "textRaw": "`maxOutstandingPings` {number} Sets the maximum number of outstanding, unacknowledged pings. **Default:** `10`.",
                          "name": "maxOutstandingPings",
                          "type": "number",
                          "default": "`10`",
                          "desc": "Sets the maximum number of outstanding, unacknowledged pings."
                        },
                        {
                          "textRaw": "`maxSendHeaderBlockLength` {number} Sets the maximum allowed size for a serialized, compressed block of headers. Attempts to send headers that exceed this limit will result in a `'frameError'` event being emitted and the stream being closed and destroyed.",
                          "name": "maxSendHeaderBlockLength",
                          "type": "number",
                          "desc": "Sets the maximum allowed size for a serialized, compressed block of headers. Attempts to send headers that exceed this limit will result in a `'frameError'` event being emitted and the stream being closed and destroyed."
                        },
                        {
                          "textRaw": "`paddingStrategy` {number} Strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames. **Default:** `http2.constants.PADDING_STRATEGY_NONE`. Value may be one of:",
                          "name": "paddingStrategy",
                          "type": "number",
                          "default": "`http2.constants.PADDING_STRATEGY_NONE`. Value may be one of:",
                          "desc": "Strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames.",
                          "options": [
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_NONE`: No padding is applied.",
                              "name": "http2.constants.PADDING_STRATEGY_NONE",
                              "desc": "No padding is applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_MAX`: The maximum amount of padding, determined by the internal implementation, is applied.",
                              "name": "http2.constants.PADDING_STRATEGY_MAX",
                              "desc": "The maximum amount of padding, determined by the internal implementation, is applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_ALIGNED`: Attempts to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, there is a maximum allowed number of padding bytes that is determined by current flow control state and settings. If this maximum is less than the calculated amount needed to ensure alignment, the maximum is used and the total frame length is not necessarily aligned at 8 bytes.",
                              "name": "http2.constants.PADDING_STRATEGY_ALIGNED",
                              "desc": "Attempts to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, there is a maximum allowed number of padding bytes that is determined by current flow control state and settings. If this maximum is less than the calculated amount needed to ensure alignment, the maximum is used and the total frame length is not necessarily aligned at 8 bytes."
                            }
                          ]
                        },
                        {
                          "textRaw": "`peerMaxConcurrentStreams` {number} Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received. Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`. **Default:** `100`.",
                          "name": "peerMaxConcurrentStreams",
                          "type": "number",
                          "default": "`100`",
                          "desc": "Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received. Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`."
                        },
                        {
                          "textRaw": "`maxSessionInvalidFrames` {integer} Sets the maximum number of invalid frames that will be tolerated before the session is closed. **Default:** `1000`.",
                          "name": "maxSessionInvalidFrames",
                          "type": "integer",
                          "default": "`1000`",
                          "desc": "Sets the maximum number of invalid frames that will be tolerated before the session is closed."
                        },
                        {
                          "textRaw": "`maxSessionRejectedStreams` {integer} Sets the maximum number of rejected upon creation streams that will be tolerated before the session is closed. Each rejection is associated with an `NGHTTP2_ENHANCE_YOUR_CALM` error that should tell the peer to not open any more streams, continuing to open streams is therefore regarded as a sign of a misbehaving peer. **Default:** `100`.",
                          "name": "maxSessionRejectedStreams",
                          "type": "integer",
                          "default": "`100`",
                          "desc": "Sets the maximum number of rejected upon creation streams that will be tolerated before the session is closed. Each rejection is associated with an `NGHTTP2_ENHANCE_YOUR_CALM` error that should tell the peer to not open any more streams, continuing to open streams is therefore regarded as a sign of a misbehaving peer."
                        },
                        {
                          "textRaw": "`settings` {HTTP/2 Settings Object} The initial settings to send to the remote peer upon connection.",
                          "name": "settings",
                          "type": "HTTP/2 Settings Object",
                          "desc": "The initial settings to send to the remote peer upon connection."
                        },
                        {
                          "textRaw": "`streamResetBurst` {number} and `streamResetRate` {number} Sets the rate limit for the incoming stream reset (RST_STREAM frame). Both settings must be set to have any effect, and default to 1000 and 33 respectively.",
                          "name": "streamResetBurst",
                          "type": "number",
                          "desc": "and `streamResetRate` {number} Sets the rate limit for the incoming stream reset (RST_STREAM frame). Both settings must be set to have any effect, and default to 1000 and 33 respectively."
                        },
                        {
                          "textRaw": "`remoteCustomSettings` {Array} The array of integer values determines the settings types, which are included in the `customSettings`-property of the received remoteSettings. Please see the `customSettings`-property of the `Http2Settings` object for more information, on the allowed setting types.",
                          "name": "remoteCustomSettings",
                          "type": "Array",
                          "desc": "The array of integer values determines the settings types, which are included in the `customSettings`-property of the received remoteSettings. Please see the `customSettings`-property of the `Http2Settings` object for more information, on the allowed setting types."
                        },
                        {
                          "textRaw": "`...options` {Object} Any `tls.createServer()` options can be provided. For servers, the identity options (`pfx` or `key`/`cert`) are usually required.",
                          "name": "...options",
                          "type": "Object",
                          "desc": "Any `tls.createServer()` options can be provided. For servers, the identity options (`pfx` or `key`/`cert`) are usually required."
                        },
                        {
                          "textRaw": "`origins` {string[]} An array of origin strings to send within an `ORIGIN` frame immediately following creation of a new server `Http2Session`.",
                          "name": "origins",
                          "type": "string[]",
                          "desc": "An array of origin strings to send within an `ORIGIN` frame immediately following creation of a new server `Http2Session`."
                        },
                        {
                          "textRaw": "`unknownProtocolTimeout` {number} Specifies a timeout in milliseconds that a server should wait when an `'unknownProtocol'` event is emitted. If the socket has not been destroyed by that time the server will destroy it. **Default:** `10000`.",
                          "name": "unknownProtocolTimeout",
                          "type": "number",
                          "default": "`10000`",
                          "desc": "Specifies a timeout in milliseconds that a server should wait when an `'unknownProtocol'` event is emitted. If the socket has not been destroyed by that time the server will destroy it."
                        },
                        {
                          "textRaw": "`strictFieldWhitespaceValidation` {boolean} If `true`, it turns on strict leading and trailing whitespace validation for HTTP/2 header field names and values as per RFC-9113. **Default:** `true`.",
                          "name": "strictFieldWhitespaceValidation",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If `true`, it turns on strict leading and trailing whitespace validation for HTTP/2 header field names and values as per RFC-9113."
                        },
                        {
                          "textRaw": "`strictSingleValueFields` {boolean} If `true`, strict validation is used for headers and trailers defined as having only a single value, such that an error is thrown if multiple values are provided. **Default:** `true`.",
                          "name": "strictSingleValueFields",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If `true`, strict validation is used for headers and trailers defined as having only a single value, such that an error is thrown if multiple values are provided."
                        },
                        {
                          "textRaw": "`http1Options` {Object} An options object for configuring the HTTP/1 fallback when `allowHTTP1` is `true`. These options are passed to the underlying HTTP/1 server. See `http.createServer()` for available options. Among others, the following are supported:",
                          "name": "http1Options",
                          "type": "Object",
                          "desc": "An options object for configuring the HTTP/1 fallback when `allowHTTP1` is `true`. These options are passed to the underlying HTTP/1 server. See `http.createServer()` for available options. Among others, the following are supported:",
                          "options": [
                            {
                              "textRaw": "`IncomingMessage` {http.IncomingMessage} Specifies the `IncomingMessage` class to use for HTTP/1 fallback. **Default:** `http.IncomingMessage`.",
                              "name": "IncomingMessage",
                              "type": "http.IncomingMessage",
                              "default": "`http.IncomingMessage`",
                              "desc": "Specifies the `IncomingMessage` class to use for HTTP/1 fallback."
                            },
                            {
                              "textRaw": "`ServerResponse` {http.ServerResponse} Specifies the `ServerResponse` class to use for HTTP/1 fallback. **Default:** `http.ServerResponse`.",
                              "name": "ServerResponse",
                              "type": "http.ServerResponse",
                              "default": "`http.ServerResponse`",
                              "desc": "Specifies the `ServerResponse` class to use for HTTP/1 fallback."
                            },
                            {
                              "textRaw": "`keepAliveTimeout` {number} The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. **Default:** `5000`.",
                              "name": "keepAliveTimeout",
                              "type": "number",
                              "default": "`5000`",
                              "desc": "The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "textRaw": "`onRequestHandler` {Function} See Compatibility API",
                      "name": "onRequestHandler",
                      "type": "Function",
                      "desc": "See Compatibility API",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Http2SecureServer}",
                    "name": "return",
                    "type": "Http2SecureServer"
                  }
                }
              ],
              "desc": "<p>Returns a <code>tls.Server</code> instance that creates and manages <code>Http2Session</code>\ninstances.</p>\n<pre><code class=\"language-mjs\">import { createSecureServer } from 'node:http2';\nimport { readFileSync } from 'node:fs';\n\nconst options = {\n  key: readFileSync('server-key.pem'),\n  cert: readFileSync('server-cert.pem'),\n};\n\n// Create a secure HTTP/2 server\nconst server = createSecureServer(options);\n\nserver.on('stream', (stream, headers) => {\n  stream.respond({\n    'content-type': 'text/html; charset=utf-8',\n    ':status': 200,\n  });\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(8443);\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst fs = require('node:fs');\n\nconst options = {\n  key: fs.readFileSync('server-key.pem'),\n  cert: fs.readFileSync('server-cert.pem'),\n};\n\n// Create a secure HTTP/2 server\nconst server = http2.createSecureServer(options);\n\nserver.on('stream', (stream, headers) => {\n  stream.respond({\n    'content-type': 'text/html; charset=utf-8',\n    ':status': 200,\n  });\n  stream.end('&#x3C;h1>Hello World&#x3C;/h1>');\n});\n\nserver.listen(8443);\n</code></pre>"
            },
            {
              "textRaw": "`http2.connect(authority[, options][, listener])`",
              "name": "connect",
              "type": "method",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.10.0",
                      "v14.16.0",
                      "v12.21.0",
                      "v10.24.0"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/246",
                    "description": "Added `unknownProtocolTimeout` option with a default of 10000."
                  },
                  {
                    "version": [
                      "v14.4.0",
                      "v12.18.0",
                      "v10.21.0"
                    ],
                    "commit": "3948830ce6408be620b09a70bf66158623022af0",
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/204",
                    "description": "Added `maxSettings` option with a default of 32."
                  },
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/29144",
                    "description": "The `PADDING_STRATEGY_CALLBACK` has been made equivalent to providing `PADDING_STRATEGY_ALIGNED` and `selectPadding` has been removed."
                  },
                  {
                    "version": "v8.9.3",
                    "pr-url": "https://github.com/nodejs/node/pull/17105",
                    "description": "Added the `maxOutstandingPings` option with a default limit of 10."
                  },
                  {
                    "version": "v8.9.3",
                    "pr-url": "https://github.com/nodejs/node/pull/16676",
                    "description": "Added the `maxHeaderListPairs` option with a default limit of 128 header pairs."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`authority` {string|URL} The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored.",
                      "name": "authority",
                      "type": "string|URL",
                      "desc": "The remote HTTP/2 server to connect to. This must be in the form of a minimal, valid URL with the `http://` or `https://` prefix, host name, and IP port (if a non-default port is used). Userinfo (user ID and password), path, querystring, and fragment details in the URL will be ignored."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`maxDeflateDynamicTableSize` {number} Sets the maximum dynamic table size for deflating header fields. **Default:** `4Kib`.",
                          "name": "maxDeflateDynamicTableSize",
                          "type": "number",
                          "default": "`4Kib`",
                          "desc": "Sets the maximum dynamic table size for deflating header fields."
                        },
                        {
                          "textRaw": "`maxSettings` {number} Sets the maximum number of settings entries per `SETTINGS` frame. The minimum value allowed is `1`. **Default:** `32`.",
                          "name": "maxSettings",
                          "type": "number",
                          "default": "`32`",
                          "desc": "Sets the maximum number of settings entries per `SETTINGS` frame. The minimum value allowed is `1`."
                        },
                        {
                          "textRaw": "`maxSessionMemory`{number} Sets the maximum memory that the `Http2Session` is permitted to use. The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte. The minimum value allowed is `1`. This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded, but new `Http2Stream` instances will be rejected while this limit is exceeded. The current number of `Http2Stream` sessions, the current memory use of the header compression tables, current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit. **Default:** `10`.",
                          "name": "maxSessionMemory",
                          "type": "number",
                          "default": "`10`",
                          "desc": "Sets the maximum memory that the `Http2Session` is permitted to use. The value is expressed in terms of number of megabytes, e.g. `1` equal 1 megabyte. The minimum value allowed is `1`. This is a credit based limit, existing `Http2Stream`s may cause this limit to be exceeded, but new `Http2Stream` instances will be rejected while this limit is exceeded. The current number of `Http2Stream` sessions, the current memory use of the header compression tables, current data queued to be sent, and unacknowledged `PING` and `SETTINGS` frames are all counted towards the current limit."
                        },
                        {
                          "textRaw": "`maxHeaderListPairs` {number} Sets the maximum number of header entries. This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module. The minimum value is `1`. **Default:** `128`.",
                          "name": "maxHeaderListPairs",
                          "type": "number",
                          "default": "`128`",
                          "desc": "Sets the maximum number of header entries. This is similar to `server.maxHeadersCount` or `request.maxHeadersCount` in the `node:http` module. The minimum value is `1`."
                        },
                        {
                          "textRaw": "`maxOutstandingPings` {number} Sets the maximum number of outstanding, unacknowledged pings. **Default:** `10`.",
                          "name": "maxOutstandingPings",
                          "type": "number",
                          "default": "`10`",
                          "desc": "Sets the maximum number of outstanding, unacknowledged pings."
                        },
                        {
                          "textRaw": "`maxReservedRemoteStreams` {number} Sets the maximum number of reserved push streams the client will accept at any given time. Once the current number of currently reserved push streams exceeds reaches this limit, new push streams sent by the server will be automatically rejected. The minimum allowed value is 0. The maximum allowed value is 2<sup>32</sup>-1. A negative value sets this option to the maximum allowed value. **Default:** `200`.",
                          "name": "maxReservedRemoteStreams",
                          "type": "number",
                          "default": "`200`",
                          "desc": "Sets the maximum number of reserved push streams the client will accept at any given time. Once the current number of currently reserved push streams exceeds reaches this limit, new push streams sent by the server will be automatically rejected. The minimum allowed value is 0. The maximum allowed value is 2<sup>32</sup>-1. A negative value sets this option to the maximum allowed value."
                        },
                        {
                          "textRaw": "`maxSendHeaderBlockLength` {number} Sets the maximum allowed size for a serialized, compressed block of headers. Attempts to send headers that exceed this limit will result in a `'frameError'` event being emitted and the stream being closed and destroyed.",
                          "name": "maxSendHeaderBlockLength",
                          "type": "number",
                          "desc": "Sets the maximum allowed size for a serialized, compressed block of headers. Attempts to send headers that exceed this limit will result in a `'frameError'` event being emitted and the stream being closed and destroyed."
                        },
                        {
                          "textRaw": "`paddingStrategy` {number} Strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames. **Default:** `http2.constants.PADDING_STRATEGY_NONE`. Value may be one of:",
                          "name": "paddingStrategy",
                          "type": "number",
                          "default": "`http2.constants.PADDING_STRATEGY_NONE`. Value may be one of:",
                          "desc": "Strategy used for determining the amount of padding to use for `HEADERS` and `DATA` frames.",
                          "options": [
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_NONE`: No padding is applied.",
                              "name": "http2.constants.PADDING_STRATEGY_NONE",
                              "desc": "No padding is applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_MAX`: The maximum amount of padding, determined by the internal implementation, is applied.",
                              "name": "http2.constants.PADDING_STRATEGY_MAX",
                              "desc": "The maximum amount of padding, determined by the internal implementation, is applied."
                            },
                            {
                              "textRaw": "`http2.constants.PADDING_STRATEGY_ALIGNED`: Attempts to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, there is a maximum allowed number of padding bytes that is determined by current flow control state and settings. If this maximum is less than the calculated amount needed to ensure alignment, the maximum is used and the total frame length is not necessarily aligned at 8 bytes.",
                              "name": "http2.constants.PADDING_STRATEGY_ALIGNED",
                              "desc": "Attempts to apply enough padding to ensure that the total frame length, including the 9-byte header, is a multiple of 8. For each frame, there is a maximum allowed number of padding bytes that is determined by current flow control state and settings. If this maximum is less than the calculated amount needed to ensure alignment, the maximum is used and the total frame length is not necessarily aligned at 8 bytes."
                            }
                          ]
                        },
                        {
                          "textRaw": "`peerMaxConcurrentStreams` {number} Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received. Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`. **Default:** `100`.",
                          "name": "peerMaxConcurrentStreams",
                          "type": "number",
                          "default": "`100`",
                          "desc": "Sets the maximum number of concurrent streams for the remote peer as if a `SETTINGS` frame had been received. Will be overridden if the remote peer sets its own value for `maxConcurrentStreams`."
                        },
                        {
                          "textRaw": "`protocol` {string} The protocol to connect with, if not set in the `authority`. Value may be either `'http:'` or `'https:'`. **Default:** `'https:'`",
                          "name": "protocol",
                          "type": "string",
                          "default": "`'https:'`",
                          "desc": "The protocol to connect with, if not set in the `authority`. Value may be either `'http:'` or `'https:'`."
                        },
                        {
                          "textRaw": "`settings` {HTTP/2 Settings Object} The initial settings to send to the remote peer upon connection.",
                          "name": "settings",
                          "type": "HTTP/2 Settings Object",
                          "desc": "The initial settings to send to the remote peer upon connection."
                        },
                        {
                          "textRaw": "`remoteCustomSettings` {Array} The array of integer values determines the settings types, which are included in the `CustomSettings`-property of the received remoteSettings. Please see the `CustomSettings`-property of the `Http2Settings` object for more information, on the allowed setting types.",
                          "name": "remoteCustomSettings",
                          "type": "Array",
                          "desc": "The array of integer values determines the settings types, which are included in the `CustomSettings`-property of the received remoteSettings. Please see the `CustomSettings`-property of the `Http2Settings` object for more information, on the allowed setting types."
                        },
                        {
                          "textRaw": "`createConnection` {Function} An optional callback that receives the `URL` instance passed to `connect` and the `options` object, and returns any `Duplex` stream that is to be used as the connection for this session.",
                          "name": "createConnection",
                          "type": "Function",
                          "desc": "An optional callback that receives the `URL` instance passed to `connect` and the `options` object, and returns any `Duplex` stream that is to be used as the connection for this session."
                        },
                        {
                          "textRaw": "`...options` {Object} Any `net.connect()` or `tls.connect()` options can be provided.",
                          "name": "...options",
                          "type": "Object",
                          "desc": "Any `net.connect()` or `tls.connect()` options can be provided."
                        },
                        {
                          "textRaw": "`unknownProtocolTimeout` {number} Specifies a timeout in milliseconds that a server should wait when an `'unknownProtocol'` event is emitted. If the socket has not been destroyed by that time the server will destroy it. **Default:** `10000`.",
                          "name": "unknownProtocolTimeout",
                          "type": "number",
                          "default": "`10000`",
                          "desc": "Specifies a timeout in milliseconds that a server should wait when an `'unknownProtocol'` event is emitted. If the socket has not been destroyed by that time the server will destroy it."
                        },
                        {
                          "textRaw": "`strictFieldWhitespaceValidation` {boolean} If `true`, it turns on strict leading and trailing whitespace validation for HTTP/2 header field names and values as per RFC-9113. **Default:** `true`.",
                          "name": "strictFieldWhitespaceValidation",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If `true`, it turns on strict leading and trailing whitespace validation for HTTP/2 header field names and values as per RFC-9113."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`listener` {Function} Will be registered as a one-time listener of the `'connect'` event.",
                      "name": "listener",
                      "type": "Function",
                      "desc": "Will be registered as a one-time listener of the `'connect'` event.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ClientHttp2Session}",
                    "name": "return",
                    "type": "ClientHttp2Session"
                  }
                }
              ],
              "desc": "<p>Returns a <code>ClientHttp2Session</code> instance.</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:http2';\nconst client = connect('https://localhost:1234');\n\n/* Use the client */\n\nclient.close();\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst client = http2.connect('https://localhost:1234');\n\n/* Use the client */\n\nclient.close();\n</code></pre>"
            },
            {
              "textRaw": "`http2.getDefaultSettings()`",
              "name": "getDefaultSettings",
              "type": "method",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {HTTP/2 Settings Object}",
                    "name": "return",
                    "type": "HTTP/2 Settings Object"
                  }
                }
              ],
              "desc": "<p>Returns an object containing the default settings for an <code>Http2Session</code>\ninstance. This method returns a new object instance every time it is called\nso instances returned may be safely modified for use.</p>"
            },
            {
              "textRaw": "`http2.getPackedSettings([settings])`",
              "name": "getPackedSettings",
              "type": "method",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`settings` {HTTP/2 Settings Object}",
                      "name": "settings",
                      "type": "HTTP/2 Settings Object",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Returns a <code>Buffer</code> instance containing serialized representation of the given\nHTTP/2 settings as specified in the <a href=\"https://tools.ietf.org/html/rfc7540\">HTTP/2</a> specification. This is intended\nfor use with the <code>HTTP2-Settings</code> header field.</p>\n<pre><code class=\"language-mjs\">import { getPackedSettings } from 'node:http2';\n\nconst packed = getPackedSettings({ enablePush: false });\n\nconsole.log(packed.toString('base64'));\n// Prints: AAIAAAAA\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\n\nconst packed = http2.getPackedSettings({ enablePush: false });\n\nconsole.log(packed.toString('base64'));\n// Prints: AAIAAAAA\n</code></pre>"
            },
            {
              "textRaw": "`http2.getUnpackedSettings(buf)`",
              "name": "getUnpackedSettings",
              "type": "method",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buf` {Buffer|TypedArray} The packed settings.",
                      "name": "buf",
                      "type": "Buffer|TypedArray",
                      "desc": "The packed settings."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {HTTP/2 Settings Object}",
                    "name": "return",
                    "type": "HTTP/2 Settings Object"
                  }
                }
              ],
              "desc": "<p>Returns a <a href=\"#settings-object\">HTTP/2 Settings Object</a> containing the deserialized settings from\nthe given <code>Buffer</code> as generated by <code>http2.getPackedSettings()</code>.</p>"
            },
            {
              "textRaw": "`http2.performServerHandshake(socket[, options])`",
              "name": "performServerHandshake",
              "type": "method",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`socket` {stream.Duplex}",
                      "name": "socket",
                      "type": "stream.Duplex"
                    },
                    {
                      "textRaw": "`options` {Object} Any `http2.createServer()` option can be provided.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Any `http2.createServer()` option can be provided.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ServerHttp2Session}",
                    "name": "return",
                    "type": "ServerHttp2Session"
                  }
                }
              ],
              "desc": "<p>Create an HTTP/2 server session from an existing socket.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`http2.constants`",
              "name": "constants",
              "type": "property",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "modules": [
                {
                  "textRaw": "Error codes for `RST_STREAM` and `GOAWAY`",
                  "name": "error_codes_for_`rst_stream`_and_`goaway`",
                  "type": "module",
                  "desc": "<table>\n<thead>\n<tr>\n<th>Value</th>\n<th>Name</th>\n<th>Constant</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>0x00</code></td>\n<td>No Error</td>\n<td><code>http2.constants.NGHTTP2_NO_ERROR</code></td>\n</tr>\n<tr>\n<td><code>0x01</code></td>\n<td>Protocol Error</td>\n<td><code>http2.constants.NGHTTP2_PROTOCOL_ERROR</code></td>\n</tr>\n<tr>\n<td><code>0x02</code></td>\n<td>Internal Error</td>\n<td><code>http2.constants.NGHTTP2_INTERNAL_ERROR</code></td>\n</tr>\n<tr>\n<td><code>0x03</code></td>\n<td>Flow Control Error</td>\n<td><code>http2.constants.NGHTTP2_FLOW_CONTROL_ERROR</code></td>\n</tr>\n<tr>\n<td><code>0x04</code></td>\n<td>Settings Timeout</td>\n<td><code>http2.constants.NGHTTP2_SETTINGS_TIMEOUT</code></td>\n</tr>\n<tr>\n<td><code>0x05</code></td>\n<td>Stream Closed</td>\n<td><code>http2.constants.NGHTTP2_STREAM_CLOSED</code></td>\n</tr>\n<tr>\n<td><code>0x06</code></td>\n<td>Frame Size Error</td>\n<td><code>http2.constants.NGHTTP2_FRAME_SIZE_ERROR</code></td>\n</tr>\n<tr>\n<td><code>0x07</code></td>\n<td>Refused Stream</td>\n<td><code>http2.constants.NGHTTP2_REFUSED_STREAM</code></td>\n</tr>\n<tr>\n<td><code>0x08</code></td>\n<td>Cancel</td>\n<td><code>http2.constants.NGHTTP2_CANCEL</code></td>\n</tr>\n<tr>\n<td><code>0x09</code></td>\n<td>Compression Error</td>\n<td><code>http2.constants.NGHTTP2_COMPRESSION_ERROR</code></td>\n</tr>\n<tr>\n<td><code>0x0a</code></td>\n<td>Connect Error</td>\n<td><code>http2.constants.NGHTTP2_CONNECT_ERROR</code></td>\n</tr>\n<tr>\n<td><code>0x0b</code></td>\n<td>Enhance Your Calm</td>\n<td><code>http2.constants.NGHTTP2_ENHANCE_YOUR_CALM</code></td>\n</tr>\n<tr>\n<td><code>0x0c</code></td>\n<td>Inadequate Security</td>\n<td><code>http2.constants.NGHTTP2_INADEQUATE_SECURITY</code></td>\n</tr>\n<tr>\n<td><code>0x0d</code></td>\n<td>HTTP/1.1 Required</td>\n<td><code>http2.constants.NGHTTP2_HTTP_1_1_REQUIRED</code></td>\n</tr>\n</tbody>\n</table>\n<p>The <code>'timeout'</code> event is emitted when there is no activity on the Server for\na given number of milliseconds set using <code>http2server.setTimeout()</code>.</p>",
                  "displayName": "Error codes for `RST_STREAM` and `GOAWAY`"
                }
              ]
            },
            {
              "textRaw": "Type: {symbol}",
              "name": "sensitiveHeaders",
              "type": "symbol",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "desc": "<p>This symbol can be set as a property on the HTTP/2 headers object with an array\nvalue in order to provide a list of headers considered sensitive.\nSee <a href=\"#sensitive-headers\">Sensitive headers</a> for more details.</p>"
            }
          ],
          "displayName": "Core API"
        },
        {
          "textRaw": "Compatibility API",
          "name": "compatibility_api",
          "type": "module",
          "desc": "<p>The Compatibility API has the goal of providing a similar developer experience\nof HTTP/1 when using HTTP/2, making it possible to develop applications\nthat support both <a href=\"http.html\">HTTP/1</a> and HTTP/2. This API targets only the\n<strong>public API</strong> of the <a href=\"http.html\">HTTP/1</a>. However many modules use internal\nmethods or state, and those <em>are not supported</em> as it is a completely\ndifferent implementation.</p>\n<p>The following example creates an HTTP/2 server using the compatibility\nAPI:</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer((req, res) => {\n  res.setHeader('Content-Type', 'text/html');\n  res.setHeader('X-Foo', 'bar');\n  res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });\n  res.end('ok');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer((req, res) => {\n  res.setHeader('Content-Type', 'text/html');\n  res.setHeader('X-Foo', 'bar');\n  res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });\n  res.end('ok');\n});\n</code></pre>\n<p>In order to create a mixed <a href=\"https.html\">HTTPS</a> and HTTP/2 server, refer to the\n<a href=\"#alpn-negotiation\">ALPN negotiation</a> section.\nUpgrading from non-tls HTTP/1 servers is not supported.</p>\n<p>The HTTP/2 compatibility API is composed of <a href=\"#class-http2http2serverrequest\"><code>Http2ServerRequest</code></a> and\n<a href=\"#class-http2http2serverresponse\"><code>Http2ServerResponse</code></a>. They aim at API compatibility with HTTP/1, but\nthey do not hide the differences between the protocols. As an example,\nthe status message for HTTP codes is ignored.</p>",
          "modules": [
            {
              "textRaw": "ALPN negotiation",
              "name": "alpn_negotiation",
              "type": "module",
              "desc": "<p>ALPN negotiation allows supporting both <a href=\"https.html\">HTTPS</a> and HTTP/2 over\nthe same socket. The <code>req</code> and <code>res</code> objects can be either HTTP/1 or\nHTTP/2, and an application <strong>must</strong> restrict itself to the public API of\n<a href=\"http.html\">HTTP/1</a>, and detect if it is possible to use the more advanced\nfeatures of HTTP/2.</p>\n<p>The following example creates a server that supports both protocols:</p>\n<pre><code class=\"language-mjs\">import { createSecureServer } from 'node:http2';\nimport { readFileSync } from 'node:fs';\n\nconst cert = readFileSync('./cert.pem');\nconst key = readFileSync('./key.pem');\n\nconst server = createSecureServer(\n  { cert, key, allowHTTP1: true },\n  onRequest,\n).listen(8000);\n\nfunction onRequest(req, res) {\n  // Detects if it is an HTTPS request or HTTP/2\n  const { socket: { alpnProtocol } } = req.httpVersion === '2.0' ?\n    req.stream.session : req;\n  res.writeHead(200, { 'content-type': 'application/json' });\n  res.end(JSON.stringify({\n    alpnProtocol,\n    httpVersion: req.httpVersion,\n  }));\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { createSecureServer } = require('node:http2');\nconst { readFileSync } = require('node:fs');\n\nconst cert = readFileSync('./cert.pem');\nconst key = readFileSync('./key.pem');\n\nconst server = createSecureServer(\n  { cert, key, allowHTTP1: true },\n  onRequest,\n).listen(4443);\n\nfunction onRequest(req, res) {\n  // Detects if it is an HTTPS request or HTTP/2\n  const { socket: { alpnProtocol } } = req.httpVersion === '2.0' ?\n    req.stream.session : req;\n  res.writeHead(200, { 'content-type': 'application/json' });\n  res.end(JSON.stringify({\n    alpnProtocol,\n    httpVersion: req.httpVersion,\n  }));\n}\n</code></pre>\n<p>The <code>'request'</code> event works identically on both <a href=\"https.html\">HTTPS</a> and\nHTTP/2.</p>",
              "displayName": "ALPN negotiation"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `http2.Http2ServerRequest`",
              "name": "http2.Http2ServerRequest",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamreadable\"><code>&#x3C;stream.Readable></code></a></li>\n</ul>\n<p>A <code>Http2ServerRequest</code> object is created by <a href=\"#class-http2server\"><code>http2.Server</code></a> or\n<a href=\"#class-http2secureserver\"><code>http2.SecureServer</code></a> and passed as the first argument to the\n<a href=\"#event-request\"><code>'request'</code></a> event. It may be used to access a request status, headers, and\ndata.</p>",
              "events": [
                {
                  "textRaw": "Event: `'aborted'`",
                  "name": "aborted",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'aborted'</code> event is emitted whenever a <code>Http2ServerRequest</code> instance is\nabnormally aborted in mid-communication.</p>\n<p>The <code>'aborted'</code> event will only be emitted if the <code>Http2ServerRequest</code> writable\nside has not been ended.</p>"
                },
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Indicates that the underlying <a href=\"#class-http2stream\"><code>Http2Stream</code></a> was closed.\nJust like <code>'end'</code>, this event occurs only once per response.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {boolean}",
                  "name": "aborted",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v10.1.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>request.aborted</code> property will be <code>true</code> if the request has\nbeen aborted.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "authority",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The request authority pseudo header field. Because HTTP/2 allows requests\nto set either <code>:authority</code> or <code>host</code>, this value is derived from\n<code>req.headers[':authority']</code> if present. Otherwise, it is derived from\n<code>req.headers['host']</code>.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "complete",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v12.10.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>request.complete</code> property will be <code>true</code> if the request has\nbeen completed, aborted, or destroyed.</p>"
                },
                {
                  "textRaw": "Type: {net.Socket|tls.TLSSocket}",
                  "name": "connection",
                  "type": "net.Socket|tls.TLSSocket",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [],
                    "deprecated": [
                      "v13.0.0"
                    ]
                  },
                  "stability": 0,
                  "stabilityText": "Deprecated. Use `request.socket`.",
                  "desc": "<p>See <a href=\"#requestsocket\"><code>request.socket</code></a>.</p>"
                },
                {
                  "textRaw": "Type: {Object}",
                  "name": "headers",
                  "type": "Object",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The request/response headers object.</p>\n<p>Key-value pairs of header names and values. Header names are lower-cased.</p>\n<pre><code class=\"language-js\">// Prints something like:\n//\n// { 'user-agent': 'curl/7.22.0',\n//   host: '127.0.0.1:8000',\n//   accept: '*/*' }\nconsole.log(request.headers);\n</code></pre>\n<p>See <a href=\"#headers-object\">HTTP/2 Headers Object</a>.</p>\n<p>In HTTP/2, the request path, host name, protocol, and method are represented as\nspecial headers prefixed with the <code>:</code> character (e.g. <code>':path'</code>). These special\nheaders will be included in the <code>request.headers</code> object. Care must be taken not\nto inadvertently modify these special headers or errors may occur. For instance,\nremoving all headers from the request will cause errors to occur:</p>\n<pre><code class=\"language-js\">removeAllHeaders(request.headers);\nassert(request.url);   // Fails because the :path header has been removed\n</code></pre>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "httpVersion",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>In case of server request, the HTTP version sent by the client. In the case of\nclient response, the HTTP version of the connected-to server. Returns\n<code>'2.0'</code>.</p>\n<p>Also <code>message.httpVersionMajor</code> is the first integer and\n<code>message.httpVersionMinor</code> is the second.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "method",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The request method as a string. Read-only. Examples: <code>'GET'</code>, <code>'DELETE'</code>.</p>"
                },
                {
                  "textRaw": "Type: {HTTP/2 Raw Headers}",
                  "name": "rawHeaders",
                  "type": "HTTP/2 Raw Headers",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The raw request/response headers list exactly as they were received.</p>\n<pre><code class=\"language-js\">// Prints something like:\n//\n// [ 'user-agent',\n//   'this is invalid because there can be only one',\n//   'User-Agent',\n//   'curl/7.22.0',\n//   'Host',\n//   '127.0.0.1:8000',\n//   'ACCEPT',\n//   '*/*' ]\nconsole.log(request.rawHeaders);\n</code></pre>"
                },
                {
                  "textRaw": "Type: {string[]}",
                  "name": "rawTrailers",
                  "type": "string[]",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The raw request/response trailer keys and values exactly as they were\nreceived. Only populated at the <code>'end'</code> event.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "scheme",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The request scheme pseudo header field indicating the scheme\nportion of the target URL.</p>"
                },
                {
                  "textRaw": "Type: {net.Socket|tls.TLSSocket}",
                  "name": "socket",
                  "type": "net.Socket|tls.TLSSocket",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Returns a <code>Proxy</code> object that acts as a <code>net.Socket</code> (or <code>tls.TLSSocket</code>) but\napplies getters, setters, and methods based on HTTP/2 logic.</p>\n<p><code>destroyed</code>, <code>readable</code>, and <code>writable</code> properties will be retrieved from and\nset on <code>request.stream</code>.</p>\n<p><code>destroy</code>, <code>emit</code>, <code>end</code>, <code>on</code> and <code>once</code> methods will be called on\n<code>request.stream</code>.</p>\n<p><code>setTimeout</code> method will be called on <code>request.stream.session</code>.</p>\n<p><code>pause</code>, <code>read</code>, <code>resume</code>, and <code>write</code> will throw an error with code\n<code>ERR_HTTP2_NO_SOCKET_MANIPULATION</code>. See <a href=\"#http2session-and-sockets\"><code>Http2Session</code> and Sockets</a> for\nmore information.</p>\n<p>All other interactions will be routed directly to the socket. With TLS support,\nuse <a href=\"tls.html#tlssocketgetpeercertificatedetailed\"><code>request.socket.getPeerCertificate()</code></a> to obtain the client's\nauthentication details.</p>"
                },
                {
                  "textRaw": "Type: {Http2Stream}",
                  "name": "stream",
                  "type": "Http2Stream",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <a href=\"#class-http2stream\"><code>Http2Stream</code></a> object backing the request.</p>"
                },
                {
                  "textRaw": "Type: {Object}",
                  "name": "trailers",
                  "type": "Object",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The request/response trailers object. Only populated at the <code>'end'</code> event.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "url",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Request URL string. This contains only the URL that is present in the actual\nHTTP request. If the request is:</p>\n<pre><code class=\"language-http\">GET /status?name=ryan HTTP/1.1\nAccept: text/plain\n</code></pre>\n<p>Then <code>request.url</code> will be:</p>\n<pre><code class=\"language-json\">\"/status?name=ryan\"\n</code></pre>\n<p>To parse the url into its parts, <code>new URL()</code> can be used:</p>\n<pre><code class=\"language-console\">$ node\n> new URL('/status?name=ryan', 'http://example.com')\nURL {\n  href: 'http://example.com/status?name=ryan',\n  origin: 'http://example.com',\n  protocol: 'http:',\n  username: '',\n  password: '',\n  host: 'example.com',\n  hostname: 'example.com',\n  port: '',\n  pathname: '/status',\n  search: '?name=ryan',\n  searchParams: URLSearchParams { 'name' => 'ryan' },\n  hash: ''\n}\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`request.destroy([error])`",
                  "name": "destroy",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`error` {Error}",
                          "name": "error",
                          "type": "Error",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Calls <code>destroy()</code> on the <a href=\"#class-http2stream\"><code>Http2Stream</code></a> that received\nthe <a href=\"#class-http2http2serverrequest\"><code>Http2ServerRequest</code></a>. If <code>error</code> is provided, an <code>'error'</code> event\nis emitted and <code>error</code> is passed as an argument to any listeners on the event.</p>\n<p>It does nothing if the stream was already destroyed.</p>"
                },
                {
                  "textRaw": "`request.setTimeout(msecs, callback)`",
                  "name": "setTimeout",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`msecs` {number}",
                          "name": "msecs",
                          "type": "number"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {http2.Http2ServerRequest}",
                        "name": "return",
                        "type": "http2.Http2ServerRequest"
                      }
                    }
                  ],
                  "desc": "<p>Sets the <a href=\"#class-http2stream\"><code>Http2Stream</code></a>'s timeout value to <code>msecs</code>. If a callback is\nprovided, then it is added as a listener on the <code>'timeout'</code> event on\nthe response object.</p>\n<p>If no <code>'timeout'</code> listener is added to the request, the response, or\nthe server, then <a href=\"#class-http2stream\"><code>Http2Stream</code></a>s are destroyed when they time out. If a\nhandler is assigned to the request, the response, or the server's <code>'timeout'</code>\nevents, timed out sockets must be handled explicitly.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `http2.Http2ServerResponse`",
              "name": "http2.Http2ServerResponse",
              "type": "class",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"stream.html#stream\"><code>&#x3C;Stream></code></a></li>\n</ul>\n<p>This object is created internally by an HTTP server, not by the user. It is\npassed as the second parameter to the <a href=\"#event-request\"><code>'request'</code></a> event.</p>",
              "events": [
                {
                  "textRaw": "Event: `'close'`",
                  "name": "close",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Indicates that the underlying <a href=\"#class-http2stream\"><code>Http2Stream</code></a> was terminated before\n<a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a> was called or able to flush.</p>"
                },
                {
                  "textRaw": "Event: `'finish'`",
                  "name": "finish",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Emitted when the response has been sent. More specifically, this event is\nemitted when the last segment of the response headers and body have been\nhanded off to the HTTP/2 multiplexing for transmission over the network. It\ndoes not imply that the client has received anything yet.</p>\n<p>After this event, no more events will be emitted on the response object.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`response.addTrailers(headers)`",
                  "name": "addTrailers",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`headers` {Object}",
                          "name": "headers",
                          "type": "Object"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This method adds HTTP trailing headers (a header but at the end of the\nmessage) to the response.</p>\n<p>Attempting to set a header field name or value that contains invalid characters\nwill result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown.</p>"
                },
                {
                  "textRaw": "`response.appendHeader(name, value)`",
                  "name": "appendHeader",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v21.7.0",
                      "v20.12.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        },
                        {
                          "textRaw": "`value` {string|string[]}",
                          "name": "value",
                          "type": "string|string[]"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Append a single header value to the header object.</p>\n<p>If the value is an array, this is equivalent to calling this method multiple\ntimes.</p>\n<p>If there were no previous values for the header, this is equivalent to calling\n<a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a>.</p>\n<p>Attempting to set a header field name or value that contains invalid characters\nwill result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown.</p>\n<pre><code class=\"language-js\">// Returns headers including \"set-cookie: a\" and \"set-cookie: b\"\nconst server = http2.createServer((req, res) => {\n  res.setHeader('set-cookie', 'a');\n  res.appendHeader('set-cookie', 'b');\n  res.writeHead(200);\n  res.end('ok');\n});\n</code></pre>"
                },
                {
                  "textRaw": "`response.createPushResponse(headers, callback)`",
                  "name": "createPushResponse",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object} An object describing the headers",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object",
                          "desc": "An object describing the headers"
                        },
                        {
                          "textRaw": "`callback` {Function} Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method",
                          "name": "callback",
                          "type": "Function",
                          "desc": "Called once `http2stream.pushStream()` is finished, or either when the attempt to create the pushed `Http2Stream` has failed or has been rejected, or the state of `Http2ServerRequest` is closed prior to calling the `http2stream.pushStream()` method",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            },
                            {
                              "textRaw": "`res` {http2.Http2ServerResponse} The newly-created `Http2ServerResponse` object",
                              "name": "res",
                              "type": "http2.Http2ServerResponse",
                              "desc": "The newly-created `Http2ServerResponse` object"
                            }
                          ]
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Call <a href=\"#http2streampushstreamheaders-options-callback\"><code>http2stream.pushStream()</code></a> with the given headers, and wrap the\ngiven <a href=\"#class-http2stream\"><code>Http2Stream</code></a> on a newly created <code>Http2ServerResponse</code> as the callback\nparameter if successful. When <code>Http2ServerRequest</code> is closed, the callback is\ncalled with an error <code>ERR_HTTP2_INVALID_STREAM</code>.</p>"
                },
                {
                  "textRaw": "`response.end([data[, encoding]][, callback])`",
                  "name": "end",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": "v10.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/18780",
                        "description": "This method now returns a reference to `ServerResponse`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`data` {string|Buffer|Uint8Array}",
                          "name": "data",
                          "type": "string|Buffer|Uint8Array",
                          "optional": true
                        },
                        {
                          "textRaw": "`encoding` {string}",
                          "name": "encoding",
                          "type": "string",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {this}",
                        "name": "return",
                        "type": "this"
                      }
                    }
                  ],
                  "desc": "<p>This method signals to the server that all of the response headers and body\nhave been sent; that server should consider this message complete.\nThe method, <code>response.end()</code>, MUST be called on each response.</p>\n<p>If <code>data</code> is specified, it is equivalent to calling\n<a href=\"http.html#responsewritechunk-encoding-callback\"><code>response.write(data, encoding)</code></a> followed by <code>response.end(callback)</code>.</p>\n<p>If <code>callback</code> is specified, it will be called when the response stream\nis finished.</p>"
                },
                {
                  "textRaw": "`response.getHeader(name)`",
                  "name": "getHeader",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      }
                    }
                  ],
                  "desc": "<p>Reads out a header that has already been queued but not sent to the client.\nThe name is case-insensitive.</p>\n<pre><code class=\"language-js\">const contentType = response.getHeader('content-type');\n</code></pre>"
                },
                {
                  "textRaw": "`response.getHeaderNames()`",
                  "name": "getHeaderNames",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {string[]}",
                        "name": "return",
                        "type": "string[]"
                      }
                    }
                  ],
                  "desc": "<p>Returns an array containing the unique names of the current outgoing headers.\nAll header names are lowercase.</p>\n<pre><code class=\"language-js\">response.setHeader('Foo', 'bar');\nresponse.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);\n\nconst headerNames = response.getHeaderNames();\n// headerNames === ['foo', 'set-cookie']\n</code></pre>"
                },
                {
                  "textRaw": "`response.getHeaders()`",
                  "name": "getHeaders",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Object}",
                        "name": "return",
                        "type": "Object"
                      }
                    }
                  ],
                  "desc": "<p>Returns a shallow copy of the current outgoing headers. Since a shallow copy\nis used, array values may be mutated without additional calls to various\nheader-related http module methods. The keys of the returned object are the\nheader names and the values are the respective header values. All header names\nare lowercase.</p>\n<p>The object returned by the <code>response.getHeaders()</code> method <em>does not</em>\nprototypically inherit from the JavaScript <code>Object</code>. This means that typical\n<code>Object</code> methods such as <code>obj.toString()</code>, <code>obj.hasOwnProperty()</code>, and others\nare not defined and <em>will not work</em>.</p>\n<pre><code class=\"language-js\">response.setHeader('Foo', 'bar');\nresponse.setHeader('Set-Cookie', ['foo=bar', 'bar=baz']);\n\nconst headers = response.getHeaders();\n// headers === { foo: 'bar', 'set-cookie': ['foo=bar', 'bar=baz'] }\n</code></pre>"
                },
                {
                  "textRaw": "`response.hasHeader(name)`",
                  "name": "hasHeader",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Returns <code>true</code> if the header identified by <code>name</code> is currently set in the\noutgoing headers. The header name matching is case-insensitive.</p>\n<pre><code class=\"language-js\">const hasContentType = response.hasHeader('content-type');\n</code></pre>"
                },
                {
                  "textRaw": "`response.removeHeader(name)`",
                  "name": "removeHeader",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Removes a header that has been queued for implicit sending.</p>\n<pre><code class=\"language-js\">response.removeHeader('Content-Encoding');\n</code></pre>"
                },
                {
                  "textRaw": "`response.setHeader(name, value)`",
                  "name": "setHeader",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        },
                        {
                          "textRaw": "`value` {string|string[]}",
                          "name": "value",
                          "type": "string|string[]"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sets a single header value for implicit headers. If this header already exists\nin the to-be-sent headers, its value will be replaced. Use an array of strings\nhere to send multiple headers with the same name.</p>\n<pre><code class=\"language-js\">response.setHeader('Content-Type', 'text/html; charset=utf-8');\n</code></pre>\n<p>or</p>\n<pre><code class=\"language-js\">response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']);\n</code></pre>\n<p>Attempting to set a header field name or value that contains invalid characters\nwill result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown.</p>\n<p>When headers have been set with <a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a>, they will be merged\nwith any headers passed to <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a>, with the headers passed\nto <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> given precedence.</p>\n<pre><code class=\"language-js\">// Returns content-type = text/plain\nconst server = http2.createServer((req, res) => {\n  res.setHeader('Content-Type', 'text/html; charset=utf-8');\n  res.setHeader('X-Foo', 'bar');\n  res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });\n  res.end('ok');\n});\n</code></pre>"
                },
                {
                  "textRaw": "`response.setTimeout(msecs[, callback])`",
                  "name": "setTimeout",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`msecs` {number}",
                          "name": "msecs",
                          "type": "number"
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {http2.Http2ServerResponse}",
                        "name": "return",
                        "type": "http2.Http2ServerResponse"
                      }
                    }
                  ],
                  "desc": "<p>Sets the <a href=\"#class-http2stream\"><code>Http2Stream</code></a>'s timeout value to <code>msecs</code>. If a callback is\nprovided, then it is added as a listener on the <code>'timeout'</code> event on\nthe response object.</p>\n<p>If no <code>'timeout'</code> listener is added to the request, the response, or\nthe server, then <a href=\"#class-http2stream\"><code>Http2Stream</code></a>s are destroyed when they time out. If a\nhandler is assigned to the request, the response, or the server's <code>'timeout'</code>\nevents, timed out sockets must be handled explicitly.</p>"
                },
                {
                  "textRaw": "`response.write(chunk[, encoding][, callback])`",
                  "name": "write",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {string|Buffer|Uint8Array}",
                          "name": "chunk",
                          "type": "string|Buffer|Uint8Array"
                        },
                        {
                          "textRaw": "`encoding` {string}",
                          "name": "encoding",
                          "type": "string",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>If this method is called and <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> has not been called,\nit will switch to implicit header mode and flush the implicit headers.</p>\n<p>This sends a chunk of the response body. This method may\nbe called multiple times to provide successive parts of the body.</p>\n<p>In the <code>node:http</code> module, the response body is omitted when the\nrequest is a HEAD request. Similarly, the <code>204</code> and <code>304</code> responses\n<em>must not</em> include a message body.</p>\n<p><code>chunk</code> can be a string or a buffer. If <code>chunk</code> is a string,\nthe second parameter specifies how to encode it into a byte stream.\nBy default the <code>encoding</code> is <code>'utf8'</code>. <code>callback</code> will be called when this chunk\nof data is flushed.</p>\n<p>This is the raw HTTP body and has nothing to do with higher-level multi-part\nbody encodings that may be used.</p>\n<p>The first time <a href=\"#responsewritechunk-encoding-callback\"><code>response.write()</code></a> is called, it will send the buffered\nheader information and the first chunk of the body to the client. The second\ntime <a href=\"#responsewritechunk-encoding-callback\"><code>response.write()</code></a> is called, Node.js assumes data will be streamed,\nand sends the new data separately. That is, the response is buffered up to the\nfirst chunk of the body.</p>\n<p>Returns <code>true</code> if the entire data was flushed successfully to the kernel\nbuffer. Returns <code>false</code> if all or part of the data was queued in user memory.\n<code>'drain'</code> will be emitted when the buffer is free again.</p>"
                },
                {
                  "textRaw": "`response.writeContinue()`",
                  "name": "writeContinue",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Sends a status <code>100 Continue</code> to the client, indicating that the request body\nshould be sent. See the <a href=\"#event-checkcontinue\"><code>'checkContinue'</code></a> event on <code>Http2Server</code> and\n<code>Http2SecureServer</code>.</p>"
                },
                {
                  "textRaw": "`response.writeEarlyHints(hints)`",
                  "name": "writeEarlyHints",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v18.11.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`hints` {Object}",
                          "name": "hints",
                          "type": "Object"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sends a status <code>103 Early Hints</code> to the client with a Link header,\nindicating that the user agent can preload/preconnect the linked resources.\nThe <code>hints</code> is an object containing the values of headers to be sent with\nearly hints message.</p>\n<p><strong>Example</strong></p>\n<pre><code class=\"language-js\">const earlyHintsLink = '&#x3C;/styles.css>; rel=preload; as=style';\nresponse.writeEarlyHints({\n  'link': earlyHintsLink,\n});\n\nconst earlyHintsLinks = [\n  '&#x3C;/styles.css>; rel=preload; as=style',\n  '&#x3C;/scripts.js>; rel=preload; as=script',\n];\nresponse.writeEarlyHints({\n  'link': earlyHintsLinks,\n});\n</code></pre>"
                },
                {
                  "textRaw": "`response.writeInformation(statusCode[, headers])`",
                  "name": "writeInformation",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v26.2.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`statusCode` {number} An HTTP 1xx informational status code, between `100` and `199` inclusive, excluding `101` (Switching Protocols) which is not allowed in HTTP/2.",
                          "name": "statusCode",
                          "type": "number",
                          "desc": "An HTTP 1xx informational status code, between `100` and `199` inclusive, excluding `101` (Switching Protocols) which is not allowed in HTTP/2."
                        },
                        {
                          "textRaw": "`headers` {Object} An optional object of headers to send with the informational response.",
                          "name": "headers",
                          "type": "Object",
                          "desc": "An optional object of headers to send with the informational response.",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sends an arbitrary HTTP 1xx informational response, equivalent in HTTP/2 to a\n<code>HEADERS</code> frame whose <code>:status</code> pseudo-header is a 1xx code. May be called\nmultiple times before the final response. After the final response headers\nhave been sent, this method is a no-op and returns <code>false</code>.</p>\n<p>This is the generic equivalent of <a href=\"#responsewritecontinue\"><code>response.writeContinue()</code></a> and\n<a href=\"#responsewriteearlyhintshints\"><code>response.writeEarlyHints()</code></a>.</p>\n<pre><code class=\"language-js\">response.writeInformation(110, { 'X-Progress': '50%' });\n</code></pre>"
                },
                {
                  "textRaw": "`response.writeHead(statusCode[, statusMessage][, headers])`",
                  "name": "writeHead",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v11.10.0",
                          "v10.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/25974",
                        "description": "Return `this` from `writeHead()` to allow chaining with `end()`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`statusCode` {number}",
                          "name": "statusCode",
                          "type": "number"
                        },
                        {
                          "textRaw": "`statusMessage` {string}",
                          "name": "statusMessage",
                          "type": "string",
                          "optional": true
                        },
                        {
                          "textRaw": "`headers` {HTTP/2 Headers Object}",
                          "name": "headers",
                          "type": "HTTP/2 Headers Object",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {http2.Http2ServerResponse}",
                        "name": "return",
                        "type": "http2.Http2ServerResponse"
                      }
                    }
                  ],
                  "desc": "<p>Sends a response header to the request. The status code is a 3-digit HTTP\nstatus code, like <code>404</code>. The last argument, <code>headers</code>, are the response headers.</p>\n<p>Returns a reference to the <code>Http2ServerResponse</code>, so that calls can be chained.</p>\n<p>For compatibility with <a href=\"http.html\">HTTP/1</a>, a human-readable <code>statusMessage</code> may be\npassed as the second argument. However, because the <code>statusMessage</code> has no\nmeaning within HTTP/2, the argument will have no effect and a process warning\nwill be emitted.</p>\n<pre><code class=\"language-js\">const body = 'hello world';\nresponse.writeHead(200, {\n  'Content-Length': Buffer.byteLength(body),\n  'Content-Type': 'text/plain; charset=utf-8',\n});\n</code></pre>\n<p><code>Content-Length</code> is given in bytes not characters. The\n<code>Buffer.byteLength()</code> API may be used to determine the number of bytes in a\ngiven encoding. On outbound messages, Node.js does not check if Content-Length\nand the length of the body being transmitted are equal or not. However, when\nreceiving messages, Node.js will automatically reject messages when the\n<code>Content-Length</code> does not match the actual payload size.</p>\n<p>This method may be called at most one time on a message before\n<a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a> is called.</p>\n<p>If <a href=\"#responsewritechunk-encoding-callback\"><code>response.write()</code></a> or <a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a> are called before calling\nthis, the implicit/mutable headers will be calculated and call this function.</p>\n<p>When headers have been set with <a href=\"#responsesetheadername-value\"><code>response.setHeader()</code></a>, they will be merged\nwith any headers passed to <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a>, with the headers passed\nto <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> given precedence.</p>\n<pre><code class=\"language-js\">// Returns content-type = text/plain\nconst server = http2.createServer((req, res) => {\n  res.setHeader('Content-Type', 'text/html; charset=utf-8');\n  res.setHeader('X-Foo', 'bar');\n  res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' });\n  res.end('ok');\n});\n</code></pre>\n<p>Attempting to set a header field name or value that contains invalid characters\nwill result in a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> being thrown.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {net.Socket|tls.TLSSocket}",
                  "name": "connection",
                  "type": "net.Socket|tls.TLSSocket",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [],
                    "deprecated": [
                      "v13.0.0"
                    ]
                  },
                  "stability": 0,
                  "stabilityText": "Deprecated. Use `response.socket`.",
                  "desc": "<p>See <a href=\"#responsesocket\"><code>response.socket</code></a>.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "finished",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": [],
                    "deprecated": [
                      "v13.4.0",
                      "v12.16.0"
                    ]
                  },
                  "stability": 0,
                  "stabilityText": "Deprecated. Use `response.writableEnded`.",
                  "desc": "<p>Boolean value that indicates whether the response has completed. Starts\nas <code>false</code>. After <a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a> executes, the value will be <code>true</code>.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "headersSent",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>True if headers were sent, false otherwise (read-only).</p>"
                },
                {
                  "textRaw": "Type: {http2.Http2ServerRequest}",
                  "name": "req",
                  "type": "http2.Http2ServerRequest",
                  "meta": {
                    "added": [
                      "v15.7.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>A reference to the original HTTP2 <code>request</code> object.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "sendDate",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When true, the Date header will be automatically generated and sent in\nthe response if it is not already present in the headers. Defaults to true.</p>\n<p>This should only be disabled for testing; HTTP requires the Date header\nin responses.</p>"
                },
                {
                  "textRaw": "Type: {net.Socket|tls.TLSSocket}",
                  "name": "socket",
                  "type": "net.Socket|tls.TLSSocket",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Returns a <code>Proxy</code> object that acts as a <code>net.Socket</code> (or <code>tls.TLSSocket</code>) but\napplies getters, setters, and methods based on HTTP/2 logic.</p>\n<p><code>destroyed</code>, <code>readable</code>, and <code>writable</code> properties will be retrieved from and\nset on <code>response.stream</code>.</p>\n<p><code>destroy</code>, <code>emit</code>, <code>end</code>, <code>on</code> and <code>once</code> methods will be called on\n<code>response.stream</code>.</p>\n<p><code>setTimeout</code> method will be called on <code>response.stream.session</code>.</p>\n<p><code>pause</code>, <code>read</code>, <code>resume</code>, and <code>write</code> will throw an error with code\n<code>ERR_HTTP2_NO_SOCKET_MANIPULATION</code>. See <a href=\"#http2session-and-sockets\"><code>Http2Session</code> and Sockets</a> for\nmore information.</p>\n<p>All other interactions will be routed directly to the socket.</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:http2';\nconst server = createServer((req, res) => {\n  const ip = req.socket.remoteAddress;\n  const port = req.socket.remotePort;\n  res.end(`Your IP address is ${ip} and your source port is ${port}.`);\n}).listen(3000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http2 = require('node:http2');\nconst server = http2.createServer((req, res) => {\n  const ip = req.socket.remoteAddress;\n  const port = req.socket.remotePort;\n  res.end(`Your IP address is ${ip} and your source port is ${port}.`);\n}).listen(3000);\n</code></pre>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "statusCode",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>When using implicit headers (not calling <a href=\"#responsewriteheadstatuscode-statusmessage-headers\"><code>response.writeHead()</code></a> explicitly),\nthis property controls the status code that will be sent to the client when\nthe headers get flushed.</p>\n<pre><code class=\"language-js\">response.statusCode = 404;\n</code></pre>\n<p>After response header was sent to the client, this property indicates the\nstatus code which was sent out.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "statusMessage",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Status message is not supported by HTTP/2 (RFC 7540 8.1.2.4). It returns\nan empty string.</p>"
                },
                {
                  "textRaw": "Type: {Http2Stream}",
                  "name": "stream",
                  "type": "Http2Stream",
                  "meta": {
                    "added": [
                      "v8.4.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <a href=\"#class-http2stream\"><code>Http2Stream</code></a> object backing the response.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "writableEnded",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v12.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Is <code>true</code> after <a href=\"#responseenddata-encoding-callback\"><code>response.end()</code></a> has been called. This property\ndoes not indicate whether the data has been flushed, for this use\n<a href=\"stream.html#writablewritablefinished\"><code>writable.writableFinished</code></a> instead.</p>"
                }
              ]
            }
          ],
          "displayName": "Compatibility API"
        },
        {
          "textRaw": "Collecting HTTP/2 performance metrics",
          "name": "collecting_http/2_performance_metrics",
          "type": "module",
          "desc": "<p>The <a href=\"perf_hooks.html\">Performance Observer</a> API can be used to collect basic performance\nmetrics for each <code>Http2Session</code> and <code>Http2Stream</code> instance.</p>\n<pre><code class=\"language-mjs\">import { PerformanceObserver } from 'node:perf_hooks';\n\nconst obs = new PerformanceObserver((items) => {\n  const entry = items.getEntries()[0];\n  console.log(entry.entryType);  // prints 'http2'\n  if (entry.name === 'Http2Session') {\n    // Entry contains statistics about the Http2Session\n  } else if (entry.name === 'Http2Stream') {\n    // Entry contains statistics about the Http2Stream\n  }\n});\nobs.observe({ entryTypes: ['http2'] });\n</code></pre>\n<pre><code class=\"language-cjs\">const { PerformanceObserver } = require('node:perf_hooks');\n\nconst obs = new PerformanceObserver((items) => {\n  const entry = items.getEntries()[0];\n  console.log(entry.entryType);  // prints 'http2'\n  if (entry.name === 'Http2Session') {\n    // Entry contains statistics about the Http2Session\n  } else if (entry.name === 'Http2Stream') {\n    // Entry contains statistics about the Http2Stream\n  }\n});\nobs.observe({ entryTypes: ['http2'] });\n</code></pre>\n<p>The <code>entryType</code> property of the <code>PerformanceEntry</code> will be equal to <code>'http2'</code>.</p>\n<p>The <code>name</code> property of the <code>PerformanceEntry</code> will be equal to either\n<code>'Http2Stream'</code> or <code>'Http2Session'</code>.</p>\n<p>If <code>name</code> is equal to <code>Http2Stream</code>, the <code>PerformanceEntry</code> will contain the\nfollowing additional properties:</p>\n<ul>\n<li><code>bytesRead</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of <code>DATA</code> frame bytes received for this\n<code>Http2Stream</code>.</li>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of <code>DATA</code> frame bytes sent for this\n<code>Http2Stream</code>.</li>\n<li><code>id</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The identifier of the associated <code>Http2Stream</code></li>\n<li><code>timeToFirstByte</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds elapsed between the <code>PerformanceEntry</code> <code>startTime</code> and the reception of the first <code>DATA</code> frame.</li>\n<li><code>timeToFirstByteSent</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds elapsed between\nthe <code>PerformanceEntry</code> <code>startTime</code> and sending of the first <code>DATA</code> frame.</li>\n<li><code>timeToFirstHeader</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds elapsed between the <code>PerformanceEntry</code> <code>startTime</code> and the reception of the first header.</li>\n</ul>\n<p>If <code>name</code> is equal to <code>Http2Session</code>, the <code>PerformanceEntry</code> will contain the\nfollowing additional properties:</p>\n<ul>\n<li><code>bytesRead</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of bytes received for this <code>Http2Session</code>.</li>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of bytes sent for this <code>Http2Session</code>.</li>\n<li><code>framesReceived</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of HTTP/2 frames received by the <code>Http2Session</code>.</li>\n<li><code>framesSent</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of HTTP/2 frames sent by the <code>Http2Session</code>.</li>\n<li><code>maxConcurrentStreams</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The maximum number of streams concurrently\nopen during the lifetime of the <code>Http2Session</code>.</li>\n<li><code>pingRTT</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds elapsed since the transmission\nof a <code>PING</code> frame and the reception of its acknowledgment. Only present if\na <code>PING</code> frame has been sent on the <code>Http2Session</code>.</li>\n<li><code>streamAverageDuration</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The average duration (in milliseconds) for\nall <code>Http2Stream</code> instances.</li>\n<li><code>streamCount</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of <code>Http2Stream</code> instances processed by\nthe <code>Http2Session</code>.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Either <code>'server'</code> or <code>'client'</code> to identify the type of\n<code>Http2Session</code>.</li>\n</ul>",
          "displayName": "Collecting HTTP/2 performance metrics"
        },
        {
          "textRaw": "Note on `:authority` and `host`",
          "name": "note_on_`:authority`_and_`host`",
          "type": "module",
          "desc": "<p>HTTP/2 requires requests to have either the <code>:authority</code> pseudo-header\nor the <code>host</code> header. Prefer <code>:authority</code> when constructing an HTTP/2\nrequest directly, and <code>host</code> when converting from HTTP/1 (in proxies,\nfor instance).</p>\n<p>The compatibility API falls back to <code>host</code> if <code>:authority</code> is not\npresent. See <a href=\"#requestauthority\"><code>request.authority</code></a> for more information. However,\nif you don't use the compatibility API (or use <code>req.headers</code> directly),\nyou need to implement any fall-back behavior yourself.</p>",
          "displayName": "Note on `:authority` and `host`"
        }
      ],
      "displayName": "HTTP/2",
      "source": "doc/api/http2.md"
    },
    {
      "textRaw": "HTTPS",
      "name": "https",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a\nseparate module.</p>",
      "modules": [
        {
          "textRaw": "Determining if crypto support is unavailable",
          "name": "determining_if_crypto_support_is_unavailable",
          "type": "module",
          "desc": "<p>It is possible for Node.js to be built without including support for the\n<code>node:crypto</code> module. In such cases, attempting to <code>import</code> from <code>https</code> or\ncalling <code>require('node:https')</code> will result in an error being thrown.</p>\n<p>When using CommonJS, the error thrown can be caught using try/catch:</p>\n<pre><code class=\"language-cjs\">let https;\ntry {\n  https = require('node:https');\n} catch (err) {\n  console.error('https support is disabled!');\n}\n</code></pre>\n<p>When using the lexical ESM <code>import</code> keyword, the error can only be\ncaught if a handler for <code>process.on('uncaughtException')</code> is registered\n<em>before</em> any attempt to load the module is made (using, for instance,\na preload module).</p>\n<p>When using ESM, if there is a chance that the code may be run on a build\nof Node.js where crypto support is not enabled, consider using the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import\"><code>import()</code></a> function instead of the lexical <code>import</code> keyword:</p>\n<pre><code class=\"language-mjs\">let https;\ntry {\n  https = await import('node:https');\n} catch (err) {\n  console.error('https support is disabled!');\n}\n</code></pre>",
          "displayName": "Determining if crypto support is unavailable"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `https.Agent`",
          "name": "https.Agent",
          "type": "class",
          "meta": {
            "added": [
              "v0.4.5"
            ],
            "changes": [
              {
                "version": "v5.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/4252",
                "description": "support `0` `maxCachedSessions` to disable TLS session caching."
              },
              {
                "version": "v2.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/2228",
                "description": "parameter `maxCachedSessions` added to `options` for TLS sessions reuse."
              }
            ]
          },
          "desc": "<p>An <a href=\"#class-httpsagent\"><code>Agent</code></a> object for HTTPS similar to <a href=\"http.html#class-httpagent\"><code>http.Agent</code></a>. See\n<a href=\"#httpsrequestoptions-callback\"><code>https.request()</code></a> for more information.</p>\n<p>Like <code>http.Agent</code>, the <code>createConnection(options[, callback])</code> method can be overridden\nto customize how TLS connections are established.</p>\n<blockquote>\n<p>See <a href=\"http.html#agentcreateconnectionoptions-callback\"><code>agent.createConnection()</code></a> for details on overriding this method,\nincluding asynchronous socket creation with a callback.</p>\n</blockquote>",
          "signatures": [
            {
              "textRaw": "`new Agent([options])`",
              "name": "Agent",
              "type": "ctor",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.5.0",
                      "v22.21.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58980",
                    "description": "Add support for `proxyEnv`."
                  },
                  {
                    "version": [
                      "v24.5.0",
                      "v22.21.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58980",
                    "description": "Add support for `defaultPort` and `protocol`."
                  },
                  {
                    "version": "v12.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28209",
                    "description": "do not automatically set servername if the target host was specified using an IP address."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`options` {Object} Set of configurable options to set on the agent. Can have the same fields as for `http.Agent(options)`, and",
                  "name": "options",
                  "type": "Object",
                  "desc": "Set of configurable options to set on the agent. Can have the same fields as for `http.Agent(options)`, and",
                  "options": [
                    {
                      "textRaw": "`maxCachedSessions` {number} maximum number of TLS cached sessions. Use `0` to disable TLS session caching. **Default:** `100`.",
                      "name": "maxCachedSessions",
                      "type": "number",
                      "default": "`100`",
                      "desc": "maximum number of TLS cached sessions. Use `0` to disable TLS session caching."
                    },
                    {
                      "textRaw": "`servername` {string} the value of Server Name Indication extension to be sent to the server. Use empty string `''` to disable sending the extension. **Default:** host name of the target server, unless the target server is specified using an IP address, in which case the default is `''` (no extension).See `Session Resumption` for information about TLS session reuse.",
                      "name": "servername",
                      "type": "string",
                      "default": "host name of the target server, unless the target server is specified using an IP address, in which case the default is `''` (no extension).See `Session Resumption` for information about TLS session reuse",
                      "desc": "the value of Server Name Indication extension to be sent to the server. Use empty string `''` to disable sending the extension."
                    }
                  ],
                  "optional": true
                }
              ],
              "events": [
                {
                  "textRaw": "Event: `'keylog'`",
                  "name": "keylog",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format.",
                      "name": "line",
                      "type": "Buffer",
                      "desc": "Line of ASCII text, in NSS `SSLKEYLOGFILE` format."
                    },
                    {
                      "textRaw": "`tlsSocket` {tls.TLSSocket} The `tls.TLSSocket` instance on which it was generated.",
                      "name": "tlsSocket",
                      "type": "tls.TLSSocket",
                      "desc": "The `tls.TLSSocket` instance on which it was generated."
                    }
                  ],
                  "desc": "<p>The <code>keylog</code> event is emitted when key material is generated or received by a\nconnection managed by this agent (typically before handshake has completed, but\nnot necessarily). This keying material can be stored for debugging, as it\nallows captured TLS traffic to be decrypted. It may be emitted multiple times\nfor each socket.</p>\n<p>A typical use case is to append received lines to a common text file, which is\nlater used by software (such as Wireshark) to decrypt the traffic:</p>\n<pre><code class=\"language-js\">// ...\nhttps.globalAgent.on('keylog', (line, tlsSocket) => {\n  fs.appendFileSync('/tmp/ssl-keys.log', line, { mode: 0o600 });\n});\n</code></pre>"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "Class: `https.Server`",
          "name": "https.Server",
          "type": "class",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"tls.html#class-tlsserver\"><code>&#x3C;tls.Server></code></a></li>\n</ul>\n<p>See <a href=\"http.html#class-httpserver\"><code>http.Server</code></a> for more information.</p>",
          "methods": [
            {
              "textRaw": "`server.close([callback])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {https.Server}",
                    "name": "return",
                    "type": "https.Server"
                  }
                }
              ],
              "desc": "<p>See <a href=\"http.html#serverclosecallback\"><code>server.close()</code></a> in the <code>node:http</code> module.</p>"
            },
            {
              "textRaw": "`server[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v20.4.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58467",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <a href=\"#serverclosecallback\"><code>server.close()</code></a> and returns a promise that\nfulfills when the server has closed.</p>"
            },
            {
              "textRaw": "`server.closeAllConnections()`",
              "name": "closeAllConnections",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"http.html#servercloseallconnections\"><code>server.closeAllConnections()</code></a> in the <code>node:http</code> module.</p>"
            },
            {
              "textRaw": "`server.closeIdleConnections()`",
              "name": "closeIdleConnections",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>See <a href=\"http.html#servercloseidleconnections\"><code>server.closeIdleConnections()</code></a> in the <code>node:http</code> module.</p>"
            },
            {
              "textRaw": "`server.listen()`",
              "name": "listen",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Starts the HTTPS server listening for encrypted connections.\nThis method is identical to <a href=\"net.html#serverlisten\"><code>server.listen()</code></a> from <a href=\"net.html#class-netserver\"><code>net.Server</code></a>.</p>"
            },
            {
              "textRaw": "`server.setTimeout([msecs][, callback])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.2"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`msecs` {number} **Default:** `120000` (2 minutes)",
                      "name": "msecs",
                      "type": "number",
                      "default": "`120000` (2 minutes)",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {https.Server}",
                    "name": "return",
                    "type": "https.Server"
                  }
                }
              ],
              "desc": "<p>See <a href=\"http.html#serversettimeoutmsecs-callback\"><code>server.setTimeout()</code></a> in the <code>node:http</code> module.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {number} **Default:** `60000`",
              "name": "headersTimeout",
              "type": "number",
              "meta": {
                "added": [
                  "v11.3.0"
                ],
                "changes": []
              },
              "default": "`60000`",
              "desc": "<p>See <a href=\"http.html#serverheaderstimeout\"><code>server.headersTimeout</code></a> in the <code>node:http</code> module.</p>"
            },
            {
              "textRaw": "Type: {number} **Default:** `2000`",
              "name": "maxHeadersCount",
              "type": "number",
              "default": "`2000`",
              "desc": "<p>See <a href=\"http.html#servermaxheaderscount\"><code>server.maxHeadersCount</code></a> in the <code>node:http</code> module.</p>"
            },
            {
              "textRaw": "Type: {number} **Default:** `300000`",
              "name": "requestTimeout",
              "type": "number",
              "meta": {
                "added": [
                  "v14.11.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41263",
                    "description": "The default request timeout changed from no timeout to 300s (5 minutes)."
                  }
                ]
              },
              "default": "`300000`",
              "desc": "<p>See <a href=\"http.html#serverrequesttimeout\"><code>server.requestTimeout</code></a> in the <code>node:http</code> module.</p>"
            },
            {
              "textRaw": "Type: {number} **Default:** 0 (no timeout)",
              "name": "timeout",
              "type": "number",
              "meta": {
                "added": [
                  "v0.11.2"
                ],
                "changes": [
                  {
                    "version": "v13.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27558",
                    "description": "The default timeout changed from 120s to 0 (no timeout)."
                  }
                ]
              },
              "default": "0 (no timeout)",
              "desc": "<p>See <a href=\"http.html#servertimeout\"><code>server.timeout</code></a> in the <code>node:http</code> module.</p>"
            },
            {
              "textRaw": "Type: {number} **Default:** `5000` (5 seconds)",
              "name": "keepAliveTimeout",
              "type": "number",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "default": "`5000` (5 seconds)",
              "desc": "<p>See <a href=\"http.html#serverkeepalivetimeout\"><code>server.keepAliveTimeout</code></a> in the <code>node:http</code> module.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`https.createServer([options][, requestListener])`",
          "name": "createServer",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object} Accepts `options` from `tls.createServer()`, `tls.createSecureContext()` and `http.createServer()`.",
                  "name": "options",
                  "type": "Object",
                  "desc": "Accepts `options` from `tls.createServer()`, `tls.createSecureContext()` and `http.createServer()`.",
                  "optional": true
                },
                {
                  "textRaw": "`requestListener` {Function} A listener to be added to the `'request'` event.",
                  "name": "requestListener",
                  "type": "Function",
                  "desc": "A listener to be added to the `'request'` event.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {https.Server}",
                "name": "return",
                "type": "https.Server"
              }
            }
          ],
          "desc": "<pre><code class=\"language-mjs\">// curl -k https://localhost:8000/\nimport { createServer } from 'node:https';\nimport { readFileSync } from 'node:fs';\n\nconst options = {\n  key: readFileSync('private-key.pem'),\n  cert: readFileSync('certificate.pem'),\n};\n\ncreateServer(options, (req, res) => {\n  res.writeHead(200);\n  res.end('hello world\\n');\n}).listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">// curl -k https://localhost:8000/\nconst https = require('node:https');\nconst fs = require('node:fs');\n\nconst options = {\n  key: fs.readFileSync('private-key.pem'),\n  cert: fs.readFileSync('certificate.pem'),\n};\n\nhttps.createServer(options, (req, res) => {\n  res.writeHead(200);\n  res.end('hello world\\n');\n}).listen(8000);\n</code></pre>\n<p>Or</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:https';\nimport { readFileSync } from 'node:fs';\n\nconst options = {\n  pfx: readFileSync('test_cert.pfx'),\n  passphrase: 'sample',\n};\n\ncreateServer(options, (req, res) => {\n  res.writeHead(200);\n  res.end('hello world\\n');\n}).listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">const https = require('node:https');\nconst fs = require('node:fs');\n\nconst options = {\n  pfx: fs.readFileSync('test_cert.pfx'),\n  passphrase: 'sample',\n};\n\nhttps.createServer(options, (req, res) => {\n  res.writeHead(200);\n  res.end('hello world\\n');\n}).listen(8000);\n</code></pre>\n<p>To generate the certificate and key for this example, run:</p>\n<pre><code class=\"language-bash\">openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \\\n  -keyout private-key.pem -out certificate.pem\n</code></pre>\n<p>Then, to generate the <code>pfx</code> certificate for this example, run:</p>\n<pre><code class=\"language-bash\">openssl pkcs12 -certpbe AES-256-CBC -export -out test_cert.pfx \\\n  -inkey private-key.pem -in certificate.pem -passout pass:sample\n</code></pre>"
        },
        {
          "textRaw": "`https.get(options[, callback])`",
          "name": "get",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "options"
                },
                {
                  "name": "callback",
                  "optional": true
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`https.get(url[, options][, callback])`",
          "name": "get",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.6"
            ],
            "changes": [
              {
                "version": "v10.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/21616",
                "description": "The `url` parameter can now be passed along with a separate `options` object."
              },
              {
                "version": "v7.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/10638",
                "description": "The `options` parameter can be a WHATWG `URL` object."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`url` {string|URL}",
                  "name": "url",
                  "type": "string|URL"
                },
                {
                  "textRaw": "`options` {Object|string|URL} Accepts the same `options` as `https.request()`, with the method set to GET by default.",
                  "name": "options",
                  "type": "Object|string|URL",
                  "desc": "Accepts the same `options` as `https.request()`, with the method set to GET by default.",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {http.ClientRequest}",
                "name": "return",
                "type": "http.ClientRequest"
              }
            }
          ],
          "desc": "<p>Like <a href=\"http.html#httpgetoptions-callback\"><code>http.get()</code></a> but for HTTPS.</p>\n<p><code>options</code> can be an object, a string, or a <a href=\"url.html#the-whatwg-url-api\"><code>URL</code></a> object. If <code>options</code> is a\nstring, it is automatically parsed with <a href=\"url.html#new-urlinput-base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#the-whatwg-url-api\"><code>URL</code></a>\nobject, it will be automatically converted to an ordinary <code>options</code> object.</p>\n<pre><code class=\"language-mjs\">import { get } from 'node:https';\nimport process from 'node:process';\n\nget('https://encrypted.google.com/', (res) => {\n  console.log('statusCode:', res.statusCode);\n  console.log('headers:', res.headers);\n\n  res.on('data', (d) => {\n    process.stdout.write(d);\n  });\n\n}).on('error', (e) => {\n  console.error(e);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const https = require('node:https');\n\nhttps.get('https://encrypted.google.com/', (res) => {\n  console.log('statusCode:', res.statusCode);\n  console.log('headers:', res.headers);\n\n  res.on('data', (d) => {\n    process.stdout.write(d);\n  });\n\n}).on('error', (e) => {\n  console.error(e);\n});\n</code></pre>"
        },
        {
          "textRaw": "`https.request(options[, callback])`",
          "name": "request",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "options"
                },
                {
                  "name": "callback",
                  "optional": true
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`https.request(url[, options][, callback])`",
          "name": "request",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.6"
            ],
            "changes": [
              {
                "version": [
                  "v22.4.0",
                  "v20.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/53329",
                "description": "The `clientCertEngine` option depends on custom engine support in OpenSSL which is deprecated in OpenSSL 3."
              },
              {
                "version": [
                  "v16.7.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/39310",
                "description": "When using a `URL` object parsed username and password will now be properly URI decoded."
              },
              {
                "version": [
                  "v14.1.0",
                  "v13.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/32786",
                "description": "The `highWaterMark` option is accepted now."
              },
              {
                "version": "v10.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/21616",
                "description": "The `url` parameter can now be passed along with a separate `options` object."
              },
              {
                "version": "v9.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/14903",
                "description": "The `options` parameter can now include `clientCertEngine`."
              },
              {
                "version": "v7.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/10638",
                "description": "The `options` parameter can be a WHATWG `URL` object."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`url` {string|URL}",
                  "name": "url",
                  "type": "string|URL"
                },
                {
                  "textRaw": "`options` {Object|string|URL} Accepts all `options` from `http.request()`, with some differences in default values:",
                  "name": "options",
                  "type": "Object|string|URL",
                  "desc": "Accepts all `options` from `http.request()`, with some differences in default values:",
                  "options": [
                    {
                      "textRaw": "`protocol` **Default:** `'https:'`",
                      "name": "protocol",
                      "default": "`'https:'`"
                    },
                    {
                      "textRaw": "`port` **Default:** `443`",
                      "name": "port",
                      "default": "`443`"
                    },
                    {
                      "textRaw": "`agent` **Default:** `https.globalAgent`",
                      "name": "agent",
                      "default": "`https.globalAgent`"
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {http.ClientRequest}",
                "name": "return",
                "type": "http.ClientRequest"
              }
            }
          ],
          "desc": "<p>Makes a request to a secure web server.</p>\n<p>The following additional <code>options</code> from <a href=\"tls.html#tlsconnectoptions-callback\"><code>tls.connect()</code></a> are also accepted:\n<code>ca</code>, <code>cert</code>, <code>ciphers</code>, <code>clientCertEngine</code> (deprecated), <code>crl</code>, <code>dhparam</code>, <code>ecdhCurve</code>,\n<code>honorCipherOrder</code>, <code>key</code>, <code>passphrase</code>, <code>pfx</code>, <code>rejectUnauthorized</code>,\n<code>secureOptions</code>, <code>secureProtocol</code>, <code>servername</code>, <code>sessionIdContext</code>,\n<code>highWaterMark</code>.</p>\n<p><code>options</code> can be an object, a string, or a <a href=\"url.html#the-whatwg-url-api\"><code>URL</code></a> object. If <code>options</code> is a\nstring, it is automatically parsed with <a href=\"url.html#new-urlinput-base\"><code>new URL()</code></a>. If it is a <a href=\"url.html#the-whatwg-url-api\"><code>URL</code></a>\nobject, it will be automatically converted to an ordinary <code>options</code> object.</p>\n<p><code>https.request()</code> returns an instance of the <a href=\"http.html#class-httpclientrequest\"><code>http.ClientRequest</code></a>\nclass. The <code>ClientRequest</code> instance is a writable stream. If one needs to\nupload a file with a POST request, then write to the <code>ClientRequest</code> object.</p>\n<pre><code class=\"language-mjs\">import { request } from 'node:https';\nimport process from 'node:process';\n\nconst options = {\n  hostname: 'encrypted.google.com',\n  port: 443,\n  path: '/',\n  method: 'GET',\n};\n\nconst req = request(options, (res) => {\n  console.log('statusCode:', res.statusCode);\n  console.log('headers:', res.headers);\n\n  res.on('data', (d) => {\n    process.stdout.write(d);\n  });\n});\n\nreq.on('error', (e) => {\n  console.error(e);\n});\nreq.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const https = require('node:https');\n\nconst options = {\n  hostname: 'encrypted.google.com',\n  port: 443,\n  path: '/',\n  method: 'GET',\n};\n\nconst req = https.request(options, (res) => {\n  console.log('statusCode:', res.statusCode);\n  console.log('headers:', res.headers);\n\n  res.on('data', (d) => {\n    process.stdout.write(d);\n  });\n});\n\nreq.on('error', (e) => {\n  console.error(e);\n});\nreq.end();\n</code></pre>\n<p>Example using options from <a href=\"tls.html#tlsconnectoptions-callback\"><code>tls.connect()</code></a>:</p>\n<pre><code class=\"language-js\">const options = {\n  hostname: 'encrypted.google.com',\n  port: 443,\n  path: '/',\n  method: 'GET',\n  key: fs.readFileSync('private-key.pem'),\n  cert: fs.readFileSync('certificate.pem'),\n};\noptions.agent = new https.Agent(options);\n\nconst req = https.request(options, (res) => {\n  // ...\n});\n</code></pre>\n<p>Alternatively, opt out of connection pooling by not using an <a href=\"#class-httpsagent\"><code>Agent</code></a>.</p>\n<pre><code class=\"language-js\">const options = {\n  hostname: 'encrypted.google.com',\n  port: 443,\n  path: '/',\n  method: 'GET',\n  key: fs.readFileSync('private-key.pem'),\n  cert: fs.readFileSync('certificate.pem'),\n  agent: false,\n};\n\nconst req = https.request(options, (res) => {\n  // ...\n});\n</code></pre>\n<p>Example using a <a href=\"url.html#the-whatwg-url-api\"><code>URL</code></a> as <code>options</code>:</p>\n<pre><code class=\"language-js\">const options = new URL('https://abc:xyz@example.com');\n\nconst req = https.request(options, (res) => {\n  // ...\n});\n</code></pre>\n<p>Example pinning on certificate fingerprint, or the public key (similar to\n<code>pin-sha256</code>):</p>\n<pre><code class=\"language-mjs\">import { checkServerIdentity } from 'node:tls';\nimport { Agent, request } from 'node:https';\nimport { createHash } from 'node:crypto';\n\nfunction sha256(s) {\n  return createHash('sha256').update(s).digest('base64');\n}\nconst options = {\n  hostname: 'github.com',\n  port: 443,\n  path: '/',\n  method: 'GET',\n  checkServerIdentity: function(host, cert) {\n    // Make sure the certificate is issued to the host we are connected to\n    const err = checkServerIdentity(host, cert);\n    if (err) {\n      return err;\n    }\n\n    // Pin the public key, similar to HPKP pin-sha256 pinning\n    const pubkey256 = 'SIXvRyDmBJSgatgTQRGbInBaAK+hZOQ18UmrSwnDlK8=';\n    if (sha256(cert.pubkey) !== pubkey256) {\n      const msg = 'Certificate verification error: ' +\n        `The public key of '${cert.subject.CN}' ` +\n        'does not match our pinned fingerprint';\n      return new Error(msg);\n    }\n\n    // Pin the exact certificate, rather than the pub key\n    const cert256 = 'FD:6E:9B:0E:F3:98:BC:D9:04:C3:B2:EC:16:7A:7B:' +\n      '0F:DA:72:01:C9:03:C5:3A:6A:6A:E5:D0:41:43:63:EF:65';\n    if (cert.fingerprint256 !== cert256) {\n      const msg = 'Certificate verification error: ' +\n        `The certificate of '${cert.subject.CN}' ` +\n        'does not match our pinned fingerprint';\n      return new Error(msg);\n    }\n\n    // This loop is informational only.\n    // Print the certificate and public key fingerprints of all certs in the\n    // chain. Its common to pin the public key of the issuer on the public\n    // internet, while pinning the public key of the service in sensitive\n    // environments.\n    let lastprint256;\n    do {\n      console.log('Subject Common Name:', cert.subject.CN);\n      console.log('  Certificate SHA256 fingerprint:', cert.fingerprint256);\n\n      const hash = createHash('sha256');\n      console.log('  Public key ping-sha256:', sha256(cert.pubkey));\n\n      lastprint256 = cert.fingerprint256;\n      cert = cert.issuerCertificate;\n    } while (cert.fingerprint256 !== lastprint256);\n\n  },\n};\n\noptions.agent = new Agent(options);\nconst req = request(options, (res) => {\n  console.log('All OK. Server matched our pinned cert or public key');\n  console.log('statusCode:', res.statusCode);\n\n  res.on('data', (d) => {});\n});\n\nreq.on('error', (e) => {\n  console.error(e.message);\n});\nreq.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const tls = require('node:tls');\nconst https = require('node:https');\nconst crypto = require('node:crypto');\n\nfunction sha256(s) {\n  return crypto.createHash('sha256').update(s).digest('base64');\n}\nconst options = {\n  hostname: 'github.com',\n  port: 443,\n  path: '/',\n  method: 'GET',\n  checkServerIdentity: function(host, cert) {\n    // Make sure the certificate is issued to the host we are connected to\n    const err = tls.checkServerIdentity(host, cert);\n    if (err) {\n      return err;\n    }\n\n    // Pin the public key, similar to HPKP pin-sha256 pinning\n    const pubkey256 = 'SIXvRyDmBJSgatgTQRGbInBaAK+hZOQ18UmrSwnDlK8=';\n    if (sha256(cert.pubkey) !== pubkey256) {\n      const msg = 'Certificate verification error: ' +\n        `The public key of '${cert.subject.CN}' ` +\n        'does not match our pinned fingerprint';\n      return new Error(msg);\n    }\n\n    // Pin the exact certificate, rather than the pub key\n    const cert256 = 'FD:6E:9B:0E:F3:98:BC:D9:04:C3:B2:EC:16:7A:7B:' +\n      '0F:DA:72:01:C9:03:C5:3A:6A:6A:E5:D0:41:43:63:EF:65';\n    if (cert.fingerprint256 !== cert256) {\n      const msg = 'Certificate verification error: ' +\n        `The certificate of '${cert.subject.CN}' ` +\n        'does not match our pinned fingerprint';\n      return new Error(msg);\n    }\n\n    // This loop is informational only.\n    // Print the certificate and public key fingerprints of all certs in the\n    // chain. Its common to pin the public key of the issuer on the public\n    // internet, while pinning the public key of the service in sensitive\n    // environments.\n    do {\n      console.log('Subject Common Name:', cert.subject.CN);\n      console.log('  Certificate SHA256 fingerprint:', cert.fingerprint256);\n\n      hash = crypto.createHash('sha256');\n      console.log('  Public key ping-sha256:', sha256(cert.pubkey));\n\n      lastprint256 = cert.fingerprint256;\n      cert = cert.issuerCertificate;\n    } while (cert.fingerprint256 !== lastprint256);\n\n  },\n};\n\noptions.agent = new https.Agent(options);\nconst req = https.request(options, (res) => {\n  console.log('All OK. Server matched our pinned cert or public key');\n  console.log('statusCode:', res.statusCode);\n\n  res.on('data', (d) => {});\n});\n\nreq.on('error', (e) => {\n  console.error(e.message);\n});\nreq.end();\n</code></pre>\n<p>Outputs for example:</p>\n<pre><code class=\"language-text\">Subject Common Name: github.com\n  Certificate SHA256 fingerprint: FD:6E:9B:0E:F3:98:BC:D9:04:C3:B2:EC:16:7A:7B:0F:DA:72:01:C9:03:C5:3A:6A:6A:E5:D0:41:43:63:EF:65\n  Public key ping-sha256: SIXvRyDmBJSgatgTQRGbInBaAK+hZOQ18UmrSwnDlK8=\nSubject Common Name: Sectigo ECC Domain Validation Secure Server CA\n  Certificate SHA256 fingerprint: 61:E9:73:75:E9:F6:DA:98:2F:F5:C1:9E:2F:94:E6:6C:4E:35:B6:83:7C:E3:B9:14:D2:24:5C:7F:5F:65:82:5F\n  Public key ping-sha256: Eep0p/AsSa9lFUH6KT2UY+9s1Z8v7voAPkQ4fGknZ2g=\nSubject Common Name: USERTrust ECC Certification Authority\n  Certificate SHA256 fingerprint: A6:CF:64:DB:B4:C8:D5:FD:19:CE:48:89:60:68:DB:03:B5:33:A8:D1:33:6C:62:56:A8:7D:00:CB:B3:DE:F3:EA\n  Public key ping-sha256: UJM2FOhG9aTNY0Pg4hgqjNzZ/lQBiMGRxPD5Y2/e0bw=\nSubject Common Name: AAA Certificate Services\n  Certificate SHA256 fingerprint: D7:A7:A0:FB:5D:7E:27:31:D7:71:E9:48:4E:BC:DE:F7:1D:5F:0C:3E:0A:29:48:78:2B:C8:3E:E0:EA:69:9E:F4\n  Public key ping-sha256: vRU+17BDT2iGsXvOi76E7TQMcTLXAqj0+jGPdW7L1vM=\nAll OK. Server matched our pinned cert or public key\nstatusCode: 200\n</code></pre>"
        }
      ],
      "properties": [
        {
          "textRaw": "`https.globalAgent`",
          "name": "globalAgent",
          "type": "property",
          "meta": {
            "added": [
              "v0.5.9"
            ],
            "changes": [
              {
                "version": [
                  "v19.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/43522",
                "description": "The agent now uses HTTP Keep-Alive and a 5 second timeout by default."
              }
            ]
          },
          "desc": "<p>Global instance of <a href=\"#class-httpsagent\"><code>https.Agent</code></a> for all HTTPS client requests. Diverges\nfrom a default <a href=\"#class-httpsagent\"><code>https.Agent</code></a> configuration by having <code>keepAlive</code> enabled and\na <code>timeout</code> of 5 seconds.</p>"
        }
      ],
      "displayName": "HTTPS",
      "source": "doc/api/https.md"
    },
    {
      "textRaw": "Inspector",
      "name": "inspector",
      "introduced_in": "v8.0.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:inspector</code> module provides an API for interacting with the V8\ninspector.</p>\n<p>It can be accessed using:</p>\n<pre><code class=\"language-mjs\">import * as inspector from 'node:inspector/promises';\n</code></pre>\n<pre><code class=\"language-cjs\">const inspector = require('node:inspector/promises');\n</code></pre>\n<p>or</p>\n<pre><code class=\"language-mjs\">import * as inspector from 'node:inspector';\n</code></pre>\n<pre><code class=\"language-cjs\">const inspector = require('node:inspector');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Promises API",
          "name": "promises_api",
          "type": "module",
          "meta": {
            "added": [
              "v19.0.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "classes": [
            {
              "textRaw": "Class: `inspector.Session`",
              "name": "inspector.Session",
              "type": "class",
              "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>The <code>inspector.Session</code> is used for dispatching messages to the V8 inspector\nback-end and receiving message responses and notifications.</p>",
              "signatures": [
                {
                  "textRaw": "`new inspector.Session()`",
                  "name": "inspector.Session",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Create a new instance of the <code>inspector.Session</code> class. The inspector session\nneeds to be connected through <a href=\"#sessionconnect\"><code>session.connect()</code></a> before the messages\ncan be dispatched to the inspector backend.</p>\n<p>When using <code>Session</code>, the object outputted by the console API will not be\nreleased, unless we performed manually <code>Runtime.DiscardConsoleEntries</code>\ncommand.</p>"
                }
              ],
              "events": [
                {
                  "textRaw": "Event: `'inspectorNotification'`",
                  "name": "inspectorNotification",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "Type: {Object} The notification message object",
                      "name": "type",
                      "type": "Object",
                      "desc": "The notification message object"
                    }
                  ],
                  "desc": "<p>Emitted when any notification from the V8 Inspector is received.</p>\n<pre><code class=\"language-js\">session.on('inspectorNotification', (message) => console.log(message.method));\n// Debugger.paused\n// Debugger.resumed\n</code></pre>\n<blockquote>\n<p><strong>Caveat</strong> Breakpoints with same-thread session is not recommended, see\n<a href=\"#support-of-breakpoints\">support of breakpoints</a>.</p>\n</blockquote>\n<p>It is also possible to subscribe only to notifications with specific method:</p>"
                },
                {
                  "textRaw": "Event: `<inspector-protocol-method>`",
                  "name": "<inspector-protocol-method>",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "Type: {Object} The notification message object",
                      "name": "type",
                      "type": "Object",
                      "desc": "The notification message object"
                    }
                  ],
                  "desc": "<p>Emitted when an inspector notification is received that has its method field set\nto the <code>&#x3C;inspector-protocol-method></code> value.</p>\n<p>The following snippet installs a listener on the <a href=\"https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-paused\"><code>'Debugger.paused'</code></a>\nevent, and prints the reason for program suspension whenever program\nexecution is suspended (through breakpoints, for example):</p>\n<pre><code class=\"language-js\">session.on('Debugger.paused', ({ params }) => {\n  console.log(params.hitBreakpoints);\n});\n// [ '/the/file/that/has/the/breakpoint.js:11:0' ]\n</code></pre>\n<blockquote>\n<p><strong>Caveat</strong> Breakpoints with same-thread session is not recommended, see\n<a href=\"#support-of-breakpoints\">support of breakpoints</a>.</p>\n</blockquote>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`session.connect()`",
                  "name": "connect",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Connects a session to the inspector back-end.</p>"
                },
                {
                  "textRaw": "`session.connectToMainThread()`",
                  "name": "connectToMainThread",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.11.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Connects a session to the main thread inspector back-end. An exception will\nbe thrown if this API was not called on a Worker thread.</p>"
                },
                {
                  "textRaw": "`session.disconnect()`",
                  "name": "disconnect",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Immediately close the session. All pending message callbacks will be called\nwith an error. <a href=\"#sessionconnect\"><code>session.connect()</code></a> will need to be called to be able to send\nmessages again. Reconnected session will lose all inspector state, such as\nenabled agents or configured breakpoints.</p>"
                },
                {
                  "textRaw": "`session.post(method[, params])`",
                  "name": "post",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`method` {string}",
                          "name": "method",
                          "type": "string"
                        },
                        {
                          "textRaw": "`params` {Object}",
                          "name": "params",
                          "type": "Object",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Posts a message to the inspector back-end.</p>\n<pre><code class=\"language-mjs\">import { Session } from 'node:inspector/promises';\ntry {\n  const session = new Session();\n  session.connect();\n  const result = await session.post('Runtime.evaluate', { expression: '2 + 2' });\n  console.log(result);\n} catch (error) {\n  console.error(error);\n}\n// Output: { result: { type: 'number', value: 4, description: '4' } }\n</code></pre>\n<p>The latest version of the V8 inspector protocol is published on the\n<a href=\"https://chromedevtools.github.io/devtools-protocol/v8/\">Chrome DevTools Protocol Viewer</a>.</p>\n<p>Node.js inspector supports all the Chrome DevTools Protocol domains declared\nby V8. Chrome DevTools Protocol domain provides an interface for interacting\nwith one of the runtime agents used to inspect the application state and listen\nto the run-time events.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Example usage",
                  "name": "example_usage",
                  "type": "module",
                  "desc": "<p>Apart from the debugger, various V8 Profilers are available through the DevTools\nprotocol.</p>",
                  "modules": [
                    {
                      "textRaw": "CPU profiler",
                      "name": "cpu_profiler",
                      "type": "module",
                      "desc": "<p>Here's an example showing how to use the <a href=\"https://chromedevtools.github.io/devtools-protocol/v8/Profiler\">CPU Profiler</a>:</p>\n<pre><code class=\"language-mjs\">import { Session } from 'node:inspector/promises';\nimport fs from 'node:fs';\nconst session = new Session();\nsession.connect();\n\nawait session.post('Profiler.enable');\nawait session.post('Profiler.start');\n// Invoke business logic under measurement here...\n\n// some time later...\nconst { profile } = await session.post('Profiler.stop');\n\n// Write profile to disk, upload, etc.\nfs.writeFileSync('./profile.cpuprofile', JSON.stringify(profile));\n</code></pre>",
                      "displayName": "CPU profiler"
                    },
                    {
                      "textRaw": "Heap profiler",
                      "name": "heap_profiler",
                      "type": "module",
                      "desc": "<p>Here's an example showing how to use the <a href=\"https://chromedevtools.github.io/devtools-protocol/v8/HeapProfiler\">Heap Profiler</a>:</p>\n<pre><code class=\"language-mjs\">import { Session } from 'node:inspector/promises';\nimport fs from 'node:fs';\nconst session = new Session();\n\nconst fd = fs.openSync('profile.heapsnapshot', 'w');\n\nsession.connect();\n\nsession.on('HeapProfiler.addHeapSnapshotChunk', (m) => {\n  fs.writeSync(fd, m.params.chunk);\n});\n\nconst result = await session.post('HeapProfiler.takeHeapSnapshot', null);\nconsole.log('HeapProfiler.takeHeapSnapshot done:', result);\nsession.disconnect();\nfs.closeSync(fd);\n</code></pre>",
                      "displayName": "Heap profiler"
                    }
                  ],
                  "displayName": "Example usage"
                }
              ]
            }
          ],
          "displayName": "Promises API"
        },
        {
          "textRaw": "Callback API",
          "name": "callback_api",
          "type": "module",
          "classes": [
            {
              "textRaw": "Class: `inspector.Session`",
              "name": "inspector.Session",
              "type": "class",
              "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>The <code>inspector.Session</code> is used for dispatching messages to the V8 inspector\nback-end and receiving message responses and notifications.</p>",
              "signatures": [
                {
                  "textRaw": "`new inspector.Session()`",
                  "name": "inspector.Session",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Create a new instance of the <code>inspector.Session</code> class. The inspector session\nneeds to be connected through <a href=\"#sessionconnect\"><code>session.connect()</code></a> before the messages\ncan be dispatched to the inspector backend.</p>\n<p>When using <code>Session</code>, the object outputted by the console API will not be\nreleased, unless we performed manually <code>Runtime.DiscardConsoleEntries</code>\ncommand.</p>"
                }
              ],
              "events": [
                {
                  "textRaw": "Event: `'inspectorNotification'`",
                  "name": "inspectorNotification",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "Type: {Object} The notification message object",
                      "name": "type",
                      "type": "Object",
                      "desc": "The notification message object"
                    }
                  ],
                  "desc": "<p>Emitted when any notification from the V8 Inspector is received.</p>\n<pre><code class=\"language-js\">session.on('inspectorNotification', (message) => console.log(message.method));\n// Debugger.paused\n// Debugger.resumed\n</code></pre>\n<blockquote>\n<p><strong>Caveat</strong> Breakpoints with same-thread session is not recommended, see\n<a href=\"#support-of-breakpoints\">support of breakpoints</a>.</p>\n</blockquote>\n<p>It is also possible to subscribe only to notifications with specific method:</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Event: `<inspector-protocol-method>`;",
                  "name": "event:_`<inspector-protocol-method>`;",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The notification message object</li>\n</ul>\n<p>Emitted when an inspector notification is received that has its method field set\nto the <code>&#x3C;inspector-protocol-method></code> value.</p>\n<p>The following snippet installs a listener on the <a href=\"https://chromedevtools.github.io/devtools-protocol/v8/Debugger#event-paused\"><code>'Debugger.paused'</code></a>\nevent, and prints the reason for program suspension whenever program\nexecution is suspended (through breakpoints, for example):</p>\n<pre><code class=\"language-js\">session.on('Debugger.paused', ({ params }) => {\n  console.log(params.hitBreakpoints);\n});\n// [ '/the/file/that/has/the/breakpoint.js:11:0' ]\n</code></pre>\n<blockquote>\n<p><strong>Caveat</strong> Breakpoints with same-thread session is not recommended, see\n<a href=\"#support-of-breakpoints\">support of breakpoints</a>.</p>\n</blockquote>",
                  "displayName": "Event: `<inspector-protocol-method>`;"
                },
                {
                  "textRaw": "Example usage",
                  "name": "example_usage",
                  "type": "module",
                  "desc": "<p>Apart from the debugger, various V8 Profilers are available through the DevTools\nprotocol.</p>",
                  "modules": [
                    {
                      "textRaw": "CPU profiler",
                      "name": "cpu_profiler",
                      "type": "module",
                      "desc": "<p>Here's an example showing how to use the <a href=\"https://chromedevtools.github.io/devtools-protocol/v8/Profiler\">CPU Profiler</a>:</p>\n<pre><code class=\"language-js\">const inspector = require('node:inspector');\nconst fs = require('node:fs');\nconst session = new inspector.Session();\nsession.connect();\n\nsession.post('Profiler.enable', () => {\n  session.post('Profiler.start', () => {\n    // Invoke business logic under measurement here...\n\n    // some time later...\n    session.post('Profiler.stop', (err, { profile }) => {\n      // Write profile to disk, upload, etc.\n      if (!err) {\n        fs.writeFileSync('./profile.cpuprofile', JSON.stringify(profile));\n      }\n    });\n  });\n});\n</code></pre>",
                      "displayName": "CPU profiler"
                    },
                    {
                      "textRaw": "Heap profiler",
                      "name": "heap_profiler",
                      "type": "module",
                      "desc": "<p>Here's an example showing how to use the <a href=\"https://chromedevtools.github.io/devtools-protocol/v8/HeapProfiler\">Heap Profiler</a>:</p>\n<pre><code class=\"language-js\">const inspector = require('node:inspector');\nconst fs = require('node:fs');\nconst session = new inspector.Session();\n\nconst fd = fs.openSync('profile.heapsnapshot', 'w');\n\nsession.connect();\n\nsession.on('HeapProfiler.addHeapSnapshotChunk', (m) => {\n  fs.writeSync(fd, m.params.chunk);\n});\n\nsession.post('HeapProfiler.takeHeapSnapshot', null, (err, r) => {\n  console.log('HeapProfiler.takeHeapSnapshot done:', err, r);\n  session.disconnect();\n  fs.closeSync(fd);\n});\n</code></pre>",
                      "displayName": "Heap profiler"
                    }
                  ],
                  "displayName": "Example usage"
                }
              ],
              "methods": [
                {
                  "textRaw": "`session.connect()`",
                  "name": "connect",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Connects a session to the inspector back-end.</p>"
                },
                {
                  "textRaw": "`session.connectToMainThread()`",
                  "name": "connectToMainThread",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v12.11.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Connects a session to the main thread inspector back-end. An exception will\nbe thrown if this API was not called on a Worker thread.</p>"
                },
                {
                  "textRaw": "`session.disconnect()`",
                  "name": "disconnect",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Immediately close the session. All pending message callbacks will be called\nwith an error. <a href=\"#sessionconnect\"><code>session.connect()</code></a> will need to be called to be able to send\nmessages again. Reconnected session will lose all inspector state, such as\nenabled agents or configured breakpoints.</p>"
                },
                {
                  "textRaw": "`session.post(method[, params][, callback])`",
                  "name": "post",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`method` {string}",
                          "name": "method",
                          "type": "string"
                        },
                        {
                          "textRaw": "`params` {Object}",
                          "name": "params",
                          "type": "Object",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Posts a message to the inspector back-end. <code>callback</code> will be notified when\na response is received. <code>callback</code> is a function that accepts two optional\narguments: error and message-specific result.</p>\n<pre><code class=\"language-js\">session.post('Runtime.evaluate', { expression: '2 + 2' },\n             (error, { result }) => console.log(result));\n// Output: { type: 'number', value: 4, description: '4' }\n</code></pre>\n<p>The latest version of the V8 inspector protocol is published on the\n<a href=\"https://chromedevtools.github.io/devtools-protocol/v8/\">Chrome DevTools Protocol Viewer</a>.</p>\n<p>Node.js inspector supports all the Chrome DevTools Protocol domains declared\nby V8. Chrome DevTools Protocol domain provides an interface for interacting\nwith one of the runtime agents used to inspect the application state and listen\nto the run-time events.</p>\n<p>You can not set <code>reportProgress</code> to <code>true</code> when sending a\n<code>HeapProfiler.takeHeapSnapshot</code> or <code>HeapProfiler.stopTrackingHeapObjects</code>\ncommand to V8.</p>"
                }
              ]
            }
          ],
          "displayName": "Callback API"
        },
        {
          "textRaw": "Common Objects",
          "name": "common_objects",
          "type": "module",
          "methods": [
            {
              "textRaw": "`inspector.close()`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": [
                  {
                    "version": "v18.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44489",
                    "description": "The API is exposed in the worker threads."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Attempts to close all remaining connections, blocking the event loop until all\nare closed. Once all connections are closed, deactivates the inspector.</p>"
            },
            {
              "textRaw": "`inspector.open([port[, host[, wait]]])`",
              "name": "open",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": "v20.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/48765",
                    "description": "inspector.open() now returns a `Disposable` object."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`port` {number} Port to listen on for inspector connections. Optional. **Default:** what was specified on the CLI.",
                      "name": "port",
                      "type": "number",
                      "default": "what was specified on the CLI",
                      "desc": "Port to listen on for inspector connections. Optional.",
                      "optional": true
                    },
                    {
                      "textRaw": "`host` {string} Host to listen on for inspector connections. Optional. **Default:** what was specified on the CLI.",
                      "name": "host",
                      "type": "string",
                      "default": "what was specified on the CLI",
                      "desc": "Host to listen on for inspector connections. Optional.",
                      "optional": true
                    },
                    {
                      "textRaw": "`wait` {boolean} Block until a client has connected. Optional. **Default:** `false`.",
                      "name": "wait",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Block until a client has connected. Optional.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Disposable} A Disposable that calls `inspector.close()`.",
                    "name": "return",
                    "type": "Disposable",
                    "desc": "A Disposable that calls `inspector.close()`."
                  }
                }
              ],
              "desc": "<p>Activate inspector on host and port. Equivalent to\n<code>node --inspect=[[host:]port]</code>, but can be done programmatically after node has\nstarted.</p>\n<p>If wait is <code>true</code>, will block until a client has connected to the inspect port\nand flow control has been passed to the debugger client.</p>\n<p>See the <a href=\"cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure\">security warning</a> regarding the <code>host</code>\nparameter usage.</p>"
            },
            {
              "textRaw": "`inspector.url()`",
              "name": "url",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string|undefined}",
                    "name": "return",
                    "type": "string|undefined"
                  }
                }
              ],
              "desc": "<p>Return the URL of the active inspector, or <code>undefined</code> if there is none.</p>\n<pre><code class=\"language-console\">$ node --inspect -p 'inspector.url()'\nDebugger listening on ws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34\nFor help, see: https://nodejs.org/learn/getting-started/debugging\nws://127.0.0.1:9229/166e272e-7a30-4d09-97ce-f1c012b43c34\n\n$ node --inspect=localhost:3000 -p 'inspector.url()'\nDebugger listening on ws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a\nFor help, see: https://nodejs.org/learn/getting-started/debugging\nws://localhost:3000/51cf8d0e-3c36-4c59-8efd-54519839e56a\n\n$ node -p 'inspector.url()'\nundefined\n</code></pre>"
            },
            {
              "textRaw": "`inspector.waitForDebugger()`",
              "name": "waitForDebugger",
              "type": "method",
              "meta": {
                "added": [
                  "v12.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Blocks until a client (existing or connected later) has sent\n<code>Runtime.runIfWaitingForDebugger</code> command.</p>\n<p>An exception will be thrown if there is no active inspector.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object} An object to send messages to the remote inspector console.",
              "name": "console",
              "type": "Object",
              "desc": "<pre><code class=\"language-js\">require('node:inspector').console.log('a message');\n</code></pre>\n<p>The inspector console does not have API parity with Node.js\nconsole.</p>",
              "shortDesc": "An object to send messages to the remote inspector console."
            }
          ],
          "displayName": "Common Objects"
        },
        {
          "textRaw": "Integration with DevTools",
          "name": "integration_with_devtools",
          "type": "module",
          "stability": 1.1,
          "stabilityText": "Active development",
          "desc": "<p>The <code>node:inspector</code> module provides an API for integrating with devtools that support Chrome DevTools Protocol.\nDevTools frontends connected to a running Node.js instance can capture protocol events emitted from the instance\nand display them accordingly to facilitate debugging.\nThe following methods broadcast a protocol event to all connected frontends.\nThe <code>params</code> passed to the methods can be optional, depending on the protocol.</p>\n<pre><code class=\"language-js\">// The `Network.requestWillBeSent` event will be fired.\ninspector.Network.requestWillBeSent({\n  requestId: 'request-id-1',\n  timestamp: Date.now() / 1000,\n  wallTime: Date.now(),\n  request: {\n    url: 'https://nodejs.org/en',\n    method: 'GET',\n  },\n});\n</code></pre>",
          "methods": [
            {
              "textRaw": "`inspector.Network.dataReceived([params])`",
              "name": "dataReceived",
              "type": "method",
              "meta": {
                "added": [
                  "v24.2.0",
                  "v22.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>Network.dataReceived</code> event to connected frontends, or buffers the data if\n<code>Network.streamResourceContent</code> command was not invoked for the given request yet.</p>\n<p>Also enables <code>Network.getResponseBody</code> command to retrieve the response data.</p>"
            },
            {
              "textRaw": "`inspector.Network.dataSent([params])`",
              "name": "dataSent",
              "type": "method",
              "meta": {
                "added": [
                  "v24.3.0",
                  "v22.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Enables <code>Network.getRequestPostData</code> command to retrieve the request data.</p>"
            },
            {
              "textRaw": "`inspector.Network.requestWillBeSent([params])`",
              "name": "requestWillBeSent",
              "type": "method",
              "meta": {
                "added": [
                  "v22.6.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>Network.requestWillBeSent</code> event to connected frontends. This event indicates that\nthe application is about to send an HTTP request.</p>"
            },
            {
              "textRaw": "`inspector.Network.responseReceived([params])`",
              "name": "responseReceived",
              "type": "method",
              "meta": {
                "added": [
                  "v22.6.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>Network.responseReceived</code> event to connected frontends. This event indicates that\nHTTP response is available.</p>"
            },
            {
              "textRaw": "`inspector.Network.loadingFinished([params])`",
              "name": "loadingFinished",
              "type": "method",
              "meta": {
                "added": [
                  "v22.6.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>Network.loadingFinished</code> event to connected frontends. This event indicates that\nHTTP request has finished loading.</p>"
            },
            {
              "textRaw": "`inspector.Network.loadingFailed([params])`",
              "name": "loadingFailed",
              "type": "method",
              "meta": {
                "added": [
                  "v22.7.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>Network.loadingFailed</code> event to connected frontends. This event indicates that\nHTTP request has failed to load.</p>"
            },
            {
              "textRaw": "`inspector.Network.webSocketCreated([params])`",
              "name": "webSocketCreated",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>Network.webSocketCreated</code> event to connected frontends. This event indicates that\na WebSocket connection has been initiated.</p>"
            },
            {
              "textRaw": "`inspector.Network.webSocketHandshakeResponseReceived([params])`",
              "name": "webSocketHandshakeResponseReceived",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>Network.webSocketHandshakeResponseReceived</code> event to connected frontends.\nThis event indicates that the WebSocket handshake response has been received.</p>"
            },
            {
              "textRaw": "`inspector.Network.webSocketClosed([params])`",
              "name": "webSocketClosed",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`params` {Object}",
                      "name": "params",
                      "type": "Object",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This feature is only available with the <code>--experimental-network-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>Network.webSocketClosed</code> event to connected frontends.\nThis event indicates that a WebSocket connection has been closed.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`inspector.NetworkResources.put`",
              "name": "put",
              "type": "property",
              "meta": {
                "added": [
                  "v24.5.0",
                  "v22.19.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "desc": "<p>This feature is only available with the <code>--experimental-inspector-network-resource</code> flag enabled.</p>\n<p>The inspector.NetworkResources.put method is used to provide a response for a loadNetworkResource\nrequest issued via the Chrome DevTools Protocol (CDP).\nThis is typically triggered when a source map is specified by URL, and a DevTools frontend—such as\nChrome—requests the resource to retrieve the source map.</p>\n<p>This method allows developers to predefine the resource content to be served in response to such CDP requests.</p>\n<pre><code class=\"language-js\">const inspector = require('node:inspector');\n// By preemptively calling put to register the resource, a source map can be resolved when\n// a loadNetworkResource request is made from the frontend.\nasync function setNetworkResources() {\n  const mapUrl = 'http://localhost:3000/dist/app.js.map';\n  const tsUrl = 'http://localhost:3000/src/app.ts';\n  const distAppJsMap = await fetch(mapUrl).then((res) => res.text());\n  const srcAppTs = await fetch(tsUrl).then((res) => res.text());\n  inspector.NetworkResources.put(mapUrl, distAppJsMap);\n  inspector.NetworkResources.put(tsUrl, srcAppTs);\n};\nsetNetworkResources().then(() => {\n  require('./dist/app');\n});\n</code></pre>\n<p>For more details, see the official CDP documentation: <a href=\"https://chromedevtools.github.io/devtools-protocol/tot/Network/#method-loadNetworkResource\">Network.loadNetworkResource</a></p>"
            },
            {
              "textRaw": "`params` {Object}",
              "name": "domStorageItemAdded",
              "type": "Object",
              "meta": {
                "added": [
                  "v25.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This feature is only available with the\n<code>--experimental-storage-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>DOMStorage.domStorageItemAdded</code> event to connected frontends.\nThis event indicates that a new item has been added to the storage.</p>",
              "options": [
                {
                  "textRaw": "`storageId` {Object}",
                  "name": "storageId",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`securityOrigin` {string}",
                      "name": "securityOrigin",
                      "type": "string"
                    },
                    {
                      "textRaw": "`storageKey` {string}",
                      "name": "storageKey",
                      "type": "string"
                    },
                    {
                      "textRaw": "`isLocalStorage` {boolean}",
                      "name": "isLocalStorage",
                      "type": "boolean"
                    }
                  ]
                },
                {
                  "textRaw": "`key` {string}",
                  "name": "key",
                  "type": "string"
                },
                {
                  "textRaw": "`newValue` {string}",
                  "name": "newValue",
                  "type": "string"
                }
              ]
            },
            {
              "textRaw": "`params` {Object}",
              "name": "domStorageItemRemoved",
              "type": "Object",
              "meta": {
                "added": [
                  "v25.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This feature is only available with the\n<code>--experimental-storage-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>DOMStorage.domStorageItemRemoved</code> event to connected frontends.\nThis event indicates that an item has been removed from the storage.</p>",
              "options": [
                {
                  "textRaw": "`storageId` {Object}",
                  "name": "storageId",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`securityOrigin` {string}",
                      "name": "securityOrigin",
                      "type": "string"
                    },
                    {
                      "textRaw": "`storageKey` {string}",
                      "name": "storageKey",
                      "type": "string"
                    },
                    {
                      "textRaw": "`isLocalStorage` {boolean}",
                      "name": "isLocalStorage",
                      "type": "boolean"
                    }
                  ]
                },
                {
                  "textRaw": "`key` {string}",
                  "name": "key",
                  "type": "string"
                }
              ]
            },
            {
              "textRaw": "`params` {Object}",
              "name": "domStorageItemUpdated",
              "type": "Object",
              "meta": {
                "added": [
                  "v25.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This feature is only available with the\n<code>--experimental-storage-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>DOMStorage.domStorageItemUpdated</code> event to connected frontends.\nThis event indicates that a storage item has been updated.</p>",
              "options": [
                {
                  "textRaw": "`storageId` {Object}",
                  "name": "storageId",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`securityOrigin` {string}",
                      "name": "securityOrigin",
                      "type": "string"
                    },
                    {
                      "textRaw": "`storageKey` {string}",
                      "name": "storageKey",
                      "type": "string"
                    },
                    {
                      "textRaw": "`isLocalStorage` {boolean}",
                      "name": "isLocalStorage",
                      "type": "boolean"
                    }
                  ]
                },
                {
                  "textRaw": "`key` {string}",
                  "name": "key",
                  "type": "string"
                },
                {
                  "textRaw": "`oldValue` {string}",
                  "name": "oldValue",
                  "type": "string"
                },
                {
                  "textRaw": "`newValue` {string}",
                  "name": "newValue",
                  "type": "string"
                }
              ]
            },
            {
              "textRaw": "`params` {Object}",
              "name": "domStorageItemsCleared",
              "type": "Object",
              "meta": {
                "added": [
                  "v25.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This feature is only available with the\n<code>--experimental-storage-inspection</code> flag enabled.</p>\n<p>Broadcasts the <code>DOMStorage.domStorageItemsCleared</code> event to connected\nfrontends. This event indicates that all items have been cleared from the\nstorage.</p>",
              "options": [
                {
                  "textRaw": "`storageId` {Object}",
                  "name": "storageId",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`securityOrigin` {string}",
                      "name": "securityOrigin",
                      "type": "string"
                    },
                    {
                      "textRaw": "`storageKey` {string}",
                      "name": "storageKey",
                      "type": "string"
                    },
                    {
                      "textRaw": "`isLocalStorage` {boolean}",
                      "name": "isLocalStorage",
                      "type": "boolean"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`params` {Object}",
              "name": "registerStorage",
              "type": "Object",
              "meta": {
                "added": [
                  "v25.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This feature is only available with the\n<code>--experimental-storage-inspection</code> flag enabled.</p>",
              "options": [
                {
                  "textRaw": "`isLocalStorage` {boolean}",
                  "name": "isLocalStorage",
                  "type": "boolean"
                },
                {
                  "textRaw": "`storageMap` {Object}",
                  "name": "storageMap",
                  "type": "Object"
                }
              ]
            }
          ],
          "displayName": "Integration with DevTools"
        },
        {
          "textRaw": "Support of breakpoints",
          "name": "support_of_breakpoints",
          "type": "module",
          "desc": "<p>The Chrome DevTools Protocol <a href=\"https://chromedevtools.github.io/devtools-protocol/v8/Debugger\"><code>Debugger</code> domain</a> allows an\n<code>inspector.Session</code> to attach to a program and set breakpoints to step through\nthe codes.</p>\n<p>However, setting breakpoints with a same-thread <code>inspector.Session</code>, which is\nconnected by <a href=\"#sessionconnect\"><code>session.connect()</code></a>, should be avoided as the program being\nattached and paused is exactly the debugger itself. Instead, try connect to the\nmain thread by <a href=\"#sessionconnecttomainthread\"><code>session.connectToMainThread()</code></a> and set breakpoints in a\nworker thread, or connect with a <a href=\"debugger.html\">Debugger</a> program over WebSocket\nconnection.</p>",
          "displayName": "Support of breakpoints"
        }
      ],
      "displayName": "Inspector",
      "source": "doc/api/inspector.md"
    },
    {
      "textRaw": "Iterable Streams",
      "name": "iterable_streams",
      "introduced_in": "v25.9.0",
      "type": "module",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The <code>node:stream/iter</code> module provides a streaming API built on iterables\nrather than the event-driven <code>Readable</code>/<code>Writable</code>/<code>Transform</code> class hierarchy,\nor the Web Streams <code>ReadableStream</code>/<code>WritableStream</code>/<code>TransformStream</code> interfaces.</p>\n<p>This module is available only when the <code>--experimental-stream-iter</code> CLI flag\nis enabled.</p>\n<p>Streams are represented as <code>AsyncIterable&#x3C;Uint8Array[]></code> (async) or\n<code>Iterable&#x3C;Uint8Array[]></code> (sync). There are no base classes to extend -- any\nobject implementing the iterable protocol can participate. Transforms are plain\nfunctions or objects with a <code>transform</code> method.</p>\n<p>Data flows in <strong>batches</strong> (<code>Uint8Array[]</code> per iteration) to amortize the cost\nof async operations.</p>\n<pre><code class=\"language-mjs\">import { from, pull, text } from 'node:stream/iter';\nimport { compressGzip, decompressGzip } from 'node:zlib/iter';\n\n// Compress and decompress a string\nconst compressed = pull(from('Hello, world!'), compressGzip());\nconst result = await text(pull(compressed, decompressGzip()));\nconsole.log(result); // 'Hello, world!'\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, pull, text } = require('node:stream/iter');\nconst { compressGzip, decompressGzip } = require('node:zlib/iter');\n\nasync function run() {\n  // Compress and decompress a string\n  const compressed = pull(from('Hello, world!'), compressGzip());\n  const result = await text(pull(compressed, decompressGzip()));\n  console.log(result); // 'Hello, world!'\n}\n\nrun().catch(console.error);\n</code></pre>\n<pre><code class=\"language-mjs\">import { open } from 'node:fs/promises';\nimport { text, pipeTo } from 'node:stream/iter';\nimport { compressGzip, decompressGzip } from 'node:zlib/iter';\n\n// Read a file, compress, write to another file\nconst src = await open('input.txt', 'r');\nconst dst = await open('output.gz', 'w');\nawait pipeTo(src.pull(), compressGzip(), dst.writer({ autoClose: true }));\nawait src.close();\n\n// Read it back\nconst gz = await open('output.gz', 'r');\nconsole.log(await text(gz.pull(decompressGzip(), { autoClose: true })));\n</code></pre>\n<pre><code class=\"language-cjs\">const { open } = require('node:fs/promises');\nconst { text, pipeTo } = require('node:stream/iter');\nconst { compressGzip, decompressGzip } = require('node:zlib/iter');\n\nasync function run() {\n  // Read a file, compress, write to another file\n  const src = await open('input.txt', 'r');\n  const dst = await open('output.gz', 'w');\n  await pipeTo(src.pull(), compressGzip(), dst.writer({ autoClose: true }));\n  await src.close();\n\n  // Read it back\n  const gz = await open('output.gz', 'r');\n  console.log(await text(gz.pull(decompressGzip(), { autoClose: true })));\n}\n\nrun().catch(console.error);\n</code></pre>",
      "modules": [
        {
          "textRaw": "Concepts",
          "name": "concepts",
          "type": "module",
          "modules": [
            {
              "textRaw": "Byte streams",
              "name": "byte_streams",
              "type": "module",
              "desc": "<p>All data in this API is represented as <code>Uint8Array</code> bytes. Strings\nare automatically UTF-8 encoded when passed to <code>from()</code>, <code>push()</code>, or\n<code>pipeTo()</code>. This removes ambiguity around encodings and enables zero-copy\ntransfers between streams and native code.</p>",
              "displayName": "Byte streams"
            },
            {
              "textRaw": "Batching",
              "name": "batching",
              "type": "module",
              "desc": "<p>Each iteration yields a <strong>batch</strong> -- an array of <code>Uint8Array</code> chunks\n(<code>Uint8Array[]</code>). Batching amortizes the cost of <code>await</code> and Promise creation\nacross multiple chunks. A consumer that processes one chunk at a time can\nsimply iterate the inner array:</p>\n<pre><code class=\"language-mjs\">for await (const batch of source) {\n  for (const chunk of batch) {\n    handle(chunk);\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">async function run() {\n  for await (const batch of source) {\n    for (const chunk of batch) {\n      handle(chunk);\n    }\n  }\n}\n</code></pre>",
              "displayName": "Batching"
            },
            {
              "textRaw": "Transforms",
              "name": "transforms",
              "type": "module",
              "desc": "<p>Transforms come in two forms:</p>\n<ul>\n<li>\n<p><strong>Stateless</strong> -- a function <code>(chunks, options) => result</code> called once per\nbatch. Receives <code>Uint8Array[]</code> (or <code>null</code> as the flush signal) and an\n<code>options</code> object. Returns <code>Uint8Array[]</code>, <code>null</code>, or an iterable of chunks.</p>\n</li>\n<li>\n<p><strong>Stateful</strong> -- an object <code>{ transform(source, options) }</code> where <code>transform</code>\nis a generator (sync or async) that receives the entire upstream iterable\nand an <code>options</code> object, and yields output. This form is used for\ncompression, encryption, and any transform that needs to buffer across\nbatches.</p>\n</li>\n</ul>\n<p>Both forms receive an <code>options</code> parameter with the following property:</p>\n<ul>\n<li><code>options.signal</code> <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> An AbortSignal that fires when the pipeline\nis cancelled, encounters an error, or the consumer stops reading. Transforms\ncan check <code>signal.aborted</code> or listen for the <code>'abort'</code> event to perform\nearly cleanup.</li>\n</ul>\n<p>The flush signal (<code>null</code>) is sent after the source ends, giving transforms\na chance to emit trailing data (e.g., compression footers).</p>\n<pre><code class=\"language-js\">// Stateless: uppercase transform\nconst upper = (chunks) => {\n  if (chunks === null) return null; // flush\n  return chunks.map((c) => new TextEncoder().encode(\n    new TextDecoder().decode(c).toUpperCase(),\n  ));\n};\n\n// Stateful: line splitter\nconst lines = {\n  transform: async function*(source) {\n    let partial = '';\n    for await (const chunks of source) {\n      if (chunks === null) {\n        if (partial) yield [new TextEncoder().encode(partial)];\n        continue;\n      }\n      for (const chunk of chunks) {\n        const str = partial + new TextDecoder().decode(chunk);\n        const parts = str.split('\\n');\n        partial = parts.pop();\n        for (const line of parts) {\n          yield [new TextEncoder().encode(`${line}\\n`)];\n        }\n      }\n    }\n  },\n};\n</code></pre>",
              "displayName": "Transforms"
            },
            {
              "textRaw": "Pull vs. push",
              "name": "pull_vs._push",
              "type": "module",
              "desc": "<p>The API supports two models:</p>\n<ul>\n<li>\n<p><strong>Pull</strong> -- data flows on demand. <code>pull()</code> and <code>pullSync()</code> create lazy\npipelines that only read from the source when the consumer iterates.</p>\n</li>\n<li>\n<p><strong>Push</strong> -- data is written explicitly. <code>push()</code> creates a writer/readable\npair with backpressure. The writer pushes data in; the readable is consumed\nas an async iterable.</p>\n</li>\n</ul>",
              "displayName": "Pull vs. push"
            },
            {
              "textRaw": "Backpressure",
              "name": "backpressure",
              "type": "module",
              "desc": "<p>Pull streams have natural backpressure -- the consumer drives the pace, so\nthe source is never read faster than the consumer can process. Push streams\nneed explicit backpressure because the producer and consumer run\nindependently. The <code>highWaterMark</code> and <code>backpressure</code> options on <code>push()</code>,\n<code>broadcast()</code>, and <code>share()</code> control how this works.</p>",
              "modules": [
                {
                  "textRaw": "The two-buffer model",
                  "name": "the_two-buffer_model",
                  "type": "module",
                  "desc": "<p>Push streams use a two-part buffering system. Think of it like a bucket\n(slots) being filled through a hose (pending writes), with a float valve\nthat closes when the bucket is full:</p>\n<pre><code class=\"language-text\">                          highWaterMark (e.g., 3)\n                                 |\n    Producer                     v\n       |                    +---------+\n       v                    |         |\n  [ write() ] ----+    +--->| slots   |---> Consumer pulls\n  [ write() ]     |    |    | (bucket)|     for await (...)\n  [ write() ]     v    |    +---------+\n              +--------+         ^\n              | pending|         |\n              | writes |    float valve\n              | (hose) |    (backpressure)\n              +--------+\n                   ^\n                   |\n          'strict' mode limits this too!\n</code></pre>\n<ul>\n<li>\n<p><strong>Slots (the bucket)</strong> -- data ready for the consumer, capped at\n<code>highWaterMark</code>. When the consumer pulls, it drains all slots at once\ninto a single batch.</p>\n</li>\n<li>\n<p><strong>Pending writes (the hose)</strong> -- writes waiting for slot space. After\nthe consumer drains, pending writes are promoted into the now-empty\nslots and their promises settle.</p>\n</li>\n</ul>\n<p>How each policy uses these buffers:</p>\n<table>\n<thead>\n<tr>\n<th>Policy</th>\n<th>Slots limit</th>\n<th>Pending writes limit</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'strict'</code></td>\n<td><code>highWaterMark</code></td>\n<td><code>highWaterMark</code></td>\n</tr>\n<tr>\n<td><code>'block'</code></td>\n<td><code>highWaterMark</code></td>\n<td>Unbounded</td>\n</tr>\n<tr>\n<td><code>'drop-oldest'</code></td>\n<td><code>highWaterMark</code></td>\n<td>N/A (never waits)</td>\n</tr>\n<tr>\n<td><code>'drop-newest'</code></td>\n<td><code>highWaterMark</code></td>\n<td>N/A (never waits)</td>\n</tr>\n</tbody>\n</table>",
                  "displayName": "The two-buffer model"
                },
                {
                  "textRaw": "Strict (default)",
                  "name": "strict_(default)",
                  "type": "module",
                  "desc": "<p>Strict mode catches \"fire-and-forget\" patterns where the producer calls\n<code>write()</code> without awaiting, which would cause unbounded memory growth.\nIt limits both the slots buffer and the pending writes queue to\n<code>highWaterMark</code>.</p>\n<p>If you properly await each write, you can only ever have one pending\nwrite at a time (yours), so you never hit the pending writes limit.\nUnawaited writes accumulate in the pending queue and throw once it\noverflows:</p>\n<pre><code class=\"language-mjs\">import { push, text } from 'node:stream/iter';\n\nconst { writer, readable } = push({ highWaterMark: 16 });\n\n// Consumer must run concurrently -- without it, the first write\n// that fills the buffer blocks the producer forever.\nconst consuming = text(readable);\n\n// GOOD: awaited writes. The producer waits for the consumer to\n// make room when the buffer is full.\nfor (const item of dataset) {\n  await writer.write(item);\n}\nawait writer.end();\nconsole.log(await consuming);\n</code></pre>\n<pre><code class=\"language-cjs\">const { push, text } = require('node:stream/iter');\n\nasync function run() {\n  const { writer, readable } = push({ highWaterMark: 16 });\n\n  // Consumer must run concurrently -- without it, the first write\n  // that fills the buffer blocks the producer forever.\n  const consuming = text(readable);\n\n  // GOOD: awaited writes. The producer waits for the consumer to\n  // make room when the buffer is full.\n  for (const item of dataset) {\n    await writer.write(item);\n  }\n  await writer.end();\n  console.log(await consuming);\n}\n\nrun().catch(console.error);\n</code></pre>\n<p>Forgetting to <code>await</code> will eventually throw:</p>\n<pre><code class=\"language-js\">// BAD: fire-and-forget. Strict mode throws once both buffers fill.\nfor (const item of dataset) {\n  writer.write(item); // Not awaited -- queues without bound\n}\n// --> throws \"Backpressure violation: too many pending writes\"\n</code></pre>",
                  "displayName": "Strict (default)"
                },
                {
                  "textRaw": "Block",
                  "name": "block",
                  "type": "module",
                  "desc": "<p>Block mode caps slots at <code>highWaterMark</code> but places no limit on the\npending writes queue. Awaited writes block until the consumer makes room,\njust like strict mode. The difference is that unawaited writes silently\nqueue forever instead of throwing -- a potential memory leak if the\nproducer forgets to <code>await</code>.</p>\n<p>This is the mode that existing Node.js classic streams and Web Streams\ndefault to. Use it when you control the producer and know it awaits\nproperly, or when migrating code from those APIs.</p>\n<pre><code class=\"language-mjs\">import { push, text } from 'node:stream/iter';\n\nconst { writer, readable } = push({\n  highWaterMark: 16,\n  backpressure: 'block',\n});\n\nconst consuming = text(readable);\n\n// Safe -- awaited writes block until the consumer reads.\nfor (const item of dataset) {\n  await writer.write(item);\n}\nawait writer.end();\nconsole.log(await consuming);\n</code></pre>\n<pre><code class=\"language-cjs\">const { push, text } = require('node:stream/iter');\n\nasync function run() {\n  const { writer, readable } = push({\n    highWaterMark: 16,\n    backpressure: 'block',\n  });\n\n  const consuming = text(readable);\n\n  // Safe -- awaited writes block until the consumer reads.\n  for (const item of dataset) {\n    await writer.write(item);\n  }\n  await writer.end();\n  console.log(await consuming);\n}\n\nrun().catch(console.error);\n</code></pre>",
                  "displayName": "Block"
                },
                {
                  "textRaw": "Drop-oldest",
                  "name": "drop-oldest",
                  "type": "module",
                  "desc": "<p>Writes never wait. When the slots buffer is full, the oldest buffered\nchunk is evicted to make room for the incoming write. The consumer\nalways sees the most recent data. Useful for live feeds, telemetry, or\nany scenario where stale data is less valuable than current data.</p>\n<pre><code class=\"language-mjs\">import { push } from 'node:stream/iter';\n\n// Keep only the 5 most recent readings\nconst { writer, readable } = push({\n  highWaterMark: 5,\n  backpressure: 'drop-oldest',\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { push } = require('node:stream/iter');\n\n// Keep only the 5 most recent readings\nconst { writer, readable } = push({\n  highWaterMark: 5,\n  backpressure: 'drop-oldest',\n});\n</code></pre>",
                  "displayName": "Drop-oldest"
                },
                {
                  "textRaw": "Drop-newest",
                  "name": "drop-newest",
                  "type": "module",
                  "desc": "<p>Writes never wait. When the slots buffer is full, the incoming write is\nsilently discarded. The consumer processes what is already buffered\nwithout being overwhelmed by new data. Useful for rate-limiting or\nshedding load under pressure.</p>\n<pre><code class=\"language-mjs\">import { push } from 'node:stream/iter';\n\n// Accept up to 10 buffered items; discard anything beyond that\nconst { writer, readable } = push({\n  highWaterMark: 10,\n  backpressure: 'drop-newest',\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { push } = require('node:stream/iter');\n\n// Accept up to 10 buffered items; discard anything beyond that\nconst { writer, readable } = push({\n  highWaterMark: 10,\n  backpressure: 'drop-newest',\n});\n</code></pre>",
                  "displayName": "Drop-newest"
                }
              ],
              "displayName": "Backpressure"
            },
            {
              "textRaw": "Writer interface",
              "name": "writer_interface",
              "type": "module",
              "desc": "<p>A writer is any object conforming to the Writer interface. Only <code>write()</code> is\nrequired; all other methods are optional.</p>\n<p>Each async method has a synchronous <code>*Sync</code> counterpart designed for a\ntry-fallback pattern: attempt the fast synchronous path first, and fall back\nto the async version only when the synchronous call indicates it could not\ncomplete:</p>\n<pre><code class=\"language-mjs\">if (!writer.writeSync(chunk)) await writer.write(chunk);\nif (!writer.writevSync(chunks)) await writer.writev(chunks);\nif (writer.endSync() &#x3C; 0) await writer.end();\nwriter.fail(err);  // Always synchronous, no fallback needed\n</code></pre>",
              "properties": [
                {
                  "textRaw": "{number|null}",
                  "name": "desiredSize",
                  "type": "number|null",
                  "desc": "<p>The number of buffer slots available before the high water mark is reached.\nReturns <code>null</code> if the writer is closed or the consumer has disconnected.</p>\n<p>The value is always non-negative.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`writer.end([options])`",
                  "name": "end",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal} Cancel just this operation. The signal cancels only the pending `end()` call; it does not fail the writer itself.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "Cancel just this operation. The signal cancels only the pending `end()` call; it does not fail the writer itself."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with the total number of bytes written.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with the total number of bytes written."
                      }
                    }
                  ],
                  "desc": "<p>Signal that no more data will be written.</p>"
                },
                {
                  "textRaw": "`writer.endSync()`",
                  "name": "endSync",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {number} Total bytes written, or `-1` if the writer is not open.",
                        "name": "return",
                        "type": "number",
                        "desc": "Total bytes written, or `-1` if the writer is not open."
                      }
                    }
                  ],
                  "desc": "<p>Synchronous variant of <code>writer.end()</code>. Returns <code>-1</code> if the writer is already\nclosed or errored. Can be used as a try-fallback pattern:</p>\n<pre><code class=\"language-cjs\">const result = writer.endSync();\nif (result &#x3C; 0) {\n  writer.end();\n}\n</code></pre>"
                },
                {
                  "textRaw": "`writer.fail(reason)`",
                  "name": "fail",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {any}",
                          "name": "reason",
                          "type": "any"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Put the writer into a terminal error state. If the writer is already closed\nor errored, this is a no-op. Unlike <code>write()</code> and <code>end()</code>, <code>fail()</code> is\nunconditionally synchronous because failing a writer is a pure state\ntransition with no async work to perform.</p>"
                },
                {
                  "textRaw": "`writer.write(chunk[, options])`",
                  "name": "write",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {Uint8Array|string}",
                          "name": "chunk",
                          "type": "Uint8Array|string"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal} Cancel just this write operation. The signal cancels only the pending `write()` call; it does not fail the writer itself.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "Cancel just this write operation. The signal cancels only the pending `write()` call; it does not fail the writer itself."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with `undefined` when buffer space is available.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with `undefined` when buffer space is available."
                      }
                    }
                  ],
                  "desc": "<p>Write a chunk.</p>"
                },
                {
                  "textRaw": "`writer.writeSync(chunk)`",
                  "name": "writeSync",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {Uint8Array|string}",
                          "name": "chunk",
                          "type": "Uint8Array|string"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if the write was accepted, `false` if the buffer is full.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if the write was accepted, `false` if the buffer is full."
                      }
                    }
                  ],
                  "desc": "<p>Synchronous write. Does not block; returns <code>false</code> if backpressure is active.</p>"
                },
                {
                  "textRaw": "`writer.writev(chunks[, options])`",
                  "name": "writev",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunks` {Uint8Array[]|string[]}",
                          "name": "chunks",
                          "type": "Uint8Array[]|string[]"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal} Cancel just this write operation. The signal cancels only the pending `writev()` call; it does not fail the writer itself.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "Cancel just this write operation. The signal cancels only the pending `writev()` call; it does not fail the writer itself."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Write multiple chunks as a single batch.</p>"
                },
                {
                  "textRaw": "`writer.writevSync(chunks)`",
                  "name": "writevSync",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunks` {Uint8Array[]|string[]}",
                          "name": "chunks",
                          "type": "Uint8Array[]|string[]"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if the write was accepted, `false` if the buffer is full.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if the write was accepted, `false` if the buffer is full."
                      }
                    }
                  ],
                  "desc": "<p>Synchronous batch write.</p>"
                }
              ],
              "displayName": "Writer interface"
            }
          ],
          "displayName": "Concepts"
        },
        {
          "textRaw": "The `stream/iter` module",
          "name": "the_`stream/iter`_module",
          "type": "module",
          "desc": "<p>All functions are available both as named exports and as properties of the\n<code>Stream</code> namespace object:</p>\n<pre><code class=\"language-mjs\">// Named exports\nimport { from, pull, bytes, Stream } from 'node:stream/iter';\n\n// Namespace access\nStream.from('hello');\n</code></pre>\n<pre><code class=\"language-cjs\">// Named exports\nconst { from, pull, bytes, Stream } = require('node:stream/iter');\n\n// Namespace access\nStream.from('hello');\n</code></pre>\n<p>Including the <code>node:</code> prefix on the module specifier is optional.</p>",
          "displayName": "The `stream/iter` module"
        },
        {
          "textRaw": "Sources",
          "name": "sources",
          "type": "module",
          "methods": [
            {
              "textRaw": "`from(input)`",
              "name": "from",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {string|ArrayBuffer|AsyncIterable|Object} Must not be `null` or `undefined`.",
                      "name": "input",
                      "type": "string|ArrayBuffer|AsyncIterable|Object",
                      "desc": "Must not be `null` or `undefined`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {AsyncIterable<Uint8Array[]>}",
                    "name": "return",
                    "type": "AsyncIterable<Uint8Array[]>"
                  }
                }
              ],
              "desc": "<p>Create an async byte stream from the given input. Strings are UTF-8 encoded.\n<code>ArrayBuffer</code> and <code>ArrayBufferView</code> values are wrapped as <code>Uint8Array</code>. Arrays\nand iterables are recursively flattened and normalized.</p>\n<p>Objects implementing <code>Symbol.for('Stream.toAsyncStreamable')</code> or\n<code>Symbol.for('Stream.toStreamable')</code> are converted via those protocols. The\n<code>toAsyncStreamable</code> protocol takes precedence over <code>toStreamable</code>, which takes\nprecedence over the iteration protocols (<code>Symbol.asyncIterator</code>,\n<code>Symbol.iterator</code>).</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\nimport { from, text } from 'node:stream/iter';\n\nconsole.log(await text(from('hello')));       // 'hello'\nconsole.log(await text(from(Buffer.from('hello')))); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { Buffer } = require('node:buffer');\nconst { from, text } = require('node:stream/iter');\n\nasync function run() {\n  console.log(await text(from('hello')));       // 'hello'\n  console.log(await text(from(Buffer.from('hello')))); // 'hello'\n}\n\nrun().catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`fromSync(input)`",
              "name": "fromSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {string|ArrayBuffer|Object} Must not be `null` or `undefined`.",
                      "name": "input",
                      "type": "string|ArrayBuffer|Object",
                      "desc": "Must not be `null` or `undefined`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Iterable<Uint8Array[]>}",
                    "name": "return",
                    "type": "Iterable<Uint8Array[]>"
                  }
                }
              ],
              "desc": "<p>Synchronous version of <a href=\"#frominput\"><code>from()</code></a>. Returns a sync iterable. Cannot accept\nasync iterables or promises. Objects implementing\n<code>Symbol.for('Stream.toStreamable')</code> are converted via that protocol (takes\nprecedence over <code>Symbol.iterator</code>). The <code>toAsyncStreamable</code> protocol is\nignored entirely.</p>\n<pre><code class=\"language-mjs\">import { fromSync, textSync } from 'node:stream/iter';\n\nconsole.log(textSync(fromSync('hello'))); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { fromSync, textSync } = require('node:stream/iter');\n\nconsole.log(textSync(fromSync('hello'))); // 'hello'\n</code></pre>"
            }
          ],
          "displayName": "Sources"
        },
        {
          "textRaw": "Pipelines",
          "name": "pipelines",
          "type": "module",
          "methods": [
            {
              "textRaw": "`pipeTo(source[, ...transforms], writer[, options])`",
              "name": "pipeTo",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`source` {AsyncIterable} The data source.",
                      "name": "source",
                      "type": "AsyncIterable",
                      "desc": "The data source."
                    },
                    {
                      "textRaw": "`...transforms` {Function|Object} Zero or more transforms to apply.",
                      "name": "...transforms",
                      "type": "Function|Object",
                      "desc": "Zero or more transforms to apply.",
                      "optional": true
                    },
                    {
                      "textRaw": "`writer` {Object} Destination with `write(chunk)` method.",
                      "name": "writer",
                      "type": "Object",
                      "desc": "Destination with `write(chunk)` method."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`signal` {AbortSignal} Abort the pipeline.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Abort the pipeline."
                        },
                        {
                          "textRaw": "`preventClose` {boolean} If `true`, do not call `writer.end()` when the source ends. **Default:** `false`.",
                          "name": "preventClose",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, do not call `writer.end()` when the source ends."
                        },
                        {
                          "textRaw": "`preventFail` {boolean} If `true`, do not call `writer.fail()` on error. **Default:** `false`.",
                          "name": "preventFail",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, do not call `writer.fail()` on error."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with the total number of bytes written.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with the total number of bytes written."
                  }
                }
              ],
              "desc": "<p>Pipe a source through transforms into a writer. If the writer has a\n<code>writev(chunks)</code> method, entire batches are passed in a single call (enabling\nscatter/gather I/O).</p>\n<p>If the writer implements the optional <code>*Sync</code> methods (<code>writeSync</code>, <code>writevSync</code>,\n<code>endSync</code>), <code>pipeTo()</code> will attempt to use the synchronous methods\nfirst as a fast path, and fall back to the async versions only when the sync\nmethods indicate they cannot complete (e.g., backpressure or waiting for the\nnext tick). <code>fail()</code> is always called synchronously.</p>\n<pre><code class=\"language-mjs\">import { from, pipeTo } from 'node:stream/iter';\nimport { compressGzip } from 'node:zlib/iter';\nimport { open } from 'node:fs/promises';\n\nconst fh = await open('output.gz', 'w');\nconst totalBytes = await pipeTo(\n  from('Hello, world!'),\n  compressGzip(),\n  fh.writer({ autoClose: true }),\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, pipeTo } = require('node:stream/iter');\nconst { compressGzip } = require('node:zlib/iter');\nconst { open } = require('node:fs/promises');\n\nasync function run() {\n  const fh = await open('output.gz', 'w');\n  const totalBytes = await pipeTo(\n    from('Hello, world!'),\n    compressGzip(),\n    fh.writer({ autoClose: true }),\n  );\n}\n\nrun().catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`pipeToSync(source[, ...transforms], writer[, options])`",
              "name": "pipeToSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "...transforms",
                      "optional": true
                    },
                    {
                      "name": "writer"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {Iterable} The sync data source.</li>\n<li><code>...transforms</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Zero or more sync transforms.</li>\n<li><code>writer</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Destination with <code>write(chunk)</code> method.</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>preventClose</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> <strong>Default:</strong> <code>false</code>.</li>\n<li><code>preventFail</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> <strong>Default:</strong> <code>false</code>.</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Total bytes written.</li>\n</ul>\n<p>Synchronous version of <a href=\"#pipetosource-transforms-writer-options\"><code>pipeTo()</code></a>. The <code>source</code>, all transforms, and the\n<code>writer</code> must be synchronous. Cannot accept async iterables or promises.</p>\n<p>The <code>writer</code> must have the <code>*Sync</code> methods (<code>writeSync</code>, <code>writevSync</code>,\n<code>endSync</code>) and <code>fail()</code> for this to work.</p>"
            },
            {
              "textRaw": "`pull(source[, ...transforms][, options])`",
              "name": "pull",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`source` {AsyncIterable} The data source.",
                      "name": "source",
                      "type": "AsyncIterable",
                      "desc": "The data source."
                    },
                    {
                      "textRaw": "`...transforms` {Function|Object} Zero or more transforms to apply.",
                      "name": "...transforms",
                      "type": "Function|Object",
                      "desc": "Zero or more transforms to apply.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`signal` {AbortSignal} Abort the pipeline.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Abort the pipeline."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {AsyncIterable<Uint8Array[]>}",
                    "name": "return",
                    "type": "AsyncIterable<Uint8Array[]>"
                  }
                }
              ],
              "desc": "<p>Create a lazy async pipeline. Data is not read from <code>source</code> until the\nreturned iterable is consumed. Transforms are applied in order.</p>\n<pre><code class=\"language-mjs\">import { from, pull, text } from 'node:stream/iter';\n\nconst asciiUpper = (chunks) => {\n  if (chunks === null) return null;\n  return chunks.map((c) => {\n    for (let i = 0; i &#x3C; c.length; i++) {\n      c[i] -= (c[i] >= 97 &#x26;&#x26; c[i] &#x3C;= 122) * 32;\n    }\n    return c;\n  });\n};\n\nconst result = pull(from('hello'), asciiUpper);\nconsole.log(await text(result)); // 'HELLO'\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, pull, text } = require('node:stream/iter');\n\nconst asciiUpper = (chunks) => {\n  if (chunks === null) return null;\n  return chunks.map((c) => {\n    for (let i = 0; i &#x3C; c.length; i++) {\n      c[i] -= (c[i] >= 97 &#x26;&#x26; c[i] &#x3C;= 122) * 32;\n    }\n    return c;\n  });\n};\n\nasync function run() {\n  const result = pull(from('hello'), asciiUpper);\n  console.log(await text(result)); // 'HELLO'\n}\n\nrun().catch(console.error);\n</code></pre>\n<p>Using an <code>AbortSignal</code>:</p>\n<pre><code class=\"language-mjs\">import { pull } from 'node:stream/iter';\n\nconst ac = new AbortController();\nconst result = pull(source, transform, { signal: ac.signal });\nac.abort(); // Pipeline throws AbortError on next iteration\n</code></pre>\n<pre><code class=\"language-cjs\">const { pull } = require('node:stream/iter');\n\nconst ac = new AbortController();\nconst result = pull(source, transform, { signal: ac.signal });\nac.abort(); // Pipeline throws AbortError on next iteration\n</code></pre>"
            },
            {
              "textRaw": "`pullSync(source[, ...transforms])`",
              "name": "pullSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "...transforms",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {Iterable} The sync data source.</li>\n<li><code>...transforms</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Zero or more sync transforms.</li>\n<li>Returns: {Iterable&#x3C;Uint8Array[]>}</li>\n</ul>\n<p>Synchronous version of <a href=\"#pullsource-transforms-options\"><code>pull()</code></a>. All transforms must be synchronous.</p>"
            }
          ],
          "displayName": "Pipelines"
        },
        {
          "textRaw": "Push streams",
          "name": "push_streams",
          "type": "module",
          "methods": [
            {
              "textRaw": "`push([...transforms][, options])`",
              "name": "push",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`...transforms` {Function|Object} Optional transforms applied to the readable side.",
                      "name": "...transforms",
                      "type": "Function|Object",
                      "desc": "Optional transforms applied to the readable side.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} Maximum number of buffered slots before backpressure is applied. Must be >= 1; values below 1 are clamped to 1. **Default:** `4`.",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`4`",
                          "desc": "Maximum number of buffered slots before backpressure is applied. Must be >= 1; values below 1 are clamped to 1."
                        },
                        {
                          "textRaw": "`backpressure` {string} Backpressure policy: `'strict'`, `'block'`, `'drop-oldest'`, or `'drop-newest'`. **Default:** `'strict'`.",
                          "name": "backpressure",
                          "type": "string",
                          "default": "`'strict'`",
                          "desc": "Backpressure policy: `'strict'`, `'block'`, `'drop-oldest'`, or `'drop-newest'`."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} Abort the stream.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Abort the stream."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`writer` {PushWriter} The writer side.",
                        "name": "writer",
                        "type": "PushWriter",
                        "desc": "The writer side."
                      },
                      {
                        "textRaw": "`readable` {AsyncIterable<Uint8Array[]>} The readable side.",
                        "name": "readable",
                        "type": "AsyncIterable<Uint8Array[]>",
                        "desc": "The readable side."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Create a push stream with backpressure. The writer pushes data in; the\nreadable side is consumed as an async iterable.</p>\n<pre><code class=\"language-mjs\">import { push, text } from 'node:stream/iter';\n\nconst { writer, readable } = push();\n\n// Producer and consumer must run concurrently. With strict backpressure\n// (the default), awaited writes block until the consumer reads.\nconst producing = (async () => {\n  await writer.write('hello');\n  await writer.write(' world');\n  await writer.end();\n})();\n\nconsole.log(await text(readable)); // 'hello world'\nawait producing;\n</code></pre>\n<pre><code class=\"language-cjs\">const { push, text } = require('node:stream/iter');\n\nasync function run() {\n  const { writer, readable } = push();\n\n  // Producer and consumer must run concurrently. With strict backpressure\n  // (the default), awaited writes block until the consumer reads.\n  const producing = (async () => {\n    await writer.write('hello');\n    await writer.write(' world');\n    await writer.end();\n  })();\n\n  console.log(await text(readable)); // 'hello world'\n  await producing;\n}\n\nrun().catch(console.error);\n</code></pre>\n<p>The writer returned by <code>push()</code> conforms to the [Writer interface][].</p>"
            }
          ],
          "displayName": "Push streams"
        },
        {
          "textRaw": "Duplex channels",
          "name": "duplex_channels",
          "type": "module",
          "methods": [
            {
              "textRaw": "`duplex([options])`",
              "name": "duplex",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} Buffer size for both directions. **Default:** `4`.",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`4`",
                          "desc": "Buffer size for both directions."
                        },
                        {
                          "textRaw": "`backpressure` {string} Policy for both directions. **Default:** `'strict'`.",
                          "name": "backpressure",
                          "type": "string",
                          "default": "`'strict'`",
                          "desc": "Policy for both directions."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} Cancellation signal for both channels.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Cancellation signal for both channels."
                        },
                        {
                          "textRaw": "`a` {Object} Options specific to the A-to-B direction. Overrides shared options.",
                          "name": "a",
                          "type": "Object",
                          "desc": "Options specific to the A-to-B direction. Overrides shared options.",
                          "options": [
                            {
                              "textRaw": "`highWaterMark` {number}",
                              "name": "highWaterMark",
                              "type": "number"
                            },
                            {
                              "textRaw": "`backpressure` {string}",
                              "name": "backpressure",
                              "type": "string"
                            }
                          ]
                        },
                        {
                          "textRaw": "`b` {Object} Options specific to the B-to-A direction. Overrides shared options.",
                          "name": "b",
                          "type": "Object",
                          "desc": "Options specific to the B-to-A direction. Overrides shared options.",
                          "options": [
                            {
                              "textRaw": "`highWaterMark` {number}",
                              "name": "highWaterMark",
                              "type": "number"
                            },
                            {
                              "textRaw": "`backpressure` {string}",
                              "name": "backpressure",
                              "type": "string"
                            }
                          ]
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Array} A pair `[channelA, channelB]` of duplex channels.",
                    "name": "return",
                    "type": "Array",
                    "desc": "A pair `[channelA, channelB]` of duplex channels."
                  }
                }
              ],
              "desc": "<p>Create a pair of connected duplex channels for bidirectional communication,\nsimilar to <code>socketpair()</code>. Data written to one channel's writer appears in\nthe other channel's readable.</p>\n<p>Each channel has:</p>\n<ul>\n<li><code>writer</code> — a [Writer interface][] object for sending data to the peer.</li>\n<li><code>readable</code> — an <code>AsyncIterable&#x3C;Uint8Array[]></code> for reading data from\nthe peer.</li>\n<li><code>close()</code> — close this end of the channel (idempotent).</li>\n<li><code>[Symbol.asyncDispose]()</code> — async dispose support for <code>await using</code>.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { duplex, text } from 'node:stream/iter';\n\nconst [client, server] = duplex();\n\n// Server echoes back\nconst serving = (async () => {\n  for await (const chunks of server.readable) {\n    await server.writer.writev(chunks);\n  }\n})();\n\nawait client.writer.write('hello');\nawait client.writer.end();\n\nconsole.log(await text(server.readable)); // handled by echo\nawait serving;\n</code></pre>\n<pre><code class=\"language-cjs\">const { duplex, text } = require('node:stream/iter');\n\nasync function run() {\n  const [client, server] = duplex();\n\n  // Server echoes back\n  const serving = (async () => {\n    for await (const chunks of server.readable) {\n      await server.writer.writev(chunks);\n    }\n  })();\n\n  await client.writer.write('hello');\n  await client.writer.end();\n\n  console.log(await text(server.readable)); // handled by echo\n  await serving;\n}\n\nrun().catch(console.error);\n</code></pre>"
            }
          ],
          "displayName": "Duplex channels"
        },
        {
          "textRaw": "Consumers",
          "name": "consumers",
          "type": "module",
          "methods": [
            {
              "textRaw": "`array(source[, options])`",
              "name": "array",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {AsyncIterable&#x3C;Uint8Array[]>|Iterable&#x3C;Uint8Array[]>}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>signal</code> <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a></li>\n<li><code>limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of bytes to consume. If the total bytes\ncollected exceeds limit, an <code>ERR_OUT_OF_RANGE</code> error is thrown</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> Fulfills with an array of <code>Uint8Array</code> objects.</li>\n</ul>\n<p>Collect all chunks as an array of <code>Uint8Array</code> values (without concatenating).</p>"
            },
            {
              "textRaw": "`arrayBuffer(source[, options])`",
              "name": "arrayBuffer",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {AsyncIterable&#x3C;Uint8Array[]>|Iterable&#x3C;Uint8Array[]>}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>signal</code> <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a></li>\n<li><code>limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of bytes to consume. If the total bytes\ncollected exceeds limit, an <code>ERR_OUT_OF_RANGE</code> error is thrown</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> Fulfills with an <code>ArrayBuffer</code> object.</li>\n</ul>\n<p>Collect all bytes into an <code>ArrayBuffer</code>.</p>"
            },
            {
              "textRaw": "`arrayBufferSync(source[, options])`",
              "name": "arrayBufferSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {Iterable&#x3C;Uint8Array[]>}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of bytes to consume. If the total bytes\ncollected exceeds limit, an <code>ERR_OUT_OF_RANGE</code> error is thrown</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a></li>\n</ul>\n<p>Synchronous version of <a href=\"#arraybuffersource-options\"><code>arrayBuffer()</code></a>.</p>"
            },
            {
              "textRaw": "`arraySync(source[, options])`",
              "name": "arraySync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {Iterable&#x3C;Uint8Array[]>}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of bytes to consume. If the total bytes\ncollected exceeds limit, an <code>ERR_OUT_OF_RANGE</code> error is thrown</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array[]></code></a></li>\n</ul>\n<p>Synchronous version of <a href=\"#arraysource-options\"><code>array()</code></a>.</p>"
            },
            {
              "textRaw": "`bytes(source[, options])`",
              "name": "bytes",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {AsyncIterable&#x3C;Uint8Array[]>|Iterable&#x3C;Uint8Array[]>}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>signal</code> <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a></li>\n<li><code>limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of bytes to consume. If the total bytes\ncollected exceeds limit, an <code>ERR_OUT_OF_RANGE</code> error is thrown</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> Fulfills with an <code>Uint8Array</code> object.</li>\n</ul>\n<p>Collect all bytes from a stream into a single <code>Uint8Array</code>.</p>\n<pre><code class=\"language-mjs\">import { from, bytes } from 'node:stream/iter';\n\nconst data = await bytes(from('hello'));\nconsole.log(data); // Uint8Array(5) [ 104, 101, 108, 108, 111 ]\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, bytes } = require('node:stream/iter');\n\nasync function run() {\n  const data = await bytes(from('hello'));\n  console.log(data); // Uint8Array(5) [ 104, 101, 108, 108, 111 ]\n}\n\nrun().catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`bytesSync(source[, options])`",
              "name": "bytesSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {Iterable&#x3C;Uint8Array[]>}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of bytes to consume. If the total bytes\ncollected exceeds limit, an <code>ERR_OUT_OF_RANGE</code> error is thrown</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a></li>\n</ul>\n<p>Synchronous version of <a href=\"#bytessource-options\"><code>bytes()</code></a>.</p>"
            },
            {
              "textRaw": "`text(source[, options])`",
              "name": "text",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {AsyncIterable&#x3C;Uint8Array[]>|Iterable&#x3C;Uint8Array[]>}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>encoding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Text encoding. <strong>Default:</strong> <code>'utf-8'</code>.</li>\n<li><code>signal</code> <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a></li>\n<li><code>limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of bytes to consume. If the total bytes\ncollected exceeds limit, an <code>ERR_OUT_OF_RANGE</code> error is thrown</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> Fulfills with a <code>string</code>.</li>\n</ul>\n<p>Collect all bytes and decode as text.</p>\n<pre><code class=\"language-mjs\">import { from, text } from 'node:stream/iter';\n\nconsole.log(await text(from('hello'))); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, text } = require('node:stream/iter');\n\nasync function run() {\n  console.log(await text(from('hello'))); // 'hello'\n}\n\nrun().catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`textSync(source[, options])`",
              "name": "textSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {Iterable&#x3C;Uint8Array[]>}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>encoding</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> <strong>Default:</strong> <code>'utf-8'</code>.</li>\n<li><code>limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Maximum number of bytes to consume. If the total bytes\ncollected exceeds limit, an <code>ERR_OUT_OF_RANGE</code> error is thrown</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p>Synchronous version of <a href=\"#textsource-options\"><code>text()</code></a>.</p>"
            }
          ],
          "displayName": "Consumers"
        },
        {
          "textRaw": "Utilities",
          "name": "utilities",
          "type": "module",
          "methods": [
            {
              "textRaw": "`ondrain(drainable)`",
              "name": "ondrain",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`drainable` {Object} An object implementing the drainable protocol.",
                      "name": "drainable",
                      "type": "Object",
                      "desc": "An object implementing the drainable protocol."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise|null}",
                    "name": "return",
                    "type": "Promise|null"
                  }
                }
              ],
              "desc": "<p>Wait for a drainable writer's backpressure to clear. Returns <code>null</code> if\nthe object does not implement the drainable protocol, or a promise that\nfulfills with <code>true</code> when the writer can accept more data.</p>\n<pre><code class=\"language-mjs\">import { push, ondrain, text } from 'node:stream/iter';\n\nconst { writer, readable } = push({ highWaterMark: 2 });\nwriter.writeSync('a');\nwriter.writeSync('b');\n\n// Start consuming so the buffer can actually drain\nconst consuming = text(readable);\n\n// Buffer is full -- wait for drain\nconst canWrite = await ondrain(writer);\nif (canWrite) {\n  await writer.write('c');\n}\nawait writer.end();\nawait consuming;\n</code></pre>\n<pre><code class=\"language-cjs\">const { push, ondrain, text } = require('node:stream/iter');\n\nasync function run() {\n  const { writer, readable } = push({ highWaterMark: 2 });\n  writer.writeSync('a');\n  writer.writeSync('b');\n\n  // Start consuming so the buffer can actually drain\n  const consuming = text(readable);\n\n  // Buffer is full -- wait for drain\n  const canWrite = await ondrain(writer);\n  if (canWrite) {\n    await writer.write('c');\n  }\n  await writer.end();\n  await consuming;\n}\n\nrun().catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`merge(...sources[, options])`",
              "name": "merge",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "...sources"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>...sources</code> {AsyncIterable&#x3C;Uint8Array[]>|Iterable&#x3C;Uint8Array[]>} Two or more iterables.</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>signal</code> <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a></li>\n</ul>\n</li>\n<li>Returns: {AsyncIterable&#x3C;Uint8Array[]>}</li>\n</ul>\n<p>Merge multiple async iterables by yielding batches in temporal order\n(whichever source produces data first). All sources are consumed\nconcurrently.</p>\n<pre><code class=\"language-mjs\">import { from, merge, text } from 'node:stream/iter';\n\nconst merged = merge(from('hello '), from('world'));\nconsole.log(await text(merged)); // Order depends on timing\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, merge, text } = require('node:stream/iter');\n\nasync function run() {\n  const merged = merge(from('hello '), from('world'));\n  console.log(await text(merged)); // Order depends on timing\n}\n\nrun().catch(console.error);\n</code></pre>"
            },
            {
              "textRaw": "`tap(callback)`",
              "name": "tap",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} `(chunks) => void` Called with each batch.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "`(chunks) => void` Called with each batch."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} A stateless transform.",
                    "name": "return",
                    "type": "Function",
                    "desc": "A stateless transform."
                  }
                }
              ],
              "desc": "<p>Create a pass-through transform that observes batches without modifying them.\nUseful for logging, metrics, or debugging.</p>\n<pre><code class=\"language-mjs\">import { from, pull, text, tap } from 'node:stream/iter';\n\nconst result = pull(\n  from('hello'),\n  tap((chunks) => console.log('Batch size:', chunks.length)),\n);\nconsole.log(await text(result));\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, pull, text, tap } = require('node:stream/iter');\n\nasync function run() {\n  const result = pull(\n    from('hello'),\n    tap((chunks) => console.log('Batch size:', chunks.length)),\n  );\n  console.log(await text(result));\n}\n\nrun().catch(console.error);\n</code></pre>\n<p><code>tap()</code> intentionally does not prevent in-place modification of the\nchunks by the tapping callback; but return values are ignored.</p>"
            },
            {
              "textRaw": "`tapSync(callback)`",
              "name": "tapSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function}",
                    "name": "return",
                    "type": "Function"
                  }
                }
              ],
              "desc": "<p>Synchronous version of <a href=\"#tapcallback\"><code>tap()</code></a>.</p>"
            }
          ],
          "displayName": "Utilities"
        },
        {
          "textRaw": "Multi-consumer",
          "name": "multi-consumer",
          "type": "module",
          "methods": [
            {
              "textRaw": "`broadcast([options])`",
              "name": "broadcast",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} Buffer size in slots. Must be >= 1; values below 1 are clamped to 1. **Default:** `16`.",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`16`",
                          "desc": "Buffer size in slots. Must be >= 1; values below 1 are clamped to 1."
                        },
                        {
                          "textRaw": "`backpressure` {string} `'strict'`, `'block'`, `'drop-oldest'`, or `'drop-newest'`. **Default:** `'strict'`.",
                          "name": "backpressure",
                          "type": "string",
                          "default": "`'strict'`",
                          "desc": "`'strict'`, `'block'`, `'drop-oldest'`, or `'drop-newest'`."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal}",
                          "name": "signal",
                          "type": "AbortSignal"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`writer` {BroadcastWriter}",
                        "name": "writer",
                        "type": "BroadcastWriter"
                      },
                      {
                        "textRaw": "`broadcast` {Broadcast}",
                        "name": "broadcast",
                        "type": "Broadcast"
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Create a push-model multi-consumer broadcast channel. A single writer pushes\ndata to multiple consumers. Each consumer has an independent cursor into a\nshared buffer.</p>\n<pre><code class=\"language-mjs\">import { broadcast, text } from 'node:stream/iter';\n\nconst { writer, broadcast: bc } = broadcast();\n\n// Create consumers before writing\nconst c1 = bc.push();  // Consumer 1\nconst c2 = bc.push();  // Consumer 2\n\n// Producer and consumers must run concurrently. Awaited writes\n// block when the buffer fills until consumers read.\nconst producing = (async () => {\n  await writer.write('hello');\n  await writer.end();\n})();\n\nconst [r1, r2] = await Promise.all([text(c1), text(c2)]);\nconsole.log(r1); // 'hello'\nconsole.log(r2); // 'hello'\nawait producing;\n</code></pre>\n<pre><code class=\"language-cjs\">const { broadcast, text } = require('node:stream/iter');\n\nasync function run() {\n  const { writer, broadcast: bc } = broadcast();\n\n  // Create consumers before writing\n  const c1 = bc.push();  // Consumer 1\n  const c2 = bc.push();  // Consumer 2\n\n  // Producer and consumers must run concurrently. Awaited writes\n  // block when the buffer fills until consumers read.\n  const producing = (async () => {\n    await writer.write('hello');\n    await writer.end();\n  })();\n\n  const [r1, r2] = await Promise.all([text(c1), text(c2)]);\n  console.log(r1); // 'hello'\n  console.log(r2); // 'hello'\n  await producing;\n}\n\nrun().catch(console.error);\n</code></pre>",
              "properties": [
                {
                  "textRaw": "{number}",
                  "name": "bufferSize",
                  "type": "number",
                  "desc": "<p>The number of chunks currently buffered.</p>"
                },
                {
                  "textRaw": "{number}",
                  "name": "consumerCount",
                  "type": "number",
                  "desc": "<p>The number of active consumers.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`broadcast.cancel([reason])`",
                  "name": "cancel",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {Error}",
                          "name": "reason",
                          "type": "Error",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Cancel the broadcast. All consumers receive an error.</p>"
                },
                {
                  "textRaw": "`broadcast.push([...transforms][, options])`",
                  "name": "push",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`...transforms` {Function|Object}",
                          "name": "...transforms",
                          "type": "Function|Object",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal}",
                              "name": "signal",
                              "type": "AbortSignal"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {AsyncIterable<Uint8Array[]>}",
                        "name": "return",
                        "type": "AsyncIterable<Uint8Array[]>"
                      }
                    }
                  ],
                  "desc": "<p>Create a new consumer. Each consumer receives all data written to the\nbroadcast from the point of subscription onward. Optional transforms are\napplied to this consumer's view of the data.</p>"
                },
                {
                  "textRaw": "`broadcast[Symbol.dispose]()`",
                  "name": "[Symbol.dispose]",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Alias for <code>broadcast.cancel()</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "`Broadcast.from(input[, options])`",
              "name": "from",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {AsyncIterable}",
                      "name": "input",
                      "type": "AsyncIterable"
                    },
                    {
                      "textRaw": "`options` {Object} Same as `broadcast()`.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Same as `broadcast()`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} `{ writer, broadcast }`",
                    "name": "return",
                    "type": "Object",
                    "desc": "`{ writer, broadcast }`"
                  }
                }
              ],
              "desc": "<p>Create a {Broadcast} from an existing source. The source is consumed\nautomatically and pushed to all subscribers.</p>"
            },
            {
              "textRaw": "`share(source[, options])`",
              "name": "share",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`source` {AsyncIterable} The source to share.",
                      "name": "source",
                      "type": "AsyncIterable",
                      "desc": "The source to share."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} Buffer size. Must be >= 1; values below 1 are clamped to 1. **Default:** `16`.",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`16`",
                          "desc": "Buffer size. Must be >= 1; values below 1 are clamped to 1."
                        },
                        {
                          "textRaw": "`backpressure` {string} `'strict'`, `'block'`, `'drop-oldest'`, or `'drop-newest'`. **Default:** `'strict'`.",
                          "name": "backpressure",
                          "type": "string",
                          "default": "`'strict'`",
                          "desc": "`'strict'`, `'block'`, `'drop-oldest'`, or `'drop-newest'`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Share}",
                    "name": "return",
                    "type": "Share"
                  }
                }
              ],
              "desc": "<p>Create a pull-model multi-consumer shared stream. Unlike <code>broadcast()</code>, the\nsource is only read when a consumer pulls. Multiple consumers share a single\nbuffer.</p>\n<pre><code class=\"language-mjs\">import { from, share, text } from 'node:stream/iter';\n\nconst shared = share(from('hello'));\n\nconst c1 = shared.pull();\nconst c2 = shared.pull();\n\n// Consume concurrently to avoid deadlock with small buffers.\nconst [r1, r2] = await Promise.all([text(c1), text(c2)]);\nconsole.log(r1); // 'hello'\nconsole.log(r2); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, share, text } = require('node:stream/iter');\n\nasync function run() {\n  const shared = share(from('hello'));\n\n  const c1 = shared.pull();\n  const c2 = shared.pull();\n\n  // Consume concurrently to avoid deadlock with small buffers.\n  const [r1, r2] = await Promise.all([text(c1), text(c2)]);\n  console.log(r1); // 'hello'\n  console.log(r2); // 'hello'\n}\n\nrun().catch(console.error);\n</code></pre>",
              "properties": [
                {
                  "textRaw": "{number}",
                  "name": "bufferSize",
                  "type": "number",
                  "desc": "<p>The number of chunks currently buffered.</p>"
                },
                {
                  "textRaw": "{number}",
                  "name": "consumerCount",
                  "type": "number",
                  "desc": "<p>The number of active consumers.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`share.cancel([reason])`",
                  "name": "cancel",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {Error}",
                          "name": "reason",
                          "type": "Error",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Cancel the share. All consumers receive an error.</p>"
                },
                {
                  "textRaw": "`share.pull([...transforms][, options])`",
                  "name": "pull",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`...transforms` {Function|Object}",
                          "name": "...transforms",
                          "type": "Function|Object",
                          "optional": true
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal}",
                              "name": "signal",
                              "type": "AbortSignal"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {AsyncIterable<Uint8Array[]>}",
                        "name": "return",
                        "type": "AsyncIterable<Uint8Array[]>"
                      }
                    }
                  ],
                  "desc": "<p>Create a new consumer of the shared source.</p>"
                },
                {
                  "textRaw": "`share[Symbol.dispose]()`",
                  "name": "[Symbol.dispose]",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Alias for <code>share.cancel()</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "`Share.from(input[, options])`",
              "name": "from",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {AsyncIterable}",
                      "name": "input",
                      "type": "AsyncIterable"
                    },
                    {
                      "textRaw": "`options` {Object} Same as `share()`.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Same as `share()`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Share}",
                    "name": "return",
                    "type": "Share"
                  }
                }
              ],
              "desc": "<p>Create a {Share} from an existing source.</p>"
            },
            {
              "textRaw": "`shareSync(source[, options])`",
              "name": "shareSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {Iterable} The sync source to share.</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>highWaterMark</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Must be >= 1; values below 1 are clamped\nto 1. <strong>Default:</strong> <code>16</code>.</li>\n<li><code>backpressure</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> <strong>Default:</strong> <code>'strict'</code>.</li>\n</ul>\n</li>\n<li>Returns: {SyncShare}</li>\n</ul>\n<p>Synchronous version of <a href=\"#sharesource-options\"><code>share()</code></a>.</p>"
            },
            {
              "textRaw": "`SyncShare.fromSync(input[, options])`",
              "name": "fromSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "input"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>input</code> {Iterable|SyncShareable}</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n<li>Returns: {SyncShare}</li>\n</ul>"
            }
          ],
          "displayName": "Multi-consumer"
        },
        {
          "textRaw": "Compression and decompression transforms",
          "name": "compression_and_decompression_transforms",
          "type": "module",
          "desc": "<p>Compression and decompression transforms for use with <code>pull()</code>, <code>pullSync()</code>,\n<code>pipeTo()</code>, and <code>pipeToSync()</code> are available via the <a href=\"zlib.html#iterable-compression\"><code>node:zlib/iter</code></a>\nmodule. See the <a href=\"zlib.html#iterable-compression\"><code>node:zlib/iter</code> documentation</a> for details.</p>",
          "displayName": "Compression and decompression transforms"
        },
        {
          "textRaw": "Classic stream interop",
          "name": "classic_stream_interop",
          "type": "module",
          "desc": "<p>These utility functions bridge between classic\n<a href=\"stream.html#class-streamreadable\"><code>stream.Readable</code></a>/<a href=\"stream.html#class-streamwritable\"><code>stream.Writable</code></a> streams and the <code>stream/iter</code>\nAPI.</p>\n<p>Both <code>fromReadable()</code> and <code>fromWritable()</code> accept duck-typed objects -- they\ndo not require the input to extend <code>stream.Readable</code> or <code>stream.Writable</code>\ndirectly. The minimum contract is described below for each function.</p>",
          "methods": [
            {
              "textRaw": "`fromReadable(readable)`",
              "name": "fromReadable",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`readable` {stream.Readable|Object} A classic Readable stream or any object with `read()` and `on()` methods.",
                      "name": "readable",
                      "type": "stream.Readable|Object",
                      "desc": "A classic Readable stream or any object with `read()` and `on()` methods."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {AsyncIterable<Uint8Array[]>} A stream/iter async iterable source.",
                    "name": "return",
                    "type": "AsyncIterable<Uint8Array[]>",
                    "desc": "A stream/iter async iterable source."
                  }
                }
              ],
              "desc": "<p>Converts a classic Readable stream (or duck-typed equivalent) into a\nstream/iter async iterable source that can be passed to <a href=\"#frominput\"><code>from()</code></a>,\n<a href=\"#pullsource-transforms-options\"><code>pull()</code></a>, <a href=\"#textsource-options\"><code>text()</code></a>, etc.</p>\n<p>If the object implements the <a href=\"#streamtoasyncstreamable\"><code>toAsyncStreamable</code></a> protocol (as\n<code>stream.Readable</code> does), that protocol is used. Otherwise, the function\nduck-types on <code>read()</code> and <code>on()</code> (EventEmitter) and wraps the stream with\na batched async iterator.</p>\n<p>The result is cached per instance -- calling <code>fromReadable()</code> twice with the\nsame stream returns the same iterable.</p>\n<p>For object-mode or encoded Readable streams, chunks are automatically\nnormalized to <code>Uint8Array</code>.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { fromReadable, text } from 'node:stream/iter';\n\nconst readable = new Readable({\n  read() { this.push('hello world'); this.push(null); },\n});\n\nconst result = await text(fromReadable(readable));\nconsole.log(result); // 'hello world'\n</code></pre>\n<pre><code class=\"language-cjs\">const { Readable } = require('node:stream');\nconst { fromReadable, text } = require('node:stream/iter');\n\nconst readable = new Readable({\n  read() { this.push('hello world'); this.push(null); },\n});\n\nasync function run() {\n  const result = await text(fromReadable(readable));\n  console.log(result); // 'hello world'\n}\nrun();\n</code></pre>"
            },
            {
              "textRaw": "`fromWritable(writable[, options])`",
              "name": "fromWritable",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`writable` {stream.Writable|Object} A classic Writable stream or any object with `write()` and `on()` methods.",
                      "name": "writable",
                      "type": "stream.Writable|Object",
                      "desc": "A classic Writable stream or any object with `write()` and `on()` methods."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`backpressure` {string} Backpressure policy. **Default:** `'strict'`.",
                          "name": "backpressure",
                          "type": "string",
                          "default": "`'strict'`",
                          "desc": "Backpressure policy.",
                          "options": [
                            {
                              "textRaw": "`'strict'` -- writes are rejected when the buffer is full. Catches callers that ignore backpressure.",
                              "desc": "`'strict'` -- writes are rejected when the buffer is full. Catches callers that ignore backpressure."
                            },
                            {
                              "textRaw": "`'block'` -- writes wait for drain when the buffer is full. Recommended for use with `pipeTo()`.",
                              "desc": "`'block'` -- writes wait for drain when the buffer is full. Recommended for use with `pipeTo()`."
                            },
                            {
                              "textRaw": "`'drop-newest'` -- writes are silently discarded when the buffer is full.",
                              "desc": "`'drop-newest'` -- writes are silently discarded when the buffer is full."
                            },
                            {
                              "textRaw": "`'drop-oldest'` -- **not supported**. Throws `ERR_INVALID_ARG_VALUE`.",
                              "desc": "`'drop-oldest'` -- **not supported**. Throws `ERR_INVALID_ARG_VALUE`."
                            }
                          ]
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stream/iter Writer adapter.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stream/iter Writer adapter."
                  }
                }
              ],
              "desc": "<p>Creates a stream/iter Writer adapter from a classic Writable stream (or\nduck-typed equivalent). The adapter can be passed to <a href=\"#pipetosource-transforms-writer-options\"><code>pipeTo()</code></a> as a\ndestination.</p>\n<p>Since all writes on a classic Writable are fundamentally asynchronous,\nthe synchronous Writer methods (<code>writeSync</code>, <code>writevSync</code>, <code>endSync</code>) always\nreturn <code>false</code> or <code>-1</code>, deferring to the async path. The per-write\n<code>options.signal</code> parameter from the Writer interface is also ignored.</p>\n<p>The result is cached per instance and backpressure policy -- calling\n<code>fromWritable()</code> twice with the same stream and <code>backpressure</code> option returns\nthe same Writer.</p>\n<p>For duck-typed streams that do not expose <code>writableHighWaterMark</code>,\n<code>writableLength</code>, or similar properties, sensible defaults are used.\nObject-mode writables (if detectable) are rejected since the Writer\ninterface is bytes-only.</p>\n<pre><code class=\"language-mjs\">import { Writable } from 'node:stream';\nimport { from, fromWritable, pipeTo } from 'node:stream/iter';\n\nconst writable = new Writable({\n  write(chunk, encoding, cb) { console.log(chunk.toString()); cb(); },\n});\n\nawait pipeTo(from('hello world'),\n             fromWritable(writable, { backpressure: 'block' }));\n</code></pre>\n<pre><code class=\"language-cjs\">const { Writable } = require('node:stream');\nconst { from, fromWritable, pipeTo } = require('node:stream/iter');\n\nasync function run() {\n  const writable = new Writable({\n    write(chunk, encoding, cb) { console.log(chunk.toString()); cb(); },\n  });\n\n  await pipeTo(from('hello world'),\n               fromWritable(writable, { backpressure: 'block' }));\n}\nrun();\n</code></pre>"
            },
            {
              "textRaw": "`toReadable(source[, options])`",
              "name": "toReadable",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`source` {AsyncIterable} An `AsyncIterable<Uint8Array[]>` source, such as the return value of `pull()` or `from()`.",
                      "name": "source",
                      "type": "AsyncIterable",
                      "desc": "An `AsyncIterable<Uint8Array[]>` source, such as the return value of `pull()` or `from()`."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} The internal buffer size in bytes before backpressure is applied. **Default:** `65536` (64 KB).",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "The internal buffer size in bytes before backpressure is applied."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} An optional signal to abort the readable.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "An optional signal to abort the readable."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {stream.Readable}",
                    "name": "return",
                    "type": "stream.Readable"
                  }
                }
              ],
              "desc": "<p>Creates a byte-mode <a href=\"stream.html#class-streamreadable\"><code>stream.Readable</code></a> from an <code>AsyncIterable&#x3C;Uint8Array[]></code>\n(the native batch format used by the stream/iter API). Each <code>Uint8Array</code> in a\nyielded batch is pushed as a separate chunk into the Readable.</p>\n<pre><code class=\"language-mjs\">import { createWriteStream } from 'node:fs';\nimport { from, pull, toReadable } from 'node:stream/iter';\nimport { compressGzip } from 'node:zlib/iter';\n\nconst source = pull(from('hello world'), compressGzip());\nconst readable = toReadable(source);\n\nreadable.pipe(createWriteStream('output.gz'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { createWriteStream } = require('node:fs');\nconst { from, pull, toReadable } = require('node:stream/iter');\nconst { compressGzip } = require('node:zlib/iter');\n\nconst source = pull(from('hello world'), compressGzip());\nconst readable = toReadable(source);\n\nreadable.pipe(createWriteStream('output.gz'));\n</code></pre>"
            },
            {
              "textRaw": "`toReadableSync(source[, options])`",
              "name": "toReadableSync",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>source</code> {Iterable} An <code>Iterable&#x3C;Uint8Array[]></code> source, such as the\nreturn value of <a href=\"#pullsyncsource-transforms-options\"><code>pullSync()</code></a> or <a href=\"#fromsyncinput\"><code>fromSync()</code></a>.</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>highWaterMark</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The internal buffer size in bytes before\nbackpressure is applied. <strong>Default:</strong> <code>65536</code> (64 KB).</li>\n</ul>\n</li>\n<li>Returns: <a href=\"stream.html#class-streamreadable\"><code>&#x3C;stream.Readable></code></a></li>\n</ul>\n<p>Creates a byte-mode <a href=\"stream.html#class-streamreadable\"><code>stream.Readable</code></a> from a synchronous\n<code>Iterable&#x3C;Uint8Array[]></code>. The <code>_read()</code> method pulls from the iterator\nsynchronously, so data is available immediately via <code>readable.read()</code>.</p>\n<pre><code class=\"language-mjs\">import { fromSync, toReadableSync } from 'node:stream/iter';\n\nconst source = fromSync('hello world');\nconst readable = toReadableSync(source);\n\nconsole.log(readable.read().toString()); // 'hello world'\n</code></pre>\n<pre><code class=\"language-cjs\">const { fromSync, toReadableSync } = require('node:stream/iter');\n\nconst source = fromSync('hello world');\nconst readable = toReadableSync(source);\n\nconsole.log(readable.read().toString()); // 'hello world'\n</code></pre>"
            },
            {
              "textRaw": "`toWritable(writer)`",
              "name": "toWritable",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`writer` {Object} A stream/iter Writer. Only the `write()` method is required; `end()`, `fail()`, `writeSync()`, `writevSync()`, `endSync()`, and `writev()` are optional.",
                      "name": "writer",
                      "type": "Object",
                      "desc": "A stream/iter Writer. Only the `write()` method is required; `end()`, `fail()`, `writeSync()`, `writevSync()`, `endSync()`, and `writev()` are optional."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {stream.Writable}",
                    "name": "return",
                    "type": "stream.Writable"
                  }
                }
              ],
              "desc": "<p>Creates a classic <a href=\"stream.html#class-streamwritable\"><code>stream.Writable</code></a> backed by a stream/iter Writer.</p>\n<p>Each <code>_write()</code> / <code>_writev()</code> call attempts the Writer's synchronous method\nfirst (<code>writeSync</code> / <code>writevSync</code>), falling back to the async method if the\nsync path returns <code>false</code> or throws. Similarly, <code>_final()</code> tries <code>endSync()</code>\nbefore <code>end()</code>. When the sync path succeeds, the callback is deferred via\n<code>queueMicrotask</code> to preserve the async resolution contract.</p>\n<p>The Writable's <code>highWaterMark</code> is set to <code>Number.MAX_SAFE_INTEGER</code> to\neffectively disable its internal buffering, allowing the underlying Writer\nto manage backpressure directly.</p>\n<pre><code class=\"language-mjs\">import { push, toWritable } from 'node:stream/iter';\n\nconst { writer, readable } = push();\nconst writable = toWritable(writer);\n\nwritable.write('hello');\nwritable.end();\n</code></pre>\n<pre><code class=\"language-cjs\">const { push, toWritable } = require('node:stream/iter');\n\nconst { writer, readable } = push();\nconst writable = toWritable(writer);\n\nwritable.write('hello');\nwritable.end();\n</code></pre>"
            }
          ],
          "displayName": "Classic stream interop"
        },
        {
          "textRaw": "Protocol symbols",
          "name": "protocol_symbols",
          "type": "module",
          "desc": "<p>These well-known symbols allow third-party objects to participate in the\nstreaming protocol without importing from <code>node:stream/iter</code> directly.</p>",
          "properties": [
            {
              "textRaw": "`Stream.broadcastProtocol`",
              "name": "broadcastProtocol",
              "type": "property",
              "desc": "<ul>\n<li>Value: <code>Symbol.for('Stream.broadcastProtocol')</code></li>\n</ul>\n<p>The value must be a function. When called by <code>Broadcast.from()</code>, it receives\nthe options passed to <code>Broadcast.from()</code> and must return an object conforming\nto the {Broadcast} interface. The implementation is fully custom -- it can\nmanage consumers, buffering, and backpressure however it wants.</p>\n<pre><code class=\"language-mjs\">import { Broadcast, text } from 'node:stream/iter';\n\n// This example defers to the built-in Broadcast, but a custom\n// implementation could use any mechanism.\nclass MessageBus {\n  #broadcast;\n  #writer;\n\n  constructor() {\n    const { writer, broadcast } = Broadcast();\n    this.#writer = writer;\n    this.#broadcast = broadcast;\n  }\n\n  [Symbol.for('Stream.broadcastProtocol')](options) {\n    return this.#broadcast;\n  }\n\n  send(data) {\n    this.#writer.write(new TextEncoder().encode(data));\n  }\n\n  close() {\n    this.#writer.end();\n  }\n}\n\nconst bus = new MessageBus();\nconst { broadcast } = Broadcast.from(bus);\nconst consumer = broadcast.push();\nbus.send('hello');\nbus.close();\nconsole.log(await text(consumer)); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { Broadcast, text } = require('node:stream/iter');\n\n// This example defers to the built-in Broadcast, but a custom\n// implementation could use any mechanism.\nclass MessageBus {\n  #broadcast;\n  #writer;\n\n  constructor() {\n    const { writer, broadcast } = Broadcast();\n    this.#writer = writer;\n    this.#broadcast = broadcast;\n  }\n\n  [Symbol.for('Stream.broadcastProtocol')](options) {\n    return this.#broadcast;\n  }\n\n  send(data) {\n    this.#writer.write(new TextEncoder().encode(data));\n  }\n\n  close() {\n    this.#writer.end();\n  }\n}\n\nconst bus = new MessageBus();\nconst { broadcast } = Broadcast.from(bus);\nconst consumer = broadcast.push();\nbus.send('hello');\nbus.close();\ntext(consumer).then(console.log); // 'hello'\n</code></pre>"
            },
            {
              "textRaw": "`Stream.drainableProtocol`",
              "name": "drainableProtocol",
              "type": "property",
              "desc": "<ul>\n<li>Value: <code>Symbol.for('Stream.drainableProtocol')</code></li>\n</ul>\n<p>Implement to make a writer compatible with <code>ondrain()</code>. The method should\nreturn <code>null</code> if no backpressure, or a promise that fulfills with a truthy value\nwhen backpressure clears.</p>\n<pre><code class=\"language-mjs\">import { ondrain } from 'node:stream/iter';\n\nclass CustomWriter {\n  #queue = [];\n  #drain = null;\n  #closed = false;\n  [Symbol.for('Stream.drainableProtocol')]() {\n    if (this.#closed) return null;\n    if (this.#queue.length &#x3C; 3) return Promise.resolve(true);\n    this.#drain ??= Promise.withResolvers();\n    return this.#drain.promise;\n  }\n  write(chunk) {\n    this.#queue.push(chunk);\n  }\n  flush() {\n    this.#queue.length = 0;\n    this.#drain?.resolve(true);\n    this.#drain = null;\n  }\n  close() {\n    this.#closed = true;\n  }\n}\nconst writer = new CustomWriter();\nconst ready = ondrain(writer);\nconsole.log(ready); // Promise { true } -- no backpressure\n</code></pre>\n<pre><code class=\"language-cjs\">const { ondrain } = require('node:stream/iter');\n\nclass CustomWriter {\n  #queue = [];\n  #drain = null;\n  #closed = false;\n\n  [Symbol.for('Stream.drainableProtocol')]() {\n    if (this.#closed) return null;\n    if (this.#queue.length &#x3C; 3) return Promise.resolve(true);\n    this.#drain ??= Promise.withResolvers();\n    return this.#drain.promise;\n  }\n\n  write(chunk) {\n    this.#queue.push(chunk);\n  }\n\n  flush() {\n    this.#queue.length = 0;\n    this.#drain?.resolve(true);\n    this.#drain = null;\n  }\n\n  close() {\n    this.#closed = true;\n  }\n}\n\nconst writer = new CustomWriter();\nconst ready = ondrain(writer);\nconsole.log(ready); // Promise { true } -- no backpressure\n</code></pre>"
            },
            {
              "textRaw": "`Stream.shareProtocol`",
              "name": "shareProtocol",
              "type": "property",
              "desc": "<ul>\n<li>Value: <code>Symbol.for('Stream.shareProtocol')</code></li>\n</ul>\n<p>The value must be a function. When called by <code>Share.from()</code>, it receives the\noptions passed to <code>Share.from()</code> and must return an object conforming to the\n{Share} interface. The implementation is fully custom -- it can manage the shared\nsource, consumers, buffering, and backpressure however it wants.</p>\n<pre><code class=\"language-mjs\">import { share, Share, text } from 'node:stream/iter';\n\n// This example defers to the built-in share(), but a custom\n// implementation could use any mechanism.\nclass DataPool {\n  #share;\n\n  constructor(source) {\n    this.#share = share(source);\n  }\n\n  [Symbol.for('Stream.shareProtocol')](options) {\n    return this.#share;\n  }\n}\n\nconst pool = new DataPool(\n  (async function* () {\n    yield 'hello';\n  })(),\n);\n\nconst shared = Share.from(pool);\nconst consumer = shared.pull();\nconsole.log(await text(consumer)); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { share, Share, text } = require('node:stream/iter');\n\n// This example defers to the built-in share(), but a custom\n// implementation could use any mechanism.\nclass DataPool {\n  #share;\n\n  constructor(source) {\n    this.#share = share(source);\n  }\n\n  [Symbol.for('Stream.shareProtocol')](options) {\n    return this.#share;\n  }\n}\n\nconst pool = new DataPool(\n  (async function* () {\n    yield 'hello';\n  })(),\n);\n\nconst shared = Share.from(pool);\nconst consumer = shared.pull();\ntext(consumer).then(console.log); // 'hello'\n</code></pre>"
            },
            {
              "textRaw": "`Stream.shareSyncProtocol`",
              "name": "shareSyncProtocol",
              "type": "property",
              "desc": "<ul>\n<li>Value: <code>Symbol.for('Stream.shareSyncProtocol')</code></li>\n</ul>\n<p>The value must be a function. When called by <code>SyncShare.fromSync()</code>, it receives\nthe options passed to <code>SyncShare.fromSync()</code> and must return an object conforming\nto the {SyncShare} interface. The implementation is fully custom -- it can manage\nthe shared source, consumers, and buffering however it wants.</p>\n<pre><code class=\"language-mjs\">import { shareSync, SyncShare, textSync } from 'node:stream/iter';\n\n// This example defers to the built-in shareSync(), but a custom\n// implementation could use any mechanism.\nclass SyncDataPool {\n  #share;\n\n  constructor(source) {\n    this.#share = shareSync(source);\n  }\n\n  [Symbol.for('Stream.shareSyncProtocol')](options) {\n    return this.#share;\n  }\n}\n\nconst encoder = new TextEncoder();\nconst pool = new SyncDataPool(\n  function* () {\n    yield [encoder.encode('hello')];\n  }(),\n);\n\nconst shared = SyncShare.fromSync(pool);\nconst consumer = shared.pull();\nconsole.log(textSync(consumer)); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { shareSync, SyncShare, textSync } = require('node:stream/iter');\n\n// This example defers to the built-in shareSync(), but a custom\n// implementation could use any mechanism.\nclass SyncDataPool {\n  #share;\n\n  constructor(source) {\n    this.#share = shareSync(source);\n  }\n\n  [Symbol.for('Stream.shareSyncProtocol')](options) {\n    return this.#share;\n  }\n}\n\nconst encoder = new TextEncoder();\nconst pool = new SyncDataPool(\n  function* () {\n    yield [encoder.encode('hello')];\n  }(),\n);\n\nconst shared = SyncShare.fromSync(pool);\nconst consumer = shared.pull();\nconsole.log(textSync(consumer)); // 'hello'\n</code></pre>"
            },
            {
              "textRaw": "`Stream.toAsyncStreamable`",
              "name": "toAsyncStreamable",
              "type": "property",
              "desc": "<ul>\n<li>Value: <code>Symbol.for('Stream.toAsyncStreamable')</code></li>\n</ul>\n<p>The value must be a function that converts the object into a streamable value.\nWhen the object is encountered anywhere in the streaming pipeline (as a source\npassed to <code>from()</code>, or as a value returned from a transform), this method is\ncalled to produce the actual data. It may return any value that resolves to:\na string, <code>Uint8Array</code>, <code>AsyncIterable</code>, <code>Iterable</code>, or another streamable\nobject.</p>\n<pre><code class=\"language-mjs\">import { from, text } from 'node:stream/iter';\n\nclass Greeting {\n  #name;\n\n  constructor(name) {\n    this.#name = name;\n  }\n\n  [Symbol.for('Stream.toAsyncStreamable')]() {\n    return `hello ${this.#name}`;\n  }\n}\n\nconst stream = from(new Greeting('world'));\nconsole.log(await text(stream)); // 'hello world'\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, text } = require('node:stream/iter');\n\nclass Greeting {\n  #name;\n\n  constructor(name) {\n    this.#name = name;\n  }\n\n  [Symbol.for('Stream.toAsyncStreamable')]() {\n    return `hello ${this.#name}`;\n  }\n}\n\nconst stream = from(new Greeting('world'));\ntext(stream).then(console.log); // 'hello world'\n</code></pre>"
            },
            {
              "textRaw": "`Stream.toStreamable`",
              "name": "toStreamable",
              "type": "property",
              "desc": "<ul>\n<li>Value: <code>Symbol.for('Stream.toStreamable')</code></li>\n</ul>\n<p>The value must be a function that synchronously converts the object into a\nstreamable value. When the object is encountered anywhere in the streaming\npipeline (as a source passed to <code>fromSync()</code>, or as a value returned from a\nsync transform), this method is called to produce the actual data. It must\nsynchronously return a streamable value: a string, <code>Uint8Array</code>, or <code>Iterable</code>.</p>\n<pre><code class=\"language-mjs\">import { fromSync, textSync } from 'node:stream/iter';\n\nclass Greeting {\n  #name;\n\n  constructor(name) {\n    this.#name = name;\n  }\n\n  [Symbol.for('Stream.toStreamable')]() {\n    return `hello ${this.#name}`;\n  }\n}\n\nconst stream = fromSync(new Greeting('world'));\nconsole.log(textSync(stream)); // 'hello world'\n</code></pre>\n<pre><code class=\"language-cjs\">const { fromSync, textSync } = require('node:stream/iter');\n\nclass Greeting {\n  #name;\n\n  constructor(name) {\n    this.#name = name;\n  }\n\n  [Symbol.for('Stream.toStreamable')]() {\n    return `hello ${this.#name}`;\n  }\n}\n\nconst stream = fromSync(new Greeting('world'));\nconsole.log(textSync(stream)); // 'hello world'\n</code></pre>"
            }
          ],
          "displayName": "Protocol symbols"
        }
      ],
      "displayName": "Iterable Streams",
      "source": "doc/api/stream_iter.md"
    },
    {
      "textRaw": "Modules: CommonJS modules",
      "name": "modules:_commonjs_modules",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>CommonJS modules are the original way to package JavaScript code for Node.js.\nNode.js also supports the <a href=\"esm.html\">ECMAScript modules</a> standard used by browsers\nand other JavaScript runtimes.</p>\n<p>In Node.js, each file is treated as a separate module. For\nexample, consider a file named <code>foo.js</code>:</p>\n<pre><code class=\"language-js\">const circle = require('./circle.js');\nconsole.log(`The area of a circle of radius 4 is ${circle.area(4)}`);\n</code></pre>\n<p>On the first line, <code>foo.js</code> loads the module <code>circle.js</code> that is in the same\ndirectory as <code>foo.js</code>.</p>\n<p>Here are the contents of <code>circle.js</code>:</p>\n<pre><code class=\"language-js\">const { PI } = Math;\n\nexports.area = (r) => PI * r ** 2;\n\nexports.circumference = (r) => 2 * PI * r;\n</code></pre>\n<p>The module <code>circle.js</code> has exported the functions <code>area()</code> and\n<code>circumference()</code>. Functions and objects are added to the root of a module\nby specifying additional properties on the special <code>exports</code> object.</p>\n<p>Variables local to the module will be private, because the module is wrapped\nin a function by Node.js (see <a href=\"#the-module-wrapper\">module wrapper</a>).\nIn this example, the variable <code>PI</code> is private to <code>circle.js</code>.</p>\n<p>The <code>module.exports</code> property can be assigned a new value (such as a function\nor object).</p>\n<p>In the following code, <code>bar.js</code> makes use of the <code>square</code> module, which exports\na Square class:</p>\n<pre><code class=\"language-js\">const Square = require('./square.js');\nconst mySquare = new Square(2);\nconsole.log(`The area of mySquare is ${mySquare.area()}`);\n</code></pre>\n<p>The <code>square</code> module is defined in <code>square.js</code>:</p>\n<pre><code class=\"language-js\">// Assigning to exports will not modify module, must use module.exports\nmodule.exports = class Square {\n  constructor(width) {\n    this.width = width;\n  }\n\n  area() {\n    return this.width ** 2;\n  }\n};\n</code></pre>\n<p>The CommonJS module system is implemented in the <a href=\"module.html\"><code>module</code> core module</a>.</p>",
      "miscs": [
        {
          "textRaw": "Enabling",
          "name": "Enabling",
          "type": "misc",
          "desc": "<p>Node.js has two module systems: CommonJS modules and <a href=\"esm.html\">ECMAScript modules</a>.</p>\n<p>By default, Node.js will treat the following as CommonJS modules:</p>\n<ul>\n<li>\n<p>Files with a <code>.cjs</code> extension.</p>\n</li>\n<li>\n<p>Files with a <code>.js</code> extension or without an extension, when the nearest parent\n<code>package.json</code> file contains a top-level field <a href=\"packages.html#type\"><code>\"type\"</code></a> with a value of\n<code>\"commonjs\"</code>.</p>\n</li>\n<li>\n<p>Files with a <code>.js</code> extension or without an extension, when the nearest parent\n<code>package.json</code> file doesn't contain a top-level field <a href=\"packages.html#type\"><code>\"type\"</code></a> or there is\nno <code>package.json</code> in any parent folder; unless the file contains syntax that\nerrors unless it is evaluated as an ES module. Package authors should include\nthe <a href=\"packages.html#type\"><code>\"type\"</code></a> field, even in packages where all sources are CommonJS. Being\nexplicit about the <code>type</code> of the package will make things easier for build\ntools and loaders to determine how the files in the package should be\ninterpreted.</p>\n</li>\n<li>\n<p>Files with an extension that is not <code>.mjs</code>, <code>.cjs</code>, <code>.json</code>, <code>.node</code>, or <code>.js</code>,\nwhen the nearest parent <code>package.json</code> file contains a top-level field\n<a href=\"packages.html#type\"><code>\"type\"</code></a> with a value of <code>\"module\"</code>.</p>\n</li>\n</ul>\n<p>See <a href=\"packages.html#determining-module-system\">Determining module system</a> for more details.</p>\n<p>Calling <code>require()</code> always use the CommonJS module loader. Calling <code>import()</code>\nalways use the ECMAScript module loader.</p>"
        },
        {
          "textRaw": "Accessing the main module",
          "name": "Accessing the main module",
          "type": "misc",
          "desc": "<p>When a file is run directly from Node.js, <code>require.main</code> is set to its\n<code>module</code>. That means that it is possible to determine whether a file has been\nrun directly by testing <code>require.main === module</code>.</p>\n<p>For a file <code>foo.js</code>, this will be <code>true</code> if run via <code>node foo.js</code>, but\n<code>false</code> if run by <code>require('./foo')</code>.</p>\n<p>When the entry point is not a CommonJS module, <code>require.main</code> is <code>undefined</code>,\nand the main module is out of reach.</p>"
        },
        {
          "textRaw": "Package manager tips",
          "name": "Package manager tips",
          "type": "misc",
          "desc": "<p>The semantics of the Node.js <code>require()</code> function were designed to be general\nenough to support reasonable directory structures. Package manager programs\nsuch as <code>dpkg</code>, <code>rpm</code>, and <code>npm</code> will hopefully find it possible to build\nnative packages from Node.js modules without modification.</p>\n<p>In the following, we give a suggested directory structure that could work:</p>\n<p>Let's say that we wanted to have the folder at\n<code>/usr/lib/node/&#x3C;some-package>/&#x3C;some-version></code> hold the contents of a\nspecific version of a package.</p>\n<p>Packages can depend on one another. In order to install package <code>foo</code>, it\nmay be necessary to install a specific version of package <code>bar</code>. The <code>bar</code>\npackage may itself have dependencies, and in some cases, these may even collide\nor form cyclic dependencies.</p>\n<p>Because Node.js looks up the <code>realpath</code> of any modules it loads (that is, it\nresolves symlinks) and then <a href=\"#loading-from-node_modules-folders\">looks for their dependencies in <code>node_modules</code> folders</a>,\nthis situation can be resolved with the following architecture:</p>\n<ul>\n<li><code>/usr/lib/node/foo/1.2.3/</code>: Contents of the <code>foo</code> package, version 1.2.3.</li>\n<li><code>/usr/lib/node/bar/4.3.2/</code>: Contents of the <code>bar</code> package that <code>foo</code> depends\non.</li>\n<li><code>/usr/lib/node/foo/1.2.3/node_modules/bar</code>: Symbolic link to\n<code>/usr/lib/node/bar/4.3.2/</code>.</li>\n<li><code>/usr/lib/node/bar/4.3.2/node_modules/*</code>: Symbolic links to the packages that\n<code>bar</code> depends on.</li>\n</ul>\n<p>Thus, even if a cycle is encountered, or if there are dependency\nconflicts, every module will be able to get a version of its dependency\nthat it can use.</p>\n<p>When the code in the <code>foo</code> package does <code>require('bar')</code>, it will get the\nversion that is symlinked into <code>/usr/lib/node/foo/1.2.3/node_modules/bar</code>.\nThen, when the code in the <code>bar</code> package calls <code>require('quux')</code>, it'll get\nthe version that is symlinked into\n<code>/usr/lib/node/bar/4.3.2/node_modules/quux</code>.</p>\n<p>Furthermore, to make the module lookup process even more optimal, rather\nthan putting packages directly in <code>/usr/lib/node</code>, we could put them in\n<code>/usr/lib/node_modules/&#x3C;name>/&#x3C;version></code>. Then Node.js will not bother\nlooking for missing dependencies in <code>/usr/node_modules</code> or <code>/node_modules</code>.</p>\n<p>In order to make modules available to the Node.js REPL, it might be useful to\nalso add the <code>/usr/lib/node_modules</code> folder to the <code>$NODE_PATH</code> environment\nvariable. Since the module lookups using <code>node_modules</code> folders are all\nrelative, and based on the real path of the files making the calls to\n<code>require()</code>, the packages themselves can be anywhere.</p>"
        },
        {
          "textRaw": "All together",
          "name": "All together",
          "type": "misc",
          "desc": "<p>To get the exact filename that will be loaded when <code>require()</code> is called, use\nthe <code>require.resolve()</code> function.</p>\n<p>Putting together all of the above, here is the high-level algorithm\nin pseudocode of what <code>require()</code> does:</p>\n<pre><code class=\"language-text\">require(X) from module at path Y\n1. If X is a core module,\n   a. return the core module\n   b. STOP\n2. If X begins with '/'\n   a. set Y to the file system root\n3. If X is equal to '.', or X begins with './', '/' or '../'\n   a. LOAD_AS_FILE(Y + X)\n   b. LOAD_AS_DIRECTORY(Y + X)\n   c. THROW \"not found\"\n4. If X begins with '#'\n   a. LOAD_PACKAGE_IMPORTS(X, dirname(Y))\n5. LOAD_PACKAGE_SELF(X, dirname(Y))\n6. LOAD_NODE_MODULES(X, dirname(Y))\n7. THROW \"not found\"\n\nMAYBE_DETECT_AND_LOAD(X)\n1. If X parses as a CommonJS module, load X as a CommonJS module. STOP.\n2. Else, if the source code of X can be parsed as ECMAScript module using\n  DETECT_MODULE_SYNTAX defined in the ESM resolver,\n  a. Load X as an ECMAScript module. STOP.\n3. THROW the SyntaxError from attempting to parse X as CommonJS in 1. STOP.\n\nLOAD_AS_FILE(X)\n1. If X is a file, load X as its file extension format. STOP\n2. If X.js is a file,\n    a. Find the closest package scope SCOPE to X.\n    b. If no scope was found\n      1. MAYBE_DETECT_AND_LOAD(X.js)\n    c. If the SCOPE/package.json contains \"type\" field,\n      1. If the \"type\" field is \"module\", load X.js as an ECMAScript module. STOP.\n      2. If the \"type\" field is \"commonjs\", load X.js as a CommonJS module. STOP.\n    d. MAYBE_DETECT_AND_LOAD(X.js)\n3. If X.json is a file, load X.json to a JavaScript Object. STOP\n4. If X.node is a file, load X.node as binary addon. STOP\n\nLOAD_INDEX(X)\n1. If X/index.js is a file\n    a. Find the closest package scope SCOPE to X.\n    b. If no scope was found, load X/index.js as a CommonJS module. STOP.\n    c. If the SCOPE/package.json contains \"type\" field,\n      1. If the \"type\" field is \"module\", load X/index.js as an ECMAScript module. STOP.\n      2. Else, load X/index.js as a CommonJS module. STOP.\n2. If X/index.json is a file, parse X/index.json to a JavaScript object. STOP\n3. If X/index.node is a file, load X/index.node as binary addon. STOP\n\nLOAD_AS_DIRECTORY(X)\n1. If X/package.json is a file,\n   a. Parse X/package.json, and look for \"main\" field.\n   b. If \"main\" is a falsy value, GOTO 2.\n   c. let M = X + (json main field)\n   d. LOAD_AS_FILE(M)\n   e. LOAD_INDEX(M)\n   f. LOAD_INDEX(X) DEPRECATED\n   g. THROW \"not found\"\n2. LOAD_INDEX(X)\n\nLOAD_NODE_MODULES(X, START)\n1. let DIRS = NODE_MODULES_PATHS(START)\n2. for each DIR in DIRS:\n   a. LOAD_PACKAGE_EXPORTS(X, DIR)\n   b. LOAD_AS_FILE(DIR/X)\n   c. LOAD_AS_DIRECTORY(DIR/X)\n\nNODE_MODULES_PATHS(START)\n1. let PARTS = path split(START)\n2. let I = count of PARTS - 1\n3. let DIRS = []\n4. while I >= 0,\n   a. if PARTS[I] = \"node_modules\", GOTO d.\n   b. DIR = path join(PARTS[0 .. I] + \"node_modules\")\n   c. DIRS = DIRS + DIR\n   d. let I = I - 1\n5. return DIRS + GLOBAL_FOLDERS\n\nLOAD_PACKAGE_IMPORTS(X, DIR)\n1. Find the closest package scope SCOPE to DIR.\n2. If no scope was found, return.\n3. If the SCOPE/package.json \"imports\" is null or undefined, return.\n4. If `--no-require-module` is not enabled\n  a. let CONDITIONS = [\"node\", \"require\", \"module-sync\"]\n  b. Else, let CONDITIONS = [\"node\", \"require\"]\n5. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE),\n  CONDITIONS) defined in the ESM resolver.\n6. RESOLVE_ESM_MATCH(MATCH).\n\nLOAD_PACKAGE_EXPORTS(X, DIR)\n1. Try to interpret X as a combination of NAME and SUBPATH where the name\n   may have a @scope/ prefix and the subpath begins with a slash (`/`).\n2. If X does not match this pattern or DIR/NAME/package.json is not a file,\n   return.\n3. Parse DIR/NAME/package.json, and look for \"exports\" field.\n4. If \"exports\" is null or undefined, return.\n5. If `--no-require-module` is not enabled\n  a. let CONDITIONS = [\"node\", \"require\", \"module-sync\"]\n  b. Else, let CONDITIONS = [\"node\", \"require\"]\n6. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), \".\" + SUBPATH,\n   `package.json` \"exports\", CONDITIONS) defined in the ESM resolver.\n7. RESOLVE_ESM_MATCH(MATCH)\n\nLOAD_PACKAGE_SELF(X, DIR)\n1. Find the closest package scope SCOPE to DIR.\n2. If no scope was found, return.\n3. If the SCOPE/package.json \"exports\" is null or undefined, return.\n4. If the SCOPE/package.json \"name\" is not the first segment of X, return.\n5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE),\n   \".\" + X.slice(\"name\".length), `package.json` \"exports\", [\"node\", \"require\"])\n   defined in the ESM resolver.\n6. RESOLVE_ESM_MATCH(MATCH)\n\nRESOLVE_ESM_MATCH(MATCH)\n1. let RESOLVED_PATH = fileURLToPath(MATCH)\n2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension\n   format. STOP\n3. THROW \"not found\"\n</code></pre>\n<p>The \"ESM resolver\" is defined <a href=\"esm.html#resolver-algorithm-specification\">in the ESM documentation</a>.</p>"
        },
        {
          "textRaw": "Caching",
          "name": "Caching",
          "type": "misc",
          "desc": "<p>Modules are cached after the first time they are loaded. This means (among other\nthings) that every call to <code>require('foo')</code> will get exactly the same object\nreturned, if it would resolve to the same file.</p>\n<p>Provided <code>require.cache</code> is not modified, multiple calls to <code>require('foo')</code>\nwill not cause the module code to be executed multiple times. This is an\nimportant feature. With it, \"partially done\" objects can be returned, thus\nallowing transitive dependencies to be loaded even when they would cause cycles.</p>\n<p>To have a module execute code multiple times, export a function, and call that\nfunction.</p>",
          "miscs": [
            {
              "textRaw": "Module caching caveats",
              "name": "Module caching caveats",
              "type": "misc",
              "desc": "<p>Modules are cached based on their resolved filename. Since modules may resolve\nto a different filename based on the location of the calling module (loading\nfrom <code>node_modules</code> folders), it is not a <em>guarantee</em> that <code>require('foo')</code> will\nalways return the exact same object, if it would resolve to different files.</p>\n<p>Additionally, on case-insensitive file systems or operating systems, different\nresolved filenames can point to the same file, but the cache will still treat\nthem as different modules and will reload the file multiple times. For example,\n<code>require('./foo')</code> and <code>require('./FOO')</code> return two different objects,\nirrespective of whether or not <code>./foo</code> and <code>./FOO</code> are the same file.</p>"
            }
          ]
        },
        {
          "textRaw": "Built-in modules",
          "name": "Built-in modules",
          "type": "misc",
          "meta": {
            "changes": [
              {
                "version": [
                  "v16.0.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/37246",
                "description": "Added `node:` import support to `require(...)`."
              }
            ]
          },
          "desc": "<p>Node.js has several modules compiled into the binary. These modules are\ndescribed in greater detail elsewhere in this documentation.</p>\n<p>The built-in modules are defined within the Node.js source and are located in the\n<code>lib/</code> folder.</p>\n<p>Built-in modules can be identified using the <code>node:</code> prefix, in which case\nit bypasses the <code>require</code> cache. For instance, <code>require('node:http')</code> will\nalways return the built in HTTP module, even if there is <code>require.cache</code> entry\nby that name.</p>\n<p>Some built-in modules are always preferentially loaded if their identifier is\npassed to <code>require()</code>. For instance, <code>require('http')</code> will always\nreturn the built-in HTTP module, even if there is a file by that name.</p>\n<p>The list of all the built-in modules can be retrieved from <a href=\"module.html#modulebuiltinmodules\"><code>module.builtinModules</code></a>.\nThe modules being all listed without the <code>node:</code> prefix, except those that mandate such\nprefix (as explained in the next section).</p>",
          "miscs": [
            {
              "textRaw": "Built-in modules with mandatory `node:` prefix",
              "name": "built-in_modules_with_mandatory_`node:`_prefix",
              "type": "misc",
              "desc": "<p>When being loaded by <code>require()</code>, some built-in modules must be requested with the\n<code>node:</code> prefix. This requirement exists to prevent newly introduced built-in\nmodules from having a conflict with user land packages that already have\ntaken the name. Currently the built-in modules that requires the <code>node:</code> prefix are:</p>\n<ul>\n<li><a href=\"ffi.html\"><code>node:ffi</code></a></li>\n<li><a href=\"single-executable-applications.html#single-executable-application-api\"><code>node:sea</code></a></li>\n<li><a href=\"sqlite.html\"><code>node:sqlite</code></a></li>\n<li><a href=\"test.html\"><code>node:test</code></a></li>\n<li><a href=\"test.html#test-reporters\"><code>node:test/reporters</code></a></li>\n</ul>\n<p>The list of these modules is exposed in <a href=\"module.html#modulebuiltinmodules\"><code>module.builtinModules</code></a>, including the prefix.</p>",
              "displayName": "Built-in modules with mandatory `node:` prefix"
            }
          ]
        },
        {
          "textRaw": "Cycles",
          "name": "Cycles",
          "type": "misc",
          "desc": "<p>When there are circular <code>require()</code> calls, a module might not have finished\nexecuting when it is returned.</p>\n<p>Consider this situation:</p>\n<p><code>a.js</code>:</p>\n<pre><code class=\"language-js\">console.log('a starting');\nexports.done = false;\nconst b = require('./b.js');\nconsole.log('in a, b.done = %j', b.done);\nexports.done = true;\nconsole.log('a done');\n</code></pre>\n<p><code>b.js</code>:</p>\n<pre><code class=\"language-js\">console.log('b starting');\nexports.done = false;\nconst a = require('./a.js');\nconsole.log('in b, a.done = %j', a.done);\nexports.done = true;\nconsole.log('b done');\n</code></pre>\n<p><code>main.js</code>:</p>\n<pre><code class=\"language-js\">console.log('main starting');\nconst a = require('./a.js');\nconst b = require('./b.js');\nconsole.log('in main, a.done = %j, b.done = %j', a.done, b.done);\n</code></pre>\n<p>When <code>main.js</code> loads <code>a.js</code>, then <code>a.js</code> in turn loads <code>b.js</code>. At that\npoint, <code>b.js</code> tries to load <code>a.js</code>. In order to prevent an infinite\nloop, an <strong>unfinished copy</strong> of the <code>a.js</code> exports object is returned to the\n<code>b.js</code> module. <code>b.js</code> then finishes loading, and its <code>exports</code> object is\nprovided to the <code>a.js</code> module.</p>\n<p>By the time <code>main.js</code> has loaded both modules, they're both finished.\nThe output of this program would thus be:</p>\n<pre><code class=\"language-console\">$ node main.js\nmain starting\na starting\nb starting\nin b, a.done = false\nb done\nin a, b.done = true\na done\nin main, a.done = true, b.done = true\n</code></pre>\n<p>Careful planning is required to allow cyclic module dependencies to work\ncorrectly within an application.</p>"
        },
        {
          "textRaw": "File modules",
          "name": "File modules",
          "type": "misc",
          "desc": "<p>If the exact filename is not found, then Node.js will attempt to load the\nrequired filename with the added extensions: <code>.js</code>, <code>.json</code>, and finally\n<code>.node</code>. When loading a file that has a different extension (e.g. <code>.cjs</code>), its\nfull name must be passed to <code>require()</code>, including its file extension (e.g.\n<code>require('./file.cjs')</code>).</p>\n<p><code>.json</code> files are parsed as JSON text files, <code>.node</code> files are interpreted as\ncompiled addon modules loaded with <code>process.dlopen()</code>. Files using any other\nextension (or no extension at all) are parsed as JavaScript text files. Refer to\nthe <a href=\"packages.html#determining-module-system\">Determining module system</a> section to understand what parse goal will be\nused.</p>\n<p>A required module prefixed with <code>'/'</code> is an absolute path to the file. For\nexample, <code>require('/home/marco/foo.js')</code> will load the file at\n<code>/home/marco/foo.js</code>.</p>\n<p>A required module prefixed with <code>'./'</code> is relative to the file calling\n<code>require()</code>. That is, <code>circle.js</code> must be in the same directory as <code>foo.js</code> for\n<code>require('./circle')</code> to find it.</p>\n<p>Without a leading <code>'/'</code>, <code>'./'</code>, or <code>'../'</code> to indicate a file, the module must\neither be a core module or is loaded from a <code>node_modules</code> folder.</p>\n<p>If the given path does not exist, <code>require()</code> will throw a\n<a href=\"errors.html#module_not_found\"><code>MODULE_NOT_FOUND</code></a> error.</p>"
        },
        {
          "textRaw": "Folders as modules",
          "name": "Folders as modules",
          "type": "misc",
          "stability": 3,
          "stabilityText": "Legacy: Use subpath exports or subpath imports instead.",
          "desc": "<p>There are three ways in which a folder may be passed to <code>require()</code> as\nan argument.</p>\n<p>The first is to create a <a href=\"packages.html#nodejs-packagejson-field-definitions\"><code>package.json</code></a> file in the root of the folder,\nwhich specifies a <code>main</code> module. An example <a href=\"packages.html#nodejs-packagejson-field-definitions\"><code>package.json</code></a> file might\nlook like this:</p>\n<pre><code class=\"language-json\">{ \"name\" : \"some-library\",\n  \"main\" : \"./lib/some-library.js\" }\n</code></pre>\n<p>If this was in a folder at <code>./some-library</code>, then\n<code>require('./some-library')</code> would attempt to load\n<code>./some-library/lib/some-library.js</code>.</p>\n<p>If there is no <a href=\"packages.html#nodejs-packagejson-field-definitions\"><code>package.json</code></a> file present in the directory, or if the\n<a href=\"packages.html#main\"><code>\"main\"</code></a> entry is missing or cannot be resolved, then Node.js\nwill attempt to load an <code>index.js</code> or <code>index.node</code> file out of that\ndirectory. For example, if there was no <a href=\"packages.html#nodejs-packagejson-field-definitions\"><code>package.json</code></a> file in the previous\nexample, then <code>require('./some-library')</code> would attempt to load:</p>\n<ul>\n<li><code>./some-library/index.js</code></li>\n<li><code>./some-library/index.node</code></li>\n</ul>\n<p>If these attempts fail, then Node.js will report the entire module as missing\nwith the default error:</p>\n<pre><code class=\"language-console\">Error: Cannot find module 'some-library'\n</code></pre>\n<p>In all three above cases, an <code>import('./some-library')</code> call would result in a\n<a href=\"errors.html#err_unsupported_dir_import\"><code>ERR_UNSUPPORTED_DIR_IMPORT</code></a> error. Using package <a href=\"packages.html#subpath-exports\">subpath exports</a> or\n<a href=\"packages.html#subpath-imports\">subpath imports</a> can provide the same containment organization benefits as\nfolders as modules, and work for both <code>require</code> and <code>import</code>.</p>"
        },
        {
          "textRaw": "Loading from `node_modules` folders",
          "name": "Loading from `node_modules` folders",
          "type": "misc",
          "desc": "<p>If the module identifier passed to <code>require()</code> is not a\n<a href=\"#built-in-modules\">built-in</a> module, and does not begin with <code>'/'</code>, <code>'../'</code>, or\n<code>'./'</code>, then Node.js starts at the directory of the current module, and\nadds <code>/node_modules</code>, and attempts to load the module from that location.\nNode.js will not append <code>node_modules</code> to a path already ending in\n<code>node_modules</code>.</p>\n<p>If it is not found there, then it moves to the parent directory, and so\non, until the root of the file system is reached.</p>\n<p>For example, if the file at <code>'/home/ry/projects/foo.js'</code> called\n<code>require('bar.js')</code>, then Node.js would look in the following locations, in\nthis order:</p>\n<ul>\n<li><code>/home/ry/projects/node_modules/bar.js</code></li>\n<li><code>/home/ry/node_modules/bar.js</code></li>\n<li><code>/home/node_modules/bar.js</code></li>\n<li><code>/node_modules/bar.js</code></li>\n</ul>\n<p>This allows programs to localize their dependencies, so that they do not\nclash.</p>\n<p>It is possible to require specific files or sub modules distributed with a\nmodule by including a path suffix after the module name. For instance\n<code>require('example-module/path/to/file')</code> would resolve <code>path/to/file</code>\nrelative to where <code>example-module</code> is located. The suffixed path follows the\nsame module resolution semantics.</p>"
        },
        {
          "textRaw": "Loading from the global folders",
          "name": "Loading from the global folders",
          "type": "misc",
          "desc": "<p>If the <code>NODE_PATH</code> environment variable is set to a colon-delimited list\nof absolute paths, then Node.js will search those paths for modules if they\nare not found elsewhere.</p>\n<p>On Windows, <code>NODE_PATH</code> is delimited by semicolons (<code>;</code>) instead of colons.</p>\n<p><code>NODE_PATH</code> was originally created to support loading modules from\nvarying paths before the current <a href=\"#all-together\">module resolution</a> algorithm was defined.</p>\n<p><code>NODE_PATH</code> is still supported, but is less necessary now that the Node.js\necosystem has settled on a convention for locating dependent modules.\nSometimes deployments that rely on <code>NODE_PATH</code> show surprising behavior\nwhen people are unaware that <code>NODE_PATH</code> must be set. Sometimes a\nmodule's dependencies change, causing a different version (or even a\ndifferent module) to be loaded as the <code>NODE_PATH</code> is searched.</p>\n<p>Additionally, Node.js will search in the following list of GLOBAL_FOLDERS:</p>\n<ul>\n<li>1: <code>$HOME/.node_modules</code></li>\n<li>2: <code>$HOME/.node_libraries</code></li>\n<li>3: <code>$PREFIX/lib/node</code></li>\n</ul>\n<p>Where <code>$HOME</code> is the user's home directory, and <code>$PREFIX</code> is the Node.js\nconfigured <code>node_prefix</code>.</p>\n<p>These are mostly for historic reasons.</p>\n<p>It is strongly encouraged to place dependencies in the local <code>node_modules</code>\nfolder. These will be loaded faster, and more reliably.</p>"
        },
        {
          "textRaw": "The module wrapper",
          "name": "The module wrapper",
          "type": "misc",
          "desc": "<p>Before a module's code is executed, Node.js will wrap it with a function\nwrapper that looks like the following:</p>\n<pre><code class=\"language-js\">(function(exports, require, module, __filename, __dirname) {\n// Module code actually lives in here\n});\n</code></pre>\n<p>By doing this, Node.js achieves a few things:</p>\n<ul>\n<li>It keeps top-level variables (defined with <code>var</code>, <code>const</code>, or <code>let</code>) scoped to\nthe module rather than the global object.</li>\n<li>It helps to provide some global-looking variables that are actually specific\nto the module, such as:\n<ul>\n<li>The <code>module</code> and <code>exports</code> objects that the implementor can use to export\nvalues from the module.</li>\n<li>The convenience variables <code>__filename</code> and <code>__dirname</code>, containing the\nmodule's absolute filename and directory path.</li>\n</ul>\n</li>\n</ul>"
        }
      ],
      "modules": [
        {
          "textRaw": "Loading ECMAScript modules using `require()`",
          "name": "loading_ecmascript_modules_using_`require()`",
          "type": "module",
          "meta": {
            "added": [
              "v22.0.0",
              "v20.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v25.4.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/60959",
                "description": "This feature is no longer experimental."
              },
              {
                "version": [
                  "v23.5.0",
                  "v22.13.0",
                  "v20.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/56194",
                "description": "This feature no longer emits an experimental warning by default, though the warning can still be emitted by --trace-require-module."
              },
              {
                "version": [
                  "v23.0.0",
                  "v22.12.0",
                  "v20.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/55085",
                "description": "This feature is no longer behind the `--experimental-require-module` CLI flag."
              },
              {
                "version": [
                  "v23.0.0",
                  "v22.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/54563",
                "description": "Support `'module.exports'` interop export in `require(esm)`."
              }
            ]
          },
          "desc": "<p>The <code>.mjs</code> extension is reserved for <a href=\"esm.html\">ECMAScript Modules</a>.\nSee <a href=\"packages.html#determining-module-system\">Determining module system</a> section for more info\nregarding which files are parsed as ECMAScript modules.</p>\n<p><code>require()</code> only supports loading ECMAScript modules that meet the following requirements:</p>\n<ul>\n<li>The module is fully synchronous (contains no top-level <code>await</code>); and</li>\n<li>One of these conditions are met:\n<ol>\n<li>The file has a <code>.mjs</code> extension.</li>\n<li>The file has a <code>.js</code> extension, and the closest <code>package.json</code> contains <code>\"type\": \"module\"</code></li>\n<li>The file has a <code>.js</code> extension, the closest <code>package.json</code> does not contain\n<code>\"type\": \"commonjs\"</code>, and the module contains ES module syntax.</li>\n</ol>\n</li>\n</ul>\n<p>If the ES Module being loaded meets the requirements, <code>require()</code> can load it and\nreturn the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import#module_namespace_object\">module namespace object</a>. In this case it is similar to dynamic\n<code>import()</code> but is run synchronously and returns the name space object\ndirectly.</p>\n<p>With the following ES Modules:</p>\n<pre><code class=\"language-mjs\">// distance.mjs\nexport function distance(a, b) { return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2); }\n</code></pre>\n<pre><code class=\"language-mjs\">// point.mjs\nexport default class Point {\n  constructor(x, y) { this.x = x; this.y = y; }\n}\n</code></pre>\n<p>A CommonJS module can load them with <code>require()</code>:</p>\n<pre><code class=\"language-cjs\">const distance = require('./distance.mjs');\nconsole.log(distance);\n// [Module: null prototype] {\n//   distance: [Function: distance]\n// }\n\nconst point = require('./point.mjs');\nconsole.log(point);\n// [Module: null prototype] {\n//   default: [class Point],\n//   __esModule: true,\n// }\n</code></pre>\n<p>For interoperability with existing tools that convert ES Modules into CommonJS,\nwhich could then load real ES Modules through <code>require()</code>, the returned namespace\nwould contain a <code>__esModule: true</code> property if it has a <code>default</code> export so that\nconsuming code generated by tools can recognize the default exports in real\nES Modules. If the namespace already defines <code>__esModule</code>, this would not be added.\nThis property is experimental and can change in the future. It should only be used\nby tools converting ES modules into CommonJS modules, following existing ecosystem\nconventions. Code authored directly in CommonJS should avoid depending on it.</p>\n<p>The result returned by <code>require()</code> is the <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import#module_namespace_object\">module namespace object</a>, which places\nthe default export in the <code>.default</code> property, similar to the results returned by <code>import()</code>.\nTo customize what should be returned by <code>require(esm)</code> directly, the ES Module can export the\ndesired value using the string name <code>\"module.exports\"</code>.</p>\n<pre><code class=\"language-mjs\">// point.mjs\nexport default class Point {\n  constructor(x, y) { this.x = x; this.y = y; }\n}\n\n// `distance` is lost to CommonJS consumers of this module, unless it's\n// added to `Point` as a static property.\nexport function distance(a, b) { return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2); }\nexport { Point as 'module.exports' };\n</code></pre>\n<pre><code class=\"language-cjs\">const Point = require('./point.mjs');\nconsole.log(Point); // [class Point]\n\n// Named exports are lost when 'module.exports' is used\nconst { distance } = require('./point.mjs');\nconsole.log(distance); // undefined\n</code></pre>\n<p>Notice in the example above, when the <code>module.exports</code> export name is used, named exports\nwill be lost to CommonJS consumers. To allow CommonJS consumers to continue accessing\nnamed exports, the module can make sure that the default export is an object with the\nnamed exports attached to it as properties. For example with the example above,\n<code>distance</code> can be attached to the default export, the <code>Point</code> class, as a static method.</p>\n<pre><code class=\"language-mjs\">export function distance(a, b) { return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2); }\n\nexport default class Point {\n  constructor(x, y) { this.x = x; this.y = y; }\n  static distance = distance;\n}\n\nexport { Point as 'module.exports' };\n</code></pre>\n<pre><code class=\"language-cjs\">const Point = require('./point.mjs');\nconsole.log(Point); // [class Point]\n\nconst { distance } = require('./point.mjs');\nconsole.log(distance); // [Function: distance]\n</code></pre>\n<p>If the module being <code>require()</code>'d contains top-level <code>await</code>, or the module\ngraph it <code>import</code>s contains top-level <code>await</code>,\n<a href=\"errors.html#err_require_async_module\"><code>ERR_REQUIRE_ASYNC_MODULE</code></a> will be thrown. In this case, users should\nload the asynchronous module using <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import\"><code>import()</code></a>.</p>\n<p>If <code>--experimental-print-required-tla</code> is enabled, instead of throwing\n<code>ERR_REQUIRE_ASYNC_MODULE</code> before evaluation, Node.js will evaluate the\nmodule, try to locate the top-level awaits, and print their location to\nhelp users fix them.</p>\n<p>If support for loading ES modules using <code>require()</code> results in unexpected\nbreakage, it can be disabled using <code>--no-require-module</code>.\nTo print where this feature is used, use <a href=\"cli.html#--trace-require-modulemode\"><code>--trace-require-module</code></a>.</p>\n<p>This feature can be detected by checking if\n<a href=\"process.html#processfeaturesrequire_module\"><code>process.features.require_module</code></a> is <code>true</code>.</p>",
          "displayName": "Loading ECMAScript modules using `require()`"
        },
        {
          "textRaw": "The module scope",
          "name": "the_module_scope",
          "type": "module",
          "modules": [
            {
              "textRaw": "`__dirname`",
              "name": "`__dirname`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.1.27"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p>The directory name of the current module. This is the same as the\n<a href=\"path.html#pathdirnamepath\"><code>path.dirname()</code></a> of the <a href=\"#__filename\"><code>__filename</code></a>.</p>\n<p>Example: running <code>node example.js</code> from <code>/Users/mjr</code></p>\n<pre><code class=\"language-js\">console.log(__dirname);\n// Prints: /Users/mjr\nconsole.log(path.dirname(__filename));\n// Prints: /Users/mjr\n</code></pre>",
              "displayName": "`__dirname`"
            },
            {
              "textRaw": "`__filename`",
              "name": "`__filename`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p>The file name of the current module. This is the current module file's absolute\npath with symlinks resolved.</p>\n<p>For a main program this is not necessarily the same as the file name used in the\ncommand line.</p>\n<p>See <a href=\"#__dirname\"><code>__dirname</code></a> for the directory name of the current module.</p>\n<p>Examples:</p>\n<p>Running <code>node example.js</code> from <code>/Users/mjr</code></p>\n<pre><code class=\"language-js\">console.log(__filename);\n// Prints: /Users/mjr/example.js\nconsole.log(__dirname);\n// Prints: /Users/mjr\n</code></pre>\n<p>Given two modules: <code>a</code> and <code>b</code>, where <code>b</code> is a dependency of\n<code>a</code> and there is a directory structure of:</p>\n<ul>\n<li><code>/Users/mjr/app/a.js</code></li>\n<li><code>/Users/mjr/app/node_modules/b/b.js</code></li>\n</ul>\n<p>References to <code>__filename</code> within <code>b.js</code> will return\n<code>/Users/mjr/app/node_modules/b/b.js</code> while references to <code>__filename</code> within\n<code>a.js</code> will return <code>/Users/mjr/app/a.js</code>.</p>",
              "displayName": "`__filename`"
            },
            {
              "textRaw": "`exports`",
              "name": "`exports`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.1.12"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>A reference to the <code>module.exports</code> that is shorter to type.\nSee the section about the <a href=\"#exports-shortcut\">exports shortcut</a> for details on when to use\n<code>exports</code> and when to use <code>module.exports</code>.</p>",
              "displayName": "`exports`"
            },
            {
              "textRaw": "`module`",
              "name": "`module`",
              "type": "module",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Type: <a href=\"modules.html#the-module-object\"><code>&#x3C;module></code></a></li>\n</ul>\n<p>A reference to the current module, see the section about the\n<a href=\"#the-module-object\"><code>module</code> object</a>. In particular, <code>module.exports</code> is used for defining what\na module exports and makes available through <code>require()</code>.</p>",
              "displayName": "`module`"
            }
          ],
          "methods": [
            {
              "textRaw": "`require(id)`",
              "name": "require",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.13"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`id` {string} module name or path",
                      "name": "id",
                      "type": "string",
                      "desc": "module name or path"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {any} exported module content",
                    "name": "return",
                    "type": "any",
                    "desc": "exported module content"
                  }
                }
              ],
              "desc": "<p>Used to import modules, <code>JSON</code>, and local files. Modules can be imported\nfrom <code>node_modules</code>. Local modules and JSON files can be imported using\na relative path (e.g. <code>./</code>, <code>./foo</code>, <code>./bar/baz</code>, <code>../foo</code>) that will be\nresolved against the directory named by <a href=\"#__dirname\"><code>__dirname</code></a> (if defined) or\nthe current working directory. The relative paths of POSIX style are resolved\nin an OS independent fashion, meaning that the examples above will work on\nWindows in the same way they would on Unix systems.</p>\n<pre><code class=\"language-js\">// Importing a local module with a path relative to the `__dirname` or current\n// working directory. (On Windows, this would resolve to .\\path\\myLocalModule.)\nconst myLocalModule = require('./path/myLocalModule');\n\n// Importing a JSON file:\nconst jsonData = require('./path/filename.json');\n\n// Importing a module from node_modules or Node.js built-in module:\nconst crypto = require('node:crypto');\n</code></pre>",
              "properties": [
                {
                  "textRaw": "Type: {Object}",
                  "name": "cache",
                  "type": "Object",
                  "meta": {
                    "added": [
                      "v0.3.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Modules are cached in this object when they are required. By deleting a key\nvalue from this object, the next <code>require</code> will reload the module.\nThis does not apply to <a href=\"addons.html\">native addons</a>, for which reloading will result in an\nerror.</p>\n<p>Adding or replacing entries is also possible. This cache is checked before\nbuilt-in modules and if a name matching a built-in module is added to the cache,\nonly <code>node:</code>-prefixed require calls are going to receive the built-in module.\nUse with care!</p>\n<pre><code class=\"language-js\">const assert = require('node:assert');\nconst realFs = require('node:fs');\n\nconst fakeFs = {};\nrequire.cache.fs = { exports: fakeFs };\n\nassert.strictEqual(require('fs'), fakeFs);\nassert.strictEqual(require('node:fs'), realFs);\n</code></pre>"
                },
                {
                  "textRaw": "Type: {Object}",
                  "name": "extensions",
                  "type": "Object",
                  "meta": {
                    "added": [
                      "v0.3.0"
                    ],
                    "changes": [],
                    "deprecated": [
                      "v0.10.6"
                    ]
                  },
                  "stability": 0,
                  "stabilityText": "Deprecated",
                  "desc": "<p>Instruct <code>require</code> on how to handle certain file extensions.</p>\n<p>Process files with the extension <code>.sjs</code> as <code>.js</code>:</p>\n<pre><code class=\"language-js\">require.extensions['.sjs'] = require.extensions['.js'];\n</code></pre>\n<p><strong>Deprecated.</strong> In the past, this list has been used to load non-JavaScript\nmodules into Node.js by compiling them on-demand. However, in practice, there\nare much better ways to do this, such as loading modules via some other Node.js\nprogram, or compiling them to JavaScript ahead of time.</p>\n<p>Avoid using <code>require.extensions</code>. Use could cause subtle bugs and resolving the\nextensions gets slower with each registered extension.</p>"
                },
                {
                  "textRaw": "Type: {module|undefined}",
                  "name": "main",
                  "type": "module|undefined",
                  "meta": {
                    "added": [
                      "v0.1.17"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>Module</code> object representing the entry script loaded when the Node.js\nprocess launched, or <code>undefined</code> if the entry point of the program is not a\nCommonJS module.\nSee <a href=\"#accessing-the-main-module\">\"Accessing the main module\"</a>.</p>\n<p>In <code>entry.js</code> script:</p>\n<pre><code class=\"language-js\">console.log(require.main);\n</code></pre>\n<pre><code class=\"language-bash\">node entry.js\n</code></pre>\n<pre><code class=\"language-js\">Module {\n  id: '.',\n  path: '/absolute/path/to',\n  exports: {},\n  filename: '/absolute/path/to/entry.js',\n  loaded: false,\n  children: [],\n  paths:\n   [ '/absolute/path/to/node_modules',\n     '/absolute/path/node_modules',\n     '/absolute/node_modules',\n     '/node_modules' ] }\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`require.resolve(request[, options])`",
                  "name": "resolve",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.3.0"
                    ],
                    "changes": [
                      {
                        "version": "v8.9.0",
                        "pr-url": "https://github.com/nodejs/node/pull/16397",
                        "description": "The `paths` option is now supported."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`request` {string} The module path to resolve.",
                          "name": "request",
                          "type": "string",
                          "desc": "The module path to resolve."
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`paths` {string[]} Paths to resolve module location from. If present, these paths are used instead of the default resolution paths, with the exception of GLOBAL_FOLDERS like `$HOME/.node_modules`, which are always included. Each of these paths is used as a starting point for the module resolution algorithm, meaning that the `node_modules` hierarchy is checked from this location.",
                              "name": "paths",
                              "type": "string[]",
                              "desc": "Paths to resolve module location from. If present, these paths are used instead of the default resolution paths, with the exception of GLOBAL_FOLDERS like `$HOME/.node_modules`, which are always included. Each of these paths is used as a starting point for the module resolution algorithm, meaning that the `node_modules` hierarchy is checked from this location."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      }
                    }
                  ],
                  "desc": "<p>Use the internal <code>require()</code> machinery to look up the location of a module,\nbut rather than loading the module, just return the resolved filename.</p>\n<p>If the module can not be found, a <code>MODULE_NOT_FOUND</code> error is thrown.</p>",
                  "methods": [
                    {
                      "textRaw": "`require.resolve.paths(request)`",
                      "name": "paths",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v8.9.0"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`request` {string} The module path whose lookup paths are being retrieved.",
                              "name": "request",
                              "type": "string",
                              "desc": "The module path whose lookup paths are being retrieved."
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {string[]|null}",
                            "name": "return",
                            "type": "string[]|null"
                          }
                        }
                      ],
                      "desc": "<p>Returns an array containing the paths searched during resolution of <code>request</code> or\n<code>null</code> if the <code>request</code> string references a core module, for example <code>http</code> or\n<code>fs</code>.</p>"
                    }
                  ]
                }
              ]
            }
          ],
          "displayName": "The module scope"
        },
        {
          "textRaw": "The `module` object",
          "name": "the_`module`_object",
          "type": "module",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>In each module, the <code>module</code> free variable is a reference to the object\nrepresenting the current module. For convenience, <code>module.exports</code> is\nalso accessible via the <code>exports</code> module-global. <code>module</code> is not actually\na global but rather local to each module.</p>",
          "properties": [
            {
              "textRaw": "Type: {module[]}",
              "name": "children",
              "type": "module[]",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>The module objects required for the first time by this one.</p>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "exports",
              "type": "Object",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>The <code>module.exports</code> object is created by the <code>Module</code> system. Sometimes this is\nnot acceptable; many want their module to be an instance of some class. To do\nthis, assign the desired export object to <code>module.exports</code>. Assigning\nthe desired object to <code>exports</code> will simply rebind the local <code>exports</code> variable,\nwhich is probably not what is desired.</p>\n<p>For example, suppose we were making a module called <code>a.js</code>:</p>\n<pre><code class=\"language-js\">const EventEmitter = require('node:events');\n\nmodule.exports = new EventEmitter();\n\n// Do some work, and after some time emit\n// the 'ready' event from the module itself.\nsetTimeout(() => {\n  module.exports.emit('ready');\n}, 1000);\n</code></pre>\n<p>Then in another file we could do:</p>\n<pre><code class=\"language-js\">const a = require('./a');\na.on('ready', () => {\n  console.log('module \"a\" is ready');\n});\n</code></pre>\n<p>Assignment to <code>module.exports</code> must be done immediately. It cannot be\ndone in any callbacks. This does not work:</p>\n<p><code>x.js</code>:</p>\n<pre><code class=\"language-js\">setTimeout(() => {\n  module.exports = { a: 'hello' };\n}, 0);\n</code></pre>\n<p><code>y.js</code>:</p>\n<pre><code class=\"language-js\">const x = require('./x');\nconsole.log(x.a);\n</code></pre>",
              "modules": [
                {
                  "textRaw": "`exports` shortcut",
                  "name": "`exports`_shortcut",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v0.1.16"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>exports</code> variable is available within a module's file-level scope, and is\nassigned the value of <code>module.exports</code> before the module is evaluated.</p>\n<p>It allows a shortcut, so that <code>module.exports.f = ...</code> can be written more\nsuccinctly as <code>exports.f = ...</code>. However, be aware that like any variable, if a\nnew value is assigned to <code>exports</code>, it is no longer bound to <code>module.exports</code>:</p>\n<pre><code class=\"language-js\">module.exports.hello = true; // Exported from require of module\nexports = { hello: false };  // Not exported, only available in the module\n</code></pre>\n<p>When the <code>module.exports</code> property is being completely replaced by a new\nobject, it is common to also reassign <code>exports</code>:</p>\n<pre><code class=\"language-js\">module.exports = exports = function Constructor() {\n  // ... etc.\n};\n</code></pre>\n<p>To illustrate the behavior, imagine this hypothetical implementation of\n<code>require()</code>, which is quite similar to what is actually done by <code>require()</code>:</p>\n<pre><code class=\"language-js\">function require(/* ... */) {\n  const module = { exports: {} };\n  ((module, exports) => {\n    // Module code here. In this example, define a function.\n    function someFunc() {}\n    exports = someFunc;\n    // At this point, exports is no longer a shortcut to module.exports, and\n    // this module will still export an empty default object.\n    module.exports = someFunc;\n    // At this point, the module will now export someFunc, instead of the\n    // default object.\n  })(module, module.exports);\n  return module.exports;\n}\n</code></pre>",
                  "displayName": "`exports` shortcut"
                }
              ]
            },
            {
              "textRaw": "Type: {string}",
              "name": "filename",
              "type": "string",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>The fully resolved filename of the module.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "id",
              "type": "string",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>The identifier for the module. Typically this is the fully resolved\nfilename.</p>"
            },
            {
              "textRaw": "Type: {boolean} `true` if the module is running during the Node.js preload phase.",
              "name": "isPreloading",
              "type": "boolean",
              "meta": {
                "added": [
                  "v15.4.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "desc": "`true` if the module is running during the Node.js preload phase."
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "loaded",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": []
              },
              "desc": "<p>Whether or not the module is done loading, or is in the process of\nloading.</p>"
            },
            {
              "textRaw": "Type: {module|null|undefined}",
              "name": "parent",
              "type": "module|null|undefined",
              "meta": {
                "added": [
                  "v0.1.16"
                ],
                "changes": [],
                "deprecated": [
                  "v14.6.0",
                  "v12.19.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Please use `require.main` and `module.children` instead.",
              "desc": "<p>The module that first required this one, or <code>null</code> if the current module is the\nentry point of the current process, or <code>undefined</code> if the module was loaded by\nsomething that is not a CommonJS module (E.G.: REPL or <code>import</code>).</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "path",
              "type": "string",
              "meta": {
                "added": [
                  "v11.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The directory name of the module. This is usually the same as the\n<a href=\"path.html#pathdirnamepath\"><code>path.dirname()</code></a> of the <a href=\"#moduleid\"><code>module.id</code></a>.</p>"
            },
            {
              "textRaw": "Type: {string[]}",
              "name": "paths",
              "type": "string[]",
              "meta": {
                "added": [
                  "v0.4.0"
                ],
                "changes": []
              },
              "desc": "<p>The search paths for the module.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`module.require(id)`",
              "name": "require",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`id` {string}",
                      "name": "id",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {any} exported module content",
                    "name": "return",
                    "type": "any",
                    "desc": "exported module content"
                  }
                }
              ],
              "desc": "<p>The <code>module.require()</code> method provides a way to load a module as if\n<code>require()</code> was called from the original module.</p>\n<p>In order to do this, it is necessary to get a reference to the <code>module</code> object.\nSince <code>require()</code> returns the <code>module.exports</code>, and the <code>module</code> is typically\n<em>only</em> available within a specific module's code, it must be explicitly exported\nin order to be used.</p>"
            }
          ],
          "displayName": "The `module` object"
        },
        {
          "textRaw": "The `Module` object",
          "name": "the_`module`_object",
          "type": "module",
          "desc": "<p>This section was moved to\n<a href=\"module.html#the-module-object\">Modules: <code>module</code> core module</a>.</p>\n<ul>\n<li><a id=\"modules_module_builtinmodules\" href=\"module.html#modulebuiltinmodules\"><code>module.builtinModules</code></a></li>\n<li><a id=\"modules_module_createrequire_filename\" href=\"module.html#modulecreaterequirefilename\"><code>module.createRequire(filename)</code></a></li>\n<li><a id=\"modules_module_syncbuiltinesmexports\" href=\"module.html#modulesyncbuiltinesmexports\"><code>module.syncBuiltinESMExports()</code></a></li>\n</ul>",
          "displayName": "The `Module` object"
        },
        {
          "textRaw": "Source map v3 support",
          "name": "source_map_v3_support",
          "type": "module",
          "desc": "<p>This section was moved to\n<a href=\"module.html#source-map-support\">Modules: <code>module</code> core module</a>.</p>\n<ul>\n<li><a id=\"modules_module_findsourcemap_path_error\" href=\"module.html#modulefindsourcemappath\"><code>module.findSourceMap(path)</code></a></li>\n<li><a id=\"modules_class_module_sourcemap\" href=\"module.html#class-modulesourcemap\">Class: <code>module.SourceMap</code></a>\n<ul>\n<li><a id=\"modules_new_sourcemap_payload\" href=\"module.html#new-sourcemappayload--linelengths-\"><code>new SourceMap(payload)</code></a></li>\n<li><a id=\"modules_sourcemap_payload\" href=\"module.html#sourcemappayload\"><code>sourceMap.payload</code></a></li>\n<li><a id=\"modules_sourcemap_findentry_linenumber_columnnumber\" href=\"module.html#sourcemapfindentrylineoffset-columnoffset\"><code>sourceMap.findEntry(lineNumber, columnNumber)</code></a></li>\n</ul>\n</li>\n</ul>",
          "displayName": "Source map v3 support"
        }
      ],
      "meta": {
        "changes": [
          {
            "version": [
              "v16.0.0",
              "v14.18.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/37246",
            "description": "Added `node:` import support to `require(...)`."
          }
        ]
      },
      "displayName": "Modules: CommonJS modules",
      "source": "doc/api/modules.md"
    },
    {
      "textRaw": "Modules: `node:module` API",
      "name": "modules:_`node:module`_api",
      "introduced_in": "v12.20.0",
      "type": "module",
      "meta": {
        "added": [
          "v0.3.7"
        ],
        "changes": []
      },
      "modules": [
        {
          "textRaw": "The `Module` object",
          "name": "the_`module`_object",
          "type": "module",
          "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>Provides general utility methods when interacting with instances of\n<code>Module</code>, the <a href=\"#the-module-object\"><code>module</code></a> variable often seen in <a href=\"modules.html\">CommonJS</a> modules. Accessed\nvia <code>import 'node:module'</code> or <code>require('node:module')</code>.</p>",
          "properties": [
            {
              "textRaw": "Type: {string[]}",
              "name": "builtinModules",
              "type": "string[]",
              "meta": {
                "added": [
                  "v9.3.0",
                  "v8.10.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": "v23.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/56185",
                    "description": "The list now also contains prefix-only modules."
                  }
                ]
              },
              "desc": "<p>A list of the names of all modules provided by Node.js. Can be used to verify\nif a module is maintained by a third party or not.</p>\n<p><code>module</code> in this context isn't the same object that's provided\nby the <a href=\"modules.html#the-module-wrapper\">module wrapper</a>. To access it, require the <code>Module</code> module:</p>\n<pre><code class=\"language-mjs\">// module.mjs\n// In an ECMAScript module\nimport { builtinModules as builtin } from 'node:module';\n</code></pre>\n<pre><code class=\"language-cjs\">// module.cjs\n// In a CommonJS module\nconst builtin = require('node:module').builtinModules;\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`module.createRequire(filename)`",
              "name": "createRequire",
              "type": "method",
              "meta": {
                "added": [
                  "v12.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string|URL} Filename to be used to construct the require function. Must be a file URL object, file URL string, or absolute path string.",
                      "name": "filename",
                      "type": "string|URL",
                      "desc": "Filename to be used to construct the require function. Must be a file URL object, file URL string, or absolute path string."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {require} Require function",
                    "name": "return",
                    "type": "require",
                    "desc": "Require function"
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { createRequire } from 'node:module';\nconst require = createRequire(import.meta.url);\n\n// sibling-module.js is a CommonJS module.\nconst siblingModule = require('./sibling-module');\n</code></pre>"
            },
            {
              "textRaw": "`module.findPackageJSON(specifier[, base])`",
              "name": "findPackageJSON",
              "type": "method",
              "meta": {
                "added": [
                  "v23.2.0",
                  "v22.14.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`specifier` {string|URL} The specifier for the module whose `package.json` to retrieve. When passing a _bare specifier_, the `package.json` at the root of the package is returned. When passing a _relative specifier_ or an _absolute specifier_, the closest parent `package.json` is returned.",
                      "name": "specifier",
                      "type": "string|URL",
                      "desc": "The specifier for the module whose `package.json` to retrieve. When passing a _bare specifier_, the `package.json` at the root of the package is returned. When passing a _relative specifier_ or an _absolute specifier_, the closest parent `package.json` is returned."
                    },
                    {
                      "textRaw": "`base` {string|URL} The absolute location (`file:` URL string or FS path) of the containing module. For CJS, use `__filename` (not `__dirname`!); for ESM, use `import.meta.url`. You do not need to pass it if `specifier` is an `absolute specifier`.",
                      "name": "base",
                      "type": "string|URL",
                      "desc": "The absolute location (`file:` URL string or FS path) of the containing module. For CJS, use `__filename` (not `__dirname`!); for ESM, use `import.meta.url`. You do not need to pass it if `specifier` is an `absolute specifier`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|undefined} A path if the `package.json` is found. When `specifier` is a package, the package's root `package.json`; when a relative or unresolved, the closest `package.json` to the `specifier`.",
                    "name": "return",
                    "type": "string|undefined",
                    "desc": "A path if the `package.json` is found. When `specifier` is a package, the package's root `package.json`; when a relative or unresolved, the closest `package.json` to the `specifier`."
                  }
                }
              ],
              "desc": "<blockquote>\n<p><strong>Caveat</strong>: Do not use this to try to determine module format. There are many things affecting\nthat determination; the <code>type</code> field of package.json is the <em>least</em> definitive (ex file extension\nsupersedes it, and a loader hook supersedes that).</p>\n</blockquote>\n<blockquote>\n<p><strong>Caveat</strong>: This currently leverages only the built-in default resolver; if\n<a href=\"#synchronous-resolvespecifier-context-nextresolve\"><code>resolve</code> customization hooks</a> are registered, they will not affect the resolution.\nThis may change in the future.</p>\n</blockquote>\n<pre><code class=\"language-text\">/path/to/project\n  ├ packages/\n    ├ bar/\n      ├ bar.js\n      └ package.json // name = '@foo/bar'\n    └ qux/\n      ├ node_modules/\n        └ some-package/\n          └ package.json // name = 'some-package'\n      ├ qux.js\n      └ package.json // name = '@foo/qux'\n  ├ main.js\n  └ package.json // name = '@foo'\n</code></pre>\n<pre><code class=\"language-mjs\">// /path/to/project/packages/bar/bar.js\nimport { findPackageJSON } from 'node:module';\n\nfindPackageJSON('..', import.meta.url);\n// '/path/to/project/package.json'\n// Same result when passing an absolute specifier instead:\nfindPackageJSON(new URL('../', import.meta.url));\nfindPackageJSON(import.meta.resolve('../'));\n\nfindPackageJSON('some-package', import.meta.url);\n// '/path/to/project/packages/bar/node_modules/some-package/package.json'\n// When passing an absolute specifier, you might get a different result if the\n// resolved module is inside a subfolder that has nested `package.json`.\nfindPackageJSON(import.meta.resolve('some-package'));\n// '/path/to/project/packages/bar/node_modules/some-package/some-subfolder/package.json'\n\nfindPackageJSON('@foo/qux', import.meta.url);\n// '/path/to/project/packages/qux/package.json'\n</code></pre>\n<pre><code class=\"language-cjs\">// /path/to/project/packages/bar/bar.js\nconst { findPackageJSON } = require('node:module');\nconst { pathToFileURL } = require('node:url');\nconst path = require('node:path');\n\nfindPackageJSON('..', __filename);\n// '/path/to/project/package.json'\n// Same result when passing an absolute specifier instead:\nfindPackageJSON(pathToFileURL(path.join(__dirname, '..')));\n\nfindPackageJSON('some-package', __filename);\n// '/path/to/project/packages/bar/node_modules/some-package/package.json'\n// When passing an absolute specifier, you might get a different result if the\n// resolved module is inside a subfolder that has nested `package.json`.\nfindPackageJSON(pathToFileURL(require.resolve('some-package')));\n// '/path/to/project/packages/bar/node_modules/some-package/some-subfolder/package.json'\n\nfindPackageJSON('@foo/qux', __filename);\n// '/path/to/project/packages/qux/package.json'\n</code></pre>"
            },
            {
              "textRaw": "`module.isBuiltin(moduleName)`",
              "name": "isBuiltin",
              "type": "method",
              "meta": {
                "added": [
                  "v18.6.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`moduleName` {string} name of the module",
                      "name": "moduleName",
                      "type": "string",
                      "desc": "name of the module"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} returns true if the module is builtin else returns false",
                    "name": "return",
                    "type": "boolean",
                    "desc": "returns true if the module is builtin else returns false"
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { isBuiltin } from 'node:module';\nisBuiltin('node:fs'); // true\nisBuiltin('fs'); // true\nisBuiltin('wss'); // false\n</code></pre>"
            },
            {
              "textRaw": "`module.register(specifier[, parentURL][, options])`",
              "name": "register",
              "type": "method",
              "meta": {
                "added": [
                  "v20.6.0",
                  "v18.19.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62401",
                    "description": "Runtime deprecation (DEP0205)."
                  },
                  {
                    "version": [
                      "v23.6.1",
                      "v22.13.1",
                      "v20.18.2"
                    ],
                    "pr-url": "https://github.com/nodejs-private/node-private/pull/629",
                    "description": "Using this feature with the permission model enabled requires passing `--allow-worker`."
                  },
                  {
                    "version": [
                      "v20.8.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/49655",
                    "description": "Add support for WHATWG URL instances."
                  }
                ],
                "deprecated": [
                  "v25.9.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `module.registerHooks()` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`specifier` {string|URL} Customization hooks to be registered; this should be the same string that would be passed to `import()`, except that if it is relative, it is resolved relative to `parentURL`.",
                      "name": "specifier",
                      "type": "string|URL",
                      "desc": "Customization hooks to be registered; this should be the same string that would be passed to `import()`, except that if it is relative, it is resolved relative to `parentURL`."
                    },
                    {
                      "textRaw": "`parentURL` {string|URL} If you want to resolve `specifier` relative to a base URL, such as `import.meta.url`, you can pass that URL here. **Default:** `'data:'`",
                      "name": "parentURL",
                      "type": "string|URL",
                      "default": "`'data:'`",
                      "desc": "If you want to resolve `specifier` relative to a base URL, such as `import.meta.url`, you can pass that URL here.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`parentURL` {string|URL} If you want to resolve `specifier` relative to a base URL, such as `import.meta.url`, you can pass that URL here. This property is ignored if the `parentURL` is supplied as the second argument. **Default:** `'data:'`",
                          "name": "parentURL",
                          "type": "string|URL",
                          "default": "`'data:'`",
                          "desc": "If you want to resolve `specifier` relative to a base URL, such as `import.meta.url`, you can pass that URL here. This property is ignored if the `parentURL` is supplied as the second argument."
                        },
                        {
                          "textRaw": "`data` {any} Any arbitrary, cloneable JavaScript value to pass into the `initialize` hook.",
                          "name": "data",
                          "type": "any",
                          "desc": "Any arbitrary, cloneable JavaScript value to pass into the `initialize` hook."
                        },
                        {
                          "textRaw": "`transferList` {Object[]} transferable objects to be passed into the `initialize` hook.",
                          "name": "transferList",
                          "type": "Object[]",
                          "desc": "transferable objects to be passed into the `initialize` hook."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Register a module that exports <a href=\"#customization-hooks\">hooks</a> that customize Node.js module\nresolution and loading behavior. See <a href=\"#customization-hooks\">Customization hooks</a>.</p>\n<p>This feature requires <code>--allow-worker</code> if used with the <a href=\"permissions.html#permission-model\">Permission Model</a>.</p>"
            },
            {
              "textRaw": "`module.registerHooks(options)`",
              "name": "registerHooks",
              "type": "method",
              "meta": {
                "added": [
                  "v23.5.0",
                  "v22.15.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.4.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60960",
                    "description": "Synchronous and in-thread hooks are now release candidate."
                  }
                ]
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`load` {Function|undefined} See load hook. **Default:** `undefined`.",
                          "name": "load",
                          "type": "Function|undefined",
                          "default": "`undefined`",
                          "desc": "See load hook."
                        },
                        {
                          "textRaw": "`resolve` {Function|undefined} See resolve hook. **Default:** `undefined`.",
                          "name": "resolve",
                          "type": "Function|undefined",
                          "default": "`undefined`",
                          "desc": "See resolve hook."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} An object with the following property:`deregister()` {Function} Remove the registered hooks so that they are no longer called. Hooks are otherwise retained for the lifetime of the running process.",
                    "name": "return",
                    "type": "Object",
                    "desc": "An object with the following property:`deregister()` {Function} Remove the registered hooks so that they are no longer called. Hooks are otherwise retained for the lifetime of the running process."
                  }
                }
              ],
              "desc": "<p>Register <a href=\"#customization-hooks\">hooks</a> that customize Node.js module resolution and loading behavior.\nSee <a href=\"#customization-hooks\">Customization hooks</a>. The returned object can be used to\n<a href=\"#deregistration-of-synchronous-customization-hooks\">deregister the hooks</a>.</p>"
            },
            {
              "textRaw": "`module.stripTypeScriptTypes(code[, options])`",
              "name": "stripTypeScriptTypes",
              "type": "method",
              "meta": {
                "added": [
                  "v23.2.0",
                  "v22.13.0"
                ],
                "changes": [
                  {
                    "version": "v26.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61803",
                    "description": "Removed `transform` and `sourceMap` options."
                  }
                ]
              },
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`code` {string} The code to strip type annotations from.",
                      "name": "code",
                      "type": "string",
                      "desc": "The code to strip type annotations from."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`mode` {string} **Default:** `'strip'`. Possible values are:",
                          "name": "mode",
                          "type": "string",
                          "default": "`'strip'`. Possible values are:",
                          "options": [
                            {
                              "textRaw": "`'strip'` Only strip type annotations without performing the transformation of TypeScript features.",
                              "desc": "`'strip'` Only strip type annotations without performing the transformation of TypeScript features."
                            }
                          ]
                        },
                        {
                          "textRaw": "`sourceUrl` {string} Specifies the source url used in the source map.",
                          "name": "sourceUrl",
                          "type": "string",
                          "desc": "Specifies the source url used in the source map."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string} The code with type annotations stripped.",
                    "name": "return",
                    "type": "string",
                    "desc": "The code with type annotations stripped."
                  }
                }
              ],
              "desc": "<p><code>module.stripTypeScriptTypes()</code> removes type annotations from TypeScript code. It\ncan be used to strip type annotations from TypeScript code before running it\nwith <code>vm.runInContext()</code> or <code>vm.compileFunction()</code>.</p>\n<p>By default, it will throw an error if the code contains TypeScript features\nthat require transformation, such as <code>enum</code>s. See <a href=\"typescript.html#type-stripping\">type-stripping</a> for more information.</p>\n<p><em>WARNING</em>: The output of this function should not be considered stable across Node.js versions,\ndue to changes in the TypeScript parser.</p>\n<pre><code class=\"language-mjs\">import { stripTypeScriptTypes } from 'node:module';\nconst code = 'const a: number = 1;';\nconst strippedCode = stripTypeScriptTypes(code);\nconsole.log(strippedCode);\n// Prints: const a         = 1;\n</code></pre>\n<pre><code class=\"language-cjs\">const { stripTypeScriptTypes } = require('node:module');\nconst code = 'const a: number = 1;';\nconst strippedCode = stripTypeScriptTypes(code);\nconsole.log(strippedCode);\n// Prints: const a         = 1;\n</code></pre>\n<p>If <code>sourceUrl</code> is provided, it will be used appended as a comment at the end of the output:</p>\n<pre><code class=\"language-mjs\">import { stripTypeScriptTypes } from 'node:module';\nconst code = 'const a: number = 1;';\nconst strippedCode = stripTypeScriptTypes(code, { mode: 'strip', sourceUrl: 'source.ts' });\nconsole.log(strippedCode);\n// Prints: const a         = 1\\n\\n//# sourceURL=source.ts;\n</code></pre>\n<pre><code class=\"language-cjs\">const { stripTypeScriptTypes } = require('node:module');\nconst code = 'const a: number = 1;';\nconst strippedCode = stripTypeScriptTypes(code, { mode: 'strip', sourceUrl: 'source.ts' });\nconsole.log(strippedCode);\n// Prints: const a         = 1\\n\\n//# sourceURL=source.ts;\n</code></pre>"
            },
            {
              "textRaw": "`module.syncBuiltinESMExports()`",
              "name": "syncBuiltinESMExports",
              "type": "method",
              "meta": {
                "added": [
                  "v12.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>module.syncBuiltinESMExports()</code> method updates all the live bindings for\nbuiltin <a href=\"esm.html\">ES Modules</a> to match the properties of the <a href=\"modules.html\">CommonJS</a> exports. It\ndoes not add or remove exported names from the <a href=\"esm.html\">ES Modules</a>.</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nconst assert = require('node:assert');\nconst { syncBuiltinESMExports } = require('node:module');\n\nfs.readFile = newAPI;\n\ndelete fs.readFileSync;\n\nfunction newAPI() {\n  // ...\n}\n\nfs.newAPI = newAPI;\n\nsyncBuiltinESMExports();\n\nimport('node:fs').then((esmFS) => {\n  // It syncs the existing readFile property with the new value\n  assert.strictEqual(esmFS.readFile, newAPI);\n  // readFileSync has been deleted from the required fs\n  assert.strictEqual('readFileSync' in fs, false);\n  // syncBuiltinESMExports() does not remove readFileSync from esmFS\n  assert.strictEqual('readFileSync' in esmFS, true);\n  // syncBuiltinESMExports() does not add names\n  assert.strictEqual(esmFS.newAPI, undefined);\n});\n</code></pre>"
            }
          ],
          "displayName": "The `Module` object"
        },
        {
          "textRaw": "Module compile cache",
          "name": "module_compile_cache",
          "type": "module",
          "meta": {
            "added": [
              "v22.1.0"
            ],
            "changes": [
              {
                "version": "v22.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/54501",
                "description": "add initial JavaScript APIs for runtime access."
              }
            ]
          },
          "desc": "<p>The module compile cache can be enabled either using the <a href=\"#moduleenablecompilecacheoptions\"><code>module.enableCompileCache()</code></a>\nmethod or the <a href=\"cli.html#node_compile_cachedir\"><code>NODE_COMPILE_CACHE=dir</code></a> environment variable. After it is enabled,\nwhenever Node.js compiles a CommonJS, an ECMAScript Module, or a TypeScript module, it will\nuse on-disk <a href=\"https://v8.dev/blog/code-caching-for-devs\">V8 code cache</a> persisted in the specified directory to speed up the compilation.\nThis may slow down the first load of a module graph, but subsequent loads of the same module\ngraph may get a significant speedup if the contents of the modules do not change.</p>\n<p>To clean up the generated compile cache on disk, simply remove the cache directory. The cache\ndirectory will be recreated the next time the same directory is used for compile cache\nstorage. To avoid filling up the disk with stale cache, it is recommended to use a directory\nunder the <a href=\"os.html#ostmpdir\"><code>os.tmpdir()</code></a>. If the compile cache is enabled by a call to\n<a href=\"#moduleenablecompilecacheoptions\"><code>module.enableCompileCache()</code></a> without specifying the <code>directory</code>, Node.js will use\nthe <a href=\"cli.html#node_compile_cachedir\"><code>NODE_COMPILE_CACHE=dir</code></a> environment variable if it's set, or defaults\nto <code>path.join(os.tmpdir(), 'node-compile-cache')</code> otherwise. To locate the compile cache\ndirectory used by a running Node.js instance, use <a href=\"#modulegetcompilecachedir\"><code>module.getCompileCacheDir()</code></a>.</p>\n<p>The enabled module compile cache can be disabled by the <a href=\"cli.html#node_disable_compile_cache1\"><code>NODE_DISABLE_COMPILE_CACHE=1</code></a>\nenvironment variable. This can be useful when the compile cache leads to unexpected or\nundesired behaviors (e.g. less precise test coverage).</p>\n<p>At the moment, when the compile cache is enabled and a module is loaded afresh, the\ncode cache is generated from the compiled code immediately, but will only be written\nto disk when the Node.js instance is about to exit. This is subject to change. The\n<a href=\"#moduleflushcompilecache\"><code>module.flushCompileCache()</code></a> method can be used to ensure the accumulated code cache\nis flushed to disk in case the application wants to spawn other Node.js instances\nand let them share the cache long before the parent exits.</p>\n<p>The compile cache layout on disk is an implementation detail and should not be\nrelied upon. The compile cache generated is typically only reusable in the same\nversion of Node.js, and should be not assumed to be compatible across different\nversions of Node.js.</p>",
          "modules": [
            {
              "textRaw": "Portability of the compile cache",
              "name": "portability_of_the_compile_cache",
              "type": "module",
              "desc": "<p>By default, caches are invalidated when the absolute paths of the modules being\ncached are changed. To keep the cache working after moving the\nproject directory, enable portable compile cache. This allows previously compiled\nmodules to be reused across different directory locations as long as the layout relative\nto the cache directory remains the same. This would be done on a best-effort basis. If\nNode.js cannot compute the location of a module relative to the cache directory, the module\nwill not be cached.</p>\n<p>There are two ways to enable the portable mode:</p>\n<ol>\n<li>\n<p>Using the portable option in <a href=\"#moduleenablecompilecacheoptions\"><code>module.enableCompileCache()</code></a>:</p>\n<pre><code class=\"language-js\">// Non-portable cache (default): cache breaks if project is moved\nmodule.enableCompileCache({ directory: '/path/to/cache/storage/dir' });\n\n// Portable cache: cache works after the project is moved\nmodule.enableCompileCache({ directory: '/path/to/cache/storage/dir', portable: true });\n</code></pre>\n</li>\n<li>\n<p>Setting the environment variable: <a href=\"cli.html#node_compile_cache_portable1\"><code>NODE_COMPILE_CACHE_PORTABLE=1</code></a></p>\n</li>\n</ol>",
              "displayName": "Portability of the compile cache"
            },
            {
              "textRaw": "Limitations of the compile cache",
              "name": "limitations_of_the_compile_cache",
              "type": "module",
              "desc": "<p>Currently when using the compile cache with <a href=\"https://v8project.blogspot.com/2017/12/javascript-code-coverage.html\">V8 JavaScript code coverage</a>, the\ncoverage being collected by V8 may be less precise in functions that are\ndeserialized from the code cache. It's recommended to turn this off when\nrunning tests to generate precise coverage.</p>\n<p>Compilation cache generated by one version of Node.js can not be reused by a different\nversion of Node.js. Cache generated by different versions of Node.js will be stored\nseparately if the same base directory is used to persist the cache, so they can co-exist.</p>",
              "displayName": "Limitations of the compile cache"
            }
          ],
          "properties": [
            {
              "textRaw": "`module.constants.compileCacheStatus`",
              "name": "compileCacheStatus",
              "type": "property",
              "meta": {
                "added": [
                  "v22.8.0"
                ],
                "changes": [
                  {
                    "version": "v25.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60971",
                    "description": "This feature is no longer experimental."
                  }
                ]
              },
              "desc": "<p>The following constants are returned as the <code>status</code> field in the object returned by\n<a href=\"#moduleenablecompilecacheoptions\"><code>module.enableCompileCache()</code></a> to indicate the result of the attempt to enable the\n<a href=\"#module-compile-cache\">module compile cache</a>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>ENABLED</code></td>\n    <td>\n      Node.js has enabled the compile cache successfully. The directory used to store the\n      compile cache will be returned in the <code>directory</code> field in the\n      returned object.\n    </td>\n  </tr>\n  <tr>\n    <td><code>ALREADY_ENABLED</code></td>\n    <td>\n      The compile cache has already been enabled before, either by a previous call to\n      <code>module.enableCompileCache()</code>, or by the <code>NODE_COMPILE_CACHE=dir</code>\n      environment variable. The directory used to store the\n      compile cache will be returned in the <code>directory</code> field in the\n      returned object.\n    </td>\n  </tr>\n  <tr>\n    <td><code>FAILED</code></td>\n    <td>\n      Node.js fails to enable the compile cache. This can be caused by the lack of\n      permission to use the specified directory, or various kinds of file system errors.\n      The detail of the failure will be returned in the <code>message</code> field in the\n      returned object.\n    </td>\n  </tr>\n  <tr>\n    <td><code>DISABLED</code></td>\n    <td>\n      Node.js cannot enable the compile cache because the environment variable\n      <code>NODE_DISABLE_COMPILE_CACHE=1</code> has been set.\n    </td>\n  </tr>\n</table>"
            }
          ],
          "methods": [
            {
              "textRaw": "`module.enableCompileCache([options])`",
              "name": "enableCompileCache",
              "type": "method",
              "meta": {
                "added": [
                  "v22.8.0"
                ],
                "changes": [
                  {
                    "version": "v25.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60971",
                    "description": "This feature is no longer experimental."
                  },
                  {
                    "version": [
                      "v25.0.0",
                      "v24.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58797",
                    "description": "Add `portable` option to enable portable compile cache."
                  },
                  {
                    "version": [
                      "v25.0.0",
                      "v24.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59931",
                    "description": "Rename the unreleased `path` option to `directory` to maintain consistency."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {string|Object} Optional. If a string is passed, it is considered to be `options.directory`.",
                      "name": "options",
                      "type": "string|Object",
                      "desc": "Optional. If a string is passed, it is considered to be `options.directory`.",
                      "options": [
                        {
                          "textRaw": "`directory` {string} Optional. Directory to store the compile cache. If not specified, the directory specified by the `NODE_COMPILE_CACHE=dir` environment variable will be used if it's set, or `path.join(os.tmpdir(), 'node-compile-cache')` otherwise.",
                          "name": "directory",
                          "type": "string",
                          "desc": "Optional. Directory to store the compile cache. If not specified, the directory specified by the `NODE_COMPILE_CACHE=dir` environment variable will be used if it's set, or `path.join(os.tmpdir(), 'node-compile-cache')` otherwise."
                        },
                        {
                          "textRaw": "`portable` {boolean} Optional. If `true`, enables portable compile cache so that the cache can be reused even if the project directory is moved. This is a best-effort feature. If not specified, it will depend on whether the environment variable `NODE_COMPILE_CACHE_PORTABLE=1` is set.",
                          "name": "portable",
                          "type": "boolean",
                          "desc": "Optional. If `true`, enables portable compile cache so that the cache can be reused even if the project directory is moved. This is a best-effort feature. If not specified, it will depend on whether the environment variable `NODE_COMPILE_CACHE_PORTABLE=1` is set."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`status` {integer} One of the `module.constants.compileCacheStatus`",
                        "name": "status",
                        "type": "integer",
                        "desc": "One of the `module.constants.compileCacheStatus`"
                      },
                      {
                        "textRaw": "`message` {string|undefined} If Node.js cannot enable the compile cache, this contains the error message. Only set if `status` is `module.constants.compileCacheStatus.FAILED`.",
                        "name": "message",
                        "type": "string|undefined",
                        "desc": "If Node.js cannot enable the compile cache, this contains the error message. Only set if `status` is `module.constants.compileCacheStatus.FAILED`."
                      },
                      {
                        "textRaw": "`directory` {string|undefined} If the compile cache is enabled, this contains the directory where the compile cache is stored. Only set if `status` is `module.constants.compileCacheStatus.ENABLED` or `module.constants.compileCacheStatus.ALREADY_ENABLED`.",
                        "name": "directory",
                        "type": "string|undefined",
                        "desc": "If the compile cache is enabled, this contains the directory where the compile cache is stored. Only set if `status` is `module.constants.compileCacheStatus.ENABLED` or `module.constants.compileCacheStatus.ALREADY_ENABLED`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Enable <a href=\"#module-compile-cache\">module compile cache</a> in the current Node.js instance.</p>\n<p>For general use cases, it's recommended to call <code>module.enableCompileCache()</code> without\nspecifying the <code>options.directory</code>, so that the directory can be overridden by the\n<code>NODE_COMPILE_CACHE</code> environment variable when necessary.</p>\n<p>Since compile cache is supposed to be a optimization that is not mission critical, this\nmethod is designed to not throw any exception when the compile cache cannot be enabled.\nInstead, it will return an object containing an error message in the <code>message</code> field to\naid debugging. If compile cache is enabled successfully, the <code>directory</code> field in the\nreturned object contains the path to the directory where the compile cache is stored. The\n<code>status</code> field in the returned object would be one of the <code>module.constants.compileCacheStatus</code>\nvalues to indicate the result of the attempt to enable the <a href=\"#module-compile-cache\">module compile cache</a>.</p>\n<p>This method only affects the current Node.js instance. To enable it in child worker threads,\neither call this method in child worker threads too, or set the\n<code>process.env.NODE_COMPILE_CACHE</code> value to compile cache directory so the behavior can\nbe inherited into the child workers. The directory can be obtained either from the\n<code>directory</code> field returned by this method, or with <a href=\"#modulegetcompilecachedir\"><code>module.getCompileCacheDir()</code></a>.</p>"
            },
            {
              "textRaw": "`module.flushCompileCache()`",
              "name": "flushCompileCache",
              "type": "method",
              "meta": {
                "added": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "changes": [
                  {
                    "version": "v25.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60971",
                    "description": "This feature is no longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Flush the <a href=\"#module-compile-cache\">module compile cache</a> accumulated from modules already loaded\nin the current Node.js instance to disk. This returns after all the flushing\nfile system operations come to an end, no matter they succeed or not. If there\nare any errors, this will fail silently, since compile cache misses should not\ninterfere with the actual operation of the application.</p>"
            },
            {
              "textRaw": "`module.getCompileCacheDir()`",
              "name": "getCompileCacheDir",
              "type": "method",
              "meta": {
                "added": [
                  "v22.8.0"
                ],
                "changes": [
                  {
                    "version": "v25.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/60971",
                    "description": "This feature is no longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string|undefined} Path to the module compile cache directory if it is enabled, or `undefined` otherwise.",
                    "name": "return",
                    "type": "string|undefined",
                    "desc": "Path to the module compile cache directory if it is enabled, or `undefined` otherwise."
                  }
                }
              ],
              "desc": "<p><i id=\"module_customization_hooks\"></i></p>"
            }
          ],
          "displayName": "Module compile cache"
        },
        {
          "textRaw": "Source Map Support",
          "name": "source_map_support",
          "type": "module",
          "meta": {
            "added": [
              "v13.7.0",
              "v12.17.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>Node.js supports TC39 ECMA-426 <a href=\"https://tc39.es/ecma426/\">Source Map</a> format (it was called Source map\nrevision 3 format).</p>\n<p>The APIs in this section are helpers for interacting with the source map\ncache. This cache is populated when source map parsing is enabled and\n<a href=\"https://tc39.es/ecma426/#sec-linking-generated-code\">source map include directives</a> are found in a modules' footer.</p>\n<p>To enable source map parsing, Node.js must be run with the flag\n<a href=\"cli.html#--enable-source-maps\"><code>--enable-source-maps</code></a>, or with code coverage enabled by setting\n<a href=\"cli.html#node_v8_coveragedir\"><code>NODE_V8_COVERAGE=dir</code></a>, or be enabled programmatically via\n<a href=\"#modulesetsourcemapssupportenabled-options\"><code>module.setSourceMapsSupport()</code></a>.</p>\n<pre><code class=\"language-mjs\">// module.mjs\n// In an ECMAScript module\nimport { findSourceMap, SourceMap } from 'node:module';\n</code></pre>\n<pre><code class=\"language-cjs\">// module.cjs\n// In a CommonJS module\nconst { findSourceMap, SourceMap } = require('node:module');\n</code></pre>",
          "methods": [
            {
              "textRaw": "`module.getSourceMapsSupport()`",
              "name": "getSourceMapsSupport",
              "type": "method",
              "meta": {
                "added": [
                  "v23.7.0",
                  "v22.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`enabled` {boolean} If the source maps support is enabled",
                        "name": "enabled",
                        "type": "boolean",
                        "desc": "If the source maps support is enabled"
                      },
                      {
                        "textRaw": "`nodeModules` {boolean} If the support is enabled for files in `node_modules`.",
                        "name": "nodeModules",
                        "type": "boolean",
                        "desc": "If the support is enabled for files in `node_modules`."
                      },
                      {
                        "textRaw": "`generatedCode` {boolean} If the support is enabled for generated code from `eval` or `new Function`.",
                        "name": "generatedCode",
                        "type": "boolean",
                        "desc": "If the support is enabled for generated code from `eval` or `new Function`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>This method returns whether the <a href=\"https://tc39.es/ecma426/\">Source Map v3</a> support for stack\ntraces is enabled.</p>\n<p><a id=\"module_module_findsourcemap_path_error\"></a></p>"
            },
            {
              "textRaw": "`module.findSourceMap(path)`",
              "name": "findSourceMap",
              "type": "method",
              "meta": {
                "added": [
                  "v13.7.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string}",
                      "name": "path",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {module.SourceMap|undefined} Returns `module.SourceMap` if a source map is found, `undefined` otherwise.",
                    "name": "return",
                    "type": "module.SourceMap|undefined",
                    "desc": "Returns `module.SourceMap` if a source map is found, `undefined` otherwise."
                  }
                }
              ],
              "desc": "<p><code>path</code> is the resolved path for the file for which a corresponding source map\nshould be fetched.</p>"
            },
            {
              "textRaw": "`module.setSourceMapsSupport(enabled[, options])`",
              "name": "setSourceMapsSupport",
              "type": "method",
              "meta": {
                "added": [
                  "v23.7.0",
                  "v22.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enabled` {boolean} Enable the source map support.",
                      "name": "enabled",
                      "type": "boolean",
                      "desc": "Enable the source map support."
                    },
                    {
                      "textRaw": "`options` {Object} Optional",
                      "name": "options",
                      "type": "Object",
                      "desc": "Optional",
                      "options": [
                        {
                          "textRaw": "`nodeModules` {boolean} If enabling the support for files in `node_modules`. **Default:** `false`.",
                          "name": "nodeModules",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If enabling the support for files in `node_modules`."
                        },
                        {
                          "textRaw": "`generatedCode` {boolean} If enabling the support for generated code from `eval` or `new Function`. **Default:** `false`.",
                          "name": "generatedCode",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If enabling the support for generated code from `eval` or `new Function`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function enables or disables the <a href=\"https://tc39.es/ecma426/\">Source Map v3</a> support for\nstack traces.</p>\n<p>It provides same features as launching Node.js process with commandline options\n<code>--enable-source-maps</code>, with additional options to alter the support for files\nin <code>node_modules</code> or generated codes.</p>\n<p>Only source maps in JavaScript files that are loaded after source maps has been\nenabled will be parsed and loaded. Preferably, use the commandline options\n<code>--enable-source-maps</code> to avoid losing track of source maps of modules loaded\nbefore this API call.</p>"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `module.SourceMap`",
              "name": "module.SourceMap",
              "type": "class",
              "meta": {
                "added": [
                  "v13.7.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "textRaw": "`new SourceMap(payload[, { lineLengths }])`",
                  "name": "SourceMap",
                  "type": "ctor",
                  "meta": {
                    "changes": [
                      {
                        "version": "v20.5.0",
                        "pr-url": "https://github.com/nodejs/node/pull/48461",
                        "description": "Add support for `lineLengths`."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`payload` {Object}",
                      "name": "payload",
                      "type": "Object"
                    },
                    {
                      "name": "{ lineLengths }",
                      "optional": true
                    }
                  ],
                  "desc": "<p>Creates a new <code>sourceMap</code> instance.</p>\n<p><code>payload</code> is an object with keys matching the <a href=\"https://tc39.es/ecma426/#sec-source-map-format\">Source map format</a>:</p>\n<ul>\n<li><code>file</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>version</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>sources</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a></li>\n<li><code>sourcesContent</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a></li>\n<li><code>names</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a></li>\n<li><code>mappings</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>sourceRoot</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p><code>lineLengths</code> is an optional array of the length of each line in the\ngenerated code.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Returns: {Object}",
                  "name": "payload",
                  "type": "Object",
                  "desc": "<p>Getter for the payload used to construct the <a href=\"#class-modulesourcemap\"><code>SourceMap</code></a> instance.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`sourceMap.findEntry(lineOffset, columnOffset)`",
                  "name": "findEntry",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`lineOffset` {number} The zero-indexed line number offset in the generated source",
                          "name": "lineOffset",
                          "type": "number",
                          "desc": "The zero-indexed line number offset in the generated source"
                        },
                        {
                          "textRaw": "`columnOffset` {number} The zero-indexed column number offset in the generated source",
                          "name": "columnOffset",
                          "type": "number",
                          "desc": "The zero-indexed column number offset in the generated source"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Object}",
                        "name": "return",
                        "type": "Object"
                      }
                    }
                  ],
                  "desc": "<p>Given a line offset and column offset in the generated source\nfile, returns an object representing the SourceMap range in the\noriginal file if found, or an empty object if not.</p>\n<p>The object returned contains the following keys:</p>\n<ul>\n<li><code>generatedLine</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The line offset of the start of the\nrange in the generated source</li>\n<li><code>generatedColumn</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The column offset of start of the\nrange in the generated source</li>\n<li><code>originalSource</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The file name of the original source,\nas reported in the SourceMap</li>\n<li><code>originalLine</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The line offset of the start of the\nrange in the original source</li>\n<li><code>originalColumn</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The column offset of start of the\nrange in the original source</li>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p>The returned value represents the raw range as it appears in the\nSourceMap, based on zero-indexed offsets, <em>not</em> 1-indexed line and\ncolumn numbers as they appear in Error messages and CallSite\nobjects.</p>\n<p>To get the corresponding 1-indexed line and column numbers from a\nlineNumber and columnNumber as they are reported by Error stacks\nand CallSite objects, use <code>sourceMap.findOrigin(lineNumber, columnNumber)</code></p>"
                },
                {
                  "textRaw": "`sourceMap.findOrigin(lineNumber, columnNumber)`",
                  "name": "findOrigin",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v20.4.0",
                      "v18.18.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`lineNumber` {number} The 1-indexed line number of the call site in the generated source",
                          "name": "lineNumber",
                          "type": "number",
                          "desc": "The 1-indexed line number of the call site in the generated source"
                        },
                        {
                          "textRaw": "`columnNumber` {number} The 1-indexed column number of the call site in the generated source",
                          "name": "columnNumber",
                          "type": "number",
                          "desc": "The 1-indexed column number of the call site in the generated source"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Object}",
                        "name": "return",
                        "type": "Object"
                      }
                    }
                  ],
                  "desc": "<p>Given a 1-indexed <code>lineNumber</code> and <code>columnNumber</code> from a call site in\nthe generated source, find the corresponding call site location\nin the original source.</p>\n<p>If the <code>lineNumber</code> and <code>columnNumber</code> provided are not found in any\nsource map, then an empty object is returned. Otherwise, the\nreturned object contains the following keys:</p>\n<ul>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The name of the range in the\nsource map, if one was provided</li>\n<li><code>fileName</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The file name of the original source, as\nreported in the SourceMap</li>\n<li><code>lineNumber</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The 1-indexed lineNumber of the\ncorresponding call site in the original source</li>\n<li><code>columnNumber</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The 1-indexed columnNumber of the\ncorresponding call site in the original source</li>\n</ul>"
                }
              ]
            }
          ],
          "displayName": "Source Map Support"
        }
      ],
      "miscs": [
        {
          "textRaw": "Customization Hooks",
          "name": "Customization Hooks",
          "type": "misc",
          "meta": {
            "added": [
              "v8.8.0"
            ],
            "changes": [
              {
                "version": [
                  "v25.4.0",
                  "v24.13.1"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/60960",
                "description": "Synchronous and in-thread hooks are now release candidate."
              },
              {
                "version": [
                  "v23.5.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/55698",
                "description": "Add support for synchronous and in-thread hooks."
              },
              {
                "version": [
                  "v20.6.0",
                  "v18.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/48842",
                "description": "Added `initialize` hook to replace `globalPreload`."
              },
              {
                "version": [
                  "v18.6.0",
                  "v16.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/42623",
                "description": "Add support for chaining loaders."
              },
              {
                "version": "v16.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/37468",
                "description": "Removed `getFormat`, `getSource`, `transformSource`, and `globalPreload`; added `load` hook and `getGlobalPreload` hook."
              }
            ]
          },
          "desc": "<p>Node.js currently supports two types of module customization hooks:</p>\n<ol>\n<li><a href=\"#moduleregisterhooksoptions\"><code>module.registerHooks(options)</code></a>: takes synchronous hook\nfunctions that are run directly on the thread where the modules are loaded.</li>\n<li><a href=\"#moduleregisterspecifier-parenturl-options\"><code>module.register(specifier[, parentURL][, options])</code></a>: takes specifier to a\nmodule that exports asynchronous hook functions. The functions are run on a\nseparate loader thread.</li>\n</ol>\n<p>The asynchronous hooks incur extra overhead from inter-thread communication,\nand have <a href=\"#caveats-of-asynchronous-customization-hooks\">several caveats</a> especially\nwhen customizing CommonJS modules in the module graph.\nIn most cases, it's recommended to use synchronous hooks via <code>module.registerHooks()</code>\nfor simplicity.</p>",
          "miscs": [
            {
              "textRaw": "Synchronous customization hooks",
              "name": "synchronous_customization_hooks",
              "type": "misc",
              "stability": 1.2,
              "stabilityText": "Release candidate",
              "desc": "<p><i id=\"enabling_module_customization_hooks\"></i></p>",
              "modules": [
                {
                  "textRaw": "Registration of synchronous customization hooks",
                  "name": "registration_of_synchronous_customization_hooks",
                  "type": "module",
                  "desc": "<p>To register synchronous customization hooks, use <a href=\"#moduleregisterhooksoptions\"><code>module.registerHooks()</code></a>, which\ntakes <a href=\"#hook-functions-accepted-by-moduleregisterhooks\">synchronous hook functions</a> directly in-line.</p>\n<pre><code class=\"language-mjs\">// register-hooks.js\nimport { registerHooks } from 'node:module';\nregisterHooks({\n  resolve(specifier, context, nextResolve) { /* implementation */ },\n  load(url, context, nextLoad) { /* implementation */ },\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// register-hooks.js\nconst { registerHooks } = require('node:module');\nregisterHooks({\n  resolve(specifier, context, nextResolve) { /* implementation */ },\n  load(url, context, nextLoad) { /* implementation */ },\n});\n</code></pre>",
                  "modules": [
                    {
                      "textRaw": "Registering hooks before application code runs with flags",
                      "name": "registering_hooks_before_application_code_runs_with_flags",
                      "type": "module",
                      "desc": "<p>The hooks can be registered before the application code is run by using the\n<a href=\"cli.html#--importmodule\"><code>--import</code></a> or <a href=\"cli.html#-r---require-module\"><code>--require</code></a> flag:</p>\n<pre><code class=\"language-bash\">node --import ./register-hooks.js ./my-app.js\nnode --require ./register-hooks.js ./my-app.js\n</code></pre>\n<p>The specifier passed to <code>--import</code> or <code>--require</code> can also come from a package:</p>\n<pre><code class=\"language-bash\">node --import some-package/register ./my-app.js\nnode --require some-package/register ./my-app.js\n</code></pre>\n<p>Where <code>some-package</code> has an <a href=\"packages.html#exports\"><code>\"exports\"</code></a> field defining the <code>/register</code>\nexport to map to a file that calls <code>registerHooks()</code>, like the\n<code>register-hooks.js</code> examples above.</p>\n<p>Using <code>--import</code> or <code>--require</code> ensures that the hooks are registered before any\napplication code is loaded, including the entry point of the application and for\nany worker threads by default as well.</p>",
                      "displayName": "Registering hooks before application code runs with flags"
                    },
                    {
                      "textRaw": "Registering hooks before application code runs programmatically",
                      "name": "registering_hooks_before_application_code_runs_programmatically",
                      "type": "module",
                      "desc": "<p>Alternatively, <code>registerHooks()</code> can be called from the entry point.</p>\n<p>If the entry point needs to load other modules and the loading process needs to be\ncustomized, load them using either <code>require()</code> or dynamic <code>import()</code> after the hooks\nare registered. Do not use static <code>import</code> statements to load modules that need to be\ncustomized in the same module that registers the hooks, because static <code>import</code> statements\nare evaluated before any code in the importer module is run, including the call to\n<code>registerHooks()</code>, regardless of where the static <code>import</code> statements appear in the importer\nmodule.</p>\n<pre><code class=\"language-mjs\">import { registerHooks } from 'node:module';\n\nregisterHooks({ /* implementation of synchronous hooks */ });\n\n// If loaded using static import, the hooks would not be applied when loading\n// my-app.mjs, because statically imported modules are all executed before its\n// importer regardless of where the static import appears.\n// import './my-app.mjs';\n\n// my-app.mjs must be loaded dynamically to ensure the hooks are applied.\nawait import('./my-app.mjs');\n</code></pre>\n<pre><code class=\"language-cjs\">const { registerHooks } = require('node:module');\n\nregisterHooks({ /* implementation of synchronous hooks */ });\n\nimport('./my-app.mjs');\n// Or, if my-app.mjs does not have top-level await or it's a CommonJS module,\n// require() can also be used:\n// require('./my-app.mjs');\n</code></pre>",
                      "displayName": "Registering hooks before application code runs programmatically"
                    },
                    {
                      "textRaw": "Registering hooks before application code runs with a `data:` URL",
                      "name": "registering_hooks_before_application_code_runs_with_a_`data:`_url",
                      "type": "module",
                      "desc": "<p>Alternatively, inline JavaScript code can be embedded in <code>data:</code> URLs to register\nthe hooks before the application code runs. For example,</p>\n<pre><code class=\"language-bash\">node --import 'data:text/javascript,import {registerHooks} from \"node:module\"; registerHooks(/* hooks code */);' ./my-app.js\n</code></pre>",
                      "displayName": "Registering hooks before application code runs with a `data:` URL"
                    }
                  ],
                  "displayName": "Registration of synchronous customization hooks"
                },
                {
                  "textRaw": "Convention of hooks and chaining",
                  "name": "convention_of_hooks_and_chaining",
                  "type": "module",
                  "desc": "<p>Hooks are part of a chain, even if that chain consists of only one\ncustom (user-provided) hook and the default hook, which is always present.</p>\n<p>Hook functions nest: each one must always return a plain object, and chaining happens\nas a result of each function calling <code>next&#x3C;hookName>()</code>, which is a reference to\nthe subsequent loader's hook (in LIFO order).</p>\n<p>It's possible to call <code>registerHooks()</code> more than once:</p>\n<pre><code class=\"language-mjs\">// entrypoint.mjs\nimport { registerHooks } from 'node:module';\n\nconst hook1 = { /* implementation of hooks */ };\nconst hook2 = { /* implementation of hooks */ };\n// hook2 runs before hook1.\nregisterHooks(hook1);\nregisterHooks(hook2);\n</code></pre>\n<pre><code class=\"language-cjs\">// entrypoint.cjs\nconst { registerHooks } = require('node:module');\n\nconst hook1 = { /* implementation of hooks */ };\nconst hook2 = { /* implementation of hooks */ };\n// hook2 runs before hook1.\nregisterHooks(hook1);\nregisterHooks(hook2);\n</code></pre>\n<p>In this example, the registered hooks will form chains. These chains run\nlast-in, first-out (LIFO). If both <code>hook1</code> and <code>hook2</code> define a <code>resolve</code>\nhook, they will be called like so (note the right-to-left,\nstarting with <code>hook2.resolve</code>, then <code>hook1.resolve</code>, then the Node.js default):</p>\n<p>Node.js default <code>resolve</code> ← <code>hook1.resolve</code> ← <code>hook2.resolve</code></p>\n<p>The same applies to all the other hooks.</p>\n<p>A hook that returns a value lacking a required property triggers an exception. A\nhook that returns without calling <code>next&#x3C;hookName>()</code> <em>and</em> without returning\n<code>shortCircuit: true</code> also triggers an exception. These errors are to help\nprevent unintentional breaks in the chain. Return <code>shortCircuit: true</code> from a\nhook to signal that the chain is intentionally ending at your hook.</p>\n<p>If a hook should be applied when loading other hook modules, the other hook\nmodules should be loaded after the hook is registered.</p>",
                  "displayName": "Convention of hooks and chaining"
                },
                {
                  "textRaw": "Deregistration of synchronous customization hooks",
                  "name": "deregistration_of_synchronous_customization_hooks",
                  "type": "module",
                  "desc": "<p>The object returned by <code>registerHooks()</code> has a <code>deregister()</code> method that can be\nused to remove the hooks from the chain. Once <code>deregister()</code> is called, the hooks\nwill no longer be invoked during module resolution or loading.</p>\n<p>This is currently only available for synchronous hooks registered via <code>registerHooks()</code>, not for asynchronous\nhooks registered via <code>module.register()</code>.</p>\n<pre><code class=\"language-mjs\">import { registerHooks } from 'node:module';\n\nconst hooks = registerHooks({\n  resolve(specifier, context, nextResolve) {\n    console.log('resolve hook called for', specifier);\n    return nextResolve(specifier, context);\n  },\n  load(url, context, nextLoad) {\n    return nextLoad(url, context);\n  },\n});\n\n// At this point, the hooks are active and will be called for\n// any subsequent import() or require() calls.\nawait import('./my-module.mjs');\n\n// Later, remove the hooks from the chain.\nhooks.deregister();\n\n// Subsequent loads will no longer trigger the hooks.\nawait import('./another-module.mjs');\n</code></pre>\n<pre><code class=\"language-cjs\">const { registerHooks } = require('node:module');\n\nconst hooks = registerHooks({\n  resolve(specifier, context, nextResolve) {\n    console.log('resolve hook called for', specifier);\n    return nextResolve(specifier, context);\n  },\n  load(url, context, nextLoad) {\n    return nextLoad(url, context);\n  },\n});\n\n// At this point, the hooks are active and will be called for\n// any subsequent require() calls.\nrequire('./my-module.cjs');\n\n// Later, remove the hooks from the chain.\nhooks.deregister();\n\n// Subsequent loads will no longer trigger the hooks.\nrequire('./another-module.cjs');\n</code></pre>",
                  "displayName": "Deregistration of synchronous customization hooks"
                },
                {
                  "textRaw": "Hook functions accepted by `module.registerHooks()`",
                  "name": "hook_functions_accepted_by_`module.registerhooks()`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v23.5.0",
                      "v22.15.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>module.registerHooks()</code> method accepts the following synchronous hook functions.</p>\n<pre><code class=\"language-mjs\">function resolve(specifier, context, nextResolve) {\n  // Take an `import` or `require` specifier and resolve it to a URL.\n}\n\nfunction load(url, context, nextLoad) {\n  // Take a resolved URL and return the source code to be evaluated.\n}\n</code></pre>\n<p>Synchronous hooks are run in the same thread and the same <a href=\"https://tc39.es/ecma262/#realm\">realm</a> where the modules\nare loaded, the code in the hook function can pass values to the modules being referenced\ndirectly via global variables or other shared states.</p>\n<p>Unlike the asynchronous hooks, the synchronous hooks are not inherited into child worker\nthreads by default, though if the hooks are registered using a file preloaded by\n<a href=\"cli.html#--importmodule\"><code>--import</code></a> or <a href=\"cli.html#-r---require-module\"><code>--require</code></a>, child worker threads can inherit the preloaded scripts\nvia <code>process.execArgv</code> inheritance. See <a href=\"worker_threads.html#new-workerfilename-options\">the documentation of <code>Worker</code></a> for details.</p>",
                  "displayName": "Hook functions accepted by `module.registerHooks()`"
                },
                {
                  "textRaw": "Synchronous `resolve(specifier, context, nextResolve)`",
                  "name": "synchronous_`resolve(specifier,_context,_nextresolve)`",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v23.5.0",
                          "v22.15.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/55698",
                        "description": "Add support for synchronous and in-thread hooks."
                      }
                    ]
                  },
                  "desc": "<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>conditions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> Export conditions of the relevant <code>package.json</code></li>\n<li><code>importAttributes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> An object whose key-value pairs represent the\nattributes for the module to import</li>\n<li><code>parentURL</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The module importing this one, or undefined\nif this is the Node.js entry point</li>\n</ul>\n</li>\n<li><code>nextResolve</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> The subsequent <code>resolve</code> hook in the chain, or the\nNode.js default <code>resolve</code> hook after the last user-supplied <code>resolve</code> hook\n<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> When omitted, the defaults are provided. When provided, defaults\nare merged in with preference to the provided properties.</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> A hint to the <code>load</code> hook (it might be ignored). It can be a\nmodule format (such as <code>'commonjs'</code> or <code>'module'</code>) or an arbitrary value like <code>'css'</code> or\n<code>'yaml'</code>.</li>\n<li><code>importAttributes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The import attributes to use when\ncaching the module (optional; if excluded the input will be used)</li>\n<li><code>shortCircuit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> A signal that this hook intends to\nterminate the chain of <code>resolve</code> hooks. <strong>Default:</strong> <code>false</code></li>\n<li><code>url</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The absolute URL to which this input resolves</li>\n</ul>\n</li>\n</ul>\n<p>The <code>resolve</code> hook chain is responsible for telling Node.js where to find and\nhow to cache a given <code>import</code> statement or expression, or <code>require</code> call. It can\noptionally return a format (such as <code>'module'</code>) as a hint to the <code>load</code> hook. If\na format is specified, the <code>load</code> hook is ultimately responsible for providing\nthe final <code>format</code> value (and it is free to ignore the hint provided by\n<code>resolve</code>); if <code>resolve</code> provides a <code>format</code>, a custom <code>load</code> hook is required\neven if only to pass the value to the Node.js default <code>load</code> hook.</p>\n<p>Import type attributes are part of the cache key for saving loaded modules into\nthe internal module cache. The <code>resolve</code> hook is responsible for returning an\n<code>importAttributes</code> object if the module should be cached with different\nattributes than were present in the source code.</p>\n<p>The <code>conditions</code> property in <code>context</code> is an array of conditions that will be used\nto match <a href=\"packages.html#conditional-exports\">package exports conditions</a> for this resolution\nrequest. They can be used for looking up conditional mappings elsewhere or to\nmodify the list when calling the default resolution logic.</p>\n<p>The current <a href=\"packages.html#conditional-exports\">package exports conditions</a> are always in\nthe <code>context.conditions</code> array passed into the hook. To guarantee <em>default\nNode.js module specifier resolution behavior</em> when calling <code>defaultResolve</code>, the\n<code>context.conditions</code> array passed to it <em>must</em> include <em>all</em> elements of the\n<code>context.conditions</code> array originally passed into the <code>resolve</code> hook.</p>\n<pre><code class=\"language-mjs\">import { registerHooks } from 'node:module';\n\nfunction resolve(specifier, context, nextResolve) {\n  // When calling `defaultResolve`, the arguments can be modified. For example,\n  // to change the specifier or to add applicable export conditions.\n  if (specifier.includes('foo')) {\n    specifier = specifier.replace('foo', 'bar');\n    return nextResolve(specifier, {\n      ...context,\n      conditions: [...context.conditions, 'another-condition'],\n    });\n  }\n\n  // The hook can also skip default resolution and provide a custom URL.\n  if (specifier === 'special-module') {\n    return {\n      url: 'file:///path/to/special-module.mjs',\n      format: 'module',\n      shortCircuit: true,  // This is mandatory if nextResolve() is not called.\n    };\n  }\n\n  // If no customization is needed, defer to the next hook in the chain which would be the\n  // Node.js default resolve if this is the last user-specified loader.\n  return nextResolve(specifier);\n}\n\nregisterHooks({ resolve });\n</code></pre>",
                  "displayName": "Synchronous `resolve(specifier, context, nextResolve)`"
                },
                {
                  "textRaw": "Synchronous `load(url, context, nextLoad)`",
                  "name": "synchronous_`load(url,_context,_nextload)`",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v23.5.0",
                          "v22.15.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/55698",
                        "description": "Add support for synchronous and in-thread version."
                      }
                    ]
                  },
                  "desc": "<ul>\n<li><code>url</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The URL returned by the <code>resolve</code> chain</li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>conditions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> Export conditions of the relevant <code>package.json</code></li>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The format optionally supplied by the <code>resolve</code> hook chain. This can be any string value as an input; input values do not need to\nconform to the list of acceptable return values described below.</li>\n<li><code>importAttributes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n</li>\n<li><code>nextLoad</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> The subsequent <code>load</code> hook in the chain, or the\nNode.js default <code>load</code> hook after the last user-supplied <code>load</code> hook\n<ul>\n<li><code>url</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> When omitted, defaults are provided. When provided, defaults are\nmerged in with preference to the provided properties. In the default <code>nextLoad</code>, if\nthe module pointed to by <code>url</code> does not have explicit module type information,\n<code>context.format</code> is mandatory.\n<!-- TODO(joyeecheung): make it at least optionally non-mandatory by allowing\n     JS-style/TS-style module detection when the format is simply unknown -->\n</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> One of the acceptable module formats listed <a href=\"#accepted-final-formats-returned-by-load\">below</a>.</li>\n<li><code>shortCircuit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> A signal that this hook intends to\nterminate the chain of <code>load</code> hooks. <strong>Default:</strong> <code>false</code></li>\n<li><code>source</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> The source for Node.js to evaluate</li>\n</ul>\n</li>\n</ul>\n<p>The <code>load</code> hook provides a way to define a custom method for retrieving the\nsource code of a resolved URL. This would allow a loader to potentially avoid\nreading files from disk. It could also be used to map an unrecognized format to\na supported one, for example <code>yaml</code> to <code>module</code>.</p>\n<pre><code class=\"language-mjs\">import { registerHooks } from 'node:module';\nimport { Buffer } from 'node:buffer';\n\nfunction load(url, context, nextLoad) {\n  // The hook can skip default loading and provide a custom source code.\n  if (url === 'special-module') {\n    return {\n      source: 'export const special = 42;',\n      format: 'module',\n      shortCircuit: true,  // This is mandatory if nextLoad() is not called.\n    };\n  }\n\n  // It's possible to modify the source code loaded by the next - possibly default - step,\n  // for example, replacing 'foo' with 'bar' in the source code of the module.\n  const result = nextLoad(url, context);\n  const source = typeof result.source === 'string' ?\n    result.source : Buffer.from(result.source).toString('utf8');\n  return {\n    source: source.replace(/foo/g, 'bar'),\n    ...result,\n  };\n}\n\nregisterHooks({ load });\n</code></pre>\n<p>In a more advanced scenario, this can also be used to transform an unsupported\nsource to a supported one (see <a href=\"#examples\">Examples</a> below).</p>",
                  "modules": [
                    {
                      "textRaw": "Accepted final formats returned by `load`",
                      "name": "accepted_final_formats_returned_by_`load`",
                      "type": "module",
                      "desc": "<p>The final value of <code>format</code> must be one of the following:</p>\n<table>\n<thead>\n<tr>\n<th><code>format</code></th>\n<th>Description</th>\n<th>Acceptable types for <code>source</code> returned by <code>load</code></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'addon'</code></td>\n<td>Load a Node.js addon</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a></td>\n</tr>\n<tr>\n<td><code>'builtin'</code></td>\n<td>Load a Node.js builtin module</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a></td>\n</tr>\n<tr>\n<td><code>'commonjs-typescript'</code></td>\n<td>Load a Node.js CommonJS module with TypeScript syntax</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a></td>\n</tr>\n<tr>\n<td><code>'commonjs'</code></td>\n<td>Load a Node.js CommonJS module</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a></td>\n</tr>\n<tr>\n<td><code>'json'</code></td>\n<td>Load a JSON file</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a></td>\n</tr>\n<tr>\n<td><code>'module-typescript'</code></td>\n<td>Load an ES module with TypeScript syntax</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a></td>\n</tr>\n<tr>\n<td><code>'module'</code></td>\n<td>Load an ES module</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a></td>\n</tr>\n<tr>\n<td><code>'wasm'</code></td>\n<td>Load a WebAssembly module</td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a></td>\n</tr>\n</tbody>\n</table>\n<p>The value of <code>source</code> is ignored for format <code>'builtin'</code> because currently it is\nnot possible to replace the value of a Node.js builtin (core) module.</p>\n<blockquote>\n<p>These types all correspond to classes defined in ECMAScript.</p>\n</blockquote>\n<ul>\n<li>The specific <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> object is a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>&#x3C;SharedArrayBuffer></code></a>.</li>\n<li>The specific <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> object is a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a>.</li>\n</ul>\n<p>If the source value of a text-based format (i.e., <code>'json'</code>, <code>'module'</code>)\nis not a string, it is converted to a string using <a href=\"util.html#class-utiltextdecoder\"><code>util.TextDecoder</code></a>.</p>",
                      "displayName": "Accepted final formats returned by `load`"
                    }
                  ],
                  "displayName": "Synchronous `load(url, context, nextLoad)`"
                }
              ],
              "displayName": "Synchronous customization hooks"
            },
            {
              "textRaw": "Asynchronous customization hooks",
              "name": "asynchronous_customization_hooks",
              "type": "misc",
              "stability": 1.1,
              "stabilityText": "Active Development",
              "modules": [
                {
                  "textRaw": "Caveats of asynchronous customization hooks",
                  "name": "caveats_of_asynchronous_customization_hooks",
                  "type": "module",
                  "desc": "<p>The asynchronous customization hooks have many caveats and it is uncertain if their\nissues can be resolved. Users are encouraged to use the synchronous customization hooks\nvia <code>module.registerHooks()</code> instead to avoid these caveats.</p>\n<ul>\n<li>Asynchronous hooks run on a separate thread, so the hook functions cannot directly\nmutate the global state of the modules being customized. It's typical to use message\nchannels and atomics to pass data between the two or to affect control flows.\nSee <a href=\"#communication-with-asynchronous-module-customization-hooks\">Communication with asynchronous module customization hooks</a>.</li>\n<li>Asynchronous hooks do not affect all <code>require()</code> calls in the module graph.\n<ul>\n<li>Custom <code>require</code> functions created using <code>module.createRequire()</code> are not\naffected.</li>\n<li>If the asynchronous <code>load</code> hook does not override the <code>source</code> for CommonJS modules\nthat go through it, the child modules loaded by those CommonJS modules via built-in\n<code>require()</code> would not be affected by the asynchronous hooks either.</li>\n</ul>\n</li>\n<li>There are several caveats that the asynchronous hooks need to handle when\ncustomizing CommonJS modules. See <a href=\"#asynchronous-resolvespecifier-context-nextresolve\">asynchronous <code>resolve</code> hook</a> and\n<a href=\"#asynchronous-loadurl-context-nextload\">asynchronous <code>load</code> hook</a> for details.</li>\n<li>When <code>require()</code> calls inside CommonJS modules are customized by asynchronous hooks,\nNode.js may need to load the source code of the CommonJS module multiple times to maintain\ncompatibility with existing CommonJS monkey-patching. If the module code changes between\nloads, this may lead to unexpected behaviors.\n<ul>\n<li>As a side effect, if both asynchronous hooks and synchronous hooks are registered and the\nasynchronous hooks choose to customize the CommonJS module, the synchronous hooks may be\ninvoked multiple times for the <code>require()</code> calls in that CommonJS module.</li>\n</ul>\n</li>\n</ul>",
                  "displayName": "Caveats of asynchronous customization hooks"
                },
                {
                  "textRaw": "Registration of asynchronous customization hooks",
                  "name": "registration_of_asynchronous_customization_hooks",
                  "type": "module",
                  "desc": "<p>Asynchronous customization hooks are registered using <a href=\"#moduleregisterspecifier-parenturl-options\"><code>module.register()</code></a> which takes\na path or URL to another module that exports the <a href=\"#asynchronous-hooks-accepted-by-moduleregister\">asynchronous hook functions</a>.</p>\n<p>Similar to <code>registerHooks()</code>, <code>register()</code> can be called in a module preloaded by <code>--import</code> or\n<code>--require</code>, or called directly within the entry point.</p>\n<pre><code class=\"language-mjs\">// Use module.register() to register asynchronous hooks in a dedicated thread.\nimport { register } from 'node:module';\nregister('./hooks.mjs', import.meta.url);\n\n// If my-app.mjs is loaded statically here as `import './my-app.mjs'`, since ESM\n// dependencies are evaluated before the module that imports them,\n// it's loaded _before_ the hooks are registered above and won't be affected.\n// To ensure the hooks are applied, dynamic import() must be used to load ESM\n// after the hooks are registered.\nimport('./my-app.mjs');\n</code></pre>\n<pre><code class=\"language-cjs\">const { register } = require('node:module');\nconst { pathToFileURL } = require('node:url');\n// Use module.register() to register asynchronous hooks in a dedicated thread.\nregister('./hooks.mjs', pathToFileURL(__filename));\n\nimport('./my-app.mjs');\n</code></pre>\n<p>In <code>hooks.mjs</code>:</p>\n<pre><code class=\"language-mjs\">// hooks.mjs\nexport async function resolve(specifier, context, nextResolve) {\n  /* implementation */\n}\nexport async function load(url, context, nextLoad) {\n  /* implementation */\n}\n</code></pre>\n<p>Unlike synchronous hooks, the asynchronous hooks would not run for these modules loaded in the file\nthat calls <code>register()</code>:</p>\n<pre><code class=\"language-mjs\">// register-hooks.js\nimport { register, createRequire } from 'node:module';\nregister('./hooks.mjs', import.meta.url);\n\n// Asynchronous hooks does not affect modules loaded via custom require()\n// functions created by module.createRequire().\nconst userRequire = createRequire(import.meta.filename);\nuserRequire('./my-app-2.cjs');  // Hooks won't affect this\n</code></pre>\n<pre><code class=\"language-cjs\">// register-hooks.js\nconst { register, createRequire } = require('node:module');\nconst { pathToFileURL } = require('node:url');\nregister('./hooks.mjs', pathToFileURL(__filename));\n\n// Asynchronous hooks does not affect modules loaded via built-in require()\n// in the module calling `register()`\nrequire('./my-app-2.cjs');  // Hooks won't affect this\n// .. or custom require() functions created by module.createRequire().\nconst userRequire = createRequire(__filename);\nuserRequire('./my-app-3.cjs');  // Hooks won't affect this\n</code></pre>\n<p>Asynchronous hooks can also be registered using a <code>data:</code> URL with the <code>--import</code> flag:</p>\n<pre><code class=\"language-bash\">node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(\"my-instrumentation\", pathToFileURL(\"./\"));' ./my-app.js\n</code></pre>",
                  "displayName": "Registration of asynchronous customization hooks"
                },
                {
                  "textRaw": "Chaining of asynchronous customization hooks",
                  "name": "chaining_of_asynchronous_customization_hooks",
                  "type": "module",
                  "desc": "<p>Chaining of <code>register()</code> work similarly to <code>registerHooks()</code>. If synchronous and asynchronous\nhooks are mixed, the synchronous hooks are always run first before the asynchronous\nhooks start running, that is, in the last synchronous hook being run, its next\nhook includes invocation of the asynchronous hooks.</p>\n<pre><code class=\"language-mjs\">// entrypoint.mjs\nimport { register } from 'node:module';\n\nregister('./foo.mjs', import.meta.url);\nregister('./bar.mjs', import.meta.url);\nawait import('./my-app.mjs');\n</code></pre>\n<pre><code class=\"language-cjs\">// entrypoint.cjs\nconst { register } = require('node:module');\nconst { pathToFileURL } = require('node:url');\n\nconst parentURL = pathToFileURL(__filename);\nregister('./foo.mjs', parentURL);\nregister('./bar.mjs', parentURL);\nimport('./my-app.mjs');\n</code></pre>\n<p>If <code>foo.mjs</code> and <code>bar.mjs</code> define a <code>resolve</code> hook, they will be called like so\n(note the right-to-left, starting with <code>./bar.mjs</code>, then <code>./foo.mjs</code>, then the Node.js default):</p>\n<p>Node.js default ← <code>./foo.mjs</code> ← <code>./bar.mjs</code></p>\n<p>When using the asynchronous hooks, the registered hooks also affect subsequent\n<code>register</code> calls, which takes care of loading hook modules. In the example above,\n<code>bar.mjs</code> will be resolved and loaded via the hooks registered by <code>foo.mjs</code>\n(because <code>foo</code>'s hooks will have already been added to the chain). This allows\nfor things like writing hooks in non-JavaScript languages, so long as\nearlier registered hooks transpile into JavaScript.</p>\n<p>The <code>register()</code> method cannot be called from the thread running the hook module that\nexports the asynchronous hooks or its dependencies.</p>",
                  "displayName": "Chaining of asynchronous customization hooks"
                },
                {
                  "textRaw": "Communication with asynchronous module customization hooks",
                  "name": "communication_with_asynchronous_module_customization_hooks",
                  "type": "module",
                  "desc": "<p>Asynchronous hooks run on a dedicated thread, separate from the main\nthread that runs application code. This means mutating global variables won't\naffect the other thread(s), and message channels must be used to communicate\nbetween the threads.</p>\n<p>The <code>register</code> method can be used to pass data to an <a href=\"#initialize\"><code>initialize</code></a> hook. The\ndata passed to the hook may include transferable objects like ports.</p>\n<pre><code class=\"language-mjs\">import { register } from 'node:module';\nimport { MessageChannel } from 'node:worker_threads';\n\n// This example demonstrates how a message channel can be used to\n// communicate with the hooks, by sending `port2` to the hooks.\nconst { port1, port2 } = new MessageChannel();\n\nport1.on('message', (msg) => {\n  console.log(msg);\n});\nport1.unref();\n\nregister('./my-hooks.mjs', {\n  parentURL: import.meta.url,\n  data: { number: 1, port: port2 },\n  transferList: [port2],\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { register } = require('node:module');\nconst { pathToFileURL } = require('node:url');\nconst { MessageChannel } = require('node:worker_threads');\n\n// This example showcases how a message channel can be used to\n// communicate with the hooks, by sending `port2` to the hooks.\nconst { port1, port2 } = new MessageChannel();\n\nport1.on('message', (msg) => {\n  console.log(msg);\n});\nport1.unref();\n\nregister('./my-hooks.mjs', {\n  parentURL: pathToFileURL(__filename),\n  data: { number: 1, port: port2 },\n  transferList: [port2],\n});\n</code></pre>",
                  "displayName": "Communication with asynchronous module customization hooks"
                },
                {
                  "textRaw": "Asynchronous hooks accepted by `module.register()`",
                  "name": "asynchronous_hooks_accepted_by_`module.register()`",
                  "type": "module",
                  "meta": {
                    "added": [
                      "v8.8.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v20.6.0",
                          "v18.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/48842",
                        "description": "Added `initialize` hook to replace `globalPreload`."
                      },
                      {
                        "version": [
                          "v18.6.0",
                          "v16.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/42623",
                        "description": "Add support for chaining loaders."
                      },
                      {
                        "version": "v16.12.0",
                        "pr-url": "https://github.com/nodejs/node/pull/37468",
                        "description": "Removed `getFormat`, `getSource`, `transformSource`, and `globalPreload`; added `load` hook and `getGlobalPreload` hook."
                      }
                    ]
                  },
                  "desc": "<p>The <a href=\"#moduleregisterspecifier-parenturl-options\"><code>register</code></a> method can be used to register a module that exports a set of\nhooks. The hooks are functions that are called by Node.js to customize the\nmodule resolution and loading process. The exported functions must have specific\nnames and signatures, and they must be exported as named exports.</p>\n<pre><code class=\"language-mjs\">export async function initialize({ number, port }) {\n  // Receives data from `register`.\n}\n\nexport async function resolve(specifier, context, nextResolve) {\n  // Take an `import` or `require` specifier and resolve it to a URL.\n}\n\nexport async function load(url, context, nextLoad) {\n  // Take a resolved URL and return the source code to be evaluated.\n}\n</code></pre>\n<p>Asynchronous hooks are run in a separate thread, isolated from the main thread where\napplication code runs. That means it is a different <a href=\"https://tc39.es/ecma262/#realm\">realm</a>. The hooks thread\nmay be terminated by the main thread at any time, so do not depend on\nasynchronous operations (like <code>console.log</code>) to complete. They are inherited into\nchild workers by default.</p>",
                  "displayName": "Asynchronous hooks accepted by `module.register()`"
                },
                {
                  "textRaw": "Asynchronous `resolve(specifier, context, nextResolve)`",
                  "name": "asynchronous_`resolve(specifier,_context,_nextresolve)`",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v21.0.0",
                          "v20.10.0",
                          "v18.19.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50140",
                        "description": "The property `context.importAssertions` is replaced with `context.importAttributes`. Using the old name is still supported and will emit an experimental warning."
                      },
                      {
                        "version": [
                          "v18.6.0",
                          "v16.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/42623",
                        "description": "Add support for chaining resolve hooks. Each hook must either call `nextResolve()` or include a `shortCircuit` property set to `true` in its return."
                      },
                      {
                        "version": [
                          "v17.1.0",
                          "v16.14.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/40250",
                        "description": "Add support for import assertions."
                      }
                    ]
                  },
                  "desc": "<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>conditions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> Export conditions of the relevant <code>package.json</code></li>\n<li><code>importAttributes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> An object whose key-value pairs represent the\nattributes for the module to import</li>\n<li><code>parentURL</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The module importing this one, or undefined\nif this is the Node.js entry point</li>\n</ul>\n</li>\n<li><code>nextResolve</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> The subsequent <code>resolve</code> hook in the chain, or the\nNode.js default <code>resolve</code> hook after the last user-supplied <code>resolve</code> hook\n<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> When omitted, the defaults are provided. When provided, defaults\nare merged in with preference to the provided properties.</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> The asynchronous version takes either an object containing the\nfollowing properties, or a <code>Promise</code> that will resolve to such an object.\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> A hint to the <code>load</code> hook (it might be ignored). It can be a\nmodule format (such as <code>'commonjs'</code> or <code>'module'</code>) or an arbitrary value like <code>'css'</code> or\n<code>'yaml'</code>.</li>\n<li><code>importAttributes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The import attributes to use when\ncaching the module (optional; if excluded the input will be used)</li>\n<li><code>shortCircuit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> A signal that this hook intends to\nterminate the chain of <code>resolve</code> hooks. <strong>Default:</strong> <code>false</code></li>\n<li><code>url</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The absolute URL to which this input resolves</li>\n</ul>\n</li>\n</ul>\n<p>The asynchronous version works similarly to the synchronous version, only that the\n<code>nextResolve</code> function returns a <code>Promise</code>, and the <code>resolve</code> hook itself can return a <code>Promise</code>.</p>\n<blockquote>\n<p><strong>Warning</strong> In the case of the asynchronous version, despite support for returning\npromises and async functions, calls to <code>resolve</code> may still block the main thread which\ncan impact performance.</p>\n</blockquote>\n<blockquote>\n<p><strong>Warning</strong> The <code>resolve</code> hook invoked for <code>require()</code> calls inside CommonJS modules\ncustomized by asynchronous hooks does not receive the original specifier passed to\n<code>require()</code>. Instead, it receives a URL already fully resolved using the default\nCommonJS resolution.</p>\n</blockquote>\n<blockquote>\n<p><strong>Warning</strong> In the CommonJS modules that are customized by the asynchronous customization hooks,\n<code>require.resolve()</code> and <code>require()</code> will use <code>\"import\"</code> export condition instead of\n<code>\"require\"</code>, which may cause unexpected behaviors when loading dual packages.</p>\n</blockquote>\n<pre><code class=\"language-mjs\">export async function resolve(specifier, context, nextResolve) {\n  // When calling `defaultResolve`, the arguments can be modified. For example,\n  // to change the specifier or add conditions.\n  if (specifier.includes('foo')) {\n    specifier = specifier.replace('foo', 'bar');\n    return nextResolve(specifier, {\n      ...context,\n      conditions: [...context.conditions, 'another-condition'],\n    });\n  }\n\n  // The hook can also skips default resolution and provide a custom URL.\n  if (specifier === 'special-module') {\n    return {\n      url: 'file:///path/to/special-module.mjs',\n      format: 'module',\n      shortCircuit: true,  // This is mandatory if not calling nextResolve().\n    };\n  }\n\n  // If no customization is needed, defer to the next hook in the chain which would be the\n  // Node.js default resolve if this is the last user-specified loader.\n  return nextResolve(specifier);\n}\n</code></pre>",
                  "displayName": "Asynchronous `resolve(specifier, context, nextResolve)`"
                },
                {
                  "textRaw": "Asynchronous `load(url, context, nextLoad)`",
                  "name": "asynchronous_`load(url,_context,_nextload)`",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": "v22.6.0",
                        "pr-url": "https://github.com/nodejs/node/pull/56350",
                        "description": "Add support for `source` with format `commonjs-typescript` and `module-typescript`."
                      },
                      {
                        "version": "v20.6.0",
                        "pr-url": "https://github.com/nodejs/node/pull/47999",
                        "description": "Add support for `source` with format `commonjs`."
                      },
                      {
                        "version": [
                          "v18.6.0",
                          "v16.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/42623",
                        "description": "Add support for chaining load hooks. Each hook must either call `nextLoad()` or include a `shortCircuit` property set to `true` in its return."
                      }
                    ]
                  },
                  "desc": "<ul>\n<li><code>url</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The URL returned by the <code>resolve</code> chain</li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>conditions</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> Export conditions of the relevant <code>package.json</code></li>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The format optionally supplied by the <code>resolve</code> hook chain. This can be any string value as an input; input values do not need to\nconform to the list of acceptable return values described below.</li>\n<li><code>importAttributes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n</li>\n<li><code>nextLoad</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> The subsequent <code>load</code> hook in the chain, or the\nNode.js default <code>load</code> hook after the last user-supplied <code>load</code> hook\n<ul>\n<li><code>url</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> When omitted, defaults are provided. When provided, defaults are\nmerged in with preference to the provided properties. In the default <code>nextLoad</code>, if\nthe module pointed to by <code>url</code> does not have explicit module type information,\n<code>context.format</code> is mandatory.\n<!-- TODO(joyeecheung): make it at least optionally non-mandatory by allowing\n     JS-style/TS-style module detection when the format is simply unknown -->\n</li>\n</ul>\n</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> The asynchronous version takes either an object containing the\nfollowing properties, or a <code>Promise</code> that will resolve to such an object.\n<ul>\n<li><code>format</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>shortCircuit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> A signal that this hook intends to\nterminate the chain of <code>load</code> hooks. <strong>Default:</strong> <code>false</code></li>\n<li><code>source</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> The source for Node.js to evaluate</li>\n</ul>\n</li>\n</ul>\n<blockquote>\n<p><strong>Warning</strong>: The asynchronous <code>load</code> hook and namespaced exports from CommonJS\nmodules are incompatible. Attempting to use them together will result in an empty\nobject from the import. This may be addressed in the future. This does not apply\nto the synchronous <code>load</code> hook, in which case exports can be used as usual.</p>\n</blockquote>\n<p>The asynchronous version works similarly to the synchronous version, though\nwhen using the asynchronous <code>load</code> hook, omitting vs providing a <code>source</code> for\n<code>'commonjs'</code> has very different effects:</p>\n<ul>\n<li>When a <code>source</code> is provided, all <code>require</code> calls from this module will be\nprocessed by the ESM loader with registered <code>resolve</code> and <code>load</code> hooks; all\n<code>require.resolve</code> calls from this module will be processed by the ESM loader\nwith registered <code>resolve</code> hooks; only a subset of the CommonJS API will be\navailable (e.g. no <code>require.extensions</code>, no <code>require.cache</code>, no\n<code>require.resolve.paths</code>) and monkey-patching on the CommonJS module loader\nwill not apply.</li>\n<li>If <code>source</code> is undefined or <code>null</code>, it will be handled by the CommonJS module\nloader and <code>require</code>/<code>require.resolve</code> calls will not go through the\nregistered hooks. This behavior for nullish <code>source</code> is temporary — in the\nfuture, nullish <code>source</code> will not be supported.</li>\n</ul>\n<p>These caveats do not apply to the synchronous <code>load</code> hook, in which case\nthe complete set of CommonJS APIs available to the customized CommonJS\nmodules, and <code>require</code>/<code>require.resolve</code> always go through the registered\nhooks.</p>\n<p>The Node.js internal asynchronous <code>load</code> implementation, which is the value of <code>next</code> for the\nlast hook in the <code>load</code> chain, returns <code>null</code> for <code>source</code> when <code>format</code> is\n<code>'commonjs'</code> for backward compatibility. Here is an example hook that would\nopt-in to using the non-default behavior:</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs/promises';\n\n// Asynchronous version accepted by module.register(). This fix is not needed\n// for the synchronous version accepted by module.registerHooks().\nexport async function load(url, context, nextLoad) {\n  const result = await nextLoad(url, context);\n  if (result.format === 'commonjs') {\n    result.source ??= await readFile(new URL(result.responseURL ?? url));\n  }\n  return result;\n}\n</code></pre>\n<p>This doesn't apply to the synchronous <code>load</code> hook either, in which case the\n<code>source</code> returned contains source code loaded by the next hook, regardless\nof module format.</p>",
                  "displayName": "Asynchronous `load(url, context, nextLoad)`"
                }
              ],
              "methods": [
                {
                  "textRaw": "`initialize()`",
                  "name": "initialize",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v20.6.0",
                      "v18.19.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>The <code>initialize</code> hook is only accepted by <a href=\"#moduleregisterspecifier-parenturl-options\"><code>register</code></a>. <code>registerHooks()</code> does\nnot support nor need it since initialization done for synchronous hooks can be run\ndirectly before the call to <code>registerHooks()</code>.</p>\n<p>The <code>initialize</code> hook provides a way to define a custom function that runs in\nthe hooks thread when the hooks module is initialized. Initialization happens\nwhen the hooks module is registered via <a href=\"#moduleregisterspecifier-parenturl-options\"><code>register</code></a>.</p>\n<p>This hook can receive data from a <a href=\"#moduleregisterspecifier-parenturl-options\"><code>register</code></a> invocation, including\nports and other transferable objects. The return value of <code>initialize</code> can be a\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a>, in which case it will be awaited before the main application thread\nexecution resumes.</p>\n<p>Module customization code:</p>\n<pre><code class=\"language-mjs\">// path-to-my-hooks.js\n\nexport async function initialize({ number, port }) {\n  port.postMessage(`increment: ${number + 1}`);\n}\n</code></pre>\n<p>Caller code:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { register } from 'node:module';\nimport { MessageChannel } from 'node:worker_threads';\n\n// This example showcases how a message channel can be used to communicate\n// between the main (application) thread and the hooks running on the hooks\n// thread, by sending `port2` to the `initialize` hook.\nconst { port1, port2 } = new MessageChannel();\n\nport1.on('message', (msg) => {\n  assert.strictEqual(msg, 'increment: 2');\n});\nport1.unref();\n\nregister('./path-to-my-hooks.js', {\n  parentURL: import.meta.url,\n  data: { number: 1, port: port2 },\n  transferList: [port2],\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { register } = require('node:module');\nconst { pathToFileURL } = require('node:url');\nconst { MessageChannel } = require('node:worker_threads');\n\n// This example showcases how a message channel can be used to communicate\n// between the main (application) thread and the hooks running on the hooks\n// thread, by sending `port2` to the `initialize` hook.\nconst { port1, port2 } = new MessageChannel();\n\nport1.on('message', (msg) => {\n  assert.strictEqual(msg, 'increment: 2');\n});\nport1.unref();\n\nregister('./path-to-my-hooks.js', {\n  parentURL: pathToFileURL(__filename),\n  data: { number: 1, port: port2 },\n  transferList: [port2],\n});\n</code></pre>"
                }
              ],
              "displayName": "Asynchronous customization hooks"
            },
            {
              "textRaw": "Examples",
              "name": "examples",
              "type": "misc",
              "desc": "<p>The various module customization hooks can be used together to accomplish\nwide-ranging customizations of the Node.js code loading and evaluation\nbehaviors.</p>",
              "modules": [
                {
                  "textRaw": "Import from HTTPS",
                  "name": "import_from_https",
                  "type": "module",
                  "desc": "<p>The hook below registers hooks to enable rudimentary support for such\nspecifiers. While this may seem like a significant improvement to Node.js core\nfunctionality, there are substantial downsides to actually using these hooks:\nperformance is much slower than loading files from disk, there is no caching,\nand there is no security.</p>\n<pre><code class=\"language-mjs\">// https-hooks.mjs\nimport { get } from 'node:https';\n\nexport function load(url, context, nextLoad) {\n  // For JavaScript to be loaded over the network, we need to fetch and\n  // return it.\n  if (url.startsWith('https://')) {\n    return new Promise((resolve, reject) => {\n      get(url, (res) => {\n        let data = '';\n        res.setEncoding('utf8');\n        res.on('data', (chunk) => data += chunk);\n        res.on('end', () => resolve({\n          // This example assumes all network-provided JavaScript is ES module\n          // code.\n          format: 'module',\n          shortCircuit: true,\n          source: data,\n        }));\n      }).on('error', (err) => reject(err));\n    });\n  }\n\n  // Let Node.js handle all other URLs.\n  return nextLoad(url);\n}\n</code></pre>\n<pre><code class=\"language-mjs\">// main.mjs\nimport { VERSION } from 'https://coffeescript.org/browser-compiler-modern/coffeescript.js';\n\nconsole.log(VERSION);\n</code></pre>\n<p>With the preceding hooks module, running\n<code>node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(pathToFileURL(\"./https-hooks.mjs\"));' ./main.mjs</code>\nprints the current version of CoffeeScript per the module at the URL in\n<code>main.mjs</code>.</p>\n<!-- TODO(joyeecheung): add an example on how to implement it with a fetchSync based on\nworkers and Atomics.wait() - or all these examples are too much to be put in the API\ndocumentation already and should be put into a repository instead? -->",
                  "displayName": "Import from HTTPS"
                },
                {
                  "textRaw": "Transpilation",
                  "name": "transpilation",
                  "type": "module",
                  "desc": "<p>Sources that are in formats Node.js doesn't understand can be converted into\nJavaScript using the <a href=\"#synchronous-loadurl-context-nextload\"><code>load</code> hook</a>.</p>\n<p>This is less performant than transpiling source files before running Node.js;\ntranspiler hooks should only be used for development and testing purposes.</p>",
                  "modules": [
                    {
                      "textRaw": "Asynchronous version",
                      "name": "asynchronous_version",
                      "type": "module",
                      "desc": "<pre><code class=\"language-mjs\">// coffeescript-hooks.mjs\nimport { readFile } from 'node:fs/promises';\nimport { findPackageJSON } from 'node:module';\nimport coffeescript from 'coffeescript';\n\nconst extensionsRegex = /\\.(coffee|litcoffee|coffee\\.md)$/;\n\nexport async function load(url, context, nextLoad) {\n  if (extensionsRegex.test(url)) {\n    // CoffeeScript files can be either CommonJS or ES modules. Use a custom format\n    // to tell Node.js not to detect its module type.\n    const { source: rawSource } = await nextLoad(url, { ...context, format: 'coffee' });\n    // This hook converts CoffeeScript source code into JavaScript source code\n    // for all imported CoffeeScript files.\n    const transformedSource = coffeescript.compile(rawSource.toString(), url);\n\n    // To determine how Node.js would interpret the transpilation result,\n    // search up the file system for the nearest parent package.json file\n    // and read its \"type\" field.\n    return {\n      format: await getPackageType(url),\n      shortCircuit: true,\n      source: transformedSource,\n    };\n  }\n\n  // Let Node.js handle all other URLs.\n  return nextLoad(url, context);\n}\n\nasync function getPackageType(url) {\n  // `url` is only a file path during the first iteration when passed the\n  // resolved url from the load() hook\n  // an actual file path from load() will contain a file extension as it's\n  // required by the spec\n  // this simple truthy check for whether `url` contains a file extension will\n  // work for most projects but does not cover some edge-cases (such as\n  // extensionless files or a url ending in a trailing space)\n  const pJson = findPackageJSON(url);\n\n  return readFile(pJson, 'utf8')\n    .then(JSON.parse)\n    .then((json) => json?.type)\n    .catch(() => undefined);\n}\n</code></pre>",
                      "displayName": "Asynchronous version"
                    },
                    {
                      "textRaw": "Synchronous version",
                      "name": "synchronous_version",
                      "type": "module",
                      "desc": "<pre><code class=\"language-mjs\">// coffeescript-sync-hooks.mjs\nimport { readFileSync } from 'node:fs';\nimport { registerHooks, findPackageJSON } from 'node:module';\nimport coffeescript from 'coffeescript';\n\nconst extensionsRegex = /\\.(coffee|litcoffee|coffee\\.md)$/;\n\nfunction load(url, context, nextLoad) {\n  if (extensionsRegex.test(url)) {\n    const { source: rawSource } = nextLoad(url, { ...context, format: 'coffee' });\n    const transformedSource = coffeescript.compile(rawSource.toString(), url);\n\n    return {\n      format: getPackageType(url),\n      shortCircuit: true,\n      source: transformedSource,\n    };\n  }\n\n  return nextLoad(url, context);\n}\n\nfunction getPackageType(url) {\n  const pJson = findPackageJSON(url);\n  if (!pJson) {\n    return undefined;\n  }\n  try {\n    const file = readFileSync(pJson, 'utf-8');\n    return JSON.parse(file)?.type;\n  } catch {\n    return undefined;\n  }\n}\n\nregisterHooks({ load });\n</code></pre>",
                      "displayName": "Synchronous version"
                    }
                  ],
                  "displayName": "Transpilation"
                },
                {
                  "textRaw": "Running hooks",
                  "name": "running_hooks",
                  "type": "module",
                  "desc": "<pre><code class=\"language-coffee\"># main.coffee\nimport { scream } from './scream.coffee'\nconsole.log scream 'hello, world'\n\nimport { version } from 'node:process'\nconsole.log \"Brought to you by Node.js version #{version}\"\n</code></pre>\n<pre><code class=\"language-coffee\"># scream.coffee\nexport scream = (str) -> str.toUpperCase()\n</code></pre>\n<p>For the sake of running the example, add a <code>package.json</code> file containing the\nmodule type of the CoffeeScript files.</p>\n<pre><code class=\"language-json\">{\n  \"type\": \"module\"\n}\n</code></pre>\n<p>This is only for running the example. In real world loaders, <code>getPackageType()</code> must be\nable to return an <code>format</code> known to Node.js even in the absence of an explicit type in a\n<code>package.json</code>, or otherwise the <code>nextLoad</code> call would throw <code>ERR_UNKNOWN_FILE_EXTENSION</code>\n(if undefined) or <code>ERR_UNKNOWN_MODULE_FORMAT</code> (if it's not a known format listed in\nthe <a href=\"#synchronous-loadurl-context-nextload\">load hook</a> documentation).</p>\n<p>With the preceding hooks modules, running\n<code>node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(pathToFileURL(\"./coffeescript-hooks.mjs\"));' ./main.coffee</code>\nor <code>node --import ./coffeescript-sync-hooks.mjs ./main.coffee</code>\ncauses <code>main.coffee</code> to be turned into JavaScript after its source code is\nloaded from disk but before Node.js executes it; and so on for any <code>.coffee</code>,\n<code>.litcoffee</code> or <code>.coffee.md</code> files referenced via <code>import</code> statements of any\nloaded file.</p>",
                  "displayName": "Running hooks"
                },
                {
                  "textRaw": "Import maps",
                  "name": "import_maps",
                  "type": "module",
                  "desc": "<p>The previous two examples defined <code>load</code> hooks. This is an example of a\n<code>resolve</code> hook. This hooks module reads an <code>import-map.json</code> file that defines\nwhich specifiers to override to other URLs (this is a very simplistic\nimplementation of a small subset of the \"import maps\" specification).</p>",
                  "modules": [
                    {
                      "textRaw": "Asynchronous version",
                      "name": "asynchronous_version",
                      "type": "module",
                      "desc": "<pre><code class=\"language-mjs\">// import-map-hooks.js\nimport fs from 'node:fs/promises';\n\nconst { imports } = JSON.parse(await fs.readFile('import-map.json'));\n\nexport async function resolve(specifier, context, nextResolve) {\n  if (Object.hasOwn(imports, specifier)) {\n    return nextResolve(imports[specifier], context);\n  }\n\n  return nextResolve(specifier, context);\n}\n</code></pre>",
                      "displayName": "Asynchronous version"
                    },
                    {
                      "textRaw": "Synchronous version",
                      "name": "synchronous_version",
                      "type": "module",
                      "desc": "<pre><code class=\"language-mjs\">// import-map-sync-hooks.js\nimport fs from 'node:fs/promises';\nimport module from 'node:module';\n\nconst { imports } = JSON.parse(fs.readFileSync('import-map.json', 'utf-8'));\n\nfunction resolve(specifier, context, nextResolve) {\n  if (Object.hasOwn(imports, specifier)) {\n    return nextResolve(imports[specifier], context);\n  }\n\n  return nextResolve(specifier, context);\n}\n\nmodule.registerHooks({ resolve });\n</code></pre>",
                      "displayName": "Synchronous version"
                    },
                    {
                      "textRaw": "Using the hooks",
                      "name": "using_the_hooks",
                      "type": "module",
                      "desc": "<p>With these files:</p>\n<pre><code class=\"language-mjs\">// main.js\nimport 'a-module';\n</code></pre>\n<pre><code class=\"language-json\">// import-map.json\n{\n  \"imports\": {\n    \"a-module\": \"./some-module.js\"\n  }\n}\n</code></pre>\n<pre><code class=\"language-mjs\">// some-module.js\nconsole.log('some module!');\n</code></pre>\n<p>Running <code>node --import 'data:text/javascript,import { register } from \"node:module\"; import { pathToFileURL } from \"node:url\"; register(pathToFileURL(\"./import-map-hooks.js\"));' main.js</code>\nor <code>node --import ./import-map-sync-hooks.js main.js</code>\nshould print <code>some module!</code>.</p>",
                      "displayName": "Using the hooks"
                    }
                  ],
                  "displayName": "Import maps"
                }
              ],
              "displayName": "Examples"
            }
          ]
        }
      ],
      "displayName": "Modules: `node:module` API",
      "source": "doc/api/module.md"
    },
    {
      "textRaw": "Modules: TypeScript",
      "name": "modules:_typescript",
      "introduced_in": "v22.6.0",
      "type": "module",
      "meta": {
        "changes": [
          {
            "version": "v26.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/61803",
            "description": "Removed `--experimental-transform-types` flag."
          },
          {
            "version": [
              "v25.2.0",
              "v24.12.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/60600",
            "description": "Type stripping is now stable."
          },
          {
            "version": [
              "v24.3.0",
              "v22.18.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/58643",
            "description": "Type stripping no longer emits an experimental warning."
          },
          {
            "version": [
              "v23.6.0",
              "v22.18.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/56350",
            "description": "Type stripping is enabled by default."
          },
          {
            "version": "v22.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/54283",
            "description": "Added `--experimental-transform-types` flag."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "modules": [
        {
          "textRaw": "Enabling",
          "name": "enabling",
          "type": "module",
          "desc": "<p>There are two ways to enable runtime TypeScript support in Node.js:</p>\n<ol>\n<li>\n<p>For <a href=\"#full-typescript-support\">full support</a> of all of TypeScript's syntax and features, including\nusing any version of TypeScript, use a third-party package.</p>\n</li>\n<li>\n<p>For lightweight support, you can use the built-in support for\n<a href=\"#type-stripping\">type stripping</a>.</p>\n</li>\n</ol>",
          "displayName": "Enabling"
        },
        {
          "textRaw": "Full TypeScript support",
          "name": "full_typescript_support",
          "type": "module",
          "desc": "<p>To use TypeScript with full support for all TypeScript features, including\n<code>tsconfig.json</code>, you can use a third-party package. These instructions use\n<a href=\"https://tsx.hirok.io/\"><code>tsx</code></a> as an example but there are many other similar libraries available.</p>\n<ol>\n<li>\n<p>Install the package as a development dependency using whatever package\nmanager you're using for your project. For example, with <code>npm</code>:</p>\n<pre><code class=\"language-bash\">npm install --save-dev tsx\n</code></pre>\n</li>\n<li>\n<p>Then you can run your TypeScript code via:</p>\n<pre><code class=\"language-bash\">npx tsx your-file.ts\n</code></pre>\n<p>Or alternatively, you can run with <code>node</code> via:</p>\n<pre><code class=\"language-bash\">node --import=tsx your-file.ts\n</code></pre>\n</li>\n</ol>",
          "displayName": "Full TypeScript support"
        },
        {
          "textRaw": "Type stripping",
          "name": "type_stripping",
          "type": "module",
          "meta": {
            "added": [
              "v22.6.0"
            ],
            "changes": [
              {
                "version": [
                  "v25.2.0",
                  "v24.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/60600",
                "description": "Type stripping is now stable."
              }
            ]
          },
          "desc": "<p>By default Node.js will execute TypeScript files that contains only\nerasable TypeScript syntax.\nNode.js will replace TypeScript syntax with whitespace,\nand no type checking is performed.\nTo disable this feature, use the flag <a href=\"cli.html#--no-strip-types\"><code>--no-strip-types</code></a>.</p>\n<p>Node.js ignores <code>tsconfig.json</code> files and therefore\nfeatures that depend on settings within <code>tsconfig.json</code>,\nsuch as paths or converting newer JavaScript syntax to older standards, are\nintentionally unsupported. To get full TypeScript support, see <a href=\"#full-typescript-support\">Full TypeScript support</a>.</p>\n<p>The type stripping feature is designed to be lightweight.\nBy intentionally not supporting syntaxes that require JavaScript code\ngeneration, and by replacing inline types with whitespace, Node.js can run\nTypeScript code without the need for source maps.</p>\n<p>Type stripping is compatible with most versions of TypeScript\nbut we recommend version 5.8 or newer with the following <code>tsconfig.json</code> settings:</p>\n<pre><code class=\"language-json\">{\n  \"compilerOptions\": {\n     \"noEmit\": true, // Optional - see note below\n     \"target\": \"esnext\",\n     \"module\": \"nodenext\",\n     \"rewriteRelativeImportExtensions\": true,\n     \"erasableSyntaxOnly\": true,\n     \"verbatimModuleSyntax\": true\n  }\n}\n</code></pre>\n<p>Use the <code>noEmit</code> option if you intend to only execute <code>*.ts</code> files, for example\na build script. You won't need this flag if you intend to distribute <code>*.js</code>\nfiles.</p>",
          "modules": [
            {
              "textRaw": "Determining module system",
              "name": "determining_module_system",
              "type": "module",
              "desc": "<p>Node.js supports both <a href=\"modules.html\">CommonJS</a> and <a href=\"esm.html\">ES Modules</a> syntax in TypeScript\nfiles. Node.js will not convert from one module system to another; if you want\nyour code to run as an ES module, you must use <code>import</code> and <code>export</code> syntax, and\nif you want your code to run as CommonJS you must use <code>require</code> and\n<code>module.exports</code>.</p>\n<ul>\n<li><code>.ts</code> files will have their module system determined <a href=\"packages.html#determining-module-system\">the same way as <code>.js</code>\nfiles.</a> To use <code>import</code> and <code>export</code> syntax, add <code>\"type\": \"module\"</code> to the\nnearest parent <code>package.json</code>.</li>\n<li><code>.mts</code> files will always be run as ES modules, similar to <code>.mjs</code> files.</li>\n<li><code>.cts</code> files will always be run as CommonJS modules, similar to <code>.cjs</code> files.</li>\n<li><code>.tsx</code> files are unsupported.</li>\n</ul>\n<p>As in JavaScript files, <a href=\"esm.html#mandatory-file-extensions\">file extensions are mandatory</a> in <code>import</code> statements\nand <code>import()</code> expressions: <code>import './file.ts'</code>, not <code>import './file'</code>. Because\nof backward compatibility, file extensions are also mandatory in <code>require()</code>\ncalls: <code>require('./file.ts')</code>, not <code>require('./file')</code>, similar to how the\n<code>.cjs</code> extension is mandatory in <code>require</code> calls in CommonJS files.</p>\n<p>The <code>tsconfig.json</code> option <code>allowImportingTsExtensions</code> will allow the\nTypeScript compiler <code>tsc</code> to type-check files with <code>import</code> specifiers that\ninclude the <code>.ts</code> extension.</p>",
              "displayName": "Determining module system"
            },
            {
              "textRaw": "TypeScript features",
              "name": "typescript_features",
              "type": "module",
              "desc": "<p>Since Node.js is only removing inline types, any TypeScript features that\ninvolve <em>replacing</em> TypeScript syntax with new JavaScript syntax will error.</p>\n<p>The most prominent features that require transformation are:</p>\n<ul>\n<li><code>Enum</code> declarations</li>\n<li><code>namespace</code> with runtime code</li>\n<li>parameter properties</li>\n<li>import aliases</li>\n</ul>\n<p><code>namespace</code>s that do not contain runtime code are supported.\nThis example will work correctly:</p>\n<pre><code class=\"language-ts\">// This namespace is exporting a type\nnamespace TypeOnly {\n   export type A = string;\n}\n</code></pre>\n<p>This will result in <a href=\"errors.html#err_unsupported_typescript_syntax\"><code>ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX</code></a> error:</p>\n<pre><code class=\"language-ts\">// This namespace is exporting a value\nnamespace A {\n   export let x = 1\n}\n</code></pre>\n<p>Since Decorators are currently a <a href=\"https://github.com/tc39/proposal-decorators\">TC39 Stage 3 proposal</a>,\nthey are not transformed and will result in a parser error.\nNode.js does not provide polyfills and thus will not support decorators until\nthey are supported natively in JavaScript.</p>\n<p>In addition, Node.js does not read <code>tsconfig.json</code> files and does not support\nfeatures that depend on settings within <code>tsconfig.json</code>, such as paths or\nconverting newer JavaScript syntax into older standards.</p>",
              "displayName": "TypeScript features"
            },
            {
              "textRaw": "Importing types without `type` keyword",
              "name": "importing_types_without_`type`_keyword",
              "type": "module",
              "desc": "<p>Due to the nature of type stripping, the <code>type</code> keyword is necessary to\ncorrectly strip type imports. Without the <code>type</code> keyword, Node.js will treat the\nimport as a value import, which will result in a runtime error. The tsconfig\noption <a href=\"https://www.typescriptlang.org/tsconfig/#verbatimModuleSyntax\"><code>verbatimModuleSyntax</code></a> can be used to match this behavior.</p>\n<p>This example will work correctly:</p>\n<pre><code class=\"language-ts\">import type { Type1, Type2 } from './module.ts';\nimport { fn, type FnParams } from './fn.ts';\n</code></pre>\n<p>This will result in a runtime error:</p>\n<pre><code class=\"language-ts\">import { Type1, Type2 } from './module.ts';\nimport { fn, FnParams } from './fn.ts';\n</code></pre>",
              "displayName": "Importing types without `type` keyword"
            },
            {
              "textRaw": "Non-file forms of input",
              "name": "non-file_forms_of_input",
              "type": "module",
              "desc": "<p>Type stripping can be enabled for <code>--eval</code> and STDIN. The module system\nwill be determined by <code>--input-type</code>, as it is for JavaScript.</p>\n<p>TypeScript syntax is unsupported in the REPL, <code>--check</code>, and\n<code>inspect</code>.</p>",
              "displayName": "Non-file forms of input"
            },
            {
              "textRaw": "Source maps",
              "name": "source_maps",
              "type": "module",
              "desc": "<p>Since inline types are replaced by whitespace, source maps are unnecessary for\ncorrect line numbers in stack traces; and Node.js does not generate them.</p>",
              "displayName": "Source maps"
            },
            {
              "textRaw": "Type stripping in dependencies",
              "name": "type_stripping_in_dependencies",
              "type": "module",
              "desc": "<p>To discourage package authors from publishing packages written in TypeScript,\nNode.js refuses to handle TypeScript files inside folders under a <code>node_modules</code>\npath.</p>",
              "displayName": "Type stripping in dependencies"
            },
            {
              "textRaw": "Paths aliases",
              "name": "paths_aliases",
              "type": "module",
              "desc": "<p><a href=\"https://www.typescriptlang.org/tsconfig/#paths\"><code>tsconfig</code> \"paths\"</a> won't be transformed and therefore produce an error. The closest\nfeature available is <a href=\"packages.html#subpath-imports\">subpath imports</a> with the limitation that they need to start\nwith <code>#</code>.</p>",
              "displayName": "Paths aliases"
            }
          ],
          "displayName": "Type stripping"
        }
      ],
      "displayName": "Modules: TypeScript",
      "source": "doc/api/typescript.md"
    },
    {
      "textRaw": "Net",
      "name": "net",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:net</code> module provides an asynchronous network API for creating stream-based\nTCP or <a href=\"#ipc-support\">IPC</a> servers (<a href=\"#netcreateserveroptions-connectionlistener\"><code>net.createServer()</code></a>) and clients\n(<a href=\"#netcreateconnection\"><code>net.createConnection()</code></a>).</p>\n<p>It can be accessed using:</p>\n<pre><code class=\"language-mjs\">import net from 'node:net';\n</code></pre>\n<pre><code class=\"language-cjs\">const net = require('node:net');\n</code></pre>",
      "modules": [
        {
          "textRaw": "IPC support",
          "name": "ipc_support",
          "type": "module",
          "meta": {
            "changes": [
              {
                "version": "v20.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/49667",
                "description": "Support binding to abstract Unix domain socket path like `\\0abstract`. We can bind '\\0' for Node.js `< v20.4.0`."
              }
            ]
          },
          "desc": "<p>The <code>node:net</code> module supports IPC with named pipes on Windows, and Unix domain\nsockets on other operating systems.</p>",
          "modules": [
            {
              "textRaw": "Identifying paths for IPC connections",
              "name": "identifying_paths_for_ipc_connections",
              "type": "module",
              "desc": "<p><a href=\"#netconnect\"><code>net.connect()</code></a>, <a href=\"#netcreateconnection\"><code>net.createConnection()</code></a>, <a href=\"#serverlisten\"><code>server.listen()</code></a>, and\n<a href=\"#socketconnect\"><code>socket.connect()</code></a> take a <code>path</code> parameter to identify IPC endpoints.</p>\n<p>On Unix, the local domain is also known as the Unix domain. The path is a\nfile system pathname. It will throw an error when the length of pathname is\ngreater than the length of <code>sizeof(sockaddr_un.sun_path)</code>. Typical values are\n107 bytes on Linux and 103 bytes on macOS. If a Node.js API abstraction creates\nthe Unix domain socket, it will unlink the Unix domain socket as well. For\nexample, <a href=\"#netcreateserveroptions-connectionlistener\"><code>net.createServer()</code></a> may create a Unix domain socket and\n<a href=\"#serverclosecallback\"><code>server.close()</code></a> will unlink it. But if a user creates the Unix domain\nsocket outside of these abstractions, the user will need to remove it. The same\napplies when a Node.js API creates a Unix domain socket but the program then\ncrashes. In short, a Unix domain socket will be visible in the file system and\nwill persist until unlinked. On Linux, You can use Unix abstract socket by adding\n<code>\\0</code> to the beginning of the path, such as <code>\\0abstract</code>. The path to the Unix\nabstract socket is not visible in the file system and it will disappear automatically\nwhen all open references to the socket are closed.</p>\n<p>On Windows, the local domain is implemented using a named pipe. The path <em>must</em>\nrefer to an entry in <code>\\\\?\\pipe\\</code> or <code>\\\\.\\pipe\\</code>. Any characters are permitted,\nbut the latter may do some processing of pipe names, such as resolving <code>..</code>\nsequences. Despite how it might look, the pipe namespace is flat. Pipes will\n<em>not persist</em>. They are removed when the last reference to them is closed.\nUnlike Unix domain sockets, Windows will close and remove the pipe when the\nowning process exits.</p>\n<p>JavaScript string escaping requires paths to be specified with extra backslash\nescaping such as:</p>\n<pre><code class=\"language-js\">net.createServer().listen(\n  path.join('\\\\\\\\?\\\\pipe', process.cwd(), 'myctl'));\n</code></pre>",
              "displayName": "Identifying paths for IPC connections"
            }
          ],
          "displayName": "IPC support"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `net.BlockList`",
          "name": "net.BlockList",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.18.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>BlockList</code> object can be used with some network APIs to specify rules for\ndisabling inbound or outbound access to specific IP addresses, IP ranges, or\nIP subnets.</p>",
          "methods": [
            {
              "textRaw": "`blockList.addAddress(address[, type])`",
              "name": "addAddress",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`address` {string|net.SocketAddress} An IPv4 or IPv6 address.",
                      "name": "address",
                      "type": "string|net.SocketAddress",
                      "desc": "An IPv4 or IPv6 address."
                    },
                    {
                      "textRaw": "`type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`.",
                      "name": "type",
                      "type": "string",
                      "default": "`'ipv4'`",
                      "desc": "Either `'ipv4'` or `'ipv6'`.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Adds a rule to block the given IP address.</p>"
            },
            {
              "textRaw": "`blockList.addRange(start, end[, type])`",
              "name": "addRange",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`start` {string|net.SocketAddress} The starting IPv4 or IPv6 address in the range.",
                      "name": "start",
                      "type": "string|net.SocketAddress",
                      "desc": "The starting IPv4 or IPv6 address in the range."
                    },
                    {
                      "textRaw": "`end` {string|net.SocketAddress} The ending IPv4 or IPv6 address in the range.",
                      "name": "end",
                      "type": "string|net.SocketAddress",
                      "desc": "The ending IPv4 or IPv6 address in the range."
                    },
                    {
                      "textRaw": "`type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`.",
                      "name": "type",
                      "type": "string",
                      "default": "`'ipv4'`",
                      "desc": "Either `'ipv4'` or `'ipv6'`.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Adds a rule to block a range of IP addresses from <code>start</code> (inclusive) to\n<code>end</code> (inclusive).</p>"
            },
            {
              "textRaw": "`blockList.addSubnet(net, prefix[, type])`",
              "name": "addSubnet",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`net` {string|net.SocketAddress} The network IPv4 or IPv6 address.",
                      "name": "net",
                      "type": "string|net.SocketAddress",
                      "desc": "The network IPv4 or IPv6 address."
                    },
                    {
                      "textRaw": "`prefix` {number} The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`.",
                      "name": "prefix",
                      "type": "number",
                      "desc": "The number of CIDR prefix bits. For IPv4, this must be a value between `0` and `32`. For IPv6, this must be between `0` and `128`."
                    },
                    {
                      "textRaw": "`type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`.",
                      "name": "type",
                      "type": "string",
                      "default": "`'ipv4'`",
                      "desc": "Either `'ipv4'` or `'ipv6'`.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Adds a rule to block a range of IP addresses specified as a subnet mask.</p>"
            },
            {
              "textRaw": "`blockList.check(address[, type])`",
              "name": "check",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`address` {string|net.SocketAddress} The IP address to check",
                      "name": "address",
                      "type": "string|net.SocketAddress",
                      "desc": "The IP address to check"
                    },
                    {
                      "textRaw": "`type` {string} Either `'ipv4'` or `'ipv6'`. **Default:** `'ipv4'`.",
                      "name": "type",
                      "type": "string",
                      "default": "`'ipv4'`",
                      "desc": "Either `'ipv4'` or `'ipv6'`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the given IP address matches any of the rules added to the\n<code>BlockList</code>.</p>\n<pre><code class=\"language-js\">const blockList = new net.BlockList();\nblockList.addAddress('123.123.123.123');\nblockList.addRange('10.0.0.1', '10.0.0.10');\nblockList.addSubnet('8592:757c:efae:4e45::', 64, 'ipv6');\n\nconsole.log(blockList.check('123.123.123.123'));  // Prints: true\nconsole.log(blockList.check('10.0.0.3'));  // Prints: true\nconsole.log(blockList.check('222.111.111.222'));  // Prints: false\n\n// IPv6 notation for IPv4 addresses works:\nconsole.log(blockList.check('::ffff:7b7b:7b7b', 'ipv6')); // Prints: true\nconsole.log(blockList.check('::ffff:123.123.123.123', 'ipv6')); // Prints: true\n</code></pre>"
            },
            {
              "textRaw": "`BlockList.isBlockList(value)`",
              "name": "isBlockList",
              "type": "method",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any} Any JS value",
                      "name": "value",
                      "type": "any",
                      "desc": "Any JS value"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns `true` if the `value` is a `net.BlockList`.",
                    "name": "return",
                    "desc": "`true` if the `value` is a `net.BlockList`."
                  }
                }
              ]
            },
            {
              "textRaw": "`blockList.fromJSON(value)`",
              "name": "fromJSON",
              "type": "method",
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "value"
                    }
                  ]
                }
              ],
              "desc": " <!-- YAML\nadded:\n - v24.5.0\n - v22.19.0\n-->\n<pre><code class=\"language-js\">const blockList = new net.BlockList();\nconst data = [\n  'Subnet: IPv4 192.168.1.0/24',\n  'Address: IPv4 10.0.0.5',\n  'Range: IPv4 192.168.2.1-192.168.2.10',\n  'Range: IPv4 10.0.0.1-10.0.0.10',\n];\nblockList.fromJSON(data);\nblockList.fromJSON(JSON.stringify(data));\n</code></pre>\n<ul>\n<li><code>value</code> Blocklist.rules</li>\n</ul>"
            },
            {
              "textRaw": "`blockList.toJSON()`",
              "name": "toJSON",
              "type": "method",
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns Blocklist.rules",
                    "name": "return",
                    "desc": "Blocklist.rules"
                  }
                }
              ],
              "desc": " <!-- YAML\nadded:\n - v24.5.0\n - v22.19.0\n-->"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string[]}",
              "name": "rules",
              "type": "string[]",
              "meta": {
                "added": [
                  "v15.0.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "desc": "<p>The list of rules added to the blocklist.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `net.SocketAddress`",
          "name": "net.SocketAddress",
          "type": "class",
          "meta": {
            "added": [
              "v15.14.0",
              "v14.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "textRaw": "`new net.SocketAddress([options])`",
              "name": "net.SocketAddress",
              "type": "ctor",
              "meta": {
                "added": [
                  "v15.14.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`address` {string} The network address as either an IPv4 or IPv6 string. **Default**: `'127.0.0.1'` if `family` is `'ipv4'`; `'::'` if `family` is `'ipv6'`.",
                      "name": "address",
                      "type": "string",
                      "desc": "The network address as either an IPv4 or IPv6 string. **Default**: `'127.0.0.1'` if `family` is `'ipv4'`; `'::'` if `family` is `'ipv6'`."
                    },
                    {
                      "textRaw": "`family` {string} One of either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`.",
                      "name": "family",
                      "type": "string",
                      "desc": "One of either `'ipv4'` or `'ipv6'`. **Default**: `'ipv4'`."
                    },
                    {
                      "textRaw": "`flowlabel` {number} An IPv6 flow-label used only if `family` is `'ipv6'`.",
                      "name": "flowlabel",
                      "type": "number",
                      "desc": "An IPv6 flow-label used only if `family` is `'ipv6'`."
                    },
                    {
                      "textRaw": "`port` {number} An IP port.",
                      "name": "port",
                      "type": "number",
                      "desc": "An IP port."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string}",
              "name": "address",
              "type": "string",
              "meta": {
                "added": [
                  "v15.14.0",
                  "v14.18.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {string} Either `'ipv4'` or `'ipv6'`.",
              "name": "family",
              "type": "string",
              "meta": {
                "added": [
                  "v15.14.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "desc": "Either `'ipv4'` or `'ipv6'`."
            },
            {
              "textRaw": "Type: {number}",
              "name": "flowlabel",
              "type": "number",
              "meta": {
                "added": [
                  "v15.14.0",
                  "v14.18.0"
                ],
                "changes": []
              }
            },
            {
              "textRaw": "Type: {number}",
              "name": "port",
              "type": "number",
              "meta": {
                "added": [
                  "v15.14.0",
                  "v14.18.0"
                ],
                "changes": []
              }
            }
          ],
          "methods": [
            {
              "textRaw": "`SocketAddress.parse(input)`",
              "name": "parse",
              "type": "method",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {string} An input string containing an IP address and optional port, e.g. `123.1.2.3:1234` or `[1::1]:1234`.",
                      "name": "input",
                      "type": "string",
                      "desc": "An input string containing an IP address and optional port, e.g. `123.1.2.3:1234` or `[1::1]:1234`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.SocketAddress} Returns a `SocketAddress` if parsing was successful. Otherwise returns `undefined`.",
                    "name": "return",
                    "type": "net.SocketAddress",
                    "desc": "Returns a `SocketAddress` if parsing was successful. Otherwise returns `undefined`."
                  }
                }
              ]
            }
          ]
        },
        {
          "textRaw": "Class: `net.Server`",
          "name": "net.Server",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.90"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>This class is used to create a TCP or <a href=\"#ipc-support\">IPC</a> server.</p>",
          "signatures": [
            {
              "textRaw": "`new net.Server([options][, connectionListener])`",
              "name": "net.Server",
              "type": "ctor",
              "params": [
                {
                  "textRaw": "`options` {Object} See `net.createServer([options][, connectionListener])`.",
                  "name": "options",
                  "type": "Object",
                  "desc": "See `net.createServer([options][, connectionListener])`.",
                  "optional": true
                },
                {
                  "textRaw": "`connectionListener` {Function} Automatically set as a listener for the `'connection'` event.",
                  "name": "connectionListener",
                  "type": "Function",
                  "desc": "Automatically set as a listener for the `'connection'` event.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {net.Server}",
                "name": "return",
                "type": "net.Server"
              },
              "desc": "<p><code>net.Server</code> is an <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a> with the following events:</p>"
            }
          ],
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the server closes. If connections exist, this\nevent is not emitted until all connections are ended.</p>"
            },
            {
              "textRaw": "Event: `'connection'`",
              "name": "connection",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "Type: {net.Socket} The connection object",
                  "name": "type",
                  "type": "net.Socket",
                  "desc": "The connection object"
                }
              ],
              "desc": "<p>Emitted when a new connection is made. <code>socket</code> is an instance of\n<code>net.Socket</code>.</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "name": "error",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "Type: {Error}",
                  "name": "type",
                  "type": "Error"
                }
              ],
              "desc": "<p>Emitted when an error occurs. Unlike <a href=\"#class-netsocket\"><code>net.Socket</code></a>, the <a href=\"#event-close\"><code>'close'</code></a>\nevent will <strong>not</strong> be emitted directly following this event unless\n<a href=\"#serverclosecallback\"><code>server.close()</code></a> is manually called. See the example in discussion of\n<a href=\"#serverlisten\"><code>server.listen()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'listening'`",
              "name": "listening",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the server has been bound after calling <a href=\"#serverlisten\"><code>server.listen()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'drop'`",
              "name": "drop",
              "type": "event",
              "meta": {
                "added": [
                  "v18.6.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`data` {Object} The argument passed to event listener.",
                  "name": "data",
                  "type": "Object",
                  "desc": "The argument passed to event listener.",
                  "options": [
                    {
                      "textRaw": "`localAddress` {string} Local address.",
                      "name": "localAddress",
                      "type": "string",
                      "desc": "Local address."
                    },
                    {
                      "textRaw": "`localPort` {number} Local port.",
                      "name": "localPort",
                      "type": "number",
                      "desc": "Local port."
                    },
                    {
                      "textRaw": "`localFamily` {string} Local family.",
                      "name": "localFamily",
                      "type": "string",
                      "desc": "Local family."
                    },
                    {
                      "textRaw": "`remoteAddress` {string} Remote address.",
                      "name": "remoteAddress",
                      "type": "string",
                      "desc": "Remote address."
                    },
                    {
                      "textRaw": "`remotePort` {number} Remote port.",
                      "name": "remotePort",
                      "type": "number",
                      "desc": "Remote port."
                    },
                    {
                      "textRaw": "`remoteFamily` {string} Remote IP family. `'IPv4'` or `'IPv6'`.",
                      "name": "remoteFamily",
                      "type": "string",
                      "desc": "Remote IP family. `'IPv4'` or `'IPv6'`."
                    }
                  ]
                }
              ],
              "desc": "<p>When the number of connections reaches the threshold of <code>server.maxConnections</code>,\nthe server will drop new connections and emit <code>'drop'</code> event instead. If it is a\nTCP server, the argument is as follows, otherwise the argument is <code>undefined</code>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`server.address()`",
              "name": "address",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v18.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/43054",
                    "description": "The `family` property now returns a string instead of a number."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41431",
                    "description": "The `family` property now returns a number instead of a string."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object|string|null}",
                    "name": "return",
                    "type": "Object|string|null"
                  }
                }
              ],
              "desc": "<p>Returns the bound <code>address</code>, the address <code>family</code> name, and <code>port</code> of the server\nas reported by the operating system if listening on an IP socket\n(useful to find which port was assigned when getting an OS-assigned address):\n<code>{ port: 12346, family: 'IPv4', address: '127.0.0.1' }</code>.</p>\n<p>For a server listening on a pipe or Unix domain socket, the name is returned\nas a string.</p>\n<pre><code class=\"language-js\">const server = net.createServer((socket) => {\n  socket.end('goodbye\\n');\n}).on('error', (err) => {\n  // Handle errors here.\n  throw err;\n});\n\n// Grab an arbitrary unused port.\nserver.listen(() => {\n  console.log('opened server on', server.address());\n});\n</code></pre>\n<p><code>server.address()</code> returns <code>null</code> before the <code>'listening'</code> event has been\nemitted or after calling <code>server.close()</code>.</p>"
            },
            {
              "textRaw": "`server.close([callback])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} Called when the server is closed.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Called when the server is closed.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Server}",
                    "name": "return",
                    "type": "net.Server"
                  }
                }
              ],
              "desc": "<p>Stops the server from accepting new connections and keeps existing\nconnections. This function is asynchronous, the server is finally closed\nwhen all connections are ended and the server emits a <a href=\"#event-close\"><code>'close'</code></a> event.\nThe optional <code>callback</code> will be called once the <code>'close'</code> event occurs. Unlike\nthat event, it will be called with an <code>Error</code> as its only argument if the server\nwas not open when it was closed.</p>"
            },
            {
              "textRaw": "`server[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v20.5.0",
                  "v18.18.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58467",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <a href=\"#serverclosecallback\"><code>server.close()</code></a> and returns a promise that fulfills when the\nserver has closed.</p>"
            },
            {
              "textRaw": "`server.getConnections(callback)`",
              "name": "getConnections",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Server}",
                    "name": "return",
                    "type": "net.Server"
                  }
                }
              ],
              "desc": "<p>Asynchronously get the number of concurrent connections on the server. Works\nwhen sockets were sent to forks.</p>\n<p>Callback should take two arguments <code>err</code> and <code>count</code>.</p>"
            },
            {
              "textRaw": "`server.listen()`",
              "name": "listen",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Start a server listening for connections. A <code>net.Server</code> can be a TCP or\nan <a href=\"#ipc-support\">IPC</a> server depending on what it listens to.</p>\n<p>Possible signatures:</p>\n<ul>\n<li><a href=\"#serverlistenhandle-backlog-callback\"><code>server.listen(handle[, backlog][, callback])</code></a></li>\n<li><a href=\"#serverlistenoptions-callback\"><code>server.listen(options[, callback])</code></a></li>\n<li><a href=\"#serverlistenpath-backlog-callback\"><code>server.listen(path[, backlog][, callback])</code></a>\nfor <a href=\"#ipc-support\">IPC</a> servers</li>\n<li><a href=\"#serverlistenport-host-backlog-callback\"><code>server.listen([port[, host[, backlog]]][, callback])</code></a>\nfor TCP servers</li>\n</ul>\n<p>This function is asynchronous. When the server starts listening, the\n<a href=\"#event-listening\"><code>'listening'</code></a> event will be emitted. The last parameter <code>callback</code>\nwill be added as a listener for the <a href=\"#event-listening\"><code>'listening'</code></a> event.</p>\n<p>All <code>listen()</code> methods can take a <code>backlog</code> parameter to specify the maximum\nlength of the queue of pending connections. The actual length will be determined\nby the OS through sysctl settings such as <code>tcp_max_syn_backlog</code> and <code>somaxconn</code>\non Linux. The default value of this parameter is 511 (not 512).</p>\n<p>All <a href=\"#class-netsocket\"><code>net.Socket</code></a> are set to <code>SO_REUSEADDR</code> (see <a href=\"https://man7.org/linux/man-pages/man7/socket.7.html\"><code>socket(7)</code></a> for\ndetails).</p>\n<p>The <code>server.listen()</code> method can be called again if and only if there was an\nerror during the first <code>server.listen()</code> call or <code>server.close()</code> has been\ncalled. Otherwise, an <code>ERR_SERVER_ALREADY_LISTEN</code> error will be thrown.</p>\n<p>One of the most common errors raised when listening is <code>EADDRINUSE</code>.\nThis happens when another server is already listening on the requested\n<code>port</code>/<code>path</code>/<code>handle</code>. One way to handle this would be to retry\nafter a certain amount of time:</p>\n<pre><code class=\"language-js\">server.on('error', (e) => {\n  if (e.code === 'EADDRINUSE') {\n    console.error('Address in use, retrying...');\n    setTimeout(() => {\n      server.close();\n      server.listen(PORT, HOST);\n    }, 1000);\n  }\n});\n</code></pre>",
              "methods": [
                {
                  "textRaw": "`server.listen(handle[, backlog][, callback])`",
                  "name": "listen",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.5.10"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`handle` {Object}",
                          "name": "handle",
                          "type": "Object"
                        },
                        {
                          "textRaw": "`backlog` {number} Common parameter of `server.listen()` functions",
                          "name": "backlog",
                          "type": "number",
                          "desc": "Common parameter of `server.listen()` functions",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}",
                          "name": "callback",
                          "type": "Function",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {net.Server}",
                        "name": "return",
                        "type": "net.Server"
                      }
                    }
                  ],
                  "desc": "<p>Start a server listening for connections on a given <code>handle</code> that has\nalready been bound to a port, a Unix domain socket, or a Windows named pipe.</p>\n<p>The <code>handle</code> object can be either a server, a socket (anything with an\nunderlying <code>_handle</code> member), or an object with an <code>fd</code> member that is a\nvalid file descriptor.</p>\n<p>Listening on a file descriptor is not supported on Windows.</p>"
                },
                {
                  "textRaw": "`server.listen(options[, callback])`",
                  "name": "listen",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.11.14"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v23.1.0",
                          "v22.12.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/55408",
                        "description": "The `reusePort` option is supported."
                      },
                      {
                        "version": "v15.6.0",
                        "pr-url": "https://github.com/nodejs/node/pull/36623",
                        "description": "AbortSignal support was added."
                      },
                      {
                        "version": "v11.4.0",
                        "pr-url": "https://github.com/nodejs/node/pull/23798",
                        "description": "The `ipv6Only` option is supported."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object} Required. Supports the following properties:",
                          "name": "options",
                          "type": "Object",
                          "desc": "Required. Supports the following properties:",
                          "options": [
                            {
                              "textRaw": "`backlog` {number} Common parameter of `server.listen()` functions.",
                              "name": "backlog",
                              "type": "number",
                              "desc": "Common parameter of `server.listen()` functions."
                            },
                            {
                              "textRaw": "`exclusive` {boolean} **Default:** `false`",
                              "name": "exclusive",
                              "type": "boolean",
                              "default": "`false`"
                            },
                            {
                              "textRaw": "`host` {string}",
                              "name": "host",
                              "type": "string"
                            },
                            {
                              "textRaw": "`ipv6Only` {boolean} For TCP servers, setting `ipv6Only` to `true` will disable dual-stack support, i.e., binding to host `::` won't make `0.0.0.0` be bound. **Default:** `false`.",
                              "name": "ipv6Only",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "For TCP servers, setting `ipv6Only` to `true` will disable dual-stack support, i.e., binding to host `::` won't make `0.0.0.0` be bound."
                            },
                            {
                              "textRaw": "`reusePort` {boolean} For TCP servers, setting `reusePort` to `true` allows multiple sockets on the same host to bind to the same port. Incoming connections are distributed by the operating system to listening sockets. This option is available only on some platforms, such as Linux 3.9+, DragonFlyBSD 3.6+, FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+. On unsupported platforms, this option raises an error. **Default:** `false`.",
                              "name": "reusePort",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "For TCP servers, setting `reusePort` to `true` allows multiple sockets on the same host to bind to the same port. Incoming connections are distributed by the operating system to listening sockets. This option is available only on some platforms, such as Linux 3.9+, DragonFlyBSD 3.6+, FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+. On unsupported platforms, this option raises an error."
                            },
                            {
                              "textRaw": "`path` {string} Will be ignored if `port` is specified. See Identifying paths for IPC connections.",
                              "name": "path",
                              "type": "string",
                              "desc": "Will be ignored if `port` is specified. See Identifying paths for IPC connections."
                            },
                            {
                              "textRaw": "`port` {number}",
                              "name": "port",
                              "type": "number"
                            },
                            {
                              "textRaw": "`readableAll` {boolean} For IPC servers makes the pipe readable for all users. **Default:** `false`.",
                              "name": "readableAll",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "For IPC servers makes the pipe readable for all users."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} An AbortSignal that may be used to close a listening server.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "An AbortSignal that may be used to close a listening server."
                            },
                            {
                              "textRaw": "`writableAll` {boolean} For IPC servers makes the pipe writable for all users. **Default:** `false`.",
                              "name": "writableAll",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "For IPC servers makes the pipe writable for all users."
                            }
                          ]
                        },
                        {
                          "textRaw": "`callback` {Function} functions.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "functions.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {net.Server}",
                        "name": "return",
                        "type": "net.Server"
                      }
                    }
                  ],
                  "desc": "<p>If <code>port</code> is specified, it behaves the same as\n<a href=\"#serverlistenport-host-backlog-callback\"><code>server.listen([port[, host[, backlog]]][, callback])</code></a>.\nOtherwise, if <code>path</code> is specified, it behaves the same as\n<a href=\"#serverlistenpath-backlog-callback\"><code>server.listen(path[, backlog][, callback])</code></a>.\nIf none of them is specified, an error will be thrown.</p>\n<p>If <code>exclusive</code> is <code>false</code> (default), then cluster workers will use the same\nunderlying handle, allowing connection handling duties to be shared. When\n<code>exclusive</code> is <code>true</code>, the handle is not shared, and attempted port sharing\nresults in an error. An example which listens on an exclusive port is\nshown below.</p>\n<pre><code class=\"language-js\">server.listen({\n  host: 'localhost',\n  port: 80,\n  exclusive: true,\n});\n</code></pre>\n<p>When <code>exclusive</code> is <code>true</code> and the underlying handle is shared, it is\npossible that several workers query a handle with different backlogs.\nIn this case, the first <code>backlog</code> passed to the master process will be used.</p>\n<p>Starting an IPC server as root may cause the server path to be inaccessible for\nunprivileged users. Using <code>readableAll</code> and <code>writableAll</code> will make the server\naccessible for all users.</p>\n<p>If the <code>signal</code> option is enabled, calling <code>.abort()</code> on the corresponding\n<code>AbortController</code> is similar to calling <code>.close()</code> on the server:</p>\n<pre><code class=\"language-js\">const controller = new AbortController();\nserver.listen({\n  host: 'localhost',\n  port: 80,\n  signal: controller.signal,\n});\n// Later, when you want to close the server.\ncontroller.abort();\n</code></pre>"
                },
                {
                  "textRaw": "`server.listen(path[, backlog][, callback])`",
                  "name": "listen",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.90"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`path` {string} Path the server should listen to. See Identifying paths for IPC connections.",
                          "name": "path",
                          "type": "string",
                          "desc": "Path the server should listen to. See Identifying paths for IPC connections."
                        },
                        {
                          "textRaw": "`backlog` {number} Common parameter of `server.listen()` functions.",
                          "name": "backlog",
                          "type": "number",
                          "desc": "Common parameter of `server.listen()` functions.",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}.",
                          "name": "callback",
                          "type": "Function",
                          "desc": ".",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {net.Server}",
                        "name": "return",
                        "type": "net.Server"
                      }
                    }
                  ],
                  "desc": "<p>Start an <a href=\"#ipc-support\">IPC</a> server listening for connections on the given <code>path</code>.</p>"
                },
                {
                  "textRaw": "`server.listen([port[, host[, backlog]]][, callback])`",
                  "name": "listen",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.90"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`port` {number}",
                          "name": "port",
                          "type": "number",
                          "optional": true
                        },
                        {
                          "textRaw": "`host` {string}",
                          "name": "host",
                          "type": "string",
                          "optional": true
                        },
                        {
                          "textRaw": "`backlog` {number} Common parameter of `server.listen()` functions.",
                          "name": "backlog",
                          "type": "number",
                          "desc": "Common parameter of `server.listen()` functions.",
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function}.",
                          "name": "callback",
                          "type": "Function",
                          "desc": ".",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {net.Server}",
                        "name": "return",
                        "type": "net.Server"
                      }
                    }
                  ],
                  "desc": "<p>Start a TCP server listening for connections on the given <code>port</code> and <code>host</code>.</p>\n<p>If <code>port</code> is omitted or is 0, the operating system will assign an arbitrary\nunused port, which can be retrieved by using <code>server.address().port</code>\nafter the <a href=\"#event-listening\"><code>'listening'</code></a> event has been emitted.</p>\n<p>If <code>host</code> is omitted, the server will accept connections on the\n<a href=\"https://en.wikipedia.org/wiki/IPv6_address#Unspecified_address\">unspecified IPv6 address</a> (<code>::</code>) when IPv6 is available, or the\n<a href=\"https://en.wikipedia.org/wiki/0.0.0.0\">unspecified IPv4 address</a> (<code>0.0.0.0</code>) otherwise.</p>\n<p>In most operating systems, listening to the <a href=\"https://en.wikipedia.org/wiki/IPv6_address#Unspecified_address\">unspecified IPv6 address</a> (<code>::</code>)\nmay cause the <code>net.Server</code> to also listen on the <a href=\"https://en.wikipedia.org/wiki/0.0.0.0\">unspecified IPv4 address</a>\n(<code>0.0.0.0</code>).</p>"
                }
              ]
            },
            {
              "textRaw": "`server.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {net.Server}",
                    "name": "return",
                    "type": "net.Server"
                  }
                }
              ],
              "desc": "<p>Opposite of <code>unref()</code>, calling <code>ref()</code> on a previously <code>unref</code>ed server will\n<em>not</em> let the program exit if it's the only server left (the default behavior).\nIf the server is <code>ref</code>ed calling <code>ref()</code> again will have no effect.</p>"
            },
            {
              "textRaw": "`server.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {net.Server}",
                    "name": "return",
                    "type": "net.Server"
                  }
                }
              ],
              "desc": "<p>Calling <code>unref()</code> on a server will allow the program to exit if this is the only\nactive server in the event system. If the server is already <code>unref</code>ed calling\n<code>unref()</code> again will have no effect.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean} Indicates whether or not the server is listening for connections.",
              "name": "listening",
              "type": "boolean",
              "meta": {
                "added": [
                  "v5.7.0"
                ],
                "changes": []
              },
              "desc": "Indicates whether or not the server is listening for connections."
            },
            {
              "textRaw": "Type: {integer}",
              "name": "maxConnections",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.2.0"
                ],
                "changes": [
                  {
                    "version": "v21.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/48276",
                    "description": "Setting `maxConnections` to `0` drops all the incoming connections. Previously, it was interpreted as `Infinity`."
                  }
                ]
              },
              "desc": "<p>When the number of connections reaches the <code>server.maxConnections</code> threshold:</p>\n<ol>\n<li>\n<p>If the process is not running in cluster mode, Node.js will close the connection.</p>\n</li>\n<li>\n<p>If the process is running in cluster mode, Node.js will, by default, route the connection to another worker process. To close the connection instead, set <a href=\"#serverdropmaxconnection\"><code>server.dropMaxConnection</code></a> to <code>true</code>.</p>\n</li>\n</ol>\n<p>It is not recommended to use this option once a socket has been sent to a child\nwith <a href=\"child_process.html#child_processforkmodulepath-args-options\"><code>child_process.fork()</code></a>.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "dropMaxConnection",
              "type": "boolean",
              "meta": {
                "added": [
                  "v23.1.0",
                  "v22.12.0"
                ],
                "changes": []
              },
              "desc": "<p>Set this property to <code>true</code> to begin closing connections once the number of connections reaches the <a href=\"#servermaxconnections\"><code>server.maxConnections</code></a> threshold. This setting is only effective in cluster mode.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `net.Socket`",
          "name": "net.Socket",
          "type": "class",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a></li>\n</ul>\n<p>This class is an abstraction of a TCP socket or a streaming <a href=\"#ipc-support\">IPC</a> endpoint\n(uses named pipes on Windows, and Unix domain sockets otherwise). It is also\nan <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a>.</p>\n<p>A <code>net.Socket</code> can be created by the user and used directly to interact with\na server. For example, it is returned by <a href=\"#netcreateconnection\"><code>net.createConnection()</code></a>,\nso the user can use it to talk to the server.</p>\n<p>It can also be created by Node.js and passed to the user when a connection\nis received. For example, it is passed to the listeners of a\n<a href=\"#event-connection\"><code>'connection'</code></a> event emitted on a <a href=\"#class-netserver\"><code>net.Server</code></a>, so the user can use\nit to interact with the client.</p>",
          "signatures": [
            {
              "textRaw": "`new net.Socket([options])`",
              "name": "net.Socket",
              "type": "ctor",
              "meta": {
                "added": [
                  "v0.3.4"
                ],
                "changes": [
                  {
                    "version": "v25.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61503",
                    "description": "Added `typeOfService` option."
                  },
                  {
                    "version": "v15.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37735",
                    "description": "AbortSignal support was added."
                  },
                  {
                    "version": "v12.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/25436",
                    "description": "Added `onread` option."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`options` {Object} Available options are:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Available options are:",
                  "options": [
                    {
                      "textRaw": "`allowHalfOpen` {boolean} If set to `false`, then the socket will automatically end the writable side when the readable side ends. See `net.createServer()` and the `'end'` event for details. **Default:** `false`.",
                      "name": "allowHalfOpen",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `false`, then the socket will automatically end the writable side when the readable side ends. See `net.createServer()` and the `'end'` event for details."
                    },
                    {
                      "textRaw": "`blockList` {net.BlockList} `blockList` can be used for disabling outbound access to specific IP addresses, IP ranges, or IP subnets.",
                      "name": "blockList",
                      "type": "net.BlockList",
                      "desc": "`blockList` can be used for disabling outbound access to specific IP addresses, IP ranges, or IP subnets."
                    },
                    {
                      "textRaw": "`fd` {number} If specified, wrap around an existing socket with the given file descriptor, otherwise a new socket will be created.",
                      "name": "fd",
                      "type": "number",
                      "desc": "If specified, wrap around an existing socket with the given file descriptor, otherwise a new socket will be created."
                    },
                    {
                      "textRaw": "`keepAlive` {boolean} If set to `true`, it enables keep-alive functionality on the socket immediately after the connection is established, similarly on what is done in `socket.setKeepAlive()`. **Default:** `false`.",
                      "name": "keepAlive",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, it enables keep-alive functionality on the socket immediately after the connection is established, similarly on what is done in `socket.setKeepAlive()`."
                    },
                    {
                      "textRaw": "`keepAliveInitialDelay` {number} If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. **Default:** `0`.",
                      "name": "keepAliveInitialDelay",
                      "type": "number",
                      "default": "`0`",
                      "desc": "If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket."
                    },
                    {
                      "textRaw": "`noDelay` {boolean} If set to `true`, it disables the use of Nagle's algorithm immediately after the socket is established. **Default:** `false`.",
                      "name": "noDelay",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, it disables the use of Nagle's algorithm immediately after the socket is established."
                    },
                    {
                      "textRaw": "`onread` {Object} If specified, incoming data is stored in a single `buffer` and passed to the supplied `callback` when data arrives on the socket. This will cause the streaming functionality to not provide any data. The socket will emit events like `'error'`, `'end'`, and `'close'` as usual. Methods like `pause()` and `resume()` will also behave as expected.",
                      "name": "onread",
                      "type": "Object",
                      "desc": "If specified, incoming data is stored in a single `buffer` and passed to the supplied `callback` when data arrives on the socket. This will cause the streaming functionality to not provide any data. The socket will emit events like `'error'`, `'end'`, and `'close'` as usual. Methods like `pause()` and `resume()` will also behave as expected.",
                      "options": [
                        {
                          "textRaw": "`buffer` {Buffer|Uint8Array|Function} Either a reusable chunk of memory to use for storing incoming data or a function that returns such.",
                          "name": "buffer",
                          "type": "Buffer|Uint8Array|Function",
                          "desc": "Either a reusable chunk of memory to use for storing incoming data or a function that returns such."
                        },
                        {
                          "textRaw": "`callback` {Function} This function is called for every chunk of incoming data. Two arguments are passed to it: the number of bytes written to `buffer` and a reference to `buffer`. Return `false` from this function to implicitly `pause()` the socket. This function will be executed in the global context.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "This function is called for every chunk of incoming data. Two arguments are passed to it: the number of bytes written to `buffer` and a reference to `buffer`. Return `false` from this function to implicitly `pause()` the socket. This function will be executed in the global context."
                        }
                      ]
                    },
                    {
                      "textRaw": "`readable` {boolean} Allow reads on the socket when an `fd` is passed, otherwise ignored. **Default:** `false`.",
                      "name": "readable",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Allow reads on the socket when an `fd` is passed, otherwise ignored."
                    },
                    {
                      "textRaw": "`signal` {AbortSignal} An Abort signal that may be used to destroy the socket.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "An Abort signal that may be used to destroy the socket."
                    },
                    {
                      "textRaw": "`typeOfService` {number} The initial Type of Service (TOS) value.",
                      "name": "typeOfService",
                      "type": "number",
                      "desc": "The initial Type of Service (TOS) value."
                    },
                    {
                      "textRaw": "`writable` {boolean} Allow writes on the socket when an `fd` is passed, otherwise ignored. **Default:** `false`.",
                      "name": "writable",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Allow writes on the socket when an `fd` is passed, otherwise ignored."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {net.Socket}",
                "name": "return",
                "type": "net.Socket"
              },
              "desc": "<p>Creates a new socket object.</p>\n<p>The newly created socket can be either a TCP socket or a streaming <a href=\"#ipc-support\">IPC</a>\nendpoint, depending on what it <a href=\"#socketconnect\"><code>connect()</code></a> to.</p>"
            }
          ],
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`hadError` {boolean} `true` if the socket had a transmission error.",
                  "name": "hadError",
                  "type": "boolean",
                  "desc": "`true` if the socket had a transmission error."
                }
              ],
              "desc": "<p>Emitted once the socket is fully closed. The argument <code>hadError</code> is a boolean\nwhich says if the socket was closed due to a transmission error.</p>"
            },
            {
              "textRaw": "Event: `'connect'`",
              "name": "connect",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when a socket connection is successfully established.\nSee <a href=\"#netcreateconnection\"><code>net.createConnection()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'connectionAttempt'`",
              "name": "connectionAttempt",
              "type": "event",
              "meta": {
                "added": [
                  "v21.6.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`ip` {string} The IP which the socket is attempting to connect to.",
                  "name": "ip",
                  "type": "string",
                  "desc": "The IP which the socket is attempting to connect to."
                },
                {
                  "textRaw": "`port` {number} The port which the socket is attempting to connect to.",
                  "name": "port",
                  "type": "number",
                  "desc": "The port which the socket is attempting to connect to."
                },
                {
                  "textRaw": "`family` {number} The family of the IP. It can be `6` for IPv6 or `4` for IPv4.",
                  "name": "family",
                  "type": "number",
                  "desc": "The family of the IP. It can be `6` for IPv6 or `4` for IPv4."
                }
              ],
              "desc": "<p>Emitted when a new connection attempt is started. This may be emitted multiple times\nif the family autoselection algorithm is enabled in <a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options)</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'connectionAttemptFailed'`",
              "name": "connectionAttemptFailed",
              "type": "event",
              "meta": {
                "added": [
                  "v21.6.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`ip` {string} The IP which the socket attempted to connect to.",
                  "name": "ip",
                  "type": "string",
                  "desc": "The IP which the socket attempted to connect to."
                },
                {
                  "textRaw": "`port` {number} The port which the socket attempted to connect to.",
                  "name": "port",
                  "type": "number",
                  "desc": "The port which the socket attempted to connect to."
                },
                {
                  "textRaw": "`family` {number} The family of the IP. It can be `6` for IPv6 or `4` for IPv4.",
                  "name": "family",
                  "type": "number",
                  "desc": "The family of the IP. It can be `6` for IPv6 or `4` for IPv4."
                },
                {
                  "textRaw": "`error` {Error} The error associated with the failure.",
                  "name": "error",
                  "type": "Error",
                  "desc": "The error associated with the failure."
                }
              ],
              "desc": "<p>Emitted when a connection attempt failed. This may be emitted multiple times\nif the family autoselection algorithm is enabled in <a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options)</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'connectionAttemptTimeout'`",
              "name": "connectionAttemptTimeout",
              "type": "event",
              "meta": {
                "added": [
                  "v21.6.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`ip` {string} The IP which the socket attempted to connect to.",
                  "name": "ip",
                  "type": "string",
                  "desc": "The IP which the socket attempted to connect to."
                },
                {
                  "textRaw": "`port` {number} The port which the socket attempted to connect to.",
                  "name": "port",
                  "type": "number",
                  "desc": "The port which the socket attempted to connect to."
                },
                {
                  "textRaw": "`family` {number} The family of the IP. It can be `6` for IPv6 or `4` for IPv4.",
                  "name": "family",
                  "type": "number",
                  "desc": "The family of the IP. It can be `6` for IPv6 or `4` for IPv4."
                }
              ],
              "desc": "<p>Emitted when a connection attempt timed out. This is only emitted (and may be\nemitted multiple times) if the family autoselection algorithm is enabled\nin <a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options)</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'data'`",
              "name": "data",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "Type: {Buffer|string}",
                  "name": "type",
                  "type": "Buffer|string"
                }
              ],
              "desc": "<p>Emitted when data is received. The argument <code>data</code> will be a <code>Buffer</code> or\n<code>String</code>. Encoding of data is set by <a href=\"#socketsetencodingencoding\"><code>socket.setEncoding()</code></a>.</p>\n<p>The data will be lost if there is no listener when a <code>Socket</code>\nemits a <code>'data'</code> event.</p>"
            },
            {
              "textRaw": "Event: `'drain'`",
              "name": "drain",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the write buffer becomes empty. Can be used to throttle uploads.</p>\n<p>See also: the return values of <code>socket.write()</code>.</p>"
            },
            {
              "textRaw": "Event: `'end'`",
              "name": "end",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when the other end of the socket signals the end of transmission, thus\nending the readable side of the socket.</p>\n<p>By default (<code>allowHalfOpen</code> is <code>false</code>) the socket will send an end of\ntransmission packet back and destroy its file descriptor once it has written out\nits pending write queue. However, if <code>allowHalfOpen</code> is set to <code>true</code>, the\nsocket will not automatically <a href=\"#socketenddata-encoding-callback\"><code>end()</code></a> its writable side,\nallowing the user to write arbitrary amounts of data. The user must call\n<a href=\"#socketenddata-encoding-callback\"><code>end()</code></a> explicitly to close the connection (i.e. sending a\nFIN packet back).</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "name": "error",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "Type: {Error}",
                  "name": "type",
                  "type": "Error"
                }
              ],
              "desc": "<p>Emitted when an error occurs. The <code>'close'</code> event will be called directly\nfollowing this event.</p>"
            },
            {
              "textRaw": "Event: `'lookup'`",
              "name": "lookup",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.3"
                ],
                "changes": [
                  {
                    "version": "v5.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5598",
                    "description": "The `host` parameter is supported now."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`err` {Error|null} The error object. See `dns.lookup()`.",
                  "name": "err",
                  "type": "Error|null",
                  "desc": "The error object. See `dns.lookup()`."
                },
                {
                  "textRaw": "`address` {string} The IP address.",
                  "name": "address",
                  "type": "string",
                  "desc": "The IP address."
                },
                {
                  "textRaw": "`family` {number|null} The address type. See `dns.lookup()`.",
                  "name": "family",
                  "type": "number|null",
                  "desc": "The address type. See `dns.lookup()`."
                },
                {
                  "textRaw": "`host` {string} The host name.",
                  "name": "host",
                  "type": "string",
                  "desc": "The host name."
                }
              ],
              "desc": "<p>Emitted after resolving the host name but before connecting.\nNot applicable to Unix sockets.</p>"
            },
            {
              "textRaw": "Event: `'ready'`",
              "name": "ready",
              "type": "event",
              "meta": {
                "added": [
                  "v9.11.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted when a socket is ready to be used.</p>\n<p>Triggered immediately after <code>'connect'</code>.</p>"
            },
            {
              "textRaw": "Event: `'timeout'`",
              "name": "timeout",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Emitted if the socket times out from inactivity. This is only to notify that\nthe socket has been idle. The user must manually close the connection.</p>\n<p>See also: <a href=\"#socketsettimeouttimeout-callback\"><code>socket.setTimeout()</code></a>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`socket.address()`",
              "name": "address",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v18.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/43054",
                    "description": "The `family` property now returns a string instead of a number."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41431",
                    "description": "The `family` property now returns a number instead of a string."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns the bound <code>address</code>, the address <code>family</code> name and <code>port</code> of the\nsocket as reported by the operating system:\n<code>{ port: 12346, family: 'IPv4', address: '127.0.0.1' }</code></p>"
            },
            {
              "textRaw": "`socket.connect()`",
              "name": "connect",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Initiate a connection on a given socket.</p>\n<p>Possible signatures:</p>\n<ul>\n<li><a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options[, connectListener])</code></a></li>\n<li><a href=\"#socketconnectpath-connectlistener\"><code>socket.connect(path[, connectListener])</code></a>\nfor <a href=\"#ipc-support\">IPC</a> connections.</li>\n<li><a href=\"#socketconnectport-host-connectlistener\"><code>socket.connect(port[, host][, connectListener])</code></a>\nfor TCP connections.</li>\n<li>Returns: <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a> The socket itself.</li>\n</ul>\n<p>This function is asynchronous. When the connection is established, the\n<a href=\"#event-connect\"><code>'connect'</code></a> event will be emitted. If there is a problem connecting,\ninstead of a <a href=\"#event-connect\"><code>'connect'</code></a> event, an <a href=\"#event-error_1\"><code>'error'</code></a> event will be emitted with\nthe error passed to the <a href=\"#event-error_1\"><code>'error'</code></a> listener.\nThe last parameter <code>connectListener</code>, if supplied, will be added as a listener\nfor the <a href=\"#event-connect\"><code>'connect'</code></a> event <strong>once</strong>.</p>\n<p>This function should only be used for reconnecting a socket after\n<code>'close'</code> has been emitted or otherwise it may lead to undefined\nbehavior.</p>",
              "methods": [
                {
                  "textRaw": "`socket.connect(options[, connectListener])`",
                  "name": "connect",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.90"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v20.0.0",
                          "v18.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/46790",
                        "description": "The default value for the autoSelectFamily option is now true. The `--enable-network-family-autoselection` CLI flag has been renamed to `--network-family-autoselection`. The old name is now an alias but it is discouraged."
                      },
                      {
                        "version": "v19.4.0",
                        "pr-url": "https://github.com/nodejs/node/pull/45777",
                        "description": "The default value for autoSelectFamily option can be changed at runtime using `setDefaultAutoSelectFamily` or via the command line option `--enable-network-family-autoselection`."
                      },
                      {
                        "version": [
                          "v19.3.0",
                          "v18.13.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/44731",
                        "description": "Added the `autoSelectFamily` option."
                      },
                      {
                        "version": [
                          "v17.7.0",
                          "v16.15.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/41310",
                        "description": "The `noDelay`, `keepAlive`, and `keepAliveInitialDelay` options are supported now."
                      },
                      {
                        "version": "v6.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/6021",
                        "description": "The `hints` option defaults to `0` in all cases now. Previously, in the absence of the `family` option it would default to `dns.ADDRCONFIG | dns.V4MAPPED`."
                      },
                      {
                        "version": "v5.11.0",
                        "pr-url": "https://github.com/nodejs/node/pull/6000",
                        "description": "The `hints` option is supported now."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object"
                        },
                        {
                          "textRaw": "`connectListener` {Function} Common parameter of `socket.connect()` methods. Will be added as a listener for the `'connect'` event once.",
                          "name": "connectListener",
                          "type": "Function",
                          "desc": "Common parameter of `socket.connect()` methods. Will be added as a listener for the `'connect'` event once.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {net.Socket} The socket itself.",
                        "name": "return",
                        "type": "net.Socket",
                        "desc": "The socket itself."
                      }
                    }
                  ],
                  "desc": "<p>Initiate a connection on a given socket. Normally this method is not needed,\nthe socket should be created and opened with <a href=\"#netcreateconnection\"><code>net.createConnection()</code></a>. Use\nthis only when implementing a custom Socket.</p>\n<p>For TCP connections, available <code>options</code> are:</p>\n<ul>\n<li><code>autoSelectFamily</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a>: If set to <code>true</code>, it enables a family\nautodetection algorithm that loosely implements section 5 of <a href=\"https://www.rfc-editor.org/rfc/rfc8305.txt\">RFC 8305</a>. The\n<code>all</code> option passed to lookup is set to <code>true</code> and the sockets attempts to\nconnect to all obtained IPv6 and IPv4 addresses, in sequence, until a\nconnection is established. The first returned AAAA address is tried first,\nthen the first returned A address, then the second returned AAAA address and\nso on. Each connection attempt (but the last one) is given the amount of time\nspecified by the <code>autoSelectFamilyAttemptTimeout</code> option before timing out and\ntrying the next address. Ignored if the <code>family</code> option is not <code>0</code> or if\n<code>localAddress</code> is set. Connection errors are not emitted if at least one\nconnection succeeds. If all connections attempts fails, a single\n<code>AggregateError</code> with all failed attempts is emitted. <strong>Default:</strong>\n<a href=\"#netgetdefaultautoselectfamily\"><code>net.getDefaultAutoSelectFamily()</code></a>.</li>\n<li><code>autoSelectFamilyAttemptTimeout</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a>: The amount of time in milliseconds\nto wait for a connection attempt to finish before trying the next address when\nusing the <code>autoSelectFamily</code> option. If set to a positive integer less than\n<code>10</code>, then the value <code>10</code> will be used instead. <strong>Default:</strong>\n<a href=\"#netgetdefaultautoselectfamilyattempttimeout\"><code>net.getDefaultAutoSelectFamilyAttemptTimeout()</code></a>.</li>\n<li><code>family</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a>: Version of IP stack. Must be <code>4</code>, <code>6</code>, or <code>0</code>. The value\n<code>0</code> indicates that both IPv4 and IPv6 addresses are allowed. <strong>Default:</strong> <code>0</code>.</li>\n<li><code>hints</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Optional <a href=\"dns.html#supported-getaddrinfo-flags\"><code>dns.lookup()</code> hints</a>.</li>\n<li><code>host</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Host the socket should connect to. <strong>Default:</strong> <code>'localhost'</code>.</li>\n<li><code>localAddress</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Local address the socket should connect from.</li>\n<li><code>localPort</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Local port the socket should connect from.</li>\n<li><code>lookup</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> Custom lookup function. <strong>Default:</strong> <a href=\"dns.html#dnslookuphostname-options-callback\"><code>dns.lookup()</code></a>.</li>\n<li><code>port</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Required. Port the socket should connect to.</li>\n</ul>\n<p>For <a href=\"#ipc-support\">IPC</a> connections, available <code>options</code> are:</p>\n<ul>\n<li><code>path</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Required. Path the client should connect to.\nSee <a href=\"#identifying-paths-for-ipc-connections\">Identifying paths for IPC connections</a>. If provided, the TCP-specific\noptions above are ignored.</li>\n</ul>"
                },
                {
                  "textRaw": "`socket.connect(path[, connectListener])`",
                  "name": "connect",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`path` {string} Path the client should connect to. See Identifying paths for IPC connections.",
                          "name": "path",
                          "type": "string",
                          "desc": "Path the client should connect to. See Identifying paths for IPC connections."
                        },
                        {
                          "textRaw": "`connectListener` {Function} Common parameter of `socket.connect()` methods. Will be added as a listener for the `'connect'` event once.",
                          "name": "connectListener",
                          "type": "Function",
                          "desc": "Common parameter of `socket.connect()` methods. Will be added as a listener for the `'connect'` event once.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {net.Socket} The socket itself.",
                        "name": "return",
                        "type": "net.Socket",
                        "desc": "The socket itself."
                      }
                    }
                  ],
                  "desc": "<p>Initiate an <a href=\"#ipc-support\">IPC</a> connection on the given socket.</p>\n<p>Alias to\n<a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options[, connectListener])</code></a>\ncalled with <code>{ path: path }</code> as <code>options</code>.</p>"
                },
                {
                  "textRaw": "`socket.connect(port[, host][, connectListener])`",
                  "name": "connect",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.1.90"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`port` {number} Port the client should connect to.",
                          "name": "port",
                          "type": "number",
                          "desc": "Port the client should connect to."
                        },
                        {
                          "textRaw": "`host` {string} Host the client should connect to.",
                          "name": "host",
                          "type": "string",
                          "desc": "Host the client should connect to.",
                          "optional": true
                        },
                        {
                          "textRaw": "`connectListener` {Function} Common parameter of `socket.connect()` methods. Will be added as a listener for the `'connect'` event once.",
                          "name": "connectListener",
                          "type": "Function",
                          "desc": "Common parameter of `socket.connect()` methods. Will be added as a listener for the `'connect'` event once.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {net.Socket} The socket itself.",
                        "name": "return",
                        "type": "net.Socket",
                        "desc": "The socket itself."
                      }
                    }
                  ],
                  "desc": "<p>Initiate a TCP connection on the given socket.</p>\n<p>Alias to\n<a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options[, connectListener])</code></a>\ncalled with <code>{port: port, host: host}</code> as <code>options</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "`socket.destroy([error])`",
              "name": "destroy",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`error` {Object}",
                      "name": "error",
                      "type": "Object",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  }
                }
              ],
              "desc": "<p>Ensures that no more I/O activity happens on this socket.\nDestroys the stream and closes the connection.</p>\n<p>See <a href=\"stream.html#writabledestroyerror\"><code>writable.destroy()</code></a> for further details.</p>"
            },
            {
              "textRaw": "`socket.destroySoon()`",
              "name": "destroySoon",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Destroys the socket after all data is written. If the <code>'finish'</code> event was\nalready emitted the socket is destroyed immediately. If the socket is still\nwritable it implicitly calls <code>socket.end()</code>.</p>"
            },
            {
              "textRaw": "`socket.end([data[, encoding]][, callback])`",
              "name": "end",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|Uint8Array}",
                      "name": "data",
                      "type": "string|Buffer|Uint8Array",
                      "optional": true
                    },
                    {
                      "textRaw": "`encoding` {string} Only used when data is `string`. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "Only used when data is `string`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} Optional callback for when the socket is finished.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Optional callback for when the socket is finished.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Half-closes the socket. i.e., it sends a FIN packet. It is possible the\nserver will still send some data.</p>\n<p>See <a href=\"stream.html#writableendchunk-encoding-callback\"><code>writable.end()</code></a> for further details.</p>"
            },
            {
              "textRaw": "`socket.pause()`",
              "name": "pause",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Pauses the reading of data. That is, <a href=\"#event-data\"><code>'data'</code></a> events will not be emitted.\nUseful to throttle back an upload.</p>"
            },
            {
              "textRaw": "`socket.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Opposite of <code>unref()</code>, calling <code>ref()</code> on a previously <code>unref</code>ed socket will\n<em>not</em> let the program exit if it's the only socket left (the default behavior).\nIf the socket is <code>ref</code>ed calling <code>ref</code> again will have no effect.</p>"
            },
            {
              "textRaw": "`socket.resetAndDestroy()`",
              "name": "resetAndDestroy",
              "type": "method",
              "meta": {
                "added": [
                  "v18.3.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  }
                }
              ],
              "desc": "<p>Close the TCP connection by sending an RST packet and destroy the stream.\nIf this TCP socket is in connecting status, it will send an RST packet and destroy this TCP socket once it is connected.\nOtherwise, it will call <code>socket.destroy</code> with an <code>ERR_SOCKET_CLOSED</code> Error.\nIf this is not a TCP socket (for example, a pipe), calling this method will immediately throw an <code>ERR_INVALID_HANDLE_TYPE</code> Error.</p>"
            },
            {
              "textRaw": "`socket.resume()`",
              "name": "resume",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Resumes reading after a call to <a href=\"#socketpause\"><code>socket.pause()</code></a>.</p>"
            },
            {
              "textRaw": "`socket.setEncoding([encoding])`",
              "name": "setEncoding",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Set the encoding for the socket as a <a href=\"stream.html#class-streamreadable\">Readable Stream</a>. See\n<a href=\"stream.html#readablesetencodingencoding\"><code>readable.setEncoding()</code></a> for more information.</p>"
            },
            {
              "textRaw": "`socket.setKeepAlive([enable][, initialDelay])`",
              "name": "setKeepAlive",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.92"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32204",
                    "description": "New defaults for `TCP_KEEPCNT` and `TCP_KEEPINTVL` socket options were added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enable` {boolean} **Default:** `false`",
                      "name": "enable",
                      "type": "boolean",
                      "default": "`false`",
                      "optional": true
                    },
                    {
                      "textRaw": "`initialDelay` {number} **Default:** `0`",
                      "name": "initialDelay",
                      "type": "number",
                      "default": "`0`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Enable/disable keep-alive functionality, and optionally set the initial\ndelay before the first keepalive probe is sent on an idle socket.</p>\n<p>Set <code>initialDelay</code> (in milliseconds) to set the delay between the last\ndata packet received and the first keepalive probe. Setting <code>0</code> for\n<code>initialDelay</code> will leave the value unchanged from the default\n(or previous) setting.</p>\n<p>Enabling the keep-alive functionality will set the following socket options:</p>\n<ul>\n<li><code>SO_KEEPALIVE=1</code></li>\n<li><code>TCP_KEEPIDLE=initialDelay</code></li>\n<li><code>TCP_KEEPCNT=10</code></li>\n<li><code>TCP_KEEPINTVL=1</code></li>\n</ul>"
            },
            {
              "textRaw": "`socket.setNoDelay([noDelay])`",
              "name": "setNoDelay",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`noDelay` {boolean} **Default:** `true`",
                      "name": "noDelay",
                      "type": "boolean",
                      "default": "`true`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Enable/disable the use of Nagle's algorithm.</p>\n<p>When a TCP connection is created, it will have Nagle's algorithm enabled.</p>\n<p>Nagle's algorithm delays data before it is sent via the network. It attempts\nto optimize throughput at the expense of latency.</p>\n<p>Passing <code>true</code> for <code>noDelay</code> or not passing an argument will disable Nagle's\nalgorithm for the socket. Passing <code>false</code> for <code>noDelay</code> will enable Nagle's\nalgorithm.</p>"
            },
            {
              "textRaw": "`socket.setTimeout(timeout[, callback])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`timeout` {number}",
                      "name": "timeout",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Sets the socket to timeout after <code>timeout</code> milliseconds of inactivity on\nthe socket. By default <code>net.Socket</code> do not have a timeout.</p>\n<p>When an idle timeout is triggered the socket will receive a <a href=\"#event-timeout\"><code>'timeout'</code></a>\nevent but the connection will not be severed. The user must manually call\n<a href=\"#socketenddata-encoding-callback\"><code>socket.end()</code></a> or <a href=\"#socketdestroyerror\"><code>socket.destroy()</code></a> to end the connection.</p>\n<pre><code class=\"language-js\">socket.setTimeout(3000);\nsocket.on('timeout', () => {\n  console.log('socket timeout');\n  socket.end();\n});\n</code></pre>\n<p>If <code>timeout</code> is 0, then the existing idle timeout is disabled.</p>\n<p>The optional <code>callback</code> parameter will be added as a one-time listener for the\n<a href=\"#event-timeout\"><code>'timeout'</code></a> event.</p>"
            },
            {
              "textRaw": "`socket.getTypeOfService()`",
              "name": "getTypeOfService",
              "type": "method",
              "meta": {
                "added": [
                  "v25.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {integer} The current TOS value.",
                    "name": "return",
                    "type": "integer",
                    "desc": "The current TOS value."
                  }
                }
              ],
              "desc": "<p>Returns the current Type of Service (TOS) field for IPv4 packets or Traffic\nClass for IPv6 packets for this socket.</p>\n<p><code>setTypeOfService()</code> may be called before the socket is connected; the value\nwill be cached and applied when the socket establishes a connection.\n<code>getTypeOfService()</code> will return the currently set value even before connection.</p>\n<p>On some platforms (e.g., Linux), certain TOS/ECN bits may be masked or ignored,\nand behavior can differ between IPv4 and IPv6 or dual-stack sockets. Callers\nshould verify platform-specific semantics.</p>"
            },
            {
              "textRaw": "`socket.setTypeOfService(tos)`",
              "name": "setTypeOfService",
              "type": "method",
              "meta": {
                "added": [
                  "v25.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`tos` {integer} The TOS value to set (0-255).",
                      "name": "tos",
                      "type": "integer",
                      "desc": "The TOS value to set (0-255)."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Sets the Type of Service (TOS) field for IPv4 packets or Traffic Class for IPv6\nPackets sent from this socket. This can be used to prioritize network traffic.</p>\n<p><code>setTypeOfService()</code> may be called before the socket is connected; the value\nwill be cached and applied when the socket establishes a connection.\n<code>getTypeOfService()</code> will return the currently set value even before connection.</p>\n<p>On some platforms (e.g., Linux), certain TOS/ECN bits may be masked or ignored,\nand behavior can differ between IPv4 and IPv6 or dual-stack sockets. Callers\nshould verify platform-specific semantics.</p>"
            },
            {
              "textRaw": "`socket.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The socket itself.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The socket itself."
                  }
                }
              ],
              "desc": "<p>Calling <code>unref()</code> on a socket will allow the program to exit if this is the only\nactive socket in the event system. If the socket is already <code>unref</code>ed calling\n<code>unref()</code> again will have no effect.</p>"
            },
            {
              "textRaw": "`socket.write(data[, encoding][, callback])`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer|Uint8Array}",
                      "name": "data",
                      "type": "string|Buffer|Uint8Array"
                    },
                    {
                      "textRaw": "`encoding` {string} Only used when data is `string`. **Default:** `utf8`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`utf8`",
                      "desc": "Only used when data is `string`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Sends data on the socket. The second parameter specifies the encoding in the\ncase of a string. It defaults to UTF8 encoding.</p>\n<p>Returns <code>true</code> if the entire data was flushed successfully to the kernel\nbuffer. Returns <code>false</code> if all or part of the data was queued in user memory.\n<a href=\"#event-drain\"><code>'drain'</code></a> will be emitted when the buffer is again free.</p>\n<p>The optional <code>callback</code> parameter will be executed when the data is finally\nwritten out, which may not be immediately.</p>\n<p>See <code>Writable</code> stream <a href=\"stream.html#writablewritechunk-encoding-callback\"><code>write()</code></a> method for more\ninformation.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string[]}",
              "name": "autoSelectFamilyAttemptedAddresses",
              "type": "string[]",
              "meta": {
                "added": [
                  "v19.4.0",
                  "v18.18.0"
                ],
                "changes": []
              },
              "desc": "<p>This property is only present if the family autoselection algorithm is enabled in\n<a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options)</code></a> and it is an array of the addresses that have been attempted.</p>\n<p>Each address is a string in the form of <code>$IP:$PORT</code>. If the connection was successful,\nthen the last address is the one that the socket is currently connected to.</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "bufferSize",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.3.8"
                ],
                "changes": [],
                "deprecated": [
                  "v14.6.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `writable.writableLength` instead.",
              "desc": "<p>This property shows the number of characters buffered for writing. The buffer\nmay contain strings whose length after encoding is not yet known. So this number\nis only an approximation of the number of bytes in the buffer.</p>\n<p><code>net.Socket</code> has the property that <code>socket.write()</code> always works. This is to\nhelp users get up and running quickly. The computer cannot always keep up\nwith the amount of data that is written to a socket. The network connection\nsimply might be too slow. Node.js will internally queue up the data written to a\nsocket and send it out over the wire when it is possible.</p>\n<p>The consequence of this internal buffering is that memory may grow.\nUsers who experience large or growing <code>bufferSize</code> should attempt to\n\"throttle\" the data flows in their program with\n<a href=\"#socketpause\"><code>socket.pause()</code></a> and <a href=\"#socketresume\"><code>socket.resume()</code></a>.</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "bytesRead",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.5.3"
                ],
                "changes": []
              },
              "desc": "<p>The amount of received bytes.</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "bytesWritten",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.5.3"
                ],
                "changes": []
              },
              "desc": "<p>The amount of bytes sent.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "connecting",
              "type": "boolean",
              "meta": {
                "added": [
                  "v6.1.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>true</code>,\n<a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options[, connectListener])</code></a> was\ncalled and has not yet finished. It will stay <code>true</code> until the socket becomes\nconnected, then it is set to <code>false</code> and the <code>'connect'</code> event is emitted. Note\nthat the\n<a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options[, connectListener])</code></a>\ncallback is a listener for the <code>'connect'</code> event.</p>"
            },
            {
              "textRaw": "Type: {boolean} Indicates if the connection is destroyed or not. Once a connection is destroyed no further data can be transferred using it.",
              "name": "destroyed",
              "type": "boolean",
              "desc": "<p>See <a href=\"stream.html#writabledestroyed\"><code>writable.destroyed</code></a> for further details.</p>",
              "shortDesc": "Indicates if the connection is destroyed or not. Once a connection is destroyed no further data can be transferred using it."
            },
            {
              "textRaw": "Type: {string}",
              "name": "localAddress",
              "type": "string",
              "meta": {
                "added": [
                  "v0.9.6"
                ],
                "changes": []
              },
              "desc": "<p>The string representation of the local IP address the remote client is\nconnecting on. For example, in a server listening on <code>'0.0.0.0'</code>, if a client\nconnects on <code>'192.168.1.1'</code>, the value of <code>socket.localAddress</code> would be\n<code>'192.168.1.1'</code>.</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "localPort",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.9.6"
                ],
                "changes": []
              },
              "desc": "<p>The numeric representation of the local port. For example, <code>80</code> or <code>21</code>.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "localFamily",
              "type": "string",
              "meta": {
                "added": [
                  "v18.8.0",
                  "v16.18.0"
                ],
                "changes": []
              },
              "desc": "<p>The string representation of the local IP family. <code>'IPv4'</code> or <code>'IPv6'</code>.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "pending",
              "type": "boolean",
              "meta": {
                "added": [
                  "v11.2.0",
                  "v10.16.0"
                ],
                "changes": []
              },
              "desc": "<p>This is <code>true</code> if the socket is not connected yet, either because <code>.connect()</code>\nhas not yet been called or because it is still in the process of connecting\n(see <a href=\"#socketconnecting\"><code>socket.connecting</code></a>).</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "remoteAddress",
              "type": "string",
              "meta": {
                "added": [
                  "v0.5.10"
                ],
                "changes": []
              },
              "desc": "<p>The string representation of the remote IP address. For example,\n<code>'74.125.127.100'</code> or <code>'2001:4860:a005::68'</code>. Value may be <code>undefined</code> if\nthe socket is destroyed (for example, if the client disconnected).</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "remoteFamily",
              "type": "string",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "desc": "<p>The string representation of the remote IP family. <code>'IPv4'</code> or <code>'IPv6'</code>. Value may be <code>undefined</code> if\nthe socket is destroyed (for example, if the client disconnected).</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "remotePort",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.5.10"
                ],
                "changes": []
              },
              "desc": "<p>The numeric representation of the remote port. For example, <code>80</code> or <code>21</code>. Value may be <code>undefined</code> if\nthe socket is destroyed (for example, if the client disconnected).</p>"
            },
            {
              "textRaw": "Type: {number|undefined}",
              "name": "timeout",
              "type": "number|undefined",
              "meta": {
                "added": [
                  "v10.7.0"
                ],
                "changes": []
              },
              "desc": "<p>The socket timeout in milliseconds as set by <a href=\"#socketsettimeouttimeout-callback\"><code>socket.setTimeout()</code></a>.\nIt is <code>undefined</code> if a timeout has not been set.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "readyState",
              "type": "string",
              "meta": {
                "added": [
                  "v0.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This property represents the state of the connection as a string.</p>\n<ul>\n<li>If the stream is connecting <code>socket.readyState</code> is <code>opening</code>.</li>\n<li>If the stream is readable and writable, it is <code>open</code>.</li>\n<li>If the stream is readable and not writable, it is <code>readOnly</code>.</li>\n<li>If the stream is not readable and writable, it is <code>writeOnly</code>.</li>\n</ul>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`net.connect()`",
          "name": "connect",
          "type": "method",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>Aliases to\n<a href=\"#netcreateconnection\"><code>net.createConnection()</code></a>.</p>\n<p>Possible signatures:</p>\n<ul>\n<li><a href=\"#netconnectoptions-connectlistener\"><code>net.connect(options[, connectListener])</code></a></li>\n<li><a href=\"#netconnectpath-connectlistener\"><code>net.connect(path[, connectListener])</code></a> for <a href=\"#ipc-support\">IPC</a>\nconnections.</li>\n<li><a href=\"#netconnectport-host-connectlistener\"><code>net.connect(port[, host][, connectListener])</code></a>\nfor TCP connections.</li>\n</ul>",
          "methods": [
            {
              "textRaw": "`net.connect(options[, connectListener])`",
              "name": "connect",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`connectListener` {Function}",
                      "name": "connectListener",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  }
                }
              ],
              "desc": "<p>Alias to\n<a href=\"#netcreateconnectionoptions-connectlistener\"><code>net.createConnection(options[, connectListener])</code></a>.</p>"
            },
            {
              "textRaw": "`net.connect(path[, connectListener])`",
              "name": "connect",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string}",
                      "name": "path",
                      "type": "string"
                    },
                    {
                      "textRaw": "`connectListener` {Function}",
                      "name": "connectListener",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  }
                }
              ],
              "desc": "<p>Alias to\n<a href=\"#netcreateconnectionpath-connectlistener\"><code>net.createConnection(path[, connectListener])</code></a>.</p>"
            },
            {
              "textRaw": "`net.connect(port[, host][, connectListener])`",
              "name": "connect",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`port` {number}",
                      "name": "port",
                      "type": "number"
                    },
                    {
                      "textRaw": "`host` {string}",
                      "name": "host",
                      "type": "string",
                      "optional": true
                    },
                    {
                      "textRaw": "`connectListener` {Function}",
                      "name": "connectListener",
                      "type": "Function",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket}",
                    "name": "return",
                    "type": "net.Socket"
                  }
                }
              ],
              "desc": "<p>Alias to\n<a href=\"#netcreateconnectionport-host-connectlistener\"><code>net.createConnection(port[, host][, connectListener])</code></a>.</p>"
            }
          ]
        },
        {
          "textRaw": "`net.createConnection()`",
          "name": "createConnection",
          "type": "method",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>A factory function, which creates a new <a href=\"#class-netsocket\"><code>net.Socket</code></a>,\nimmediately initiates connection with <a href=\"#socketconnect\"><code>socket.connect()</code></a>,\nthen returns the <code>net.Socket</code> that starts the connection.</p>\n<p>When the connection is established, a <a href=\"#event-connect\"><code>'connect'</code></a> event will be emitted\non the returned socket. The last parameter <code>connectListener</code>, if supplied,\nwill be added as a listener for the <a href=\"#event-connect\"><code>'connect'</code></a> event <strong>once</strong>.</p>\n<p>Possible signatures:</p>\n<ul>\n<li><a href=\"#netcreateconnectionoptions-connectlistener\"><code>net.createConnection(options[, connectListener])</code></a></li>\n<li><a href=\"#netcreateconnectionpath-connectlistener\"><code>net.createConnection(path[, connectListener])</code></a>\nfor <a href=\"#ipc-support\">IPC</a> connections.</li>\n<li><a href=\"#netcreateconnectionport-host-connectlistener\"><code>net.createConnection(port[, host][, connectListener])</code></a>\nfor TCP connections.</li>\n</ul>\n<p>The <a href=\"#netconnect\"><code>net.connect()</code></a> function is an alias to this function.</p>",
          "methods": [
            {
              "textRaw": "`net.createConnection(options[, connectListener])`",
              "name": "createConnection",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} Required. Will be passed to both the `new net.Socket([options])` call and the `socket.connect(options[, connectListener])` method.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Required. Will be passed to both the `new net.Socket([options])` call and the `socket.connect(options[, connectListener])` method."
                    },
                    {
                      "textRaw": "`connectListener` {Function} Common parameter of the `net.createConnection()` functions. If supplied, will be added as a listener for the `'connect'` event on the returned socket once.",
                      "name": "connectListener",
                      "type": "Function",
                      "desc": "Common parameter of the `net.createConnection()` functions. If supplied, will be added as a listener for the `'connect'` event on the returned socket once.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The newly created socket used to start the connection.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The newly created socket used to start the connection."
                  }
                }
              ],
              "desc": "<p>For available options, see\n<a href=\"#new-netsocketoptions\"><code>new net.Socket([options])</code></a>\nand <a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options[, connectListener])</code></a>.</p>\n<p>Additional options:</p>\n<ul>\n<li><code>timeout</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> If set, will be used to call <a href=\"#socketsettimeouttimeout-callback\"><code>socket.setTimeout(timeout)</code></a> after the socket is created, but before\nit starts the connection.</li>\n</ul>\n<p>Following is an example of a client of the echo server described\nin the <a href=\"#netcreateserveroptions-connectionlistener\"><code>net.createServer()</code></a> section:</p>\n<pre><code class=\"language-mjs\">import net from 'node:net';\nconst client = net.createConnection({ port: 8124 }, () => {\n  // 'connect' listener.\n  console.log('connected to server!');\n  client.write('world!\\r\\n');\n});\nclient.on('data', (data) => {\n  console.log(data.toString());\n  client.end();\n});\nclient.on('end', () => {\n  console.log('disconnected from server');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const net = require('node:net');\nconst client = net.createConnection({ port: 8124 }, () => {\n  // 'connect' listener.\n  console.log('connected to server!');\n  client.write('world!\\r\\n');\n});\nclient.on('data', (data) => {\n  console.log(data.toString());\n  client.end();\n});\nclient.on('end', () => {\n  console.log('disconnected from server');\n});\n</code></pre>\n<p>To connect on the socket <code>/tmp/echo.sock</code>:</p>\n<pre><code class=\"language-js\">const client = net.createConnection({ path: '/tmp/echo.sock' });\n</code></pre>\n<p>Following is an example of a client using the <code>port</code> and <code>onread</code>\noption. In this case, the <code>onread</code> option will be only used to call\n<code>new net.Socket([options])</code> and the <code>port</code> option will be used to\ncall <code>socket.connect(options[, connectListener])</code>.</p>\n<pre><code class=\"language-mjs\">import net from 'node:net';\nimport { Buffer } from 'node:buffer';\nnet.createConnection({\n  port: 8124,\n  onread: {\n    // Reuses a 4KiB Buffer for every read from the socket.\n    buffer: Buffer.alloc(4 * 1024),\n    callback: function(nread, buf) {\n      // Received data is available in `buf` from 0 to `nread`.\n      console.log(buf.toString('utf8', 0, nread));\n    },\n  },\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const net = require('node:net');\nnet.createConnection({\n  port: 8124,\n  onread: {\n    // Reuses a 4KiB Buffer for every read from the socket.\n    buffer: Buffer.alloc(4 * 1024),\n    callback: function(nread, buf) {\n      // Received data is available in `buf` from 0 to `nread`.\n      console.log(buf.toString('utf8', 0, nread));\n    },\n  },\n});\n</code></pre>"
            },
            {
              "textRaw": "`net.createConnection(path[, connectListener])`",
              "name": "createConnection",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string} Path the socket should connect to. Will be passed to `socket.connect(path[, connectListener])`. See Identifying paths for IPC connections.",
                      "name": "path",
                      "type": "string",
                      "desc": "Path the socket should connect to. Will be passed to `socket.connect(path[, connectListener])`. See Identifying paths for IPC connections."
                    },
                    {
                      "textRaw": "`connectListener` {Function} Common parameter of the `net.createConnection()` functions, an \"once\" listener for the `'connect'` event on the initiating socket. Will be passed to `socket.connect(path[, connectListener])`.",
                      "name": "connectListener",
                      "type": "Function",
                      "desc": "Common parameter of the `net.createConnection()` functions, an \"once\" listener for the `'connect'` event on the initiating socket. Will be passed to `socket.connect(path[, connectListener])`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The newly created socket used to start the connection.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The newly created socket used to start the connection."
                  }
                }
              ],
              "desc": "<p>Initiates an <a href=\"#ipc-support\">IPC</a> connection.</p>\n<p>This function creates a new <a href=\"#class-netsocket\"><code>net.Socket</code></a> with all options set to default,\nimmediately initiates connection with\n<a href=\"#socketconnectpath-connectlistener\"><code>socket.connect(path[, connectListener])</code></a>,\nthen returns the <code>net.Socket</code> that starts the connection.</p>"
            },
            {
              "textRaw": "`net.createConnection(port[, host][, connectListener])`",
              "name": "createConnection",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.90"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`port` {number} Port the socket should connect to. Will be passed to `socket.connect(port[, host][, connectListener])`.",
                      "name": "port",
                      "type": "number",
                      "desc": "Port the socket should connect to. Will be passed to `socket.connect(port[, host][, connectListener])`."
                    },
                    {
                      "textRaw": "`host` {string} Host the socket should connect to. Will be passed to `socket.connect(port[, host][, connectListener])`. **Default:** `'localhost'`.",
                      "name": "host",
                      "type": "string",
                      "default": "`'localhost'`",
                      "desc": "Host the socket should connect to. Will be passed to `socket.connect(port[, host][, connectListener])`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`connectListener` {Function} Common parameter of the `net.createConnection()` functions, an \"once\" listener for the `'connect'` event on the initiating socket. Will be passed to `socket.connect(port[, host][, connectListener])`.",
                      "name": "connectListener",
                      "type": "Function",
                      "desc": "Common parameter of the `net.createConnection()` functions, an \"once\" listener for the `'connect'` event on the initiating socket. Will be passed to `socket.connect(port[, host][, connectListener])`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {net.Socket} The newly created socket used to start the connection.",
                    "name": "return",
                    "type": "net.Socket",
                    "desc": "The newly created socket used to start the connection."
                  }
                }
              ],
              "desc": "<p>Initiates a TCP connection.</p>\n<p>This function creates a new <a href=\"#class-netsocket\"><code>net.Socket</code></a> with all options set to default,\nimmediately initiates connection with\n<a href=\"#socketconnectport-host-connectlistener\"><code>socket.connect(port[, host][, connectListener])</code></a>,\nthen returns the <code>net.Socket</code> that starts the connection.</p>"
            }
          ]
        },
        {
          "textRaw": "`net.createServer([options][, connectionListener])`",
          "name": "createServer",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": [
              {
                "version": [
                  "v20.1.0",
                  "v18.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/47405",
                "description": "The `highWaterMark` option is supported now."
              },
              {
                "version": [
                  "v17.7.0",
                  "v16.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41310",
                "description": "The `noDelay`, `keepAlive`, and `keepAliveInitialDelay` options are supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`allowHalfOpen` {boolean} If set to `false`, then the socket will automatically end the writable side when the readable side ends. **Default:** `false`.",
                      "name": "allowHalfOpen",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `false`, then the socket will automatically end the writable side when the readable side ends."
                    },
                    {
                      "textRaw": "`highWaterMark` {number} Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`. **Default:** See `stream.getDefaultHighWaterMark()`.",
                      "name": "highWaterMark",
                      "type": "number",
                      "default": "See `stream.getDefaultHighWaterMark()`",
                      "desc": "Optionally overrides all `net.Socket`s' `readableHighWaterMark` and `writableHighWaterMark`."
                    },
                    {
                      "textRaw": "`keepAlive` {boolean} If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, similarly on what is done in `socket.setKeepAlive()`. **Default:** `false`.",
                      "name": "keepAlive",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, it enables keep-alive functionality on the socket immediately after a new incoming connection is received, similarly on what is done in `socket.setKeepAlive()`."
                    },
                    {
                      "textRaw": "`keepAliveInitialDelay` {number} If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket. **Default:** `0`.",
                      "name": "keepAliveInitialDelay",
                      "type": "number",
                      "default": "`0`",
                      "desc": "If set to a positive number, it sets the initial delay before the first keepalive probe is sent on an idle socket."
                    },
                    {
                      "textRaw": "`noDelay` {boolean} If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received. **Default:** `false`.",
                      "name": "noDelay",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `true`, it disables the use of Nagle's algorithm immediately after a new incoming connection is received."
                    },
                    {
                      "textRaw": "`pauseOnConnect` {boolean} Indicates whether the socket should be paused on incoming connections. **Default:** `false`.",
                      "name": "pauseOnConnect",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Indicates whether the socket should be paused on incoming connections."
                    },
                    {
                      "textRaw": "`blockList` {net.BlockList} `blockList` can be used for disabling inbound access to specific IP addresses, IP ranges, or IP subnets. This does not work if the server is behind a reverse proxy, NAT, etc. because the address checked against the block list is the address of the proxy, or the one specified by the NAT.",
                      "name": "blockList",
                      "type": "net.BlockList",
                      "desc": "`blockList` can be used for disabling inbound access to specific IP addresses, IP ranges, or IP subnets. This does not work if the server is behind a reverse proxy, NAT, etc. because the address checked against the block list is the address of the proxy, or the one specified by the NAT."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`connectionListener` {Function} Automatically set as a listener for the `'connection'` event.",
                  "name": "connectionListener",
                  "type": "Function",
                  "desc": "Automatically set as a listener for the `'connection'` event.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {net.Server}",
                "name": "return",
                "type": "net.Server"
              }
            }
          ],
          "desc": "<p>Creates a new TCP or <a href=\"#ipc-support\">IPC</a> server.</p>\n<p>If <code>allowHalfOpen</code> is set to <code>true</code>, when the other end of the socket\nsignals the end of transmission, the server will only send back the end of\ntransmission when <a href=\"#socketenddata-encoding-callback\"><code>socket.end()</code></a> is explicitly called. For example, in the\ncontext of TCP, when a FIN packed is received, a FIN packed is sent\nback only when <a href=\"#socketenddata-encoding-callback\"><code>socket.end()</code></a> is explicitly called. Until then the\nconnection is half-closed (non-readable but still writable). See <a href=\"#event-end\"><code>'end'</code></a>\nevent and <a href=\"https://tools.ietf.org/html/rfc1122\">RFC 1122</a> (section 4.2.2.13) for more information.</p>\n<p>If <code>pauseOnConnect</code> is set to <code>true</code>, then the socket associated with each\nincoming connection will be paused, and no data will be read from its handle.\nThis allows connections to be passed between processes without any data being\nread by the original process. To begin reading data from a paused socket, call\n<a href=\"#socketresume\"><code>socket.resume()</code></a>.</p>\n<p>The server can be a TCP server or an <a href=\"#ipc-support\">IPC</a> server, depending on what it\n<a href=\"#serverlisten\"><code>listen()</code></a> to.</p>\n<p>Here is an example of a TCP echo server which listens for connections\non port 8124:</p>\n<pre><code class=\"language-mjs\">import net from 'node:net';\nconst server = net.createServer((c) => {\n  // 'connection' listener.\n  console.log('client connected');\n  c.on('end', () => {\n    console.log('client disconnected');\n  });\n  c.write('hello\\r\\n');\n  c.pipe(c);\n});\nserver.on('error', (err) => {\n  throw err;\n});\nserver.listen(8124, () => {\n  console.log('server bound');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const net = require('node:net');\nconst server = net.createServer((c) => {\n  // 'connection' listener.\n  console.log('client connected');\n  c.on('end', () => {\n    console.log('client disconnected');\n  });\n  c.write('hello\\r\\n');\n  c.pipe(c);\n});\nserver.on('error', (err) => {\n  throw err;\n});\nserver.listen(8124, () => {\n  console.log('server bound');\n});\n</code></pre>\n<p>Test this by using <code>telnet</code>:</p>\n<pre><code class=\"language-bash\">telnet localhost 8124\n</code></pre>\n<p>To listen on the socket <code>/tmp/echo.sock</code>:</p>\n<pre><code class=\"language-js\">server.listen('/tmp/echo.sock', () => {\n  console.log('server bound');\n});\n</code></pre>\n<p>Use <code>nc</code> to connect to a Unix domain socket server:</p>\n<pre><code class=\"language-bash\">nc -U /tmp/echo.sock\n</code></pre>"
        },
        {
          "textRaw": "`net.getDefaultAutoSelectFamily()`",
          "name": "getDefaultAutoSelectFamily",
          "type": "method",
          "meta": {
            "added": [
              "v19.4.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {boolean} The current default value of the `autoSelectFamily` option.",
                "name": "return",
                "type": "boolean",
                "desc": "The current default value of the `autoSelectFamily` option."
              }
            }
          ],
          "desc": "<p>Gets the current default value of the <code>autoSelectFamily</code> option of <a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options)</code></a>.\nThe initial default value is <code>true</code>, unless the command line option\n<code>--no-network-family-autoselection</code> is provided.</p>"
        },
        {
          "textRaw": "`net.setDefaultAutoSelectFamily(value)`",
          "name": "setDefaultAutoSelectFamily",
          "type": "method",
          "meta": {
            "added": [
              "v19.4.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`value` {boolean} The new default value. The initial default value is `true`, unless the command line option `--no-network-family-autoselection` is provided.",
                  "name": "value",
                  "type": "boolean",
                  "desc": "The new default value. The initial default value is `true`, unless the command line option `--no-network-family-autoselection` is provided."
                }
              ]
            }
          ],
          "desc": "<p>Sets the default value of the <code>autoSelectFamily</code> option of <a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options)</code></a>.</p>"
        },
        {
          "textRaw": "`net.getDefaultAutoSelectFamilyAttemptTimeout()`",
          "name": "getDefaultAutoSelectFamilyAttemptTimeout",
          "type": "method",
          "meta": {
            "added": [
              "v19.8.0",
              "v18.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {number} The current default value of the `autoSelectFamilyAttemptTimeout` option.",
                "name": "return",
                "type": "number",
                "desc": "The current default value of the `autoSelectFamilyAttemptTimeout` option."
              }
            }
          ],
          "desc": "<p>Gets the current default value of the <code>autoSelectFamilyAttemptTimeout</code> option of <a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options)</code></a>.\nThe initial default value is <code>500</code> or the value specified via the command line\noption <code>--network-family-autoselection-attempt-timeout</code>.</p>"
        },
        {
          "textRaw": "`net.setDefaultAutoSelectFamilyAttemptTimeout(value)`",
          "name": "setDefaultAutoSelectFamilyAttemptTimeout",
          "type": "method",
          "meta": {
            "added": [
              "v19.8.0",
              "v18.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`value` {number} The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`.",
                  "name": "value",
                  "type": "number",
                  "desc": "The new default value, which must be a positive number. If the number is less than `10`, the value `10` is used instead. The initial default value is `250` or the value specified via the command line option `--network-family-autoselection-attempt-timeout`."
                }
              ]
            }
          ],
          "desc": "<p>Sets the default value of the <code>autoSelectFamilyAttemptTimeout</code> option of <a href=\"#socketconnectoptions-connectlistener\"><code>socket.connect(options)</code></a>.</p>"
        },
        {
          "textRaw": "`net.isIP(input)`",
          "name": "isIP",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`input` {string}",
                  "name": "input",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns <code>6</code> if <code>input</code> is an IPv6 address. Returns <code>4</code> if <code>input</code> is an IPv4\naddress in <a href=\"https://en.wikipedia.org/wiki/Dot-decimal_notation\">dot-decimal notation</a> with no leading zeroes. Otherwise, returns\n<code>0</code>.</p>\n<pre><code class=\"language-js\">net.isIP('::1'); // returns 6\nnet.isIP('127.0.0.1'); // returns 4\nnet.isIP('127.000.000.001'); // returns 0\nnet.isIP('127.0.0.1/24'); // returns 0\nnet.isIP('fhqwhgads'); // returns 0\n</code></pre>"
        },
        {
          "textRaw": "`net.isIPv4(input)`",
          "name": "isIPv4",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`input` {string}",
                  "name": "input",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>Returns <code>true</code> if <code>input</code> is an IPv4 address in <a href=\"https://en.wikipedia.org/wiki/Dot-decimal_notation\">dot-decimal notation</a> with no\nleading zeroes. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">net.isIPv4('127.0.0.1'); // returns true\nnet.isIPv4('127.000.000.001'); // returns false\nnet.isIPv4('127.0.0.1/24'); // returns false\nnet.isIPv4('fhqwhgads'); // returns false\n</code></pre>"
        },
        {
          "textRaw": "`net.isIPv6(input)`",
          "name": "isIPv6",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`input` {string}",
                  "name": "input",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>Returns <code>true</code> if <code>input</code> is an IPv6 address. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">net.isIPv6('::1'); // returns true\nnet.isIPv6('fhqwhgads'); // returns false\n</code></pre>"
        }
      ],
      "displayName": "Net",
      "source": "doc/api/net.md"
    },
    {
      "textRaw": "OS",
      "name": "os",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:os</code> module provides operating system-related utility methods and\nproperties. It can be accessed using:</p>\n<pre><code class=\"language-mjs\">import os from 'node:os';\n</code></pre>\n<pre><code class=\"language-cjs\">const os = require('node:os');\n</code></pre>",
      "properties": [
        {
          "textRaw": "Type: {string}",
          "name": "EOL",
          "type": "string",
          "meta": {
            "added": [
              "v0.7.8"
            ],
            "changes": []
          },
          "desc": "<p>The operating system-specific end-of-line marker.</p>\n<ul>\n<li><code>\\n</code> on POSIX</li>\n<li><code>\\r\\n</code> on Windows</li>\n</ul>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "constants",
          "type": "Object",
          "meta": {
            "added": [
              "v6.3.0"
            ],
            "changes": []
          },
          "desc": "<p>Contains commonly used operating system-specific constants for error codes,\nprocess signals, and so on. The specific constants defined are described in\n<a href=\"#os-constants\">OS constants</a>.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "devNull",
          "type": "string",
          "meta": {
            "added": [
              "v16.3.0",
              "v14.18.0"
            ],
            "changes": []
          },
          "desc": "<p>The platform-specific file path of the null device.</p>\n<ul>\n<li><code>\\\\.\\nul</code> on Windows</li>\n<li><code>/dev/null</code> on POSIX</li>\n</ul>"
        }
      ],
      "methods": [
        {
          "textRaw": "`os.availableParallelism()`",
          "name": "availableParallelism",
          "type": "method",
          "meta": {
            "added": [
              "v19.4.0",
              "v18.14.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns an estimate of the default amount of parallelism a program should use.\nAlways returns a value greater than zero.</p>\n<p>This function is a small wrapper about libuv's <a href=\"https://docs.libuv.org/en/v1.x/misc.html#c.uv_available_parallelism\"><code>uv_available_parallelism()</code></a>.</p>"
        },
        {
          "textRaw": "`os.arch()`",
          "name": "arch",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the operating system CPU architecture for which the Node.js binary was\ncompiled. Possible values are <code>'arm'</code>, <code>'arm64'</code>, <code>'ia32'</code>, <code>'loong64'</code>,\n<code>'mips'</code>, <code>'mipsel'</code>, <code>'ppc64'</code>, <code>'riscv64'</code>, <code>'s390x'</code>, and <code>'x64'</code>.</p>\n<p>The return value is equivalent to <a href=\"process.html#processarch\"><code>process.arch</code></a>.</p>"
        },
        {
          "textRaw": "`os.cpus()`",
          "name": "cpus",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object[]}",
                "name": "return",
                "type": "Object[]"
              }
            }
          ],
          "desc": "<p>Returns an array of objects containing information about each logical CPU core.\nThe array will be empty if no CPU information is available, such as if the\n<code>/proc</code> file system is unavailable.</p>\n<p>The properties included on each object include:</p>\n<ul>\n<li><code>model</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>speed</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> (in MHz)</li>\n<li><code>times</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>user</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds the CPU has spent in user mode.</li>\n<li><code>nice</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds the CPU has spent in nice mode.</li>\n<li><code>sys</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds the CPU has spent in sys mode.</li>\n<li><code>idle</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds the CPU has spent in idle mode.</li>\n<li><code>irq</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds the CPU has spent in irq mode.</li>\n</ul>\n</li>\n</ul>\n<pre><code class=\"language-js\">[\n  {\n    model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',\n    speed: 2926,\n    times: {\n      user: 252020,\n      nice: 0,\n      sys: 30340,\n      idle: 1070356870,\n      irq: 0,\n    },\n  },\n  {\n    model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',\n    speed: 2926,\n    times: {\n      user: 306960,\n      nice: 0,\n      sys: 26980,\n      idle: 1071569080,\n      irq: 0,\n    },\n  },\n  {\n    model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',\n    speed: 2926,\n    times: {\n      user: 248450,\n      nice: 0,\n      sys: 21750,\n      idle: 1070919370,\n      irq: 0,\n    },\n  },\n  {\n    model: 'Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz',\n    speed: 2926,\n    times: {\n      user: 256880,\n      nice: 0,\n      sys: 19430,\n      idle: 1070905480,\n      irq: 20,\n    },\n  },\n];\n</code></pre>\n<p><code>nice</code> values are POSIX-only. On Windows, the <code>nice</code> values of all processors\nare always 0.</p>\n<p><code>os.cpus().length</code> should not be used to calculate the amount of parallelism\navailable to an application. Use\n<a href=\"#osavailableparallelism\"><code>os.availableParallelism()</code></a> for this purpose.</p>"
        },
        {
          "textRaw": "`os.endianness()`",
          "name": "endianness",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns a string identifying the endianness of the CPU for which the Node.js\nbinary was compiled.</p>\n<p>Possible values are <code>'BE'</code> for big endian and <code>'LE'</code> for little endian.</p>"
        },
        {
          "textRaw": "`os.freemem()`",
          "name": "freemem",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns the amount of free system memory in bytes as an integer.</p>"
        },
        {
          "textRaw": "`os.getPriority([pid])`",
          "name": "getPriority",
          "type": "method",
          "meta": {
            "added": [
              "v10.10.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pid` {integer} The process ID to retrieve scheduling priority for. **Default:** `0`.",
                  "name": "pid",
                  "type": "integer",
                  "default": "`0`",
                  "desc": "The process ID to retrieve scheduling priority for.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns the scheduling priority for the process specified by <code>pid</code>. If <code>pid</code> is\nnot provided or is <code>0</code>, the priority of the current process is returned.</p>"
        },
        {
          "textRaw": "`os.homedir()`",
          "name": "homedir",
          "type": "method",
          "meta": {
            "added": [
              "v2.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the string path of the current user's home directory.</p>\n<p>On POSIX, it uses the <code>$HOME</code> environment variable if defined. Otherwise it\nuses the <a href=\"https://en.wikipedia.org/wiki/User_identifier#Effective_user_ID\">effective UID</a> to look up the user's home directory.</p>\n<p>On Windows, it uses the <code>USERPROFILE</code> environment variable if defined.\nOtherwise it uses the path to the profile directory of the current user.</p>"
        },
        {
          "textRaw": "`os.hostname()`",
          "name": "hostname",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the host name of the operating system as a string.</p>"
        },
        {
          "textRaw": "`os.loadavg()`",
          "name": "loadavg",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {number[]}",
                "name": "return",
                "type": "number[]"
              }
            }
          ],
          "desc": "<p>Returns an array containing the 1, 5, and 15 minute load averages.</p>\n<p>The load average is a measure of system activity calculated by the operating\nsystem and expressed as a fractional number.</p>\n<p>The load average is a Unix-specific concept. On Windows, the return value is\nalways <code>[0, 0, 0]</code>.</p>"
        },
        {
          "textRaw": "`os.machine()`",
          "name": "machine",
          "type": "method",
          "meta": {
            "added": [
              "v18.9.0",
              "v16.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the machine type as a string, such as <code>arm</code>, <code>arm64</code>, <code>aarch64</code>,\n<code>mips</code>, <code>mips64</code>, <code>ppc64</code>, <code>ppc64le</code>, <code>s390x</code>, <code>i386</code>, <code>i686</code>, <code>x86_64</code>.</p>\n<p>On POSIX systems, the machine type is determined by calling\n<a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a>. On Windows, <code>RtlGetVersion()</code> is used, and if it is not\navailable, <code>GetVersionExW()</code> will be used. See\n<a href=\"https://en.wikipedia.org/wiki/Uname#Examples\">https://en.wikipedia.org/wiki/Uname#Examples</a> for more information.</p>"
        },
        {
          "textRaw": "`os.networkInterfaces()`",
          "name": "networkInterfaces",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": [
              {
                "version": "v18.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/43054",
                "description": "The `family` property now returns a string instead of a number."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41431",
                "description": "The `family` property now returns a number instead of a string."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>Returns an object containing network interfaces that have been assigned a\nnetwork address.</p>\n<p>Each key on the returned object identifies a network interface. The associated\nvalue is an array of objects that each describe an assigned network address.</p>\n<p>The properties available on the assigned network address object include:</p>\n<ul>\n<li><code>address</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The assigned IPv4 or IPv6 address</li>\n<li><code>netmask</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The IPv4 or IPv6 network mask</li>\n<li><code>family</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Either <code>IPv4</code> or <code>IPv6</code></li>\n<li><code>mac</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The MAC address of the network interface</li>\n<li><code>internal</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> <code>true</code> if the network interface is a loopback or\nsimilar interface that is not remotely accessible; otherwise <code>false</code></li>\n<li><code>scopeid</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The numeric IPv6 scope ID (only specified when <code>family</code>\nis <code>IPv6</code>)</li>\n<li><code>cidr</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The assigned IPv4 or IPv6 address with the routing prefix\nin CIDR notation. If the <code>netmask</code> is invalid, this property is set\nto <code>null</code>.</li>\n</ul>\n<pre><code class=\"language-json\">{\n  \"lo:\": [\n    {\n      \"address:\": \"127.0.0.1\",\n      \"netmask:\": \"255.0.0.0\",\n      \"family:\": \"IPv4\",\n      \"mac:\": \"00:00:00:00:00:00\",\n      \"internal:\": true,\n      \"cidr:\": \"127.0.0.1/8\"\n    },\n    {\n      \"address:\": \"::1\",\n      \"netmask:\": \"ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff\",\n      \"family:\": \"IPv6\",\n      \"mac:\": \"00:00:00:00:00:00\",\n      \"scopeid:\": 0,\n      \"internal:\": true,\n      \"cidr:\": \"::1/128\"\n    }\n  ],\n  \"eth0:\": [\n    {\n      \"address:\": \"192.168.1.108\",\n      \"netmask:\": \"255.255.255.0\",\n      \"family:\": \"IPv4\",\n      \"mac:\": \"01:02:03:0a:0b:0c\",\n      \"internal:\": false,\n      \"cidr:\": \"192.168.1.108/24\"\n    },\n    {\n      \"address:\": \"fe80::a00:27ff:fe4e:66a1\",\n      \"netmask:\": \"ffff:ffff:ffff:ffff::\",\n      \"family:\": \"IPv6\",\n      \"mac:\": \"01:02:03:0a:0b:0c\",\n      \"scopeid:\": 1,\n      \"internal:\": false,\n      \"cidr:\": \"fe80::a00:27ff:fe4e:66a1/64\"\n    }\n  ]\n}\n</code></pre>"
        },
        {
          "textRaw": "`os.platform()`",
          "name": "platform",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns a string identifying the operating system platform for which\nthe Node.js binary was compiled. The value is set at compile time.\nPossible values are <code>'aix'</code>, <code>'darwin'</code>, <code>'freebsd'</code>,<code>'linux'</code>,\n<code>'openbsd'</code>, <code>'sunos'</code>, and <code>'win32'</code>.</p>\n<p>The return value is equivalent to <a href=\"process.html#processplatform\"><code>process.platform</code></a>.</p>\n<p>The value <code>'android'</code> may also be returned if Node.js is built on the Android\noperating system. <a href=\"https://github.com/nodejs/node/blob/HEAD/BUILDING.md#android\">Android support is experimental</a>.</p>"
        },
        {
          "textRaw": "`os.release()`",
          "name": "release",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the operating system as a string.</p>\n<p>On POSIX systems, the operating system release is determined by calling\n<a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a>. On Windows, <code>GetVersionExW()</code> is used. See\n<a href=\"https://en.wikipedia.org/wiki/Uname#Examples\">https://en.wikipedia.org/wiki/Uname#Examples</a> for more information.</p>"
        },
        {
          "textRaw": "`os.setPriority([pid, ]priority)`",
          "name": "setPriority",
          "type": "method",
          "meta": {
            "added": [
              "v10.10.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pid` {integer} The process ID to set scheduling priority for. **Default:** `0`.",
                  "name": "pid",
                  "type": "integer",
                  "default": "`0`",
                  "desc": "The process ID to set scheduling priority for.",
                  "optional": true
                },
                {
                  "textRaw": "`priority` {integer} The scheduling priority to assign to the process.",
                  "name": "priority",
                  "type": "integer",
                  "desc": "The scheduling priority to assign to the process."
                }
              ]
            }
          ],
          "desc": "<p>Attempts to set the scheduling priority for the process specified by <code>pid</code>. If\n<code>pid</code> is not provided or is <code>0</code>, the process ID of the current process is used.</p>\n<p>The <code>priority</code> input must be an integer between <code>-20</code> (high priority) and <code>19</code>\n(low priority). Due to differences between Unix priority levels and Windows\npriority classes, <code>priority</code> is mapped to one of six priority constants in\n<code>os.constants.priority</code>. When retrieving a process priority level, this range\nmapping may cause the return value to be slightly different on Windows. To avoid\nconfusion, set <code>priority</code> to one of the priority constants.</p>\n<p>On Windows, setting priority to <code>PRIORITY_HIGHEST</code> requires elevated user\nprivileges. Otherwise the set priority will be silently reduced to\n<code>PRIORITY_HIGH</code>.</p>"
        },
        {
          "textRaw": "`os.tmpdir()`",
          "name": "tmpdir",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.9"
            ],
            "changes": [
              {
                "version": "v2.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/747",
                "description": "This function is now cross-platform consistent and no longer returns a path with a trailing slash on any platform."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the operating system's default directory for temporary files as a\nstring.</p>\n<p>On Windows, the result can be overridden by <code>TEMP</code> and <code>TMP</code> environment variables, and\n<code>TEMP</code> takes precedence over <code>TMP</code>. If neither is set, it defaults to <code>%SystemRoot%\\temp</code>\nor <code>%windir%\\temp</code>.</p>\n<p>On non-Windows platforms, <code>TMPDIR</code>, <code>TMP</code> and <code>TEMP</code> environment variables will be checked\nto override the result of this method, in the described order. If none of them is set, it\ndefaults to <code>/tmp</code>.</p>\n<p>Some operating system distributions would either configure <code>TMPDIR</code> (non-Windows) or\n<code>TEMP</code> and <code>TMP</code> (Windows) by default without additional configurations by the system\nadministrators. The result of <code>os.tmpdir()</code> typically reflects the system preference\nunless it's explicitly overridden by the users.</p>"
        },
        {
          "textRaw": "`os.totalmem()`",
          "name": "totalmem",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns the total amount of system memory in bytes as an integer.</p>"
        },
        {
          "textRaw": "`os.type()`",
          "name": "type",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the operating system name as returned by <a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a>. For example, it\nreturns <code>'Linux'</code> on Linux, <code>'Darwin'</code> on macOS, and <code>'Windows_NT'</code> on Windows.</p>\n<p>See <a href=\"https://en.wikipedia.org/wiki/Uname#Examples\">https://en.wikipedia.org/wiki/Uname#Examples</a> for additional information\nabout the output of running <a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a> on various operating systems.</p>"
        },
        {
          "textRaw": "`os.uptime()`",
          "name": "uptime",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.3"
            ],
            "changes": [
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/20129",
                "description": "The result of this function no longer contains a fraction component on Windows."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns the system uptime in number of seconds.</p>"
        },
        {
          "textRaw": "`os.userInfo([options])`",
          "name": "userInfo",
          "type": "method",
          "meta": {
            "added": [
              "v6.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`encoding` {string} Character encoding used to interpret resulting strings. If `encoding` is set to `'buffer'`, the `username`, `shell`, and `homedir` values will be `Buffer` instances. **Default:** `'utf8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf8'`",
                      "desc": "Character encoding used to interpret resulting strings. If `encoding` is set to `'buffer'`, the `username`, `shell`, and `homedir` values will be `Buffer` instances."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>Returns information about the currently effective user. On POSIX platforms,\nthis is typically a subset of the password file. The returned object includes\nthe <code>username</code>, <code>uid</code>, <code>gid</code>, <code>shell</code>, and <code>homedir</code>. On Windows, the <code>uid</code> and\n<code>gid</code> fields are <code>-1</code>, and <code>shell</code> is <code>null</code>.</p>\n<p>The value of <code>homedir</code> returned by <code>os.userInfo()</code> is provided by the operating\nsystem. This differs from the result of <code>os.homedir()</code>, which queries\nenvironment variables for the home directory before falling back to the\noperating system response.</p>\n<p>Throws a <a href=\"errors.html#class-systemerror\"><code>SystemError</code></a> if a user has no <code>username</code> or <code>homedir</code>.</p>"
        },
        {
          "textRaw": "`os.version()`",
          "name": "version",
          "type": "method",
          "meta": {
            "added": [
              "v13.11.0",
              "v12.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns a string identifying the kernel version.</p>\n<p>On POSIX systems, the operating system release is determined by calling\n<a href=\"https://linux.die.net/man/3/uname\"><code>uname(3)</code></a>. On Windows, <code>RtlGetVersion()</code> is used, and if it is not\navailable, <code>GetVersionExW()</code> will be used. See\n<a href=\"https://en.wikipedia.org/wiki/Uname#Examples\">https://en.wikipedia.org/wiki/Uname#Examples</a> for more information.</p>"
        }
      ],
      "modules": [
        {
          "textRaw": "OS constants",
          "name": "os_constants",
          "type": "module",
          "desc": "<p>The following constants are exported by <code>os.constants</code>.</p>\n<p>Not all constants will be available on every operating system.</p>",
          "modules": [
            {
              "textRaw": "Signal constants",
              "name": "signal_constants",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": "v5.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6093",
                    "description": "Added support for `SIGINFO`."
                  }
                ]
              },
              "desc": "<p>The following signal constants are exported by <code>os.constants.signals</code>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>SIGHUP</code></td>\n    <td>Sent to indicate when a controlling terminal is closed or a parent\n    process exits.</td>\n  </tr>\n  <tr>\n    <td><code>SIGINT</code></td>\n    <td>Sent to indicate when a user wishes to interrupt a process\n    (<kbd>Ctrl</kbd>+<kbd>C</kbd>).</td>\n  </tr>\n  <tr>\n    <td><code>SIGQUIT</code></td>\n    <td>Sent to indicate when a user wishes to terminate a process and perform a\n    core dump.</td>\n  </tr>\n  <tr>\n    <td><code>SIGILL</code></td>\n    <td>Sent to a process to notify that it has attempted to perform an illegal,\n    malformed, unknown, or privileged instruction.</td>\n  </tr>\n  <tr>\n    <td><code>SIGTRAP</code></td>\n    <td>Sent to a process when an exception has occurred.</td>\n  </tr>\n  <tr>\n    <td><code>SIGABRT</code></td>\n    <td>Sent to a process to request that it abort.</td>\n  </tr>\n  <tr>\n    <td><code>SIGIOT</code></td>\n    <td>Synonym for <code>SIGABRT</code></td>\n  </tr>\n  <tr>\n    <td><code>SIGBUS</code></td>\n    <td>Sent to a process to notify that it has caused a bus error.</td>\n  </tr>\n  <tr>\n    <td><code>SIGFPE</code></td>\n    <td>Sent to a process to notify that it has performed an illegal arithmetic\n    operation.</td>\n  </tr>\n  <tr>\n    <td><code>SIGKILL</code></td>\n    <td>Sent to a process to terminate it immediately.</td>\n  </tr>\n  <tr>\n    <td><code>SIGUSR1</code> <code>SIGUSR2</code></td>\n    <td>Sent to a process to identify user-defined conditions.</td>\n  </tr>\n  <tr>\n    <td><code>SIGSEGV</code></td>\n    <td>Sent to a process to notify of a segmentation fault.</td>\n  </tr>\n  <tr>\n    <td><code>SIGPIPE</code></td>\n    <td>Sent to a process when it has attempted to write to a disconnected\n    pipe.</td>\n  </tr>\n  <tr>\n    <td><code>SIGALRM</code></td>\n    <td>Sent to a process when a system timer elapses.</td>\n  </tr>\n  <tr>\n    <td><code>SIGTERM</code></td>\n    <td>Sent to a process to request termination.</td>\n  </tr>\n  <tr>\n    <td><code>SIGCHLD</code></td>\n    <td>Sent to a process when a child process terminates.</td>\n  </tr>\n  <tr>\n    <td><code>SIGSTKFLT</code></td>\n    <td>Sent to a process to indicate a stack fault on a coprocessor.</td>\n  </tr>\n  <tr>\n    <td><code>SIGCONT</code></td>\n    <td>Sent to instruct the operating system to continue a paused process.</td>\n  </tr>\n  <tr>\n    <td><code>SIGSTOP</code></td>\n    <td>Sent to instruct the operating system to halt a process.</td>\n  </tr>\n  <tr>\n    <td><code>SIGTSTP</code></td>\n    <td>Sent to a process to request it to stop.</td>\n  </tr>\n  <tr>\n    <td><code>SIGBREAK</code></td>\n    <td>Sent to indicate when a user wishes to interrupt a process.</td>\n  </tr>\n  <tr>\n    <td><code>SIGTTIN</code></td>\n    <td>Sent to a process when it reads from the TTY while in the\n    background.</td>\n  </tr>\n  <tr>\n    <td><code>SIGTTOU</code></td>\n    <td>Sent to a process when it writes to the TTY while in the\n    background.</td>\n  </tr>\n  <tr>\n    <td><code>SIGURG</code></td>\n    <td>Sent to a process when a socket has urgent data to read.</td>\n  </tr>\n  <tr>\n    <td><code>SIGXCPU</code></td>\n    <td>Sent to a process when it has exceeded its limit on CPU usage.</td>\n  </tr>\n  <tr>\n    <td><code>SIGXFSZ</code></td>\n    <td>Sent to a process when it grows a file larger than the maximum\n    allowed.</td>\n  </tr>\n  <tr>\n    <td><code>SIGVTALRM</code></td>\n    <td>Sent to a process when a virtual timer has elapsed.</td>\n  </tr>\n  <tr>\n    <td><code>SIGPROF</code></td>\n    <td>Sent to a process when a system timer has elapsed.</td>\n  </tr>\n  <tr>\n    <td><code>SIGWINCH</code></td>\n    <td>Sent to a process when the controlling terminal has changed its\n    size.</td>\n  </tr>\n  <tr>\n    <td><code>SIGIO</code></td>\n    <td>Sent to a process when I/O is available.</td>\n  </tr>\n  <tr>\n    <td><code>SIGPOLL</code></td>\n    <td>Synonym for <code>SIGIO</code></td>\n  </tr>\n  <tr>\n    <td><code>SIGLOST</code></td>\n    <td>Sent to a process when a file lock has been lost.</td>\n  </tr>\n  <tr>\n    <td><code>SIGPWR</code></td>\n    <td>Sent to a process to notify of a power failure.</td>\n  </tr>\n  <tr>\n    <td><code>SIGINFO</code></td>\n    <td>Synonym for <code>SIGPWR</code></td>\n  </tr>\n  <tr>\n    <td><code>SIGSYS</code></td>\n    <td>Sent to a process to notify of a bad argument.</td>\n  </tr>\n  <tr>\n    <td><code>SIGUNUSED</code></td>\n    <td>Synonym for <code>SIGSYS</code></td>\n  </tr>\n</table>",
              "displayName": "Signal constants"
            },
            {
              "textRaw": "Error constants",
              "name": "error_constants",
              "type": "module",
              "desc": "<p>The following error constants are exported by <code>os.constants.errno</code>.</p>",
              "modules": [
                {
                  "textRaw": "POSIX error constants",
                  "name": "posix_error_constants",
                  "type": "module",
                  "desc": "<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>E2BIG</code></td>\n    <td>Indicates that the list of arguments is longer than expected.</td>\n  </tr>\n  <tr>\n    <td><code>EACCES</code></td>\n    <td>Indicates that the operation did not have sufficient permissions.</td>\n  </tr>\n  <tr>\n    <td><code>EADDRINUSE</code></td>\n    <td>Indicates that the network address is already in use.</td>\n  </tr>\n  <tr>\n    <td><code>EADDRNOTAVAIL</code></td>\n    <td>Indicates that the network address is currently unavailable for\n    use.</td>\n  </tr>\n  <tr>\n    <td><code>EAFNOSUPPORT</code></td>\n    <td>Indicates that the network address family is not supported.</td>\n  </tr>\n  <tr>\n    <td><code>EAGAIN</code></td>\n    <td>Indicates that there is no data available and to try the\n    operation again later.</td>\n  </tr>\n  <tr>\n    <td><code>EALREADY</code></td>\n    <td>Indicates that the socket already has a pending connection in\n    progress.</td>\n  </tr>\n  <tr>\n    <td><code>EBADF</code></td>\n    <td>Indicates that a file descriptor is not valid.</td>\n  </tr>\n  <tr>\n    <td><code>EBADMSG</code></td>\n    <td>Indicates an invalid data message.</td>\n  </tr>\n  <tr>\n    <td><code>EBUSY</code></td>\n    <td>Indicates that a device or resource is busy.</td>\n  </tr>\n  <tr>\n    <td><code>ECANCELED</code></td>\n    <td>Indicates that an operation was canceled.</td>\n  </tr>\n  <tr>\n    <td><code>ECHILD</code></td>\n    <td>Indicates that there are no child processes.</td>\n  </tr>\n  <tr>\n    <td><code>ECONNABORTED</code></td>\n    <td>Indicates that the network connection has been aborted.</td>\n  </tr>\n  <tr>\n    <td><code>ECONNREFUSED</code></td>\n    <td>Indicates that the network connection has been refused.</td>\n  </tr>\n  <tr>\n    <td><code>ECONNRESET</code></td>\n    <td>Indicates that the network connection has been reset.</td>\n  </tr>\n  <tr>\n    <td><code>EDEADLK</code></td>\n    <td>Indicates that a resource deadlock has been avoided.</td>\n  </tr>\n  <tr>\n    <td><code>EDESTADDRREQ</code></td>\n    <td>Indicates that a destination address is required.</td>\n  </tr>\n  <tr>\n    <td><code>EDOM</code></td>\n    <td>Indicates that an argument is out of the domain of the function.</td>\n  </tr>\n  <tr>\n    <td><code>EDQUOT</code></td>\n    <td>Indicates that the disk quota has been exceeded.</td>\n  </tr>\n  <tr>\n    <td><code>EEXIST</code></td>\n    <td>Indicates that the file already exists.</td>\n  </tr>\n  <tr>\n    <td><code>EFAULT</code></td>\n    <td>Indicates an invalid pointer address.</td>\n  </tr>\n  <tr>\n    <td><code>EFBIG</code></td>\n    <td>Indicates that the file is too large.</td>\n  </tr>\n  <tr>\n    <td><code>EHOSTUNREACH</code></td>\n    <td>Indicates that the host is unreachable.</td>\n  </tr>\n  <tr>\n    <td><code>EIDRM</code></td>\n    <td>Indicates that the identifier has been removed.</td>\n  </tr>\n  <tr>\n    <td><code>EILSEQ</code></td>\n    <td>Indicates an illegal byte sequence.</td>\n  </tr>\n  <tr>\n    <td><code>EINPROGRESS</code></td>\n    <td>Indicates that an operation is already in progress.</td>\n  </tr>\n  <tr>\n    <td><code>EINTR</code></td>\n    <td>Indicates that a function call was interrupted.</td>\n  </tr>\n  <tr>\n    <td><code>EINVAL</code></td>\n    <td>Indicates that an invalid argument was provided.</td>\n  </tr>\n  <tr>\n    <td><code>EIO</code></td>\n    <td>Indicates an otherwise unspecified I/O error.</td>\n  </tr>\n  <tr>\n    <td><code>EISCONN</code></td>\n    <td>Indicates that the socket is connected.</td>\n  </tr>\n  <tr>\n    <td><code>EISDIR</code></td>\n    <td>Indicates that the path is a directory.</td>\n  </tr>\n  <tr>\n    <td><code>ELOOP</code></td>\n    <td>Indicates too many levels of symbolic links in a path.</td>\n  </tr>\n  <tr>\n    <td><code>EMFILE</code></td>\n    <td>Indicates that there are too many open files.</td>\n  </tr>\n  <tr>\n    <td><code>EMLINK</code></td>\n    <td>Indicates that there are too many hard links to a file.</td>\n  </tr>\n  <tr>\n    <td><code>EMSGSIZE</code></td>\n    <td>Indicates that the provided message is too long.</td>\n  </tr>\n  <tr>\n    <td><code>EMULTIHOP</code></td>\n    <td>Indicates that a multihop was attempted.</td>\n  </tr>\n  <tr>\n    <td><code>ENAMETOOLONG</code></td>\n    <td>Indicates that the filename is too long.</td>\n  </tr>\n  <tr>\n    <td><code>ENETDOWN</code></td>\n    <td>Indicates that the network is down.</td>\n  </tr>\n  <tr>\n    <td><code>ENETRESET</code></td>\n    <td>Indicates that the connection has been aborted by the network.</td>\n  </tr>\n  <tr>\n    <td><code>ENETUNREACH</code></td>\n    <td>Indicates that the network is unreachable.</td>\n  </tr>\n  <tr>\n    <td><code>ENFILE</code></td>\n    <td>Indicates too many open files in the system.</td>\n  </tr>\n  <tr>\n    <td><code>ENOBUFS</code></td>\n    <td>Indicates that no buffer space is available.</td>\n  </tr>\n  <tr>\n    <td><code>ENODATA</code></td>\n    <td>Indicates that no message is available on the stream head read\n    queue.</td>\n  </tr>\n  <tr>\n    <td><code>ENODEV</code></td>\n    <td>Indicates that there is no such device.</td>\n  </tr>\n  <tr>\n    <td><code>ENOENT</code></td>\n    <td>Indicates that there is no such file or directory.</td>\n  </tr>\n  <tr>\n    <td><code>ENOEXEC</code></td>\n    <td>Indicates an exec format error.</td>\n  </tr>\n  <tr>\n    <td><code>ENOLCK</code></td>\n    <td>Indicates that there are no locks available.</td>\n  </tr>\n  <tr>\n    <td><code>ENOLINK</code></td>\n    <td>Indications that a link has been severed.</td>\n  </tr>\n  <tr>\n    <td><code>ENOMEM</code></td>\n    <td>Indicates that there is not enough space.</td>\n  </tr>\n  <tr>\n    <td><code>ENOMSG</code></td>\n    <td>Indicates that there is no message of the desired type.</td>\n  </tr>\n  <tr>\n    <td><code>ENOPROTOOPT</code></td>\n    <td>Indicates that a given protocol is not available.</td>\n  </tr>\n  <tr>\n    <td><code>ENOSPC</code></td>\n    <td>Indicates that there is no space available on the device.</td>\n  </tr>\n  <tr>\n    <td><code>ENOSR</code></td>\n    <td>Indicates that there are no stream resources available.</td>\n  </tr>\n  <tr>\n    <td><code>ENOSTR</code></td>\n    <td>Indicates that a given resource is not a stream.</td>\n  </tr>\n  <tr>\n    <td><code>ENOSYS</code></td>\n    <td>Indicates that a function has not been implemented.</td>\n  </tr>\n  <tr>\n    <td><code>ENOTCONN</code></td>\n    <td>Indicates that the socket is not connected.</td>\n  </tr>\n  <tr>\n    <td><code>ENOTDIR</code></td>\n    <td>Indicates that the path is not a directory.</td>\n  </tr>\n  <tr>\n    <td><code>ENOTEMPTY</code></td>\n    <td>Indicates that the directory is not empty.</td>\n  </tr>\n  <tr>\n    <td><code>ENOTSOCK</code></td>\n    <td>Indicates that the given item is not a socket.</td>\n  </tr>\n  <tr>\n    <td><code>ENOTSUP</code></td>\n    <td>Indicates that a given operation is not supported.</td>\n  </tr>\n  <tr>\n    <td><code>ENOTTY</code></td>\n    <td>Indicates an inappropriate I/O control operation.</td>\n  </tr>\n  <tr>\n    <td><code>ENXIO</code></td>\n    <td>Indicates no such device or address.</td>\n  </tr>\n  <tr>\n    <td><code>EOPNOTSUPP</code></td>\n    <td>Indicates that an operation is not supported on the socket. Although\n    <code>ENOTSUP</code> and <code>EOPNOTSUPP</code> have the same value\n    on Linux, according to POSIX.1 these error values should be distinct.)</td>\n  </tr>\n  <tr>\n    <td><code>EOVERFLOW</code></td>\n    <td>Indicates that a value is too large to be stored in a given data\n    type.</td>\n  </tr>\n  <tr>\n    <td><code>EPERM</code></td>\n    <td>Indicates that the operation is not permitted.</td>\n  </tr>\n  <tr>\n    <td><code>EPIPE</code></td>\n    <td>Indicates a broken pipe.</td>\n  </tr>\n  <tr>\n    <td><code>EPROTO</code></td>\n    <td>Indicates a protocol error.</td>\n  </tr>\n  <tr>\n    <td><code>EPROTONOSUPPORT</code></td>\n    <td>Indicates that a protocol is not supported.</td>\n  </tr>\n  <tr>\n    <td><code>EPROTOTYPE</code></td>\n    <td>Indicates the wrong type of protocol for a socket.</td>\n  </tr>\n  <tr>\n    <td><code>ERANGE</code></td>\n    <td>Indicates that the results are too large.</td>\n  </tr>\n  <tr>\n    <td><code>EROFS</code></td>\n    <td>Indicates that the file system is read only.</td>\n  </tr>\n  <tr>\n    <td><code>ESPIPE</code></td>\n    <td>Indicates an invalid seek operation.</td>\n  </tr>\n  <tr>\n    <td><code>ESRCH</code></td>\n    <td>Indicates that there is no such process.</td>\n  </tr>\n  <tr>\n    <td><code>ESTALE</code></td>\n    <td>Indicates that the file handle is stale.</td>\n  </tr>\n  <tr>\n    <td><code>ETIME</code></td>\n    <td>Indicates an expired timer.</td>\n  </tr>\n  <tr>\n    <td><code>ETIMEDOUT</code></td>\n    <td>Indicates that the connection timed out.</td>\n  </tr>\n  <tr>\n    <td><code>ETXTBSY</code></td>\n    <td>Indicates that a text file is busy.</td>\n  </tr>\n  <tr>\n    <td><code>EWOULDBLOCK</code></td>\n    <td>Indicates that the operation would block.</td>\n  </tr>\n  <tr>\n    <td><code>EXDEV</code></td>\n    <td>Indicates an improper link.</td>\n  </tr>\n</table>",
                  "displayName": "POSIX error constants"
                },
                {
                  "textRaw": "Windows-specific error constants",
                  "name": "windows-specific_error_constants",
                  "type": "module",
                  "desc": "<p>The following error codes are specific to the Windows operating system.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>WSAEINTR</code></td>\n    <td>Indicates an interrupted function call.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEBADF</code></td>\n    <td>Indicates an invalid file handle.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEACCES</code></td>\n    <td>Indicates insufficient permissions to complete the operation.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEFAULT</code></td>\n    <td>Indicates an invalid pointer address.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEINVAL</code></td>\n    <td>Indicates that an invalid argument was passed.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEMFILE</code></td>\n    <td>Indicates that there are too many open files.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEWOULDBLOCK</code></td>\n    <td>Indicates that a resource is temporarily unavailable.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEINPROGRESS</code></td>\n    <td>Indicates that an operation is currently in progress.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEALREADY</code></td>\n    <td>Indicates that an operation is already in progress.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENOTSOCK</code></td>\n    <td>Indicates that the resource is not a socket.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEDESTADDRREQ</code></td>\n    <td>Indicates that a destination address is required.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEMSGSIZE</code></td>\n    <td>Indicates that the message size is too long.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEPROTOTYPE</code></td>\n    <td>Indicates the wrong protocol type for the socket.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENOPROTOOPT</code></td>\n    <td>Indicates a bad protocol option.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEPROTONOSUPPORT</code></td>\n    <td>Indicates that the protocol is not supported.</td>\n  </tr>\n  <tr>\n    <td><code>WSAESOCKTNOSUPPORT</code></td>\n    <td>Indicates that the socket type is not supported.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEOPNOTSUPP</code></td>\n    <td>Indicates that the operation is not supported.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEPFNOSUPPORT</code></td>\n    <td>Indicates that the protocol family is not supported.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEAFNOSUPPORT</code></td>\n    <td>Indicates that the address family is not supported.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEADDRINUSE</code></td>\n    <td>Indicates that the network address is already in use.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEADDRNOTAVAIL</code></td>\n    <td>Indicates that the network address is not available.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENETDOWN</code></td>\n    <td>Indicates that the network is down.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENETUNREACH</code></td>\n    <td>Indicates that the network is unreachable.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENETRESET</code></td>\n    <td>Indicates that the network connection has been reset.</td>\n  </tr>\n  <tr>\n    <td><code>WSAECONNABORTED</code></td>\n    <td>Indicates that the connection has been aborted.</td>\n  </tr>\n  <tr>\n    <td><code>WSAECONNRESET</code></td>\n    <td>Indicates that the connection has been reset by the peer.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENOBUFS</code></td>\n    <td>Indicates that there is no buffer space available.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEISCONN</code></td>\n    <td>Indicates that the socket is already connected.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENOTCONN</code></td>\n    <td>Indicates that the socket is not connected.</td>\n  </tr>\n  <tr>\n    <td><code>WSAESHUTDOWN</code></td>\n    <td>Indicates that data cannot be sent after the socket has been\n    shutdown.</td>\n  </tr>\n  <tr>\n    <td><code>WSAETOOMANYREFS</code></td>\n    <td>Indicates that there are too many references.</td>\n  </tr>\n  <tr>\n    <td><code>WSAETIMEDOUT</code></td>\n    <td>Indicates that the connection has timed out.</td>\n  </tr>\n  <tr>\n    <td><code>WSAECONNREFUSED</code></td>\n    <td>Indicates that the connection has been refused.</td>\n  </tr>\n  <tr>\n    <td><code>WSAELOOP</code></td>\n    <td>Indicates that a name cannot be translated.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENAMETOOLONG</code></td>\n    <td>Indicates that a name was too long.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEHOSTDOWN</code></td>\n    <td>Indicates that a network host is down.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEHOSTUNREACH</code></td>\n    <td>Indicates that there is no route to a network host.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENOTEMPTY</code></td>\n    <td>Indicates that the directory is not empty.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEPROCLIM</code></td>\n    <td>Indicates that there are too many processes.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEUSERS</code></td>\n    <td>Indicates that the user quota has been exceeded.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEDQUOT</code></td>\n    <td>Indicates that the disk quota has been exceeded.</td>\n  </tr>\n  <tr>\n    <td><code>WSAESTALE</code></td>\n    <td>Indicates a stale file handle reference.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEREMOTE</code></td>\n    <td>Indicates that the item is remote.</td>\n  </tr>\n  <tr>\n    <td><code>WSASYSNOTREADY</code></td>\n    <td>Indicates that the network subsystem is not ready.</td>\n  </tr>\n  <tr>\n    <td><code>WSAVERNOTSUPPORTED</code></td>\n    <td>Indicates that the <code>winsock.dll</code> version is out of\n    range.</td>\n  </tr>\n  <tr>\n    <td><code>WSANOTINITIALISED</code></td>\n    <td>Indicates that successful WSAStartup has not yet been performed.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEDISCON</code></td>\n    <td>Indicates that a graceful shutdown is in progress.</td>\n  </tr>\n  <tr>\n    <td><code>WSAENOMORE</code></td>\n    <td>Indicates that there are no more results.</td>\n  </tr>\n  <tr>\n    <td><code>WSAECANCELLED</code></td>\n    <td>Indicates that an operation has been canceled.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEINVALIDPROCTABLE</code></td>\n    <td>Indicates that the procedure call table is invalid.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEINVALIDPROVIDER</code></td>\n    <td>Indicates an invalid service provider.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEPROVIDERFAILEDINIT</code></td>\n    <td>Indicates that the service provider failed to initialized.</td>\n  </tr>\n  <tr>\n    <td><code>WSASYSCALLFAILURE</code></td>\n    <td>Indicates a system call failure.</td>\n  </tr>\n  <tr>\n    <td><code>WSASERVICE_NOT_FOUND</code></td>\n    <td>Indicates that a service was not found.</td>\n  </tr>\n  <tr>\n    <td><code>WSATYPE_NOT_FOUND</code></td>\n    <td>Indicates that a class type was not found.</td>\n  </tr>\n  <tr>\n    <td><code>WSA_E_NO_MORE</code></td>\n    <td>Indicates that there are no more results.</td>\n  </tr>\n  <tr>\n    <td><code>WSA_E_CANCELLED</code></td>\n    <td>Indicates that the call was canceled.</td>\n  </tr>\n  <tr>\n    <td><code>WSAEREFUSED</code></td>\n    <td>Indicates that a database query was refused.</td>\n  </tr>\n</table>",
                  "displayName": "Windows-specific error constants"
                }
              ],
              "displayName": "Error constants"
            },
            {
              "textRaw": "dlopen constants",
              "name": "dlopen_constants",
              "type": "module",
              "desc": "<p>If available on the operating system, the following constants\nare exported in <code>os.constants.dlopen</code>. See <a href=\"http://man7.org/linux/man-pages/man3/dlopen.3.html\"><code>dlopen(3)</code></a> for detailed\ninformation.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>RTLD_LAZY</code></td>\n    <td>Perform lazy binding. Node.js sets this flag by default.</td>\n  </tr>\n  <tr>\n    <td><code>RTLD_NOW</code></td>\n    <td>Resolve all undefined symbols in the library before dlopen(3)\n    returns.</td>\n  </tr>\n  <tr>\n    <td><code>RTLD_GLOBAL</code></td>\n    <td>Symbols defined by the library will be made available for symbol\n    resolution of subsequently loaded libraries.</td>\n  </tr>\n  <tr>\n    <td><code>RTLD_LOCAL</code></td>\n    <td>The converse of <code>RTLD_GLOBAL</code>. This is the default behavior\n    if neither flag is specified.</td>\n  </tr>\n  <tr>\n    <td><code>RTLD_DEEPBIND</code></td>\n    <td>Make a self-contained library use its own symbols in preference to\n    symbols from previously loaded libraries.</td>\n  </tr>\n</table>",
              "displayName": "dlopen constants"
            },
            {
              "textRaw": "Priority constants",
              "name": "priority_constants",
              "type": "module",
              "meta": {
                "added": [
                  "v10.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The following process scheduling constants are exported by\n<code>os.constants.priority</code>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>PRIORITY_LOW</code></td>\n    <td>The lowest process scheduling priority. This corresponds to\n    <code>IDLE_PRIORITY_CLASS</code> on Windows, and a nice value of\n    <code>19</code> on all other platforms.</td>\n  </tr>\n  <tr>\n    <td><code>PRIORITY_BELOW_NORMAL</code></td>\n    <td>The process scheduling priority above <code>PRIORITY_LOW</code> and\n    below <code>PRIORITY_NORMAL</code>. This corresponds to\n    <code>BELOW_NORMAL_PRIORITY_CLASS</code> on Windows, and a nice value of\n    <code>10</code> on all other platforms.</td>\n  </tr>\n  <tr>\n    <td><code>PRIORITY_NORMAL</code></td>\n    <td>The default process scheduling priority. This corresponds to\n    <code>NORMAL_PRIORITY_CLASS</code> on Windows, and a nice value of\n    <code>0</code> on all other platforms.</td>\n  </tr>\n  <tr>\n    <td><code>PRIORITY_ABOVE_NORMAL</code></td>\n    <td>The process scheduling priority above <code>PRIORITY_NORMAL</code> and\n    below <code>PRIORITY_HIGH</code>. This corresponds to\n    <code>ABOVE_NORMAL_PRIORITY_CLASS</code> on Windows, and a nice value of\n    <code>-7</code> on all other platforms.</td>\n  </tr>\n  <tr>\n    <td><code>PRIORITY_HIGH</code></td>\n    <td>The process scheduling priority above <code>PRIORITY_ABOVE_NORMAL</code>\n    and below <code>PRIORITY_HIGHEST</code>. This corresponds to\n    <code>HIGH_PRIORITY_CLASS</code> on Windows, and a nice value of\n    <code>-14</code> on all other platforms.</td>\n  </tr>\n  <tr>\n    <td><code>PRIORITY_HIGHEST</code></td>\n    <td>The highest process scheduling priority. This corresponds to\n    <code>REALTIME_PRIORITY_CLASS</code> on Windows, and a nice value of\n    <code>-20</code> on all other platforms.</td>\n  </tr>\n</table>",
              "displayName": "Priority constants"
            },
            {
              "textRaw": "libuv constants",
              "name": "libuv_constants",
              "type": "module",
              "desc": "<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>UV_UDP_REUSEADDR</code></td>\n    <td></td>\n  </tr>\n</table>",
              "displayName": "libuv constants"
            }
          ],
          "displayName": "OS constants"
        }
      ],
      "displayName": "OS",
      "source": "doc/api/os.md"
    },
    {
      "textRaw": "Path",
      "name": "path",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:path</code> module provides utilities for working with file and directory\npaths. It can be accessed using:</p>\n<pre><code class=\"language-cjs\">const path = require('node:path');\n</code></pre>\n<pre><code class=\"language-mjs\">import path from 'node:path';\n</code></pre>",
      "modules": [
        {
          "textRaw": "Windows vs. POSIX",
          "name": "windows_vs._posix",
          "type": "module",
          "desc": "<p>The default operation of the <code>node:path</code> module varies based on the operating\nsystem on which a Node.js application is running. Specifically, when running on\na Windows operating system, the <code>node:path</code> module will assume that\nWindows-style paths are being used.</p>\n<p>So using <code>path.basename()</code> might yield different results on POSIX and Windows:</p>\n<p>On POSIX:</p>\n<pre><code class=\"language-js\">path.basename('C:\\\\temp\\\\myfile.html');\n// Returns: 'C:\\\\temp\\\\myfile.html'\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.basename('C:\\\\temp\\\\myfile.html');\n// Returns: 'myfile.html'\n</code></pre>\n<p>To achieve consistent results when working with Windows file paths on any\noperating system, use <a href=\"#pathwin32\"><code>path.win32</code></a>:</p>\n<p>On POSIX and Windows:</p>\n<pre><code class=\"language-js\">path.win32.basename('C:\\\\temp\\\\myfile.html');\n// Returns: 'myfile.html'\n</code></pre>\n<p>To achieve consistent results when working with POSIX file paths on any\noperating system, use <a href=\"#pathposix\"><code>path.posix</code></a>:</p>\n<p>On POSIX and Windows:</p>\n<pre><code class=\"language-js\">path.posix.basename('/tmp/myfile.html');\n// Returns: 'myfile.html'\n</code></pre>\n<p>On Windows Node.js follows the concept of per-drive working directory.\nThis behavior can be observed when using a drive path without a backslash. For\nexample, <code>path.resolve('C:\\\\')</code> can potentially return a different result than\n<code>path.resolve('C:')</code>. For more information, see\n<a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#fully-qualified-vs-relative-paths\">this MSDN page</a>.</p>",
          "displayName": "Windows vs. POSIX"
        }
      ],
      "methods": [
        {
          "textRaw": "`path.basename(path[, suffix])`",
          "name": "basename",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.25"
            ],
            "changes": [
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/5348",
                "description": "Passing a non-string as the `path` argument will throw now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                },
                {
                  "textRaw": "`suffix` {string} An optional suffix to remove",
                  "name": "suffix",
                  "type": "string",
                  "desc": "An optional suffix to remove",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.basename()</code> method returns the last portion of a <code>path</code>, similar to\nthe Unix <code>basename</code> command. Trailing <a href=\"#pathsep\">directory separators</a> are\nignored.</p>\n<pre><code class=\"language-js\">path.basename('/foo/bar/baz/asdf/quux.html');\n// Returns: 'quux.html'\n\npath.basename('/foo/bar/baz/asdf/quux.html', '.html');\n// Returns: 'quux'\n</code></pre>\n<p>Although Windows usually treats file names, including file extensions, in a\ncase-insensitive manner, this function does not. For example, <code>C:\\\\foo.html</code> and\n<code>C:\\\\foo.HTML</code> refer to the same file, but <code>basename</code> treats the extension as a\ncase-sensitive string:</p>\n<pre><code class=\"language-js\">path.win32.basename('C:\\\\foo.html', '.html');\n// Returns: 'foo'\n\npath.win32.basename('C:\\\\foo.HTML', '.html');\n// Returns: 'foo.HTML'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string or if <code>suffix</code> is given\nand is not a string.</p>"
        },
        {
          "textRaw": "`path.dirname(path)`",
          "name": "dirname",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/5348",
                "description": "Passing a non-string as the `path` argument will throw now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.dirname()</code> method returns the directory name of a <code>path</code>, similar to\nthe Unix <code>dirname</code> command. Trailing directory separators are ignored, see\n<a href=\"#pathsep\"><code>path.sep</code></a>.</p>\n<pre><code class=\"language-js\">path.dirname('/foo/bar/baz/asdf/quux');\n// Returns: '/foo/bar/baz/asdf'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.extname(path)`",
          "name": "extname",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.25"
            ],
            "changes": [
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/5348",
                "description": "Passing a non-string as the `path` argument will throw now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.extname()</code> method returns the extension of the <code>path</code>, from the last\noccurrence of the <code>.</code> (period) character to end of string in the last portion of\nthe <code>path</code>. If there is no <code>.</code> in the last portion of the <code>path</code>, or if\nthere are no <code>.</code> characters other than the first character of\nthe basename of <code>path</code> (see <code>path.basename()</code>) , an empty string is returned.</p>\n<pre><code class=\"language-js\">path.extname('index.html');\n// Returns: '.html'\n\npath.extname('index.coffee.md');\n// Returns: '.md'\n\npath.extname('index.');\n// Returns: '.'\n\npath.extname('index');\n// Returns: ''\n\npath.extname('.index');\n// Returns: ''\n\npath.extname('.index.md');\n// Returns: '.md'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.format(pathObject)`",
          "name": "format",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": [
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/44349",
                "description": "The dot will be added if it is not specified in `ext`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pathObject` {Object} Any JavaScript object having the following properties:",
                  "name": "pathObject",
                  "type": "Object",
                  "desc": "Any JavaScript object having the following properties:",
                  "options": [
                    {
                      "textRaw": "`dir` {string}",
                      "name": "dir",
                      "type": "string"
                    },
                    {
                      "textRaw": "`root` {string}",
                      "name": "root",
                      "type": "string"
                    },
                    {
                      "textRaw": "`base` {string}",
                      "name": "base",
                      "type": "string"
                    },
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`ext` {string}",
                      "name": "ext",
                      "type": "string"
                    }
                  ]
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.format()</code> method returns a path string from an object. This is the\nopposite of <a href=\"#pathparsepath\"><code>path.parse()</code></a>.</p>\n<p>When providing properties to the <code>pathObject</code> remember that there are\ncombinations where one property has priority over another:</p>\n<ul>\n<li><code>pathObject.root</code> is ignored if <code>pathObject.dir</code> is provided</li>\n<li><code>pathObject.ext</code> and <code>pathObject.name</code> are ignored if <code>pathObject.base</code> exists</li>\n</ul>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">// If `dir`, `root` and `base` are provided,\n// `${dir}${path.sep}${base}`\n// will be returned. `root` is ignored.\npath.format({\n  root: '/ignored',\n  dir: '/home/user/dir',\n  base: 'file.txt',\n});\n// Returns: '/home/user/dir/file.txt'\n\n// `root` will be used if `dir` is not specified.\n// If only `root` is provided or `dir` is equal to `root` then the\n// platform separator will not be included. `ext` will be ignored.\npath.format({\n  root: '/',\n  base: 'file.txt',\n  ext: 'ignored',\n});\n// Returns: '/file.txt'\n\n// `name` + `ext` will be used if `base` is not specified.\npath.format({\n  root: '/',\n  name: 'file',\n  ext: '.txt',\n});\n// Returns: '/file.txt'\n\n// The dot will be added if it is not specified in `ext`.\npath.format({\n  root: '/',\n  name: 'file',\n  ext: 'txt',\n});\n// Returns: '/file.txt'\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.format({\n  dir: 'C:\\\\path\\\\dir',\n  base: 'file.txt',\n});\n// Returns: 'C:\\\\path\\\\dir\\\\file.txt'\n</code></pre>"
        },
        {
          "textRaw": "`path.matchesGlob(path, pattern)`",
          "name": "matchesGlob",
          "type": "method",
          "meta": {
            "added": [
              "v22.5.0",
              "v20.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.8.0",
                  "v22.20.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59572",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string} The path to glob-match against.",
                  "name": "path",
                  "type": "string",
                  "desc": "The path to glob-match against."
                },
                {
                  "textRaw": "`pattern` {string} The glob to check the path against.",
                  "name": "pattern",
                  "type": "string",
                  "desc": "The glob to check the path against."
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean} Whether or not the `path` matched the `pattern`.",
                "name": "return",
                "type": "boolean",
                "desc": "Whether or not the `path` matched the `pattern`."
              }
            }
          ],
          "desc": "<p>The <code>path.matchesGlob()</code> method determines if <code>path</code> matches the <code>pattern</code>.</p>\n<p>For example:</p>\n<pre><code class=\"language-js\">path.matchesGlob('/foo/bar', '/foo/*'); // true\npath.matchesGlob('/foo/bar*', 'foo/bird'); // false\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> or <code>pattern</code> are not strings.</p>"
        },
        {
          "textRaw": "`path.isAbsolute(path)`",
          "name": "isAbsolute",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.2"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>The <code>path.isAbsolute()</code> method determines if the literal <code>path</code> is absolute.\nTherefore, it’s not safe for mitigating path traversals.</p>\n<p>If the given <code>path</code> is a zero-length string, <code>false</code> will be returned.</p>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">path.isAbsolute('/foo/bar');   // true\npath.isAbsolute('/baz/..');    // true\npath.isAbsolute('/baz/../..'); // true\npath.isAbsolute('qux/');       // false\npath.isAbsolute('.');          // false\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.isAbsolute('//server');    // true\npath.isAbsolute('\\\\\\\\server');  // true\npath.isAbsolute('C:/foo/..');   // true\npath.isAbsolute('C:\\\\foo\\\\..'); // true\npath.isAbsolute('bar\\\\baz');    // false\npath.isAbsolute('bar/baz');     // false\npath.isAbsolute('.');           // false\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.join([...paths])`",
          "name": "join",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`...paths` {string} A sequence of path segments",
                  "name": "...paths",
                  "type": "string",
                  "desc": "A sequence of path segments",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.join()</code> method joins all given <code>path</code> segments together using the\nplatform-specific separator as a delimiter, then normalizes the resulting path.</p>\n<p>Zero-length <code>path</code> segments are ignored. If the joined path string is a\nzero-length string then <code>'.'</code> will be returned, representing the current\nworking directory.</p>\n<pre><code class=\"language-js\">path.join('/foo', 'bar', 'baz/asdf', 'quux', '..');\n// Returns: '/foo/bar/baz/asdf'\n\npath.join('foo', {}, 'bar');\n// Throws 'TypeError: Path must be a string. Received {}'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if any of the path segments is not a string.</p>"
        },
        {
          "textRaw": "`path.normalize(path)`",
          "name": "normalize",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.23"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.normalize()</code> method normalizes the given <code>path</code>, resolving <code>'..'</code> and\n<code>'.'</code> segments.</p>\n<p>When multiple, sequential path segment separation characters are found (e.g.\n<code>/</code> on POSIX and either <code>\\</code> or <code>/</code> on Windows), they are replaced by a single\ninstance of the platform-specific path segment separator (<code>/</code> on POSIX and\n<code>\\</code> on Windows). Trailing separators are preserved.</p>\n<p>If the <code>path</code> is a zero-length string, <code>'.'</code> is returned, representing the\ncurrent working directory.</p>\n<p>On POSIX, the types of normalization applied by this function do not strictly\nadhere to the POSIX specification. For example, this function will replace two\nleading forward slashes with a single slash as if it was a regular absolute\npath, whereas a few POSIX systems assign special meaning to paths beginning with\nexactly two forward slashes. Similarly, other substitutions performed by this\nfunction, such as removing <code>..</code> segments, may change how the underlying system\nresolves the path.</p>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">path.normalize('/foo/bar//baz/asdf/quux/..');\n// Returns: '/foo/bar/baz/asdf'\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.normalize('C:\\\\temp\\\\\\\\foo\\\\bar\\\\..\\\\');\n// Returns: 'C:\\\\temp\\\\foo\\\\'\n</code></pre>\n<p>Since Windows recognizes multiple path separators, both separators will be\nreplaced by instances of the Windows preferred separator (<code>\\</code>):</p>\n<pre><code class=\"language-js\">path.win32.normalize('C:////temp\\\\\\\\/\\\\/\\\\/foo/bar');\n// Returns: 'C:\\\\temp\\\\foo\\\\bar'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.parse(path)`",
          "name": "parse",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>The <code>path.parse()</code> method returns an object whose properties represent\nsignificant elements of the <code>path</code>. Trailing directory separators are ignored,\nsee <a href=\"#pathsep\"><code>path.sep</code></a>.</p>\n<p>The returned object will have the following properties:</p>\n<ul>\n<li><code>dir</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>root</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>base</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>ext</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n</ul>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">path.parse('/home/user/dir/file.txt');\n// Returns:\n// { root: '/',\n//   dir: '/home/user/dir',\n//   base: 'file.txt',\n//   ext: '.txt',\n//   name: 'file' }\n</code></pre>\n<pre><code class=\"language-text\">┌─────────────────────┬────────────┐\n│          dir        │    base    │\n├──────┬              ├──────┬─────┤\n│ root │              │ name │ ext │\n\"  /    home/user/dir / file  .txt \"\n└──────┴──────────────┴──────┴─────┘\n(All spaces in the \"\" line should be ignored. They are purely for formatting.)\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.parse('C:\\\\path\\\\dir\\\\file.txt');\n// Returns:\n// { root: 'C:\\\\',\n//   dir: 'C:\\\\path\\\\dir',\n//   base: 'file.txt',\n//   ext: '.txt',\n//   name: 'file' }\n</code></pre>\n<pre><code class=\"language-text\">┌─────────────────────┬────────────┐\n│          dir        │    base    │\n├──────┬              ├──────┬─────┤\n│ root │              │ name │ ext │\n\" C:\\      path\\dir   \\ file  .txt \"\n└──────┴──────────────┴──────┴─────┘\n(All spaces in the \"\" line should be ignored. They are purely for formatting.)\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if <code>path</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.relative(from, to)`",
          "name": "relative",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": [
              {
                "version": "v6.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/8523",
                "description": "On Windows, the leading slashes for UNC paths are now included in the return value."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`from` {string}",
                  "name": "from",
                  "type": "string"
                },
                {
                  "textRaw": "`to` {string}",
                  "name": "to",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.relative()</code> method returns the relative path from <code>from</code> to <code>to</code> based\non the current working directory. If <code>from</code> and <code>to</code> each resolve to the same\npath (after calling <code>path.resolve()</code> on each), a zero-length string is returned.</p>\n<p>If a zero-length string is passed as <code>from</code> or <code>to</code>, the current working\ndirectory will be used instead of the zero-length strings.</p>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb');\n// Returns: '../../impl/bbb'\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">path.relative('C:\\\\orandea\\\\test\\\\aaa', 'C:\\\\orandea\\\\impl\\\\bbb');\n// Returns: '..\\\\..\\\\impl\\\\bbb'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if either <code>from</code> or <code>to</code> is not a string.</p>"
        },
        {
          "textRaw": "`path.resolve([...paths])`",
          "name": "resolve",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`...paths` {string} A sequence of paths or path segments",
                  "name": "...paths",
                  "type": "string",
                  "desc": "A sequence of paths or path segments",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>path.resolve()</code> method resolves a sequence of paths or path segments into\nan absolute path.</p>\n<p>The given sequence of paths is processed from right to left, with each\nsubsequent <code>path</code> prepended until an absolute path is constructed.\nFor instance, given the sequence of path segments: <code>/foo</code>, <code>/bar</code>, <code>baz</code>,\ncalling <code>path.resolve('/foo', '/bar', 'baz')</code> would return <code>/bar/baz</code>\nbecause <code>'baz'</code> is not an absolute path but <code>'/bar' + '/' + 'baz'</code> is.</p>\n<p>If, after processing all given <code>path</code> segments, an absolute path has not yet\nbeen generated, the current working directory is used.</p>\n<p>The resulting path is normalized and trailing slashes are removed unless the\npath is resolved to the root directory.</p>\n<p>Zero-length <code>path</code> segments are ignored.</p>\n<p>If no <code>path</code> segments are passed, <code>path.resolve()</code> will return the absolute path\nof the current working directory.</p>\n<pre><code class=\"language-js\">path.resolve('/foo/bar', './baz');\n// Returns: '/foo/bar/baz'\n\npath.resolve('/foo/bar', '/tmp/file/');\n// Returns: '/tmp/file'\n\npath.resolve('wwwroot', 'static_files/png/', '../gif/image.gif');\n// If the current working directory is /home/myself/node,\n// this returns '/home/myself/node/wwwroot/static_files/gif/image.gif'\n</code></pre>\n<p>A <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> is thrown if any of the arguments is not a string.</p>"
        },
        {
          "textRaw": "`path.toNamespacedPath(path)`",
          "name": "toNamespacedPath",
          "type": "method",
          "meta": {
            "added": [
              "v9.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string}",
                  "name": "path",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>On Windows systems only, returns an equivalent <a href=\"https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#namespaces\">namespace-prefixed path</a> for\nthe given <code>path</code>. If <code>path</code> is not a string, <code>path</code> will be returned without\nmodifications.</p>\n<p>This method is meaningful only on Windows systems. On POSIX systems, the\nmethod is non-operational and always returns <code>path</code> without modifications.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {string}",
          "name": "delimiter",
          "type": "string",
          "meta": {
            "added": [
              "v0.9.3"
            ],
            "changes": []
          },
          "desc": "<p>Provides the platform-specific path delimiter:</p>\n<ul>\n<li><code>;</code> for Windows</li>\n<li><code>:</code> for POSIX</li>\n</ul>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">console.log(process.env.PATH);\n// Prints: '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin'\n\nprocess.env.PATH.split(path.delimiter);\n// Returns: ['/usr/bin', '/bin', '/usr/sbin', '/sbin', '/usr/local/bin']\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">console.log(process.env.PATH);\n// Prints: 'C:\\Windows\\system32;C:\\Windows;C:\\Program Files\\node\\'\n\nprocess.env.PATH.split(path.delimiter);\n// Returns ['C:\\\\Windows\\\\system32', 'C:\\\\Windows', 'C:\\\\Program Files\\\\node\\\\']\n</code></pre>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "posix",
          "type": "Object",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": [
              {
                "version": "v15.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/34962",
                "description": "Exposed as `require('path/posix')`."
              }
            ]
          },
          "desc": "<p>The <code>path.posix</code> property provides access to POSIX specific implementations\nof the <code>path</code> methods.</p>\n<p>The API is accessible via <code>require('node:path').posix</code> or <code>require('node:path/posix')</code>.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "sep",
          "type": "string",
          "meta": {
            "added": [
              "v0.7.9"
            ],
            "changes": []
          },
          "desc": "<p>Provides the platform-specific path segment separator:</p>\n<ul>\n<li><code>\\</code> on Windows</li>\n<li><code>/</code> on POSIX</li>\n</ul>\n<p>For example, on POSIX:</p>\n<pre><code class=\"language-js\">'foo/bar/baz'.split(path.sep);\n// Returns: ['foo', 'bar', 'baz']\n</code></pre>\n<p>On Windows:</p>\n<pre><code class=\"language-js\">'foo\\\\bar\\\\baz'.split(path.sep);\n// Returns: ['foo', 'bar', 'baz']\n</code></pre>\n<p>On Windows, both the forward slash (<code>/</code>) and backward slash (<code>\\</code>) are accepted\nas path segment separators; however, the <code>path</code> methods only add backward\nslashes (<code>\\</code>).</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "win32",
          "type": "Object",
          "meta": {
            "added": [
              "v0.11.15"
            ],
            "changes": [
              {
                "version": "v15.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/34962",
                "description": "Exposed as `require('path/win32')`."
              }
            ]
          },
          "desc": "<p>The <code>path.win32</code> property provides access to Windows-specific implementations\nof the <code>path</code> methods.</p>\n<p>The API is accessible via <code>require('node:path').win32</code> or <code>require('node:path/win32')</code>.</p>"
        }
      ],
      "displayName": "Path",
      "source": "doc/api/path.md"
    },
    {
      "textRaw": "Performance measurement APIs",
      "name": "performance_measurement_apis",
      "introduced_in": "v8.5.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>This module provides an implementation of a subset of the W3C\n<a href=\"https://w3c.github.io/perf-timing-primer/\">Web Performance APIs</a> as well as additional APIs for\nNode.js-specific performance measurements.</p>\n<p>Node.js supports the following <a href=\"https://w3c.github.io/perf-timing-primer/\">Web Performance APIs</a>:</p>\n<ul>\n<li><a href=\"https://www.w3.org/TR/hr-time-2\">High Resolution Time</a></li>\n<li><a href=\"https://w3c.github.io/performance-timeline/\">Performance Timeline</a></li>\n<li><a href=\"https://www.w3.org/TR/user-timing/\">User Timing</a></li>\n<li><a href=\"https://www.w3.org/TR/resource-timing-2/\">Resource Timing</a></li>\n</ul>\n<pre><code class=\"language-mjs\">import { performance, PerformanceObserver } from 'node:perf_hooks';\n\nconst obs = new PerformanceObserver((items) => {\n  console.log(items.getEntries()[0].duration);\n  performance.clearMarks();\n});\nobs.observe({ type: 'measure' });\nperformance.measure('Start to Now');\n\nperformance.mark('A');\ndoSomeLongRunningProcess(() => {\n  performance.measure('A to Now', 'A');\n\n  performance.mark('B');\n  performance.measure('A to B', 'A', 'B');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { PerformanceObserver, performance } = require('node:perf_hooks');\n\nconst obs = new PerformanceObserver((items) => {\n  console.log(items.getEntries()[0].duration);\n});\nobs.observe({ type: 'measure' });\nperformance.measure('Start to Now');\n\nperformance.mark('A');\n(async function doSomeLongRunningProcess() {\n  await new Promise((r) => setTimeout(r, 5000));\n  performance.measure('A to Now', 'A');\n\n  performance.mark('B');\n  performance.measure('A to B', 'A', 'B');\n})();\n</code></pre>",
      "properties": [
        {
          "textRaw": "`perf_hooks.performance`",
          "name": "performance",
          "type": "property",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "desc": "<p>An object that can be used to collect performance metrics from the current\nNode.js instance. It is similar to <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/performance\"><code>window.performance</code></a> in browsers.</p>",
          "methods": [
            {
              "textRaw": "`performance.clearMarks([name])`",
              "name": "clearMarks",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>If <code>name</code> is not provided, removes all <code>PerformanceMark</code> objects from the\nPerformance Timeline. If <code>name</code> is provided, removes only the named mark.</p>"
            },
            {
              "textRaw": "`performance.clearMeasures([name])`",
              "name": "clearMeasures",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>If <code>name</code> is not provided, removes all <code>PerformanceMeasure</code> objects from the\nPerformance Timeline. If <code>name</code> is provided, removes only the named measure.</p>"
            },
            {
              "textRaw": "`performance.clearResourceTimings([name])`",
              "name": "clearResourceTimings",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>If <code>name</code> is not provided, removes all <code>PerformanceResourceTiming</code> objects from\nthe Resource Timeline. If <code>name</code> is provided, removes only the named resource.</p>"
            },
            {
              "textRaw": "`performance.eventLoopUtilization([utilization1[, utilization2]])`",
              "name": "eventLoopUtilization",
              "type": "method",
              "meta": {
                "added": [
                  "v14.10.0",
                  "v12.19.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.2.0",
                      "v24.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60370",
                    "description": "Added `perf_hooks.eventLoopUtilization` alias."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`utilization1` {Object} The result of a previous call to `eventLoopUtilization()`.",
                      "name": "utilization1",
                      "type": "Object",
                      "desc": "The result of a previous call to `eventLoopUtilization()`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`utilization2` {Object} The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.",
                      "name": "utilization2",
                      "type": "Object",
                      "desc": "The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`idle` {number}",
                        "name": "idle",
                        "type": "number"
                      },
                      {
                        "textRaw": "`active` {number}",
                        "name": "active",
                        "type": "number"
                      },
                      {
                        "textRaw": "`utilization` {number}",
                        "name": "utilization",
                        "type": "number"
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>This is an alias of <a href=\"#perf_hookseventlooputilizationutilization1-utilization2\"><code>perf_hooks.eventLoopUtilization()</code></a>.</p>\n<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>"
            },
            {
              "textRaw": "`performance.getEntries()`",
              "name": "getEntries",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  }
                }
              ],
              "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order with\nrespect to <code>performanceEntry.startTime</code>. If you are only interested in\nperformance entries of certain types or that have certain names, see\n<code>performance.getEntriesByType()</code> and <code>performance.getEntriesByName()</code>.</p>"
            },
            {
              "textRaw": "`performance.getEntriesByName(name[, type])`",
              "name": "getEntriesByName",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`type` {string}",
                      "name": "type",
                      "type": "string",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  }
                }
              ],
              "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code> whose <code>performanceEntry.name</code> is\nequal to <code>name</code>, and optionally, whose <code>performanceEntry.entryType</code> is equal to\n<code>type</code>.</p>"
            },
            {
              "textRaw": "`performance.getEntriesByType(type)`",
              "name": "getEntriesByType",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string}",
                      "name": "type",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  }
                }
              ],
              "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code> whose <code>performanceEntry.entryType</code>\nis equal to <code>type</code>.</p>"
            },
            {
              "textRaw": "`performance.mark(name[, options])`",
              "name": "mark",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver. The name argument is no longer optional."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37136",
                    "description": "Updated to conform to the User Timing Level 3 specification."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`detail` {any} Additional optional detail to include with the mark.",
                          "name": "detail",
                          "type": "any",
                          "desc": "Additional optional detail to include with the mark."
                        },
                        {
                          "textRaw": "`startTime` {number} An optional timestamp to be used as the mark time. **Default**: `performance.now()`.",
                          "name": "startTime",
                          "type": "number",
                          "desc": "An optional timestamp to be used as the mark time. **Default**: `performance.now()`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new <code>PerformanceMark</code> entry in the Performance Timeline. A\n<code>PerformanceMark</code> is a subclass of <code>PerformanceEntry</code> whose\n<code>performanceEntry.entryType</code> is always <code>'mark'</code>, and whose\n<code>performanceEntry.duration</code> is always <code>0</code>. Performance marks are used\nto mark specific significant moments in the Performance Timeline.</p>\n<p>The created <code>PerformanceMark</code> entry is put in the global Performance Timeline\nand can be queried with <code>performance.getEntries</code>,\n<code>performance.getEntriesByName</code>, and <code>performance.getEntriesByType</code>. When the\nobservation is performed, the entries should be cleared from the global\nPerformance Timeline manually with <code>performance.clearMarks</code>.</p>"
            },
            {
              "textRaw": "`performance.markResourceTiming(timingInfo, requestedUrl, initiatorType, global, cacheMode, bodyInfo, responseStatus[, deliveryType])`",
              "name": "markResourceTiming",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v22.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/51589",
                    "description": "Added bodyInfo, responseStatus, and deliveryType arguments."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`timingInfo` {Object} Fetch Timing Info",
                      "name": "timingInfo",
                      "type": "Object",
                      "desc": "Fetch Timing Info"
                    },
                    {
                      "textRaw": "`requestedUrl` {string} The resource url",
                      "name": "requestedUrl",
                      "type": "string",
                      "desc": "The resource url"
                    },
                    {
                      "textRaw": "`initiatorType` {string} The initiator name, e.g: 'fetch'",
                      "name": "initiatorType",
                      "type": "string",
                      "desc": "The initiator name, e.g: 'fetch'"
                    },
                    {
                      "textRaw": "`global` {Object}",
                      "name": "global",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`cacheMode` {string} The cache mode must be an empty string ('') or 'local'",
                      "name": "cacheMode",
                      "type": "string",
                      "desc": "The cache mode must be an empty string ('') or 'local'"
                    },
                    {
                      "textRaw": "`bodyInfo` {Object} Fetch Response Body Info",
                      "name": "bodyInfo",
                      "type": "Object",
                      "desc": "Fetch Response Body Info"
                    },
                    {
                      "textRaw": "`responseStatus` {number} The response's status code",
                      "name": "responseStatus",
                      "type": "number",
                      "desc": "The response's status code"
                    },
                    {
                      "textRaw": "`deliveryType` {string} The delivery type. **Default:** `''`.",
                      "name": "deliveryType",
                      "type": "string",
                      "default": "`''`",
                      "desc": "The delivery type.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>\n<p>Creates a new <code>PerformanceResourceTiming</code> entry in the Resource Timeline. A\n<code>PerformanceResourceTiming</code> is a subclass of <code>PerformanceEntry</code> whose\n<code>performanceEntry.entryType</code> is always <code>'resource'</code>. Performance resources\nare used to mark moments in the Resource Timeline.</p>\n<p>The created <code>PerformanceMark</code> entry is put in the global Resource Timeline\nand can be queried with <code>performance.getEntries</code>,\n<code>performance.getEntriesByName</code>, and <code>performance.getEntriesByType</code>. When the\nobservation is performed, the entries should be cleared from the global\nPerformance Timeline manually with <code>performance.clearResourceTimings</code>.</p>"
            },
            {
              "textRaw": "`performance.measure(name[, startMarkOrOptions[, endMark]])`",
              "name": "measure",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37136",
                    "description": "Updated to conform to the User Timing Level 3 specification."
                  },
                  {
                    "version": [
                      "v13.13.0",
                      "v12.16.3"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32651",
                    "description": "Make `startMark` and `endMark` parameters optional."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`startMarkOrOptions` {string|Object} Optional.",
                      "name": "startMarkOrOptions",
                      "type": "string|Object",
                      "desc": "Optional.",
                      "options": [
                        {
                          "textRaw": "`detail` {any} Additional optional detail to include with the measure.",
                          "name": "detail",
                          "type": "any",
                          "desc": "Additional optional detail to include with the measure."
                        },
                        {
                          "textRaw": "`duration` {number} Duration between start and end times.",
                          "name": "duration",
                          "type": "number",
                          "desc": "Duration between start and end times."
                        },
                        {
                          "textRaw": "`end` {number|string} Timestamp to be used as the end time, or a string identifying a previously recorded mark.",
                          "name": "end",
                          "type": "number|string",
                          "desc": "Timestamp to be used as the end time, or a string identifying a previously recorded mark."
                        },
                        {
                          "textRaw": "`start` {number|string} Timestamp to be used as the start time, or a string identifying a previously recorded mark.",
                          "name": "start",
                          "type": "number|string",
                          "desc": "Timestamp to be used as the start time, or a string identifying a previously recorded mark."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`endMark` {string} Optional. Must be omitted if `startMarkOrOptions` is an {Object}.",
                      "name": "endMark",
                      "type": "string",
                      "desc": "Optional. Must be omitted if `startMarkOrOptions` is an {Object}.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Creates a new <code>PerformanceMeasure</code> entry in the Performance Timeline. A\n<code>PerformanceMeasure</code> is a subclass of <code>PerformanceEntry</code> whose\n<code>performanceEntry.entryType</code> is always <code>'measure'</code>, and whose\n<code>performanceEntry.duration</code> measures the number of milliseconds elapsed since\n<code>startMark</code> and <code>endMark</code>.</p>\n<p>The <code>startMark</code> argument may identify any <em>existing</em> <code>PerformanceMark</code> in the\nPerformance Timeline, or <em>may</em> identify any of the timestamp properties\nprovided by the <code>PerformanceNodeTiming</code> class. If the named <code>startMark</code> does\nnot exist, an error is thrown.</p>\n<p>The optional <code>endMark</code> argument must identify any <em>existing</em> <code>PerformanceMark</code>\nin the Performance Timeline or any of the timestamp properties provided by the\n<code>PerformanceNodeTiming</code> class. <code>endMark</code> will be <code>performance.now()</code>\nif no parameter is passed, otherwise if the named <code>endMark</code> does not exist, an\nerror will be thrown.</p>\n<p>The created <code>PerformanceMeasure</code> entry is put in the global Performance Timeline\nand can be queried with <code>performance.getEntries</code>,\n<code>performance.getEntriesByName</code>, and <code>performance.getEntriesByType</code>. When the\nobservation is performed, the entries should be cleared from the global\nPerformance Timeline manually with <code>performance.clearMeasures</code>.</p>"
            },
            {
              "textRaw": "`performance.now()`",
              "name": "now",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns the current high resolution millisecond timestamp, where 0 represents\nthe start of the current <code>node</code> process.</p>"
            },
            {
              "textRaw": "`performance.setResourceTimingBufferSize(maxSize)`",
              "name": "setResourceTimingBufferSize",
              "type": "method",
              "meta": {
                "added": [
                  "v18.8.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "maxSize"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the global performance resource timing buffer size to the specified number\nof \"resource\" type performance entry objects.</p>\n<p>By default the max buffer size is set to 250.</p>"
            },
            {
              "textRaw": "`performance.timerify(fn[, options])`",
              "name": "timerify",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.2.0",
                      "v24.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60370",
                    "description": "Added `perf_hooks.timerify` alias."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37475",
                    "description": "Added the histogram option."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37136",
                    "description": "Re-implemented to use pure-JavaScript and the ability to time async functions."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function}",
                      "name": "fn",
                      "type": "Function"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`histogram` {RecordableHistogram} A histogram object created using `perf_hooks.createHistogram()` that will record runtime durations in nanoseconds.",
                          "name": "histogram",
                          "type": "RecordableHistogram",
                          "desc": "A histogram object created using `perf_hooks.createHistogram()` that will record runtime durations in nanoseconds."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This is an alias of <a href=\"#perf_hookstimerifyfn-options\"><code>perf_hooks.timerify()</code></a>.</p>\n<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>"
            },
            {
              "textRaw": "`performance.toJSON()`",
              "name": "toJSON",
              "type": "method",
              "meta": {
                "added": [
                  "v16.1.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `performance` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>An object which is JSON representation of the <code>performance</code> object. It\nis similar to <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON\"><code>window.performance.toJSON</code></a> in browsers.</p>",
              "events": [
                {
                  "textRaw": "Event: `'resourcetimingbufferfull'`",
                  "name": "resourcetimingbufferfull",
                  "type": "event",
                  "meta": {
                    "added": [
                      "v18.8.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>The <code>'resourcetimingbufferfull'</code> event is fired when the global performance\nresource timing buffer is full. Adjust resource timing buffer size with\n<code>performance.setResourceTimingBufferSize()</code> or clear the buffer with\n<code>performance.clearResourceTimings()</code> in the event listener to allow\nmore entries to be added to the performance timeline buffer.</p>"
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {PerformanceNodeTiming}",
              "name": "nodeTiming",
              "type": "PerformanceNodeTiming",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>\n<p>An instance of the <code>PerformanceNodeTiming</code> class that provides performance\nmetrics for specific Node.js operational milestones.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "timeOrigin",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The <a href=\"https://w3c.github.io/hr-time/#dom-performance-timeorigin\"><code>timeOrigin</code></a> specifies the high resolution millisecond timestamp at\nwhich the current <code>node</code> process began, measured in Unix time.</p>"
            }
          ]
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `PerformanceEntry`",
          "name": "PerformanceEntry",
          "type": "class",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "desc": "<p>The constructor of this class is not exposed to users directly.</p>",
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "duration",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceEntry` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The total number of milliseconds elapsed for this entry. This value will not\nbe meaningful for all Performance Entry types.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "entryType",
              "type": "string",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceEntry` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The type of the performance entry. It may be one of:</p>\n<ul>\n<li><code>'dns'</code> (Node.js only)</li>\n<li><code>'function'</code> (Node.js only)</li>\n<li><code>'gc'</code> (Node.js only)</li>\n<li><code>'http2'</code> (Node.js only)</li>\n<li><code>'http'</code> (Node.js only)</li>\n<li><code>'mark'</code> (available on the Web)</li>\n<li><code>'measure'</code> (available on the Web)</li>\n<li><code>'net'</code> (Node.js only)</li>\n<li><code>'node'</code> (Node.js only)</li>\n<li><code>'resource'</code> (available on the Web)</li>\n</ul>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "name",
              "type": "string",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceEntry` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The name of the performance entry.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "startTime",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceEntry` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp marking the starting time of the\nPerformance Entry.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `PerformanceMark`",
          "name": "PerformanceMark",
          "type": "class",
          "meta": {
            "added": [
              "v18.2.0",
              "v16.17.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"perf_hooks.html#class-performanceentry\"><code>&#x3C;PerformanceEntry></code></a></li>\n</ul>\n<p>Exposes marks created via the <code>Performance.mark()</code> method.</p>",
          "properties": [
            {
              "textRaw": "Type: {any}",
              "name": "detail",
              "type": "any",
              "meta": {
                "added": [
                  "v16.0.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceMark` object as the receiver."
                  }
                ]
              },
              "desc": "<p>Additional detail specified when creating with <code>Performance.mark()</code> method.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `PerformanceMeasure`",
          "name": "PerformanceMeasure",
          "type": "class",
          "meta": {
            "added": [
              "v18.2.0",
              "v16.17.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"perf_hooks.html#class-performanceentry\"><code>&#x3C;PerformanceEntry></code></a></li>\n</ul>\n<p>Exposes measures created via the <code>Performance.measure()</code> method.</p>\n<p>The constructor of this class is not exposed to users directly.</p>",
          "properties": [
            {
              "textRaw": "Type: {any}",
              "name": "detail",
              "type": "any",
              "meta": {
                "added": [
                  "v16.0.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceMeasure` object as the receiver."
                  }
                ]
              },
              "desc": "<p>Additional detail specified when creating with <code>Performance.measure()</code> method.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `PerformanceNodeEntry`",
          "name": "PerformanceNodeEntry",
          "type": "class",
          "meta": {
            "added": [
              "v19.0.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"perf_hooks.html#class-performanceentry\"><code>&#x3C;PerformanceEntry></code></a></li>\n</ul>\n<p><em>This class is an extension by Node.js. It is not available in Web browsers.</em></p>\n<p>Provides detailed Node.js timing data.</p>\n<p>The constructor of this class is not exposed to users directly.</p>",
          "properties": [
            {
              "textRaw": "Type: {any}",
              "name": "detail",
              "type": "any",
              "meta": {
                "added": [
                  "v16.0.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceNodeEntry` object as the receiver."
                  }
                ]
              },
              "desc": "<p>Additional detail specific to the <code>entryType</code>.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "flags",
              "type": "number",
              "meta": {
                "added": [
                  "v13.9.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37136",
                    "description": "Runtime deprecated. Now moved to the detail property when entryType is 'gc'."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `performanceNodeEntry.detail` instead.",
              "desc": "<p>When <code>performanceEntry.entryType</code> is equal to <code>'gc'</code>, the <code>performance.flags</code>\nproperty contains additional information about garbage collection operation.\nThe value may be one of:</p>\n<ul>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_NO</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_FORCED</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE</code></li>\n</ul>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "kind",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37136",
                    "description": "Runtime deprecated. Now moved to the detail property when entryType is 'gc'."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `performanceNodeEntry.detail` instead.",
              "desc": "<p>When <code>performanceEntry.entryType</code> is equal to <code>'gc'</code>, the <code>performance.kind</code>\nproperty identifies the type of garbage collection operation that occurred.\nThe value may be one of:</p>\n<ul>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_MAJOR</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_INCREMENTAL</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_WEAKCB</code></li>\n</ul>"
            }
          ],
          "modules": [
            {
              "textRaw": "Garbage Collection ('gc') Details",
              "name": "garbage_collection_('gc')_details",
              "type": "module",
              "desc": "<p>When <code>performanceEntry.type</code> is equal to <code>'gc'</code>, the\n<code>performanceNodeEntry.detail</code> property will be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> with two properties:</p>\n<ul>\n<li><code>kind</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> One of:\n<ul>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_MAJOR</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_MINOR</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_INCREMENTAL</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_WEAKCB</code></li>\n</ul>\n</li>\n<li><code>flags</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> One of:\n<ul>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_NO</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_FORCED</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY</code></li>\n<li><code>perf_hooks.constants.NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE</code></li>\n</ul>\n</li>\n</ul>",
              "displayName": "Garbage Collection ('gc') Details"
            },
            {
              "textRaw": "HTTP ('http') Details",
              "name": "http_('http')_details",
              "type": "module",
              "desc": "<p>When <code>performanceEntry.type</code> is equal to <code>'http'</code>, the\n<code>performanceNodeEntry.detail</code> property will be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> containing\nadditional information.</p>\n<p>If <code>performanceEntry.name</code> is equal to <code>HttpClient</code>, the <code>detail</code>\nwill contain the following properties: <code>req</code>, <code>res</code>. And the <code>req</code> property\nwill be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> containing <code>method</code>, <code>url</code>, <code>headers</code>, the <code>res</code> property\nwill be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> containing <code>statusCode</code>, <code>statusMessage</code>, <code>headers</code>.</p>\n<p>If <code>performanceEntry.name</code> is equal to <code>HttpRequest</code>, the <code>detail</code>\nwill contain the following properties: <code>req</code>, <code>res</code>. And the <code>req</code> property\nwill be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> containing <code>method</code>, <code>url</code>, <code>headers</code>, the <code>res</code> property\nwill be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> containing <code>statusCode</code>, <code>statusMessage</code>, <code>headers</code>.</p>\n<p>This could add additional memory overhead and should only be used for\ndiagnostic purposes, not left turned on in production by default.</p>",
              "displayName": "HTTP ('http') Details"
            },
            {
              "textRaw": "HTTP/2 ('http2') Details",
              "name": "http/2_('http2')_details",
              "type": "module",
              "desc": "<p>When <code>performanceEntry.type</code> is equal to <code>'http2'</code>, the\n<code>performanceNodeEntry.detail</code> property will be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> containing\nadditional performance information.</p>\n<p>If <code>performanceEntry.name</code> is equal to <code>Http2Stream</code>, the <code>detail</code>\nwill contain the following properties:</p>\n<ul>\n<li><code>bytesRead</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of <code>DATA</code> frame bytes received for this\n<code>Http2Stream</code>.</li>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of <code>DATA</code> frame bytes sent for this\n<code>Http2Stream</code>.</li>\n<li><code>id</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The identifier of the associated <code>Http2Stream</code></li>\n<li><code>timeToFirstByte</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds elapsed between the <code>PerformanceEntry</code> <code>startTime</code> and the reception of the first <code>DATA</code> frame.</li>\n<li><code>timeToFirstByteSent</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds elapsed between\nthe <code>PerformanceEntry</code> <code>startTime</code> and sending of the first <code>DATA</code> frame.</li>\n<li><code>timeToFirstHeader</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds elapsed between the <code>PerformanceEntry</code> <code>startTime</code> and the reception of the first header.</li>\n</ul>\n<p>If <code>performanceEntry.name</code> is equal to <code>Http2Session</code>, the <code>detail</code> will\ncontain the following properties:</p>\n<ul>\n<li><code>bytesRead</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of bytes received for this <code>Http2Session</code>.</li>\n<li><code>bytesWritten</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of bytes sent for this <code>Http2Session</code>.</li>\n<li><code>framesReceived</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of HTTP/2 frames received by the <code>Http2Session</code>.</li>\n<li><code>framesSent</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of HTTP/2 frames sent by the <code>Http2Session</code>.</li>\n<li><code>maxConcurrentStreams</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The maximum number of streams concurrently\nopen during the lifetime of the <code>Http2Session</code>.</li>\n<li><code>pingRTT</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of milliseconds elapsed since the transmission\nof a <code>PING</code> frame and the reception of its acknowledgment. Only present if\na <code>PING</code> frame has been sent on the <code>Http2Session</code>.</li>\n<li><code>streamAverageDuration</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The average duration (in milliseconds) for\nall <code>Http2Stream</code> instances.</li>\n<li><code>streamCount</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The number of <code>Http2Stream</code> instances processed by\nthe <code>Http2Session</code>.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Either <code>'server'</code> or <code>'client'</code> to identify the type of\n<code>Http2Session</code>.</li>\n</ul>",
              "displayName": "HTTP/2 ('http2') Details"
            },
            {
              "textRaw": "Timerify ('function') Details",
              "name": "timerify_('function')_details",
              "type": "module",
              "desc": "<p>When <code>performanceEntry.type</code> is equal to <code>'function'</code>, the\n<code>performanceNodeEntry.detail</code> property will be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\"><code>&#x3C;Array></code></a> listing\nthe input arguments to the timed function.</p>",
              "displayName": "Timerify ('function') Details"
            },
            {
              "textRaw": "Net ('net') Details",
              "name": "net_('net')_details",
              "type": "module",
              "desc": "<p>When <code>performanceEntry.type</code> is equal to <code>'net'</code>, the\n<code>performanceNodeEntry.detail</code> property will be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> containing\nadditional information.</p>\n<p>If <code>performanceEntry.name</code> is equal to <code>connect</code>, the <code>detail</code>\nwill contain the following properties: <code>host</code>, <code>port</code>.</p>",
              "displayName": "Net ('net') Details"
            },
            {
              "textRaw": "DNS ('dns') Details",
              "name": "dns_('dns')_details",
              "type": "module",
              "desc": "<p>When <code>performanceEntry.type</code> is equal to <code>'dns'</code>, the\n<code>performanceNodeEntry.detail</code> property will be an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> containing\nadditional information.</p>\n<p>If <code>performanceEntry.name</code> is equal to <code>lookup</code>, the <code>detail</code>\nwill contain the following properties: <code>hostname</code>, <code>family</code>, <code>hints</code>, <code>verbatim</code>,\n<code>addresses</code>.</p>\n<p>If <code>performanceEntry.name</code> is equal to <code>lookupService</code>, the <code>detail</code> will\ncontain the following properties: <code>host</code>, <code>port</code>, <code>hostname</code>, <code>service</code>.</p>\n<p>If <code>performanceEntry.name</code> is equal to <code>queryxxx</code> or <code>getHostByAddr</code>, the <code>detail</code> will\ncontain the following properties: <code>host</code>, <code>ttl</code>, <code>result</code>. The value of <code>result</code> is\nsame as the result of <code>queryxxx</code> or <code>getHostByAddr</code>.</p>",
              "displayName": "DNS ('dns') Details"
            }
          ]
        },
        {
          "textRaw": "Class: `PerformanceNodeTiming`",
          "name": "PerformanceNodeTiming",
          "type": "class",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"perf_hooks.html#class-performanceentry\"><code>&#x3C;PerformanceEntry></code></a></li>\n</ul>\n<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>\n<p>Provides timing details for Node.js itself. The constructor of this class\nis not exposed to users.</p>",
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "bootstrapComplete",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js process\ncompleted bootstrapping. If bootstrapping has not yet finished, the property\nhas the value of -1.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "environment",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js environment was\ninitialized.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "idleTime",
              "type": "number",
              "meta": {
                "added": [
                  "v14.10.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp of the amount of time the event loop\nhas been idle within the event loop's event provider (e.g. <code>epoll_wait</code>). This\ndoes not take CPU usage into consideration. If the event loop has not yet\nstarted (e.g., in the first tick of the main script), the property has the\nvalue of 0.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "loopExit",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js event loop\nexited. If the event loop has not yet exited, the property has the value of -1.\nIt can only have a value of not -1 in a handler of the <a href=\"process.html#event-exit\"><code>'exit'</code></a> event.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "loopStart",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js event loop\nstarted. If the event loop has not yet started (e.g., in the first tick of the\nmain script), the property has the value of -1.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "nodeStart",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the Node.js process was\ninitialized.</p>"
            },
            {
              "textRaw": "Returns: {Object}",
              "name": "uvMetricsInfo",
              "type": "Object",
              "meta": {
                "added": [
                  "v22.8.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "desc": "<p>This is a wrapper to the <code>uv_metrics_info</code> function.\nIt returns the current set of event loop metrics.</p>\n<p>It is recommended to use this property inside a function whose execution was\nscheduled using <code>setImmediate</code> to avoid collecting metrics before finishing all\noperations scheduled during the current loop iteration.</p>\n<pre><code class=\"language-cjs\">const { performance } = require('node:perf_hooks');\n\nsetImmediate(() => {\n  console.log(performance.nodeTiming.uvMetricsInfo);\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { performance } from 'node:perf_hooks';\n\nsetImmediate(() => {\n  console.log(performance.nodeTiming.uvMetricsInfo);\n});\n</code></pre>",
              "options": [
                {
                  "textRaw": "`loopCount` {number} Number of event loop iterations.",
                  "name": "loopCount",
                  "type": "number",
                  "desc": "Number of event loop iterations."
                },
                {
                  "textRaw": "`events` {number} Number of events that have been processed by the event handler.",
                  "name": "events",
                  "type": "number",
                  "desc": "Number of events that have been processed by the event handler."
                },
                {
                  "textRaw": "`eventsWaiting` {number} Number of events that were waiting to be processed when the event provider was called.",
                  "name": "eventsWaiting",
                  "type": "number",
                  "desc": "Number of events that were waiting to be processed when the event provider was called."
                }
              ]
            },
            {
              "textRaw": "Type: {number}",
              "name": "v8Start",
              "type": "number",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The high resolution millisecond timestamp at which the V8 platform was\ninitialized.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `PerformanceResourceTiming`",
          "name": "PerformanceResourceTiming",
          "type": "class",
          "meta": {
            "added": [
              "v18.2.0",
              "v16.17.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"perf_hooks.html#class-performanceentry\"><code>&#x3C;PerformanceEntry></code></a></li>\n</ul>\n<p>Provides detailed network timing data regarding the loading of an application's\nresources.</p>\n<p>The constructor of this class is not exposed to users directly.</p>",
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "workerStart",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp at immediately before dispatching\nthe <code>fetch</code> request. If the resource is not intercepted by a worker the property\nwill always return 0.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "redirectStart",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp that represents the start time\nof the fetch which initiates the redirect.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "redirectEnd",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp that will be created immediately after\nreceiving the last byte of the response of the last redirect.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "fetchStart",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp immediately before the Node.js starts\nto fetch the resource.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "domainLookupStart",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp immediately before the Node.js starts\nthe domain name lookup for the resource.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "domainLookupEnd",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp representing the time immediately\nafter the Node.js finished the domain name lookup for the resource.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "connectStart",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp representing the time immediately\nbefore Node.js starts to establish the connection to the server to retrieve\nthe resource.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "connectEnd",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp representing the time immediately\nafter Node.js finishes establishing the connection to the server to retrieve\nthe resource.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "secureConnectionStart",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp representing the time immediately\nbefore Node.js starts the handshake process to secure the current connection.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "requestStart",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp representing the time immediately\nbefore Node.js receives the first byte of the response from the server.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "responseEnd",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>The high resolution millisecond timestamp representing the time immediately\nafter Node.js receives the last byte of the resource or immediately before\nthe transport connection is closed, whichever comes first.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "transferSize",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>A number representing the size (in octets) of the fetched resource. The size\nincludes the response header fields plus the response payload body.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "encodedBodySize",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>A number representing the size (in octets) received from the fetch\n(HTTP or cache), of the payload body, before removing any applied\ncontent-codings.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "decodedBodySize",
              "type": "number",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This property getter must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "desc": "<p>A number representing the size (in octets) received from the fetch\n(HTTP or cache), of the message body, after removing any applied\ncontent-codings.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`performanceResourceTiming.toJSON()`",
              "name": "toJSON",
              "type": "method",
              "meta": {
                "added": [
                  "v18.2.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44483",
                    "description": "This method must be called with the `PerformanceResourceTiming` object as the receiver."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Returns a <code>object</code> that is the JSON representation of the\n<code>PerformanceResourceTiming</code> object</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `PerformanceObserver`",
          "name": "PerformanceObserver",
          "type": "class",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "properties": [
            {
              "textRaw": "Type: {string[]}",
              "name": "supportedEntryTypes",
              "type": "string[]",
              "meta": {
                "added": [
                  "v16.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Get supported types.</p>"
            }
          ],
          "signatures": [
            {
              "textRaw": "`new PerformanceObserver(callback)`",
              "name": "PerformanceObserver",
              "type": "ctor",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "options": [
                    {
                      "textRaw": "`list` {PerformanceObserverEntryList}",
                      "name": "list",
                      "type": "PerformanceObserverEntryList"
                    },
                    {
                      "textRaw": "`observer` {PerformanceObserver}",
                      "name": "observer",
                      "type": "PerformanceObserver"
                    }
                  ]
                }
              ],
              "desc": "<p><code>PerformanceObserver</code> objects provide notifications when new\n<code>PerformanceEntry</code> instances have been added to the Performance Timeline.</p>\n<pre><code class=\"language-mjs\">import { performance, PerformanceObserver } from 'node:perf_hooks';\n\nconst obs = new PerformanceObserver((list, observer) => {\n  console.log(list.getEntries());\n\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ entryTypes: ['mark'], buffered: true });\n\nperformance.mark('test');\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  performance,\n  PerformanceObserver,\n} = require('node:perf_hooks');\n\nconst obs = new PerformanceObserver((list, observer) => {\n  console.log(list.getEntries());\n\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ entryTypes: ['mark'], buffered: true });\n\nperformance.mark('test');\n</code></pre>\n<p>Because <code>PerformanceObserver</code> instances introduce their own additional\nperformance overhead, instances should not be left subscribed to notifications\nindefinitely. Users should disconnect observers as soon as they are no\nlonger needed.</p>\n<p>The <code>callback</code> is invoked when a <code>PerformanceObserver</code> is\nnotified about new <code>PerformanceEntry</code> instances. The callback receives a\n<code>PerformanceObserverEntryList</code> instance and a reference to the\n<code>PerformanceObserver</code>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`performanceObserver.disconnect()`",
              "name": "disconnect",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Disconnects the <code>PerformanceObserver</code> instance from all notifications.</p>"
            },
            {
              "textRaw": "`performanceObserver.observe(options)`",
              "name": "observe",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": [
                  {
                    "version": "v16.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39297",
                    "description": "Updated to conform to Performance Timeline Level 2. The buffered option has been added back."
                  },
                  {
                    "version": "v16.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37136",
                    "description": "Updated to conform to User Timing Level 3. The buffered option has been removed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`type` {string} A single {PerformanceEntry} type. Must not be given if `entryTypes` is already specified.",
                          "name": "type",
                          "type": "string",
                          "desc": "A single {PerformanceEntry} type. Must not be given if `entryTypes` is already specified."
                        },
                        {
                          "textRaw": "`entryTypes` {string[]} An array of strings identifying the types of {PerformanceEntry} instances the observer is interested in. If not provided an error will be thrown.",
                          "name": "entryTypes",
                          "type": "string[]",
                          "desc": "An array of strings identifying the types of {PerformanceEntry} instances the observer is interested in. If not provided an error will be thrown."
                        },
                        {
                          "textRaw": "`buffered` {boolean} If true, the observer callback is called with a list global `PerformanceEntry` buffered entries. If false, only `PerformanceEntry`s created after the time point are sent to the observer callback. **Default:** `false`.",
                          "name": "buffered",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If true, the observer callback is called with a list global `PerformanceEntry` buffered entries. If false, only `PerformanceEntry`s created after the time point are sent to the observer callback."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Subscribes the <a href=\"perf_hooks.html#class-performanceobserver\"><code>&#x3C;PerformanceObserver></code></a> instance to notifications of new\n<a href=\"perf_hooks.html#class-performanceentry\"><code>&#x3C;PerformanceEntry></code></a> instances identified either by <code>options.entryTypes</code>\nor <code>options.type</code>:</p>\n<pre><code class=\"language-mjs\">import { performance, PerformanceObserver } from 'node:perf_hooks';\n\nconst obs = new PerformanceObserver((list, observer) => {\n  // Called once asynchronously. `list` contains three items.\n});\nobs.observe({ type: 'mark' });\n\nfor (let n = 0; n &#x3C; 3; n++)\n  performance.mark(`test${n}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  performance,\n  PerformanceObserver,\n} = require('node:perf_hooks');\n\nconst obs = new PerformanceObserver((list, observer) => {\n  // Called once asynchronously. `list` contains three items.\n});\nobs.observe({ type: 'mark' });\n\nfor (let n = 0; n &#x3C; 3; n++)\n  performance.mark(`test${n}`);\n</code></pre>"
            },
            {
              "textRaw": "`performanceObserver.takeRecords()`",
              "name": "takeRecords",
              "type": "method",
              "meta": {
                "added": [
                  "v16.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]} Current list of entries stored in the performance observer, emptying it out.",
                    "name": "return",
                    "type": "PerformanceEntry[]",
                    "desc": "Current list of entries stored in the performance observer, emptying it out."
                  }
                }
              ]
            }
          ]
        },
        {
          "textRaw": "Class: `PerformanceObserverEntryList`",
          "name": "PerformanceObserverEntryList",
          "type": "class",
          "meta": {
            "added": [
              "v8.5.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>PerformanceObserverEntryList</code> class is used to provide access to the\n<code>PerformanceEntry</code> instances passed to a <code>PerformanceObserver</code>.\nThe constructor of this class is not exposed to users.</p>",
          "methods": [
            {
              "textRaw": "`performanceObserverEntryList.getEntries()`",
              "name": "getEntries",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  }
                }
              ],
              "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code>.</p>\n<pre><code class=\"language-mjs\">import { performance, PerformanceObserver } from 'node:perf_hooks';\n\nconst obs = new PerformanceObserver((perfObserverList, observer) => {\n  console.log(perfObserverList.getEntries());\n  /**\n   * [\n   *   PerformanceEntry {\n   *     name: 'test',\n   *     entryType: 'mark',\n   *     startTime: 81.465639,\n   *     duration: 0,\n   *     detail: null\n   *   },\n   *   PerformanceEntry {\n   *     name: 'meow',\n   *     entryType: 'mark',\n   *     startTime: 81.860064,\n   *     duration: 0,\n   *     detail: null\n   *   }\n   * ]\n   */\n\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ type: 'mark' });\n\nperformance.mark('test');\nperformance.mark('meow');\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  performance,\n  PerformanceObserver,\n} = require('node:perf_hooks');\n\nconst obs = new PerformanceObserver((perfObserverList, observer) => {\n  console.log(perfObserverList.getEntries());\n  /**\n   * [\n   *   PerformanceEntry {\n   *     name: 'test',\n   *     entryType: 'mark',\n   *     startTime: 81.465639,\n   *     duration: 0,\n   *     detail: null\n   *   },\n   *   PerformanceEntry {\n   *     name: 'meow',\n   *     entryType: 'mark',\n   *     startTime: 81.860064,\n   *     duration: 0,\n   *     detail: null\n   *   }\n   * ]\n   */\n\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ type: 'mark' });\n\nperformance.mark('test');\nperformance.mark('meow');\n</code></pre>"
            },
            {
              "textRaw": "`performanceObserverEntryList.getEntriesByName(name[, type])`",
              "name": "getEntriesByName",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`type` {string}",
                      "name": "type",
                      "type": "string",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  }
                }
              ],
              "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code> whose <code>performanceEntry.name</code> is\nequal to <code>name</code>, and optionally, whose <code>performanceEntry.entryType</code> is equal to\n<code>type</code>.</p>\n<pre><code class=\"language-mjs\">import { performance, PerformanceObserver } from 'node:perf_hooks';\n\nconst obs = new PerformanceObserver((perfObserverList, observer) => {\n  console.log(perfObserverList.getEntriesByName('meow'));\n  /**\n   * [\n   *   PerformanceEntry {\n   *     name: 'meow',\n   *     entryType: 'mark',\n   *     startTime: 98.545991,\n   *     duration: 0,\n   *     detail: null\n   *   }\n   * ]\n   */\n  console.log(perfObserverList.getEntriesByName('nope')); // []\n\n  console.log(perfObserverList.getEntriesByName('test', 'mark'));\n  /**\n   * [\n   *   PerformanceEntry {\n   *     name: 'test',\n   *     entryType: 'mark',\n   *     startTime: 63.518931,\n   *     duration: 0,\n   *     detail: null\n   *   }\n   * ]\n   */\n  console.log(perfObserverList.getEntriesByName('test', 'measure')); // []\n\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ entryTypes: ['mark', 'measure'] });\n\nperformance.mark('test');\nperformance.mark('meow');\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  performance,\n  PerformanceObserver,\n} = require('node:perf_hooks');\n\nconst obs = new PerformanceObserver((perfObserverList, observer) => {\n  console.log(perfObserverList.getEntriesByName('meow'));\n  /**\n   * [\n   *   PerformanceEntry {\n   *     name: 'meow',\n   *     entryType: 'mark',\n   *     startTime: 98.545991,\n   *     duration: 0,\n   *     detail: null\n   *   }\n   * ]\n   */\n  console.log(perfObserverList.getEntriesByName('nope')); // []\n\n  console.log(perfObserverList.getEntriesByName('test', 'mark'));\n  /**\n   * [\n   *   PerformanceEntry {\n   *     name: 'test',\n   *     entryType: 'mark',\n   *     startTime: 63.518931,\n   *     duration: 0,\n   *     detail: null\n   *   }\n   * ]\n   */\n  console.log(perfObserverList.getEntriesByName('test', 'measure')); // []\n\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ entryTypes: ['mark', 'measure'] });\n\nperformance.mark('test');\nperformance.mark('meow');\n</code></pre>"
            },
            {
              "textRaw": "`performanceObserverEntryList.getEntriesByType(type)`",
              "name": "getEntriesByType",
              "type": "method",
              "meta": {
                "added": [
                  "v8.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string}",
                      "name": "type",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {PerformanceEntry[]}",
                    "name": "return",
                    "type": "PerformanceEntry[]"
                  }
                }
              ],
              "desc": "<p>Returns a list of <code>PerformanceEntry</code> objects in chronological order\nwith respect to <code>performanceEntry.startTime</code> whose <code>performanceEntry.entryType</code>\nis equal to <code>type</code>.</p>\n<pre><code class=\"language-mjs\">import { performance, PerformanceObserver } from 'node:perf_hooks';\n\nconst obs = new PerformanceObserver((perfObserverList, observer) => {\n  console.log(perfObserverList.getEntriesByType('mark'));\n  /**\n   * [\n   *   PerformanceEntry {\n   *     name: 'test',\n   *     entryType: 'mark',\n   *     startTime: 55.897834,\n   *     duration: 0,\n   *     detail: null\n   *   },\n   *   PerformanceEntry {\n   *     name: 'meow',\n   *     entryType: 'mark',\n   *     startTime: 56.350146,\n   *     duration: 0,\n   *     detail: null\n   *   }\n   * ]\n   */\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ type: 'mark' });\n\nperformance.mark('test');\nperformance.mark('meow');\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  performance,\n  PerformanceObserver,\n} = require('node:perf_hooks');\n\nconst obs = new PerformanceObserver((perfObserverList, observer) => {\n  console.log(perfObserverList.getEntriesByType('mark'));\n  /**\n   * [\n   *   PerformanceEntry {\n   *     name: 'test',\n   *     entryType: 'mark',\n   *     startTime: 55.897834,\n   *     duration: 0,\n   *     detail: null\n   *   },\n   *   PerformanceEntry {\n   *     name: 'meow',\n   *     entryType: 'mark',\n   *     startTime: 56.350146,\n   *     duration: 0,\n   *     detail: null\n   *   }\n   * ]\n   */\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ type: 'mark' });\n\nperformance.mark('test');\nperformance.mark('meow');\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `Histogram`",
          "name": "Histogram",
          "type": "class",
          "meta": {
            "added": [
              "v11.10.0"
            ],
            "changes": []
          },
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "count",
              "type": "number",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The number of samples recorded by the histogram.</p>"
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "countBigInt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The number of samples recorded by the histogram.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "exceeds",
              "type": "number",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The number of times the event loop delay exceeded the maximum 1 hour event\nloop delay threshold.</p>"
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "exceedsBigInt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The number of times the event loop delay exceeded the maximum 1 hour event\nloop delay threshold.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "max",
              "type": "number",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The maximum recorded event loop delay.</p>"
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "maxBigInt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The maximum recorded event loop delay.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "mean",
              "type": "number",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The mean of the recorded event loop delays.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "min",
              "type": "number",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The minimum recorded event loop delay.</p>"
            },
            {
              "textRaw": "Type: {bigint}",
              "name": "minBigInt",
              "type": "bigint",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>The minimum recorded event loop delay.</p>"
            },
            {
              "textRaw": "Type: {Map}",
              "name": "percentiles",
              "type": "Map",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "desc": "<p>Returns a <code>Map</code> object detailing the accumulated percentile distribution.</p>"
            },
            {
              "textRaw": "Type: {Map}",
              "name": "percentilesBigInt",
              "type": "Map",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "desc": "<p>Returns a <code>Map</code> object detailing the accumulated percentile distribution.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "stddev",
              "type": "number",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "desc": "<p>The standard deviation of the recorded event loop delays.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`histogram.percentile(percentile)`",
              "name": "percentile",
              "type": "method",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`percentile` {number} A percentile value in the range (0, 100].",
                      "name": "percentile",
                      "type": "number",
                      "desc": "A percentile value in the range (0, 100]."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns the value at the given percentile.</p>"
            },
            {
              "textRaw": "`histogram.percentileBigInt(percentile)`",
              "name": "percentileBigInt",
              "type": "method",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`percentile` {number} A percentile value in the range (0, 100].",
                      "name": "percentile",
                      "type": "number",
                      "desc": "A percentile value in the range (0, 100]."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {bigint}",
                    "name": "return",
                    "type": "bigint"
                  }
                }
              ],
              "desc": "<p>Returns the value at the given percentile.</p>"
            },
            {
              "textRaw": "`histogram.reset()`",
              "name": "reset",
              "type": "method",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Resets the collected histogram data.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `IntervalHistogram extends Histogram`",
          "name": "IntervalHistogram extends Histogram",
          "type": "class",
          "desc": "<p>A <code>Histogram</code> that is periodically updated on a given interval.</p>",
          "methods": [
            {
              "textRaw": "`histogram.disable()`",
              "name": "disable",
              "type": "method",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Disables the update interval timer. Returns <code>true</code> if the timer was\nstopped, <code>false</code> if it was already stopped.</p>"
            },
            {
              "textRaw": "`histogram.enable()`",
              "name": "enable",
              "type": "method",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Enables the update interval timer. Returns <code>true</code> if the timer was\nstarted, <code>false</code> if it was already started.</p>"
            },
            {
              "textRaw": "`histogram[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v24.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Disables the update interval timer when the histogram is disposed.</p>\n<pre><code class=\"language-js\">const { monitorEventLoopDelay } = require('node:perf_hooks');\n{\n  using hist = monitorEventLoopDelay({ resolution: 20 });\n  hist.enable();\n  // The histogram will be disabled when the block is exited.\n}\n</code></pre>"
            }
          ],
          "modules": [
            {
              "textRaw": "Cloning an `IntervalHistogram`",
              "name": "cloning_an_`intervalhistogram`",
              "type": "module",
              "desc": "<p><a href=\"perf_hooks.html#class-intervalhistogram-extends-histogram\"><code>&#x3C;IntervalHistogram></code></a> instances can be cloned via <a href=\"worker_threads.html#class-messageport\"><code>&#x3C;MessagePort></code></a>. On the receiving\nend, the histogram is cloned as a plain <a href=\"perf_hooks.html#class-histogram\"><code>&#x3C;Histogram></code></a> object that does not\nimplement the <code>enable()</code> and <code>disable()</code> methods.</p>",
              "displayName": "Cloning an `IntervalHistogram`"
            }
          ]
        },
        {
          "textRaw": "Class: `RecordableHistogram extends Histogram`",
          "name": "RecordableHistogram extends Histogram",
          "type": "class",
          "meta": {
            "added": [
              "v15.9.0",
              "v14.18.0"
            ],
            "changes": []
          },
          "methods": [
            {
              "textRaw": "`histogram.add(other)`",
              "name": "add",
              "type": "method",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`other` {RecordableHistogram}",
                      "name": "other",
                      "type": "RecordableHistogram"
                    }
                  ]
                }
              ],
              "desc": "<p>Adds the values from <code>other</code> to this histogram.</p>"
            },
            {
              "textRaw": "`histogram.record(val)`",
              "name": "record",
              "type": "method",
              "meta": {
                "added": [
                  "v15.9.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`val` {number|bigint} The amount to record in the histogram.",
                      "name": "val",
                      "type": "number|bigint",
                      "desc": "The amount to record in the histogram."
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`histogram.recordDelta()`",
              "name": "recordDelta",
              "type": "method",
              "meta": {
                "added": [
                  "v15.9.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calculates the amount of time (in nanoseconds) that has passed since the\nprevious call to <code>recordDelta()</code> and records that amount in the histogram.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`perf_hooks.createHistogram([options])`",
          "name": "createHistogram",
          "type": "method",
          "meta": {
            "added": [
              "v15.9.0",
              "v14.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`lowest` {number|bigint} The lowest discernible value. Must be an integer value greater than 0. **Default:** `1`.",
                      "name": "lowest",
                      "type": "number|bigint",
                      "default": "`1`",
                      "desc": "The lowest discernible value. Must be an integer value greater than 0."
                    },
                    {
                      "textRaw": "`highest` {number|bigint} The highest recordable value. Must be an integer value that is equal to or greater than two times `lowest`. **Default:** `Number.MAX_SAFE_INTEGER`.",
                      "name": "highest",
                      "type": "number|bigint",
                      "default": "`Number.MAX_SAFE_INTEGER`",
                      "desc": "The highest recordable value. Must be an integer value that is equal to or greater than two times `lowest`."
                    },
                    {
                      "textRaw": "`figures` {number} The number of accuracy digits. Must be a number between `1` and `5`. **Default:** `3`.",
                      "name": "figures",
                      "type": "number",
                      "default": "`3`",
                      "desc": "The number of accuracy digits. Must be a number between `1` and `5`."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {RecordableHistogram}",
                "name": "return",
                "type": "RecordableHistogram"
              }
            }
          ],
          "desc": "<p>Returns a <a href=\"perf_hooks.html#class-recordablehistogram-extends-histogram\"><code>&#x3C;RecordableHistogram></code></a>.</p>"
        },
        {
          "textRaw": "`perf_hooks.eventLoopUtilization([utilization1[, utilization2]])`",
          "name": "eventLoopUtilization",
          "type": "method",
          "meta": {
            "added": [
              "v25.2.0",
              "v24.12.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`utilization1` {Object} The result of a previous call to `eventLoopUtilization()`.",
                  "name": "utilization1",
                  "type": "Object",
                  "desc": "The result of a previous call to `eventLoopUtilization()`.",
                  "optional": true
                },
                {
                  "textRaw": "`utilization2` {Object} The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.",
                  "name": "utilization2",
                  "type": "Object",
                  "desc": "The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object",
                "options": [
                  {
                    "textRaw": "`idle` {number}",
                    "name": "idle",
                    "type": "number"
                  },
                  {
                    "textRaw": "`active` {number}",
                    "name": "active",
                    "type": "number"
                  },
                  {
                    "textRaw": "`utilization` {number}",
                    "name": "utilization",
                    "type": "number"
                  }
                ]
              }
            }
          ],
          "desc": "<p>The <code>eventLoopUtilization()</code> function returns an object that contains the\ncumulative duration of time the event loop has been both idle and active as a\nhigh resolution milliseconds timer. The <code>utilization</code> value is the calculated\nEvent Loop Utilization (ELU).</p>\n<p>If bootstrapping has not yet finished on the main thread the properties have\nthe value of <code>0</code>. The ELU is immediately available on <a href=\"worker_threads.html#worker-threads\">Worker threads</a> since\nbootstrap happens within the event loop.</p>\n<p>Both <code>utilization1</code> and <code>utilization2</code> are optional parameters.</p>\n<p>If <code>utilization1</code> is passed, then the delta between the current call's <code>active</code>\nand <code>idle</code> times, as well as the corresponding <code>utilization</code> value are\ncalculated and returned (similar to <a href=\"process.html#processhrtimetime\"><code>process.hrtime()</code></a>).</p>\n<p>If <code>utilization1</code> and <code>utilization2</code> are both passed, then the delta is\ncalculated between the two arguments. This is a convenience option because,\nunlike <a href=\"process.html#processhrtimetime\"><code>process.hrtime()</code></a>, calculating the ELU is more complex than a\nsingle subtraction.</p>\n<p>ELU is similar to CPU utilization, except that it only measures event loop\nstatistics and not CPU usage. It represents the percentage of time the event\nloop has spent outside the event loop's event provider (e.g. <code>epoll_wait</code>).\nNo other CPU idle time is taken into consideration. The following is an example\nof how a mostly idle process will have a high ELU.</p>\n<pre><code class=\"language-mjs\">import { eventLoopUtilization } from 'node:perf_hooks';\nimport { spawnSync } from 'node:child_process';\n\nsetImmediate(() => {\n  const elu = eventLoopUtilization();\n  spawnSync('sleep', ['5']);\n  console.log(eventLoopUtilization(elu).utilization);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { eventLoopUtilization } = require('node:perf_hooks');\nconst { spawnSync } = require('node:child_process');\n\nsetImmediate(() => {\n  const elu = eventLoopUtilization();\n  spawnSync('sleep', ['5']);\n  console.log(eventLoopUtilization(elu).utilization);\n});\n</code></pre>\n<p>Although the CPU is mostly idle while running this script, the value of\n<code>utilization</code> is <code>1</code>. This is because the call to\n<a href=\"child_process.html#child_processspawnsynccommand-args-options\"><code>child_process.spawnSync()</code></a> blocks the event loop from proceeding.</p>\n<p>Passing in a user-defined object instead of the result of a previous call to\n<code>eventLoopUtilization()</code> will lead to undefined behavior. The return values\nare not guaranteed to reflect any correct state of the event loop.</p>"
        },
        {
          "textRaw": "`perf_hooks.monitorEventLoopDelay([options])`",
          "name": "monitorEventLoopDelay",
          "type": "method",
          "meta": {
            "added": [
              "v11.10.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`resolution` {number} The sampling rate in milliseconds. Must be greater than zero. **Default:** `10`.",
                      "name": "resolution",
                      "type": "number",
                      "default": "`10`",
                      "desc": "The sampling rate in milliseconds. Must be greater than zero."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {IntervalHistogram}",
                "name": "return",
                "type": "IntervalHistogram"
              }
            }
          ],
          "desc": "<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>\n<p>Creates an <code>IntervalHistogram</code> object that samples and reports the event loop\ndelay over time. The delays will be reported in nanoseconds.</p>\n<p>Using a timer to detect approximate event loop delay works because the\nexecution of timers is tied specifically to the lifecycle of the libuv\nevent loop. That is, a delay in the loop will cause a delay in the execution\nof the timer, and those delays are specifically what this API is intended to\ndetect.</p>\n<pre><code class=\"language-mjs\">import { monitorEventLoopDelay } from 'node:perf_hooks';\n\nconst h = monitorEventLoopDelay({ resolution: 20 });\nh.enable();\n// Do something.\nh.disable();\nconsole.log(h.min);\nconsole.log(h.max);\nconsole.log(h.mean);\nconsole.log(h.stddev);\nconsole.log(h.percentiles);\nconsole.log(h.percentile(50));\nconsole.log(h.percentile(99));\n</code></pre>\n<pre><code class=\"language-cjs\">const { monitorEventLoopDelay } = require('node:perf_hooks');\nconst h = monitorEventLoopDelay({ resolution: 20 });\nh.enable();\n// Do something.\nh.disable();\nconsole.log(h.min);\nconsole.log(h.max);\nconsole.log(h.mean);\nconsole.log(h.stddev);\nconsole.log(h.percentiles);\nconsole.log(h.percentile(50));\nconsole.log(h.percentile(99));\n</code></pre>"
        },
        {
          "textRaw": "`perf_hooks.timerify(fn[, options])`",
          "name": "timerify",
          "type": "method",
          "meta": {
            "added": [
              "v25.2.0",
              "v24.12.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function}",
                  "name": "fn",
                  "type": "Function"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`histogram` {RecordableHistogram} A histogram object created using `perf_hooks.createHistogram()` that will record runtime durations in nanoseconds.",
                      "name": "histogram",
                      "type": "RecordableHistogram",
                      "desc": "A histogram object created using `perf_hooks.createHistogram()` that will record runtime durations in nanoseconds."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><em>This property is an extension by Node.js. It is not available in Web browsers.</em></p>\n<p>Wraps a function within a new function that measures the running time of the\nwrapped function. A <code>PerformanceObserver</code> must be subscribed to the <code>'function'</code>\nevent type in order for the timing details to be accessed.</p>\n<pre><code class=\"language-mjs\">import { timerify, performance, PerformanceObserver } from 'node:perf_hooks';\n\nfunction someFunction() {\n  console.log('hello world');\n}\n\nconst wrapped = timerify(someFunction);\n\nconst obs = new PerformanceObserver((list) => {\n  console.log(list.getEntries()[0].duration);\n\n  performance.clearMarks();\n  performance.clearMeasures();\n  obs.disconnect();\n});\nobs.observe({ entryTypes: ['function'] });\n\n// A performance timeline entry will be created\nwrapped();\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  timerify,\n  performance,\n  PerformanceObserver,\n} = require('node:perf_hooks');\n\nfunction someFunction() {\n  console.log('hello world');\n}\n\nconst wrapped = timerify(someFunction);\n\nconst obs = new PerformanceObserver((list) => {\n  console.log(list.getEntries()[0].duration);\n\n  performance.clearMarks();\n  performance.clearMeasures();\n  obs.disconnect();\n});\nobs.observe({ entryTypes: ['function'] });\n\n// A performance timeline entry will be created\nwrapped();\n</code></pre>\n<p>If the wrapped function returns a promise, a finally handler will be attached\nto the promise and the duration will be reported once the finally handler is\ninvoked.</p>"
        }
      ],
      "modules": [
        {
          "textRaw": "Examples",
          "name": "examples",
          "type": "module",
          "modules": [
            {
              "textRaw": "Measuring the duration of async operations",
              "name": "measuring_the_duration_of_async_operations",
              "type": "module",
              "desc": "<p>The following example uses the <a href=\"async_hooks.html\">Async Hooks</a> and Performance APIs to measure\nthe actual duration of a Timeout operation (including the amount of time it took\nto execute the callback).</p>\n<pre><code class=\"language-mjs\">import { createHook } from 'node:async_hooks';\nimport { performance, PerformanceObserver } from 'node:perf_hooks';\n\nconst set = new Set();\nconst hook = createHook({\n  init(id, type) {\n    if (type === 'Timeout') {\n      performance.mark(`Timeout-${id}-Init`);\n      set.add(id);\n    }\n  },\n  destroy(id) {\n    if (set.has(id)) {\n      set.delete(id);\n      performance.mark(`Timeout-${id}-Destroy`);\n      performance.measure(`Timeout-${id}`,\n                          `Timeout-${id}-Init`,\n                          `Timeout-${id}-Destroy`);\n    }\n  },\n});\nhook.enable();\n\nconst obs = new PerformanceObserver((list, observer) => {\n  console.log(list.getEntries()[0]);\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ entryTypes: ['measure'], buffered: true });\n\nsetTimeout(() => {}, 1000);\n</code></pre>\n<pre><code class=\"language-cjs\">const async_hooks = require('node:async_hooks');\nconst {\n  performance,\n  PerformanceObserver,\n} = require('node:perf_hooks');\n\nconst set = new Set();\nconst hook = async_hooks.createHook({\n  init(id, type) {\n    if (type === 'Timeout') {\n      performance.mark(`Timeout-${id}-Init`);\n      set.add(id);\n    }\n  },\n  destroy(id) {\n    if (set.has(id)) {\n      set.delete(id);\n      performance.mark(`Timeout-${id}-Destroy`);\n      performance.measure(`Timeout-${id}`,\n                          `Timeout-${id}-Init`,\n                          `Timeout-${id}-Destroy`);\n    }\n  },\n});\nhook.enable();\n\nconst obs = new PerformanceObserver((list, observer) => {\n  console.log(list.getEntries()[0]);\n  performance.clearMarks();\n  performance.clearMeasures();\n  observer.disconnect();\n});\nobs.observe({ entryTypes: ['measure'] });\n\nsetTimeout(() => {}, 1000);\n</code></pre>",
              "displayName": "Measuring the duration of async operations"
            },
            {
              "textRaw": "Measuring how long it takes to load dependencies",
              "name": "measuring_how_long_it_takes_to_load_dependencies",
              "type": "module",
              "desc": "<p>The following example measures the duration of <code>require()</code> operations to load\ndependencies:</p>\n<pre><code class=\"language-mjs\">import { performance, PerformanceObserver } from 'node:perf_hooks';\n\n// Activate the observer\nconst obs = new PerformanceObserver((list) => {\n  const entries = list.getEntries();\n  entries.forEach((entry) => {\n    console.log(`import('${entry[0]}')`, entry.duration);\n  });\n  performance.clearMarks();\n  performance.clearMeasures();\n  obs.disconnect();\n});\nobs.observe({ entryTypes: ['function'], buffered: true });\n\nconst timedImport = performance.timerify(async (module) => {\n  return await import(module);\n});\n\nawait timedImport('some-module');\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  performance,\n  PerformanceObserver,\n} = require('node:perf_hooks');\nconst mod = require('node:module');\n\n// Monkey patch the require function\nmod.Module.prototype.require =\n  performance.timerify(mod.Module.prototype.require);\nrequire = performance.timerify(require);\n\n// Activate the observer\nconst obs = new PerformanceObserver((list) => {\n  const entries = list.getEntries();\n  entries.forEach((entry) => {\n    console.log(`require('${entry[0]}')`, entry.duration);\n  });\n  performance.clearMarks();\n  performance.clearMeasures();\n  obs.disconnect();\n});\nobs.observe({ entryTypes: ['function'] });\n\nrequire('some-module');\n</code></pre>",
              "displayName": "Measuring how long it takes to load dependencies"
            },
            {
              "textRaw": "Measuring how long one HTTP round-trip takes",
              "name": "measuring_how_long_one_http_round-trip_takes",
              "type": "module",
              "desc": "<p>The following example is used to trace the time spent by HTTP client\n(<code>OutgoingMessage</code>) and HTTP request (<code>IncomingMessage</code>). For HTTP client,\nit means the time interval between starting the request and receiving the\nresponse, and for HTTP request, it means the time interval between receiving\nthe request and sending the response:</p>\n<pre><code class=\"language-mjs\">import { PerformanceObserver } from 'node:perf_hooks';\nimport { createServer, get } from 'node:http';\n\nconst obs = new PerformanceObserver((items) => {\n  items.getEntries().forEach((item) => {\n    console.log(item);\n  });\n});\n\nobs.observe({ entryTypes: ['http'] });\n\nconst PORT = 8080;\n\ncreateServer((req, res) => {\n  res.end('ok');\n}).listen(PORT, () => {\n  get(`http://127.0.0.1:${PORT}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { PerformanceObserver } = require('node:perf_hooks');\nconst http = require('node:http');\n\nconst obs = new PerformanceObserver((items) => {\n  items.getEntries().forEach((item) => {\n    console.log(item);\n  });\n});\n\nobs.observe({ entryTypes: ['http'] });\n\nconst PORT = 8080;\n\nhttp.createServer((req, res) => {\n  res.end('ok');\n}).listen(PORT, () => {\n  http.get(`http://127.0.0.1:${PORT}`);\n});\n</code></pre>",
              "displayName": "Measuring how long one HTTP round-trip takes"
            },
            {
              "textRaw": "Measuring how long the `net.connect` (only for TCP) takes when the connection is successful",
              "name": "measuring_how_long_the_`net.connect`_(only_for_tcp)_takes_when_the_connection_is_successful",
              "type": "module",
              "desc": "<pre><code class=\"language-mjs\">import { PerformanceObserver } from 'node:perf_hooks';\nimport { connect, createServer } from 'node:net';\n\nconst obs = new PerformanceObserver((items) => {\n  items.getEntries().forEach((item) => {\n    console.log(item);\n  });\n});\nobs.observe({ entryTypes: ['net'] });\nconst PORT = 8080;\ncreateServer((socket) => {\n  socket.destroy();\n}).listen(PORT, () => {\n  connect(PORT);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { PerformanceObserver } = require('node:perf_hooks');\nconst net = require('node:net');\nconst obs = new PerformanceObserver((items) => {\n  items.getEntries().forEach((item) => {\n    console.log(item);\n  });\n});\nobs.observe({ entryTypes: ['net'] });\nconst PORT = 8080;\nnet.createServer((socket) => {\n  socket.destroy();\n}).listen(PORT, () => {\n  net.connect(PORT);\n});\n</code></pre>",
              "displayName": "Measuring how long the `net.connect` (only for TCP) takes when the connection is successful"
            },
            {
              "textRaw": "Measuring how long the DNS takes when the request is successful",
              "name": "measuring_how_long_the_dns_takes_when_the_request_is_successful",
              "type": "module",
              "desc": "<pre><code class=\"language-mjs\">import { PerformanceObserver } from 'node:perf_hooks';\nimport { lookup, promises } from 'node:dns';\n\nconst obs = new PerformanceObserver((items) => {\n  items.getEntries().forEach((item) => {\n    console.log(item);\n  });\n});\nobs.observe({ entryTypes: ['dns'] });\nlookup('localhost', () => {});\npromises.resolve('localhost');\n</code></pre>\n<pre><code class=\"language-cjs\">const { PerformanceObserver } = require('node:perf_hooks');\nconst dns = require('node:dns');\nconst obs = new PerformanceObserver((items) => {\n  items.getEntries().forEach((item) => {\n    console.log(item);\n  });\n});\nobs.observe({ entryTypes: ['dns'] });\ndns.lookup('localhost', () => {});\ndns.promises.resolve('localhost');\n</code></pre>",
              "displayName": "Measuring how long the DNS takes when the request is successful"
            }
          ],
          "displayName": "Examples"
        }
      ],
      "displayName": "Performance measurement APIs",
      "source": "doc/api/perf_hooks.md"
    },
    {
      "textRaw": "Permissions",
      "name": "permissions",
      "introduced_in": "v20.0.0",
      "type": "module",
      "desc": "<p>Permissions can be used to control what system resources the\nNode.js process has access to or what actions the process can take\nwith those resources.</p>\n<ul>\n<li><a href=\"#process-based-permissions\">Process-based permissions</a> control the Node.js\nprocess's access to resources.\nThe resource can be entirely allowed or denied, or actions related to it can\nbe controlled. For example, file system reads can be allowed while denying\nwrites.\nThis feature does not protect against malicious code. According to the Node.js\n<a href=\"https://github.com/nodejs/node/blob/main/SECURITY.md\">Security Policy</a>, Node.js trusts any code it is asked to run.</li>\n</ul>\n<p>The permission model implements a \"seat belt\" approach, which prevents trusted\ncode from unintentionally changing files or using resources that access has\nnot explicitly been granted to. It does not provide security guarantees in the\npresence of malicious code. Malicious code can bypass the permission model and\nexecute arbitrary code without the restrictions imposed by the permission\nmodel.</p>\n<p>If you find a potential security vulnerability, please refer to our\n<a href=\"https://github.com/nodejs/node/blob/main/SECURITY.md\">Security Policy</a>.</p>",
      "modules": [
        {
          "textRaw": "Process-based permissions",
          "name": "process-based_permissions",
          "type": "module",
          "modules": [
            {
              "textRaw": "Permission Model",
              "name": "permission_model",
              "type": "module",
              "meta": {
                "added": [
                  "v20.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.5.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56201",
                    "description": "This feature is no longer experimental."
                  }
                ]
              },
              "stability": 2,
              "stabilityText": "Stable",
              "desc": "<p>The Node.js Permission Model is a mechanism for restricting access to specific\nresources during execution.\nThe API exists behind a flag <a href=\"cli.html#--permission\"><code>--permission</code></a> which when enabled,\nwill restrict access to all available permissions.</p>\n<p>The available permissions are documented by the <a href=\"cli.html#--permission\"><code>--permission</code></a>\nflag.</p>\n<p>When starting Node.js with <code>--permission</code>,\nthe ability to access the file system through the <code>fs</code> module, access the network,\nspawn processes, use <code>node:worker_threads</code>, use native addons, use WASI, use\nFFI, and enable the runtime inspector will be restricted (the listener for\nSIGUSR1 won't be created).</p>\n<pre><code class=\"language-console\">$ node --permission index.js\n\nError: Access to this API has been restricted\n    at node:internal/main/run_main_module:23:47 {\n  code: 'ERR_ACCESS_DENIED',\n  permission: 'FileSystemRead',\n  resource: '/home/user/index.js'\n}\n</code></pre>\n<p>Allowing access to spawning a process and creating worker threads can be done\nusing the <a href=\"cli.html#--allow-child-process\"><code>--allow-child-process</code></a> and <a href=\"cli.html#--allow-worker\"><code>--allow-worker</code></a> respectively.</p>\n<p>To allow network access, use <a href=\"cli.html#--allow-net\"><code>--allow-net</code></a> and for allowing native addons\nwhen using permission model, use the <a href=\"cli.html#--allow-addons\"><code>--allow-addons</code></a>\nflag. For WASI, use the <a href=\"cli.html#--allow-wasi\"><code>--allow-wasi</code></a> flag. For FFI, use the\n<a href=\"cli.html#--allow-ffi\"><code>--allow-ffi</code></a> flag. The <a href=\"ffi.html\"><code>node:ffi</code></a> module also requires the\n<code>--experimental-ffi</code> flag and is only available in builds with FFI support.</p>",
              "modules": [
                {
                  "textRaw": "Runtime API",
                  "name": "runtime_api",
                  "type": "module",
                  "desc": "<p>When enabling the Permission Model through the <a href=\"cli.html#--permission\"><code>--permission</code></a>\nflag a new property <code>permission</code> is added to the <code>process</code> object.\nThis property contains the following functions:</p>",
                  "methods": [
                    {
                      "textRaw": "`permission.has(scope[, reference])`",
                      "name": "has",
                      "type": "method",
                      "signatures": [
                        {
                          "params": [
                            {
                              "name": "scope"
                            },
                            {
                              "name": "reference",
                              "optional": true
                            }
                          ]
                        }
                      ],
                      "desc": "<p>API call to check permissions at runtime (<a href=\"process.html#processpermissionhasscope-reference\"><code>permission.has()</code></a>)</p>\n<pre><code class=\"language-js\">process.permission.has('fs.write'); // true\nprocess.permission.has('fs.write', '/home/rafaelgss/protected-folder'); // true\n\nprocess.permission.has('fs.read'); // true\nprocess.permission.has('fs.read', '/home/rafaelgss/protected-folder'); // false\n</code></pre>"
                    },
                    {
                      "textRaw": "`permission.drop(scope[, reference])`",
                      "name": "drop",
                      "type": "method",
                      "signatures": [
                        {
                          "params": [
                            {
                              "name": "scope"
                            },
                            {
                              "name": "reference",
                              "optional": true
                            }
                          ]
                        }
                      ],
                      "desc": "<p>API call to drop permissions at runtime. This operation is <strong>irreversible</strong>.</p>\n<p>When called without a reference, the entire scope is dropped. When called\nwith a reference, only the permission for that specific resource is revoked.\nDropping a permission only affects future access checks. It does not close or\nrevoke access to resources that are already open, such as file descriptors,\nnetwork sockets, child processes, or worker threads. Applications are\nresponsible for closing or terminating those resources when they are no longer\nneeded.</p>\n<p>You can only drop the exact resource that was explicitly granted. The\nreference passed to <code>drop()</code> must match the original grant. If a permission\nwas granted using a wildcard (<code>*</code>), only the entire scope can be dropped\n(by calling <code>drop()</code> without a reference). If a directory was granted\n(e.g. <code>--allow-fs-read=/my/folder</code>), you cannot drop individual files\ninside it - you must drop the same directory that was originally granted.</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\n\n// Read config at startup while we still have permission\nconst config = fs.readFileSync('/etc/myapp/config.json', 'utf8');\n\n// Drop read access to /etc/myapp after initialization\nprocess.permission.drop('fs.read', '/etc/myapp');\n\n// This will now throw ERR_ACCESS_DENIED\nprocess.permission.has('fs.read', '/etc/myapp/config.json'); // false\n\n// Drop child process permission entirely\nprocess.permission.drop('child');\n</code></pre>"
                    }
                  ],
                  "displayName": "Runtime API"
                },
                {
                  "textRaw": "File System Permissions",
                  "name": "file_system_permissions",
                  "type": "module",
                  "desc": "<p>The Permission Model, by default, restricts access to the file system through the <code>node:fs</code> module.\nIt does not guarantee that users will not be able to access the file system through other means,\nsuch as through the <code>node:sqlite</code> module.</p>\n<p>To allow access to the file system, use the <a href=\"cli.html#--allow-fs-read\"><code>--allow-fs-read</code></a> and\n<a href=\"cli.html#--allow-fs-write\"><code>--allow-fs-write</code></a> flags:</p>\n<pre><code class=\"language-console\">$ node --permission --allow-fs-read=* --allow-fs-write=* index.js\nHello world!\n</code></pre>\n<p>By default the entrypoints of your application are included\nin the allowed file system read list. For example:</p>\n<pre><code class=\"language-console\">$ node --permission index.js\n</code></pre>\n<ul>\n<li><code>index.js</code> will be included in the allowed file system read list</li>\n</ul>\n<pre><code class=\"language-console\">$ node -r /path/to/custom-require.js --permission index.js.\n</code></pre>\n<ul>\n<li><code>/path/to/custom-require.js</code> will be included in the allowed file system read\nlist.</li>\n<li><code>index.js</code> will be included in the allowed file system read list.</li>\n</ul>\n<p>The valid arguments for both flags are:</p>\n<ul>\n<li><code>*</code> - To allow all <code>FileSystemRead</code> or <code>FileSystemWrite</code> operations,\nrespectively.</li>\n<li>Relative paths to the current working directory.</li>\n<li>Absolute paths.</li>\n</ul>\n<p>Example:</p>\n<ul>\n<li><code>--allow-fs-read=*</code> - It will allow all <code>FileSystemRead</code> operations.</li>\n<li><code>--allow-fs-write=*</code> - It will allow all <code>FileSystemWrite</code> operations.</li>\n<li><code>--allow-fs-write=/tmp/</code> - It will allow <code>FileSystemWrite</code> access to the <code>/tmp/</code>\nfolder.</li>\n<li><code>--allow-fs-read=/tmp/ --allow-fs-read=/home/.gitignore</code> - It allows <code>FileSystemRead</code> access\nto the <code>/tmp/</code> folder <strong>and</strong> the <code>/home/.gitignore</code> path.</li>\n</ul>\n<p>Wildcards are supported too:</p>\n<ul>\n<li><code>--allow-fs-read=/home/test*</code> will allow read access to everything\nthat matches the wildcard. e.g: <code>/home/test/file1</code> or <code>/home/test2</code></li>\n</ul>\n<p>After passing a wildcard character (<code>*</code>) all subsequent characters will\nbe ignored. For example: <code>/home/*.js</code> will work similar to <code>/home/*</code>.</p>\n<p>When the permission model is initialized, it will automatically add a wildcard\n(*) if the specified directory exists. For example, if <code>/home/test/files</code>\nexists, it will be treated as <code>/home/test/files/*</code>. However, if the directory\ndoes not exist, the wildcard will not be added, and access will be limited to\n<code>/home/test/files</code>. If you want to allow access to a folder that does not exist\nyet, make sure to explicitly include the wildcard:\n<code>/my-path/folder-do-not-exist/*</code>.</p>",
                  "displayName": "File System Permissions"
                },
                {
                  "textRaw": "Configuration file support",
                  "name": "configuration_file_support",
                  "type": "module",
                  "desc": "<p>In addition to passing permission flags on the command line, they can also be\ndeclared in a Node.js configuration file when using the experimental\n[<code>--experimental-config-file</code>][] flag. Permission options must be placed inside\nthe <code>permission</code> top-level object.</p>\n<p>Example <code>node.config.json</code>:</p>\n<pre><code class=\"language-json\">{\n  \"permission\": {\n    \"allow-fs-read\": [\"./foo\"],\n    \"allow-fs-write\": [\"./bar\"],\n    \"allow-child-process\": true,\n    \"allow-worker\": true,\n    \"allow-net\": true,\n    \"allow-addons\": false,\n    \"allow-ffi\": false\n  }\n}\n</code></pre>\n<p>When the <code>permission</code> namespace is present in the configuration file, Node.js\nautomatically enables the <code>--permission</code> flag. Run with:</p>\n<pre><code class=\"language-console\">$ node --experimental-default-config-file app.js\n</code></pre>",
                  "displayName": "Configuration file support"
                },
                {
                  "textRaw": "Using the Permission Model with `npx`",
                  "name": "using_the_permission_model_with_`npx`",
                  "type": "module",
                  "desc": "<p>If you're using <a href=\"https://docs.npmjs.com/cli/commands/npx\"><code>npx</code></a> to execute a Node.js script, you can enable the\nPermission Model by passing the <code>--node-options</code> flag. For example:</p>\n<pre><code class=\"language-bash\">npx --node-options=\"--permission\" package-name\n</code></pre>\n<p>This sets the <code>NODE_OPTIONS</code> environment variable for all Node.js processes\nspawned by <a href=\"https://docs.npmjs.com/cli/commands/npx\"><code>npx</code></a>, without affecting the <code>npx</code> process itself.</p>\n<p><strong>FileSystemRead Error with <code>npx</code></strong></p>\n<p>The above command will likely throw a <code>FileSystemRead</code> invalid access error\nbecause Node.js requires file system read access to locate and execute the\npackage. To avoid this:</p>\n<ol>\n<li>\n<p><strong>Using a Globally Installed Package</strong>\nGrant read access to the global <code>node_modules</code> directory by running:</p>\n<pre><code class=\"language-bash\">npx --node-options=\"--permission --allow-fs-read=$(npm prefix -g)\" package-name\n</code></pre>\n</li>\n<li>\n<p><strong>Using the <code>npx</code> Cache</strong>\nIf you are installing the package temporarily or relying on the <code>npx</code> cache,\ngrant read access to the npm cache directory:</p>\n<pre><code class=\"language-bash\">npx --node-options=\"--permission --allow-fs-read=$(npm config get cache)\" package-name\n</code></pre>\n</li>\n</ol>\n<p>Any arguments you would normally pass to <code>node</code> (e.g., <code>--allow-*</code> flags) can\nalso be passed through the <code>--node-options</code> flag. This flexibility makes it\neasy to configure permissions as needed when using <code>npx</code>.</p>",
                  "displayName": "Using the Permission Model with `npx`"
                },
                {
                  "textRaw": "Permission Model constraints",
                  "name": "permission_model_constraints",
                  "type": "module",
                  "desc": "<p>There are constraints you need to know before using this system:</p>\n<ul>\n<li>The model does not inherit to a worker thread.</li>\n<li>When using the Permission Model the following features will be restricted:\n<ul>\n<li>Native modules</li>\n<li>Network</li>\n<li>Child process</li>\n<li>Worker Threads</li>\n<li>Inspector protocol</li>\n<li>File system access</li>\n<li>WASI</li>\n<li>FFI</li>\n</ul>\n</li>\n<li>The Permission Model is initialized after the Node.js environment is set up.\nHowever, certain flags such as <code>--env-file</code> or <code>--openssl-config</code> are designed\nto read files before environment initialization. As a result, such flags are\nnot subject to the rules of the Permission Model. The same applies for V8\nflags that can be set via runtime through <code>v8.setFlagsFromString</code>.</li>\n<li>OpenSSL engines cannot be requested at runtime when the Permission\nModel is enabled, affecting the built-in crypto, https, and tls modules.</li>\n<li>Run-Time Loadable Extensions cannot be loaded when the Permission Model is\nenabled, affecting the sqlite module.</li>\n<li>Using existing file descriptors via the <code>node:fs</code> module bypasses the\nPermission Model.</li>\n</ul>",
                  "displayName": "Permission Model constraints"
                },
                {
                  "textRaw": "process._debugProcess() and cross-process Inspector activation",
                  "name": "process._debugprocess()_and_cross-process_inspector_activation",
                  "type": "module",
                  "desc": "<p>The <code>kInspector</code> permission scope restricts the current process from opening its own V8 Inspector. However,\nprocess._debugProcess(pid) — which sends an OS-level signal (SIGUSR1 on POSIX, a remote thread on Windows)\nto an external process — is not gated by the <code>kInspector</code> scope or any other Permission Model scope.</p>\n<p>A sandboxed process running under --permission with no additional grants can call process._debugProcess(pid)\nto force another Node.js process to open its V8 Inspector. The target process does not need to be running\nunder --permission for this to work — any Node.js process running on the same host under the same OS user\ncan be signaled.</p>\n<p>This is consistent with the Node.js threat model: Node.js trusts the OS environment in which it runs.\nCross-process signaling is an operating-system-level capability; restricting it is the responsibility of\nthe operator (for example, using OS-level process isolation, separate OS users per process, or\nseccomp/AppArmor profiles on Linux).</p>\n<p>Developers relying on --permission to sandbox untrusted code should be aware that:</p>\n<ul>\n<li>process._debugProcess() is callable from any sandboxed process with no grants.</li>\n<li>If a target Node.js process is running on the same host under the same OS user, it can be forced to\nopen its Inspector via this API.</li>\n<li>To prevent this, run sandboxed and target processes under different OS users, or use OS-level isolation\nmechanisms outside of Node.js.</li>\n</ul>",
                  "displayName": "process._debugProcess() and cross-process Inspector activation"
                },
                {
                  "textRaw": "Limitations and Known Issues",
                  "name": "limitations_and_known_issues",
                  "type": "module",
                  "desc": "<ul>\n<li>Symbolic links will be followed even to locations outside of the set of paths\nthat access has been granted to. Relative symbolic links may allow access to\narbitrary files and directories. When starting applications with the\npermission model enabled, you must ensure that no paths to which access has\nbeen granted contain relative symbolic links.</li>\n</ul>",
                  "displayName": "Limitations and Known Issues"
                }
              ],
              "displayName": "Permission Model"
            }
          ],
          "displayName": "Process-based permissions"
        }
      ],
      "displayName": "Permissions",
      "source": "doc/api/permissions.md"
    },
    {
      "textRaw": "Punycode",
      "name": "punycode",
      "introduced_in": "v0.10.0",
      "type": "module",
      "meta": {
        "changes": [],
        "deprecated": [
          "v7.0.0"
        ]
      },
      "stability": 0,
      "stabilityText": "Deprecated",
      "desc": "<p><strong>The version of the punycode module bundled in Node.js is being deprecated.</strong>\nIn a future major version of Node.js this module will be removed. Users\ncurrently depending on the <code>punycode</code> module should switch to using the\nuserland-provided <a href=\"https://github.com/bestiejs/punycode.js\">Punycode.js</a> module instead. For punycode-based URL\nencoding, see <a href=\"url.html#urldomaintoasciidomain\"><code>url.domainToASCII</code></a> or, more generally, the\n<a href=\"url.html#the-whatwg-url-api\">WHATWG URL API</a>.</p>\n<p>The <code>punycode</code> module is a bundled version of the <a href=\"https://github.com/bestiejs/punycode.js\">Punycode.js</a> module. It\ncan be accessed using:</p>\n<pre><code class=\"language-js\">const punycode = require('node:punycode');\n</code></pre>\n<p><a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a> is a character encoding scheme defined by RFC 3492 that is\nprimarily intended for use in Internationalized Domain Names. Because host\nnames in URLs are limited to ASCII characters only, Domain Names that contain\nnon-ASCII characters must be converted into ASCII using the Punycode scheme.\nFor instance, the Japanese character that translates into the English word,\n<code>'example'</code> is <code>'例'</code>. The Internationalized Domain Name, <code>'例.com'</code> (equivalent\nto <code>'example.com'</code>) is represented by Punycode as the ASCII string\n<code>'xn--fsq.com'</code>.</p>\n<p>The <code>punycode</code> module provides a simple implementation of the Punycode standard.</p>\n<p>The <code>punycode</code> module is a third-party dependency used by Node.js and\nmade available to developers as a convenience. Fixes or other modifications to\nthe module must be directed to the <a href=\"https://github.com/bestiejs/punycode.js\">Punycode.js</a> project.</p>",
      "methods": [
        {
          "textRaw": "`punycode.decode(string)`",
          "name": "decode",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>punycode.decode()</code> method converts a <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a> string of ASCII-only\ncharacters to the equivalent string of Unicode codepoints.</p>\n<pre><code class=\"language-js\">punycode.decode('maana-pta'); // 'mañana'\npunycode.decode('--dqo34k'); // '☃-⌘'\n</code></pre>"
        },
        {
          "textRaw": "`punycode.encode(string)`",
          "name": "encode",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>punycode.encode()</code> method converts a string of Unicode codepoints to a\n<a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a> string of ASCII-only characters.</p>\n<pre><code class=\"language-js\">punycode.encode('mañana'); // 'maana-pta'\npunycode.encode('☃-⌘'); // '--dqo34k'\n</code></pre>"
        },
        {
          "textRaw": "`punycode.toASCII(domain)`",
          "name": "toASCII",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`domain` {string}",
                  "name": "domain",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>punycode.toASCII()</code> method converts a Unicode string representing an\nInternationalized Domain Name to <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a>. Only the non-ASCII parts of the\ndomain name will be converted. Calling <code>punycode.toASCII()</code> on a string that\nalready only contains ASCII characters will have no effect.</p>\n<pre><code class=\"language-js\">// encode domain names\npunycode.toASCII('mañana.com');  // 'xn--maana-pta.com'\npunycode.toASCII('☃-⌘.com');   // 'xn----dqo34k.com'\npunycode.toASCII('example.com'); // 'example.com'\n</code></pre>"
        },
        {
          "textRaw": "`punycode.toUnicode(domain)`",
          "name": "toUnicode",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.1"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`domain` {string}",
                  "name": "domain",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>punycode.toUnicode()</code> method converts a string representing a domain name\ncontaining <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a> encoded characters into Unicode. Only the <a href=\"https://tools.ietf.org/html/rfc3492\">Punycode</a>\nencoded parts of the domain name are be converted.</p>\n<pre><code class=\"language-js\">// decode domain names\npunycode.toUnicode('xn--maana-pta.com'); // 'mañana.com'\npunycode.toUnicode('xn----dqo34k.com');  // '☃-⌘.com'\npunycode.toUnicode('example.com');       // 'example.com'\n</code></pre>"
        }
      ],
      "properties": [
        {
          "textRaw": "`punycode.ucs2`",
          "name": "ucs2",
          "type": "property",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "methods": [
            {
              "textRaw": "`punycode.ucs2.decode(string)`",
              "name": "decode",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`string` {string}",
                      "name": "string",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>punycode.ucs2.decode()</code> method returns an array containing the numeric\ncodepoint values of each Unicode symbol in the string.</p>\n<pre><code class=\"language-js\">punycode.ucs2.decode('abc'); // [0x61, 0x62, 0x63]\n// surrogate pair for U+1D306 tetragram for centre:\npunycode.ucs2.decode('\\uD834\\uDF06'); // [0x1D306]\n</code></pre>"
            },
            {
              "textRaw": "`punycode.ucs2.encode(codePoints)`",
              "name": "encode",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`codePoints` {integer[]}",
                      "name": "codePoints",
                      "type": "integer[]"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>punycode.ucs2.encode()</code> method returns a string based on an array of\nnumeric code point values.</p>\n<pre><code class=\"language-js\">punycode.ucs2.encode([0x61, 0x62, 0x63]); // 'abc'\npunycode.ucs2.encode([0x1D306]); // '\\uD834\\uDF06'\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Type: {string}",
          "name": "version",
          "type": "string",
          "meta": {
            "added": [
              "v0.6.1"
            ],
            "changes": []
          },
          "desc": "<p>Returns a string identifying the current <a href=\"https://github.com/bestiejs/punycode.js\">Punycode.js</a> version number.</p>"
        }
      ],
      "displayName": "Punycode",
      "source": "doc/api/punycode.md"
    },
    {
      "textRaw": "Query string",
      "name": "query_string",
      "introduced_in": "v0.1.25",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:querystring</code> module provides utilities for parsing and formatting URL\nquery strings. It can be accessed using:</p>\n<pre><code class=\"language-js\">const querystring = require('node:querystring');\n</code></pre>\n<p><code>querystring</code> is more performant than <a href=\"url.html#class-urlsearchparams\"><code>&#x3C;URLSearchParams></code></a> but is not a\nstandardized API. Use <a href=\"url.html#class-urlsearchparams\"><code>&#x3C;URLSearchParams></code></a> when performance is not critical or\nwhen compatibility with browser code is desirable.</p>",
      "methods": [
        {
          "textRaw": "`querystring.decode()`",
          "name": "decode",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.99"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>The <code>querystring.decode()</code> function is an alias for <code>querystring.parse()</code>.</p>"
        },
        {
          "textRaw": "`querystring.encode()`",
          "name": "encode",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.99"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>The <code>querystring.encode()</code> function is an alias for <code>querystring.stringify()</code>.</p>"
        },
        {
          "textRaw": "`querystring.escape(str)`",
          "name": "escape",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.25"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`str` {string}",
                  "name": "str",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>querystring.escape()</code> method performs URL percent-encoding on the given\n<code>str</code> in a manner that is optimized for the specific requirements of URL\nquery strings.</p>\n<p>The <code>querystring.escape()</code> method is used by <code>querystring.stringify()</code> and is\ngenerally not expected to be used directly. It is exported primarily to allow\napplication code to provide a replacement percent-encoding implementation if\nnecessary by assigning <code>querystring.escape</code> to an alternative function.</p>"
        },
        {
          "textRaw": "`querystring.parse(str[, sep[, eq[, options]]])`",
          "name": "parse",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.25"
            ],
            "changes": [
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/10967",
                "description": "Multiple empty entries are now parsed correctly (e.g. `&=&=`)."
              },
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/6055",
                "description": "The returned object no longer inherits from `Object.prototype`."
              },
              {
                "version": [
                  "v6.0.0",
                  "v4.2.4"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/3807",
                "description": "The `eq` parameter may now have a length of more than `1`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`str` {string} The URL query string to parse",
                  "name": "str",
                  "type": "string",
                  "desc": "The URL query string to parse"
                },
                {
                  "textRaw": "`sep` {string} The substring used to delimit key and value pairs in the query string. **Default:** `'&'`.",
                  "name": "sep",
                  "type": "string",
                  "default": "`'&'`",
                  "desc": "The substring used to delimit key and value pairs in the query string.",
                  "optional": true
                },
                {
                  "textRaw": "`eq` {string}. The substring used to delimit keys and values in the query string. **Default:** `'='`.",
                  "name": "eq",
                  "type": "string",
                  "default": "`'='`",
                  "desc": ". The substring used to delimit keys and values in the query string.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`decodeURIComponent` {Function} The function to use when decoding percent-encoded characters in the query string. **Default:** `querystring.unescape()`.",
                      "name": "decodeURIComponent",
                      "type": "Function",
                      "default": "`querystring.unescape()`",
                      "desc": "The function to use when decoding percent-encoded characters in the query string."
                    },
                    {
                      "textRaw": "`maxKeys` {number} Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations. **Default:** `1000`.",
                      "name": "maxKeys",
                      "type": "number",
                      "default": "`1000`",
                      "desc": "Specifies the maximum number of keys to parse. Specify `0` to remove key counting limitations."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>querystring.parse()</code> method parses a URL query string (<code>str</code>) into a\ncollection of key and value pairs.</p>\n<p>For example, the query string <code>'foo=bar&#x26;abc=xyz&#x26;abc=123'</code> is parsed into:</p>\n<pre><code class=\"language-json\">{\n  \"foo\": \"bar\",\n  \"abc\": [\"xyz\", \"123\"]\n}\n</code></pre>\n<p>The object returned by the <code>querystring.parse()</code> method <em>does not</em>\nprototypically inherit from the JavaScript <code>Object</code>. This means that typical\n<code>Object</code> methods such as <code>obj.toString()</code>, <code>obj.hasOwnProperty()</code>, and others\nare not defined and <em>will not work</em>.</p>\n<p>By default, percent-encoded characters within the query string will be assumed\nto use UTF-8 encoding. If an alternative character encoding is used, then an\nalternative <code>decodeURIComponent</code> option will need to be specified:</p>\n<pre><code class=\"language-js\">// Assuming gbkDecodeURIComponent function already exists...\n\nquerystring.parse('w=%D6%D0%CE%C4&#x26;foo=bar', null, null,\n                  { decodeURIComponent: gbkDecodeURIComponent });\n</code></pre>"
        },
        {
          "textRaw": "`querystring.stringify(obj[, sep[, eq[, options]]])`",
          "name": "stringify",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.25"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`obj` {Object} The object to serialize into a URL query string",
                  "name": "obj",
                  "type": "Object",
                  "desc": "The object to serialize into a URL query string"
                },
                {
                  "textRaw": "`sep` {string} The substring used to delimit key and value pairs in the query string. **Default:** `'&'`.",
                  "name": "sep",
                  "type": "string",
                  "default": "`'&'`",
                  "desc": "The substring used to delimit key and value pairs in the query string.",
                  "optional": true
                },
                {
                  "textRaw": "`eq` {string}. The substring used to delimit keys and values in the query string. **Default:** `'='`.",
                  "name": "eq",
                  "type": "string",
                  "default": "`'='`",
                  "desc": ". The substring used to delimit keys and values in the query string.",
                  "optional": true
                },
                {
                  "textRaw": "`options`",
                  "name": "options",
                  "options": [
                    {
                      "textRaw": "`encodeURIComponent` {Function} The function to use when converting URL-unsafe characters to percent-encoding in the query string. **Default:** `querystring.escape()`.",
                      "name": "encodeURIComponent",
                      "type": "Function",
                      "default": "`querystring.escape()`",
                      "desc": "The function to use when converting URL-unsafe characters to percent-encoding in the query string."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>querystring.stringify()</code> method produces a URL query string from a\ngiven <code>obj</code> by iterating through the object's \"own properties\".</p>\n<p>It serializes the following types of values passed in <code>obj</code>:\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number[]></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint[]></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean[]></code></a>\nThe numeric values must be finite. Any other input values will be coerced to\nempty strings.</p>\n<pre><code class=\"language-js\">querystring.stringify({ foo: 'bar', baz: ['qux', 'quux'], corge: '' });\n// Returns 'foo=bar&#x26;baz=qux&#x26;baz=quux&#x26;corge='\n\nquerystring.stringify({ foo: 'bar', baz: 'qux' }, ';', ':');\n// Returns 'foo:bar;baz:qux'\n</code></pre>\n<p>By default, characters requiring percent-encoding within the query string will\nbe encoded as UTF-8. If an alternative encoding is required, then an alternative\n<code>encodeURIComponent</code> option will need to be specified:</p>\n<pre><code class=\"language-js\">// Assuming gbkEncodeURIComponent function already exists,\n\nquerystring.stringify({ w: '中文', foo: 'bar' }, null, null,\n                      { encodeURIComponent: gbkEncodeURIComponent });\n</code></pre>"
        },
        {
          "textRaw": "`querystring.unescape(str)`",
          "name": "unescape",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.25"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`str` {string}",
                  "name": "str",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>querystring.unescape()</code> method performs decoding of URL percent-encoded\ncharacters on the given <code>str</code>.</p>\n<p>The <code>querystring.unescape()</code> method is used by <code>querystring.parse()</code> and is\ngenerally not expected to be used directly. It is exported primarily to allow\napplication code to provide a replacement decoding implementation if\nnecessary by assigning <code>querystring.unescape</code> to an alternative function.</p>\n<p>By default, the <code>querystring.unescape()</code> method will attempt to use the\nJavaScript built-in <code>decodeURIComponent()</code> method to decode. If that fails,\na safer equivalent that does not throw on malformed URLs will be used.</p>"
        }
      ],
      "displayName": "Query string",
      "source": "doc/api/querystring.md"
    },
    {
      "textRaw": "Readline",
      "name": "readline",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:readline</code> module provides an interface for reading data from a\n<a href=\"stream.html#readable-streams\">Readable</a> stream (such as <a href=\"process.html#processstdin\"><code>process.stdin</code></a>) one line at a time.</p>\n<p>To use the promise-based APIs:</p>\n<pre><code class=\"language-mjs\">import * as readline from 'node:readline/promises';\n</code></pre>\n<pre><code class=\"language-cjs\">const readline = require('node:readline/promises');\n</code></pre>\n<p>To use the callback and sync APIs:</p>\n<pre><code class=\"language-mjs\">import * as readline from 'node:readline';\n</code></pre>\n<pre><code class=\"language-cjs\">const readline = require('node:readline');\n</code></pre>\n<p>The following simple example illustrates the basic use of the <code>node:readline</code>\nmodule.</p>\n<pre><code class=\"language-mjs\">import * as readline from 'node:readline/promises';\nimport { stdin as input, stdout as output } from 'node:process';\n\nconst rl = readline.createInterface({ input, output });\n\nconst answer = await rl.question('What do you think of Node.js? ');\n\nconsole.log(`Thank you for your valuable feedback: ${answer}`);\n\nrl.close();\n</code></pre>\n<pre><code class=\"language-cjs\">const readline = require('node:readline');\nconst { stdin: input, stdout: output } = require('node:process');\n\nconst rl = readline.createInterface({ input, output });\n\nrl.question('What do you think of Node.js? ', (answer) => {\n  // TODO: Log the answer in a database\n  console.log(`Thank you for your valuable feedback: ${answer}`);\n\n  rl.close();\n});\n</code></pre>\n<p>Once this code is invoked, the Node.js application will not terminate until the\n<code>readline.Interface</code> is closed because the interface waits for data to be\nreceived on the <code>input</code> stream.</p>\n<p><a id='readline_class_interface'></a></p>",
      "classes": [
        {
          "textRaw": "Class: `InterfaceConstructor`",
          "name": "InterfaceConstructor",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.104"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>Instances of the <code>InterfaceConstructor</code> class are constructed using the\n<code>readlinePromises.createInterface()</code> or <code>readline.createInterface()</code> method.\nEvery instance is associated with a single <code>input</code> <a href=\"stream.html#readable-streams\">Readable</a> stream and a\nsingle <code>output</code> <a href=\"stream.html#writable-streams\">Writable</a> stream.\nThe <code>output</code> stream is used to print prompts for user input that arrives on,\nand is read from, the <code>input</code> stream.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'close'</code> event is emitted when one of the following occur:</p>\n<ul>\n<li>The <code>rl.close()</code> method is called and the <code>InterfaceConstructor</code> instance has\nrelinquished control over the <code>input</code> and <code>output</code> streams;</li>\n<li>The <code>input</code> stream receives its <code>'end'</code> event;</li>\n<li>The <code>input</code> stream receives <kbd>Ctrl</kbd>+<kbd>D</kbd> to signal\nend-of-transmission (EOT);</li>\n<li>The <code>input</code> stream receives <kbd>Ctrl</kbd>+<kbd>C</kbd> to signal <code>SIGINT</code>\nand there is no <code>'SIGINT'</code> event listener registered on the\n<code>InterfaceConstructor</code> instance.</li>\n</ul>\n<p>The listener function is called without passing any arguments.</p>\n<p>The <code>InterfaceConstructor</code> instance is finished once the <code>'close'</code> event is\nemitted.</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "name": "error",
              "type": "event",
              "meta": {
                "added": [
                  "v16.0.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'error'</code> event is emitted when an error occurs on the <code>input</code> stream\nassociated with the <code>node:readline</code> <code>Interface</code>.</p>\n<p>The listener function is called with an <code>Error</code> object passed as the single argument.</p>"
            },
            {
              "textRaw": "Event: `'line'`",
              "name": "line",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'line'</code> event is emitted whenever the <code>input</code> stream receives an\nend-of-line input (<code>\\n</code>, <code>\\r</code>, or <code>\\r\\n</code>). This usually occurs when the user\npresses <kbd>Enter</kbd> or <kbd>Return</kbd>.</p>\n<p>The <code>'line'</code> event is also emitted if new data has been read from a stream and\nthat stream ends without a final end-of-line marker.</p>\n<p>The listener function is called with a string containing the single line of\nreceived input.</p>\n<pre><code class=\"language-js\">rl.on('line', (input) => {\n  console.log(`Received: ${input}`);\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'history'`",
              "name": "history",
              "type": "event",
              "meta": {
                "added": [
                  "v15.8.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'history'</code> event is emitted whenever the history array has changed.</p>\n<p>The listener function is called with an array containing the history array.\nIt will reflect all changes, added lines and removed lines due to\n<code>historySize</code> and <code>removeHistoryDuplicates</code>.</p>\n<p>The primary purpose is to allow a listener to persist the history.\nIt is also possible for the listener to change the history object. This\ncould be useful to prevent certain lines to be added to the history, like\na password.</p>\n<pre><code class=\"language-js\">rl.on('history', (history) => {\n  console.log(`Received: ${history}`);\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'pause'`",
              "name": "pause",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'pause'</code> event is emitted when one of the following occur:</p>\n<ul>\n<li>The <code>input</code> stream is paused.</li>\n<li>The <code>input</code> stream is not paused and receives the <code>'SIGCONT'</code> event. (See\nevents <a href=\"#event-sigtstp\"><code>'SIGTSTP'</code></a> and <a href=\"#event-sigcont\"><code>'SIGCONT'</code></a>.)</li>\n</ul>\n<p>The listener function is called without passing any arguments.</p>\n<pre><code class=\"language-js\">rl.on('pause', () => {\n  console.log('Readline paused.');\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'resume'`",
              "name": "resume",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'resume'</code> event is emitted whenever the <code>input</code> stream is resumed.</p>\n<p>The listener function is called without passing any arguments.</p>\n<pre><code class=\"language-js\">rl.on('resume', () => {\n  console.log('Readline resumed.');\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'SIGCONT'`",
              "name": "SIGCONT",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'SIGCONT'</code> event is emitted when a Node.js process previously moved into\nthe background using <kbd>Ctrl</kbd>+<kbd>Z</kbd> (i.e. <code>SIGTSTP</code>) is then\nbrought back to the foreground using <a href=\"http://man7.org/linux/man-pages/man1/fg.1p.html\"><code>fg(1p)</code></a>.</p>\n<p>If the <code>input</code> stream was paused <em>before</em> the <code>SIGTSTP</code> request, this event will\nnot be emitted.</p>\n<p>The listener function is invoked without passing any arguments.</p>\n<pre><code class=\"language-js\">rl.on('SIGCONT', () => {\n  // `prompt` will automatically resume the stream\n  rl.prompt();\n});\n</code></pre>\n<p>The <code>'SIGCONT'</code> event is <em>not</em> supported on Windows.</p>"
            },
            {
              "textRaw": "Event: `'SIGINT'`",
              "name": "SIGINT",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'SIGINT'</code> event is emitted whenever the <code>input</code> stream receives\na <kbd>Ctrl+C</kbd> input, known typically as <code>SIGINT</code>. If there are no\n<code>'SIGINT'</code> event listeners registered when the <code>input</code> stream receives a\n<code>SIGINT</code>, the <code>'pause'</code> event will be emitted.</p>\n<p>The listener function is invoked without passing any arguments.</p>\n<pre><code class=\"language-js\">rl.on('SIGINT', () => {\n  rl.question('Are you sure you want to exit? ', (answer) => {\n    if (answer.match(/^y(es)?$/i)) rl.pause();\n  });\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'SIGTSTP'`",
              "name": "SIGTSTP",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'SIGTSTP'</code> event is emitted when the <code>input</code> stream receives\na <kbd>Ctrl</kbd>+<kbd>Z</kbd> input, typically known as <code>SIGTSTP</code>. If there are\nno <code>'SIGTSTP'</code> event listeners registered when the <code>input</code> stream receives a\n<code>SIGTSTP</code>, the Node.js process will be sent to the background.</p>\n<p>When the program is resumed using <a href=\"http://man7.org/linux/man-pages/man1/fg.1p.html\"><code>fg(1p)</code></a>, the <code>'pause'</code> and <code>'SIGCONT'</code> events\nwill be emitted. These can be used to resume the <code>input</code> stream.</p>\n<p>The <code>'pause'</code> and <code>'SIGCONT'</code> events will not be emitted if the <code>input</code> was\npaused before the process was sent to the background.</p>\n<p>The listener function is invoked without passing any arguments.</p>\n<pre><code class=\"language-js\">rl.on('SIGTSTP', () => {\n  // This will override SIGTSTP and prevent the program from going to the\n  // background.\n  console.log('Caught SIGTSTP.');\n});\n</code></pre>\n<p>The <code>'SIGTSTP'</code> event is <em>not</em> supported on Windows.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`rl.close()`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>rl.close()</code> method closes the <code>InterfaceConstructor</code> instance and\nrelinquishes control over the <code>input</code> and <code>output</code> streams. When called,\nthe <code>'close'</code> event will be emitted.</p>\n<p>Calling <code>rl.close()</code> does not immediately stop other events (including <code>'line'</code>)\nfrom being emitted by the <code>InterfaceConstructor</code> instance.</p>"
            },
            {
              "textRaw": "`rl[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v23.10.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Alias for <code>rl.close()</code>.</p>"
            },
            {
              "textRaw": "`rl.pause()`",
              "name": "pause",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>rl.pause()</code> method pauses the <code>input</code> stream, allowing it to be resumed\nlater if necessary.</p>\n<p>Calling <code>rl.pause()</code> does not immediately pause other events (including\n<code>'line'</code>) from being emitted by the <code>InterfaceConstructor</code> instance.</p>"
            },
            {
              "textRaw": "`rl.prompt([preserveCursor])`",
              "name": "prompt",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`preserveCursor` {boolean} If `true`, prevents the cursor placement from being reset to `0`.",
                      "name": "preserveCursor",
                      "type": "boolean",
                      "desc": "If `true`, prevents the cursor placement from being reset to `0`.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>rl.prompt()</code> method writes the <code>InterfaceConstructor</code> instances configured\n<code>prompt</code> to a new line in <code>output</code> in order to provide a user with a new\nlocation at which to provide input.</p>\n<p>When called, <code>rl.prompt()</code> will resume the <code>input</code> stream if it has been\npaused.</p>\n<p>If the <code>InterfaceConstructor</code> was created with <code>output</code> set to <code>null</code> or\n<code>undefined</code> the prompt is not written.</p>"
            },
            {
              "textRaw": "`rl.resume()`",
              "name": "resume",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>rl.resume()</code> method resumes the <code>input</code> stream if it has been paused.</p>"
            },
            {
              "textRaw": "`rl.setPrompt(prompt)`",
              "name": "setPrompt",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`prompt` {string}",
                      "name": "prompt",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>rl.setPrompt()</code> method sets the prompt that will be written to <code>output</code>\nwhenever <code>rl.prompt()</code> is called.</p>"
            },
            {
              "textRaw": "`rl.getPrompt()`",
              "name": "getPrompt",
              "type": "method",
              "meta": {
                "added": [
                  "v15.3.0",
                  "v14.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string} the current prompt string",
                    "name": "return",
                    "type": "string",
                    "desc": "the current prompt string"
                  }
                }
              ],
              "desc": "<p>The <code>rl.getPrompt()</code> method returns the current prompt used by <code>rl.prompt()</code>.</p>"
            },
            {
              "textRaw": "`rl.write(data[, key])`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string}",
                      "name": "data",
                      "type": "string"
                    },
                    {
                      "textRaw": "`key` {Object}",
                      "name": "key",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ctrl` {boolean} `true` to indicate the <kbd>Ctrl</kbd> key.",
                          "name": "ctrl",
                          "type": "boolean",
                          "desc": "`true` to indicate the <kbd>Ctrl</kbd> key."
                        },
                        {
                          "textRaw": "`meta` {boolean} `true` to indicate the <kbd>Meta</kbd> key.",
                          "name": "meta",
                          "type": "boolean",
                          "desc": "`true` to indicate the <kbd>Meta</kbd> key."
                        },
                        {
                          "textRaw": "`shift` {boolean} `true` to indicate the <kbd>Shift</kbd> key.",
                          "name": "shift",
                          "type": "boolean",
                          "desc": "`true` to indicate the <kbd>Shift</kbd> key."
                        },
                        {
                          "textRaw": "`name` {string} The name of the a key.",
                          "name": "name",
                          "type": "string",
                          "desc": "The name of the a key."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>rl.write()</code> method will write either <code>data</code> or a key sequence identified\nby <code>key</code> to the <code>output</code>. The <code>key</code> argument is supported only if <code>output</code> is\na <a href=\"tty.html\">TTY</a> text terminal. See <a href=\"#tty-keybindings\">TTY keybindings</a> for a list of key\ncombinations.</p>\n<p>If <code>key</code> is specified, <code>data</code> is ignored.</p>\n<p>When called, <code>rl.write()</code> will resume the <code>input</code> stream if it has been\npaused.</p>\n<p>If the <code>InterfaceConstructor</code> was created with <code>output</code> set to <code>null</code> or\n<code>undefined</code> the <code>data</code> and <code>key</code> are not written.</p>\n<pre><code class=\"language-js\">rl.write('Delete this!');\n// Simulate Ctrl+U to delete the line written previously\nrl.write(null, { ctrl: true, name: 'u' });\n</code></pre>\n<p>The <code>rl.write()</code> method will write the data to the <code>readline</code> <code>Interface</code>'s\n<code>input</code> <em>as if it were provided by the user</em>.</p>"
            },
            {
              "textRaw": "`rl[Symbol.asyncIterator]()`",
              "name": "[Symbol.asyncIterator]",
              "type": "method",
              "meta": {
                "added": [
                  "v11.4.0",
                  "v10.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v11.14.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/26989",
                    "description": "Symbol.asyncIterator support is no longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {AsyncIterator}",
                    "name": "return",
                    "type": "AsyncIterator"
                  }
                }
              ],
              "desc": "<p>Create an <code>AsyncIterator</code> object that iterates through each line in the input\nstream as a string. This method allows asynchronous iteration of\n<code>InterfaceConstructor</code> objects through <code>for await...of</code> loops.</p>\n<p>Errors in the input stream are not forwarded.</p>\n<p>If the loop is terminated with <code>break</code>, <code>throw</code>, or <code>return</code>,\n<a href=\"#rlclose\"><code>rl.close()</code></a> will be called. In other words, iterating over a\n<code>InterfaceConstructor</code> will always consume the input stream fully.</p>\n<p>Performance is not on par with the traditional <code>'line'</code> event API. Use <code>'line'</code>\ninstead for performance-sensitive applications.</p>\n<pre><code class=\"language-js\">async function processLineByLine() {\n  const rl = readline.createInterface({\n    // ...\n  });\n\n  for await (const line of rl) {\n    // Each line in the readline input will be successively available here as\n    // `line`.\n  }\n}\n</code></pre>\n<p><code>readline.createInterface()</code> will start to consume the input stream once\ninvoked. Having asynchronous operations between interface creation and\nasynchronous iteration may result in missed lines.</p>"
            },
            {
              "textRaw": "`rl.getCursorPos()`",
              "name": "getCursorPos",
              "type": "method",
              "meta": {
                "added": [
                  "v13.5.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`rows` {number} the row of the prompt the cursor currently lands on",
                        "name": "rows",
                        "type": "number",
                        "desc": "the row of the prompt the cursor currently lands on"
                      },
                      {
                        "textRaw": "`cols` {number} the screen column the cursor currently lands on",
                        "name": "cols",
                        "type": "number",
                        "desc": "the screen column the cursor currently lands on"
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Returns the real position of the cursor in relation to the input\nprompt + string. Long input (wrapping) strings, as well as multiple\nline prompts are included in the calculations.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string}",
              "name": "line",
              "type": "string",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.8.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33676",
                    "description": "Value will always be a string, never undefined."
                  }
                ]
              },
              "desc": "<p>The current input data being processed by node.</p>\n<p>This can be used when collecting input from a TTY stream to retrieve the\ncurrent value that has been processed thus far, prior to the <code>line</code> event\nbeing emitted. Once the <code>line</code> event has been emitted, this property will\nbe an empty string.</p>\n<p>Be aware that modifying the value during the instance runtime may have\nunintended consequences if <code>rl.cursor</code> is not also controlled.</p>\n<p><strong>If not using a TTY stream for input, use the <a href=\"#event-line\"><code>'line'</code></a> event.</strong></p>\n<p>One possible use case would be as follows:</p>\n<pre><code class=\"language-js\">const values = ['lorem ipsum', 'dolor sit amet'];\nconst rl = readline.createInterface(process.stdin);\nconst showResults = debounce(() => {\n  console.log(\n    '\\n',\n    values.filter((val) => val.startsWith(rl.line)).join(' '),\n  );\n}, 300);\nprocess.stdin.on('keypress', (c, k) => {\n  showResults();\n});\n</code></pre>"
            },
            {
              "textRaw": "Type: {number|undefined}",
              "name": "cursor",
              "type": "number|undefined",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": []
              },
              "desc": "<p>The cursor position relative to <code>rl.line</code>.</p>\n<p>This will track where the current cursor lands in the input string, when\nreading input from a TTY stream. The position of cursor determines the\nportion of the input string that will be modified as input is processed,\nas well as the column where the terminal caret will be rendered.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Promises API",
          "name": "promises_api",
          "type": "module",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "classes": [
            {
              "textRaw": "Class: `readlinePromises.Interface`",
              "name": "readlinePromises.Interface",
              "type": "class",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Extends: <a href=\"readline.html#class-readlineinterfaceconstructor\"><code>&#x3C;readline.InterfaceConstructor></code></a></li>\n</ul>\n<p>Instances of the <code>readlinePromises.Interface</code> class are constructed using the\n<code>readlinePromises.createInterface()</code> method. Every instance is associated with a\nsingle <code>input</code> <a href=\"stream.html#readable-streams\">Readable</a> stream and a single <code>output</code> <a href=\"stream.html#writable-streams\">Writable</a> stream.\nThe <code>output</code> stream is used to print prompts for user input that arrives on,\nand is read from, the <code>input</code> stream.</p>",
              "methods": [
                {
                  "textRaw": "`rl.question(query[, options])`",
                  "name": "question",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`query` {string} A statement or query to write to `output`, prepended to the prompt.",
                          "name": "query",
                          "type": "string",
                          "desc": "A statement or query to write to `output`, prepended to the prompt."
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal} Optionally allows the `question()` to be canceled using an `AbortSignal`.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "Optionally allows the `question()` to be canceled using an `AbortSignal`."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} A promise that is fulfilled with the user's input in response to the `query`.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "A promise that is fulfilled with the user's input in response to the `query`."
                      }
                    }
                  ],
                  "desc": "<p>The <code>rl.question()</code> method displays the <code>query</code> by writing it to the <code>output</code>,\nwaits for user input to be provided on <code>input</code>, then invokes the <code>callback</code>\nfunction passing the provided input as the first argument.</p>\n<p>When called, <code>rl.question()</code> will resume the <code>input</code> stream if it has been\npaused.</p>\n<p>If the <code>readlinePromises.Interface</code> was created with <code>output</code> set to <code>null</code> or\n<code>undefined</code> the <code>query</code> is not written.</p>\n<p>If the question is called after <code>rl.close()</code>, it returns a rejected promise.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-mjs\">const answer = await rl.question('What is your favorite food? ');\nconsole.log(`Oh, so your favorite food is ${answer}`);\n</code></pre>\n<p>Using an <code>AbortSignal</code> to cancel a question.</p>\n<pre><code class=\"language-mjs\">const signal = AbortSignal.timeout(10_000);\n\nsignal.addEventListener('abort', () => {\n  console.log('The food question timed out');\n}, { once: true });\n\nconst answer = await rl.question('What is your favorite food? ', { signal });\nconsole.log(`Oh, so your favorite food is ${answer}`);\n</code></pre>"
                }
              ]
            },
            {
              "textRaw": "Class: `readlinePromises.Readline`",
              "name": "readlinePromises.Readline",
              "type": "class",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "textRaw": "`new readlinePromises.Readline(stream[, options])`",
                  "name": "readlinePromises.Readline",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`stream` {stream.Writable} A TTY stream.",
                      "name": "stream",
                      "type": "stream.Writable",
                      "desc": "A TTY stream."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`autoCommit` {boolean} If `true`, no need to call `rl.commit()`.",
                          "name": "autoCommit",
                          "type": "boolean",
                          "desc": "If `true`, no need to call `rl.commit()`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "methods": [
                {
                  "textRaw": "`rl.clearLine(dir)`",
                  "name": "clearLine",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`dir` {integer}",
                          "name": "dir",
                          "type": "integer",
                          "options": [
                            {
                              "textRaw": "`-1`: to the left from cursor",
                              "name": "-1",
                              "desc": "to the left from cursor"
                            },
                            {
                              "textRaw": "`1`: to the right from cursor",
                              "name": "1",
                              "desc": "to the right from cursor"
                            },
                            {
                              "textRaw": "`0`: the entire line",
                              "name": "0",
                              "desc": "the entire line"
                            }
                          ]
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: this",
                        "name": "return",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>The <code>rl.clearLine()</code> method adds to the internal list of pending action an\naction that clears current line of the associated <code>stream</code> in a specified\ndirection identified by <code>dir</code>.\nCall <code>rl.commit()</code> to see the effect of this method, unless <code>autoCommit: true</code>\nwas passed to the constructor.</p>"
                },
                {
                  "textRaw": "`rl.clearScreenDown()`",
                  "name": "clearScreenDown",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: this",
                        "name": "return",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>The <code>rl.clearScreenDown()</code> method adds to the internal list of pending action an\naction that clears the associated stream from the current position of the\ncursor down.\nCall <code>rl.commit()</code> to see the effect of this method, unless <code>autoCommit: true</code>\nwas passed to the constructor.</p>"
                },
                {
                  "textRaw": "`rl.commit()`",
                  "name": "commit",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>The <code>rl.commit()</code> method sends all the pending actions to the associated\n<code>stream</code> and clears the internal list of pending actions.</p>"
                },
                {
                  "textRaw": "`rl.cursorTo(x[, y])`",
                  "name": "cursorTo",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`x` {integer}",
                          "name": "x",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`y` {integer}",
                          "name": "y",
                          "type": "integer",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: this",
                        "name": "return",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>The <code>rl.cursorTo()</code> method adds to the internal list of pending action an action\nthat moves cursor to the specified position in the associated <code>stream</code>.\nCall <code>rl.commit()</code> to see the effect of this method, unless <code>autoCommit: true</code>\nwas passed to the constructor.</p>"
                },
                {
                  "textRaw": "`rl.moveCursor(dx, dy)`",
                  "name": "moveCursor",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`dx` {integer}",
                          "name": "dx",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`dy` {integer}",
                          "name": "dy",
                          "type": "integer"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: this",
                        "name": "return",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>The <code>rl.moveCursor()</code> method adds to the internal list of pending action an\naction that moves the cursor <em>relative</em> to its current position in the\nassociated <code>stream</code>.\nCall <code>rl.commit()</code> to see the effect of this method, unless <code>autoCommit: true</code>\nwas passed to the constructor.</p>"
                },
                {
                  "textRaw": "`rl.rollback()`",
                  "name": "rollback",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: this",
                        "name": "return",
                        "desc": "this"
                      }
                    }
                  ],
                  "desc": "<p>The <code>rl.rollback</code> methods clears the internal list of pending actions without\nsending it to the associated <code>stream</code>.</p>"
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`readlinePromises.createInterface(options)`",
              "name": "createInterface",
              "type": "method",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`input` {stream.Readable} The Readable stream to listen to. This option is _required_.",
                          "name": "input",
                          "type": "stream.Readable",
                          "desc": "The Readable stream to listen to. This option is _required_."
                        },
                        {
                          "textRaw": "`output` {stream.Writable} The Writable stream to write readline data to.",
                          "name": "output",
                          "type": "stream.Writable",
                          "desc": "The Writable stream to write readline data to."
                        },
                        {
                          "textRaw": "`completer` {Function} An optional function used for Tab autocompletion.",
                          "name": "completer",
                          "type": "Function",
                          "desc": "An optional function used for Tab autocompletion."
                        },
                        {
                          "textRaw": "`terminal` {boolean} `true` if the `input` and `output` streams should be treated like a TTY, and have ANSI/VT100 escape codes written to it. **Default:** checking `isTTY` on the `output` stream upon instantiation.",
                          "name": "terminal",
                          "type": "boolean",
                          "default": "checking `isTTY` on the `output` stream upon instantiation",
                          "desc": "`true` if the `input` and `output` streams should be treated like a TTY, and have ANSI/VT100 escape codes written to it."
                        },
                        {
                          "textRaw": "`history` {string[]} Initial list of history lines. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. **Default:** `[]`.",
                          "name": "history",
                          "type": "string[]",
                          "default": "`[]`",
                          "desc": "Initial list of history lines. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all."
                        },
                        {
                          "textRaw": "`historySize` {number} Maximum number of history lines retained. To disable the history set this value to `0`. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. **Default:** `30`.",
                          "name": "historySize",
                          "type": "number",
                          "default": "`30`",
                          "desc": "Maximum number of history lines retained. To disable the history set this value to `0`. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all."
                        },
                        {
                          "textRaw": "`removeHistoryDuplicates` {boolean} If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list. **Default:** `false`.",
                          "name": "removeHistoryDuplicates",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list."
                        },
                        {
                          "textRaw": "`prompt` {string} The prompt string to use. **Default:** `'> '`.",
                          "name": "prompt",
                          "type": "string",
                          "default": "`'> '`",
                          "desc": "The prompt string to use."
                        },
                        {
                          "textRaw": "`crlfDelay` {number} If the delay between `\\r` and `\\n` exceeds `crlfDelay` milliseconds, both `\\r` and `\\n` will be treated as separate end-of-line input. `crlfDelay` will be coerced to a number no less than `100`. It can be set to `Infinity`, in which case `\\r` followed by `\\n` will always be considered a single newline (which may be reasonable for reading files with `\\r\\n` line delimiter). **Default:** `100`.",
                          "name": "crlfDelay",
                          "type": "number",
                          "default": "`100`",
                          "desc": "If the delay between `\\r` and `\\n` exceeds `crlfDelay` milliseconds, both `\\r` and `\\n` will be treated as separate end-of-line input. `crlfDelay` will be coerced to a number no less than `100`. It can be set to `Infinity`, in which case `\\r` followed by `\\n` will always be considered a single newline (which may be reasonable for reading files with `\\r\\n` line delimiter)."
                        },
                        {
                          "textRaw": "`escapeCodeTimeout` {number} The duration `readlinePromises` will wait for a character (when reading an ambiguous key sequence in milliseconds one that can both form a complete key sequence using the input read so far and can take additional input to complete a longer key sequence). **Default:** `500`.",
                          "name": "escapeCodeTimeout",
                          "type": "number",
                          "default": "`500`",
                          "desc": "The duration `readlinePromises` will wait for a character (when reading an ambiguous key sequence in milliseconds one that can both form a complete key sequence using the input read so far and can take additional input to complete a longer key sequence)."
                        },
                        {
                          "textRaw": "`tabSize` {integer} The number of spaces a tab is equal to (minimum 1). **Default:** `8`.",
                          "name": "tabSize",
                          "type": "integer",
                          "default": "`8`",
                          "desc": "The number of spaces a tab is equal to (minimum 1)."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} Allows closing the interface using an AbortSignal.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Allows closing the interface using an AbortSignal."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {readlinePromises.Interface}",
                    "name": "return",
                    "type": "readlinePromises.Interface"
                  }
                }
              ],
              "desc": "<p>The <code>readlinePromises.createInterface()</code> method creates a new <code>readlinePromises.Interface</code>\ninstance.</p>\n<pre><code class=\"language-mjs\">import { createInterface } from 'node:readline/promises';\nimport { stdin, stdout } from 'node:process';\nconst rl = createInterface({\n  input: stdin,\n  output: stdout,\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { createInterface } = require('node:readline/promises');\nconst rl = createInterface({\n  input: process.stdin,\n  output: process.stdout,\n});\n</code></pre>\n<p>Once the <code>readlinePromises.Interface</code> instance is created, the most common case\nis to listen for the <code>'line'</code> event:</p>\n<pre><code class=\"language-js\">rl.on('line', (line) => {\n  console.log(`Received: ${line}`);\n});\n</code></pre>\n<p>If <code>terminal</code> is <code>true</code> for this instance then the <code>output</code> stream will get\nthe best compatibility if it defines an <code>output.columns</code> property and emits\na <code>'resize'</code> event on the <code>output</code> if or when the columns ever change\n(<a href=\"process.html#processstdout\"><code>process.stdout</code></a> does this automatically when it is a TTY).</p>",
              "modules": [
                {
                  "textRaw": "Use of the `completer` function",
                  "name": "use_of_the_`completer`_function",
                  "type": "module",
                  "desc": "<p>The <code>completer</code> function takes the current line entered by the user\nas an argument, and returns an <code>Array</code> with 2 entries:</p>\n<ul>\n<li>An <code>Array</code> with matching entries for the completion.</li>\n<li>The substring that was used for the matching.</li>\n</ul>\n<p>For instance: <code>[[substr1, substr2, ...], originalsubstring]</code>.</p>\n<pre><code class=\"language-js\">function completer(line) {\n  const completions = '.help .error .exit .quit .q'.split(' ');\n  const hits = completions.filter((c) => c.startsWith(line));\n  // Show all completions if none found\n  return [hits.length ? hits : completions, line];\n}\n</code></pre>\n<p>The <code>completer</code> function can also return a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a>, or be asynchronous:</p>\n<pre><code class=\"language-js\">async function completer(linePartial) {\n  await someAsyncWork();\n  return [['123'], linePartial];\n}\n</code></pre>",
                  "displayName": "Use of the `completer` function"
                }
              ]
            }
          ],
          "displayName": "Promises API"
        },
        {
          "textRaw": "Callback API",
          "name": "callback_api",
          "type": "module",
          "meta": {
            "added": [
              "v0.1.104"
            ],
            "changes": []
          },
          "classes": [
            {
              "textRaw": "Class: `readline.Interface`",
              "name": "readline.Interface",
              "type": "class",
              "meta": {
                "added": [
                  "v0.1.104"
                ],
                "changes": [
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37947",
                    "description": "The class `readline.Interface` now inherits from `Interface`."
                  }
                ]
              },
              "desc": "<ul>\n<li>Extends: <a href=\"readline.html#class-readlineinterfaceconstructor\"><code>&#x3C;readline.InterfaceConstructor></code></a></li>\n</ul>\n<p>Instances of the <code>readline.Interface</code> class are constructed using the\n<code>readline.createInterface()</code> method. Every instance is associated with a\nsingle <code>input</code> <a href=\"stream.html#readable-streams\">Readable</a> stream and a single <code>output</code> <a href=\"stream.html#writable-streams\">Writable</a> stream.\nThe <code>output</code> stream is used to print prompts for user input that arrives on,\nand is read from, the <code>input</code> stream.</p>",
              "methods": [
                {
                  "textRaw": "`rl.question(query[, options], callback)`",
                  "name": "question",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.3.3"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`query` {string} A statement or query to write to `output`, prepended to the prompt.",
                          "name": "query",
                          "type": "string",
                          "desc": "A statement or query to write to `output`, prepended to the prompt."
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`signal` {AbortSignal} Optionally allows the `question()` to be canceled using an `AbortController`.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "Optionally allows the `question()` to be canceled using an `AbortController`."
                            }
                          ],
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function} A callback function that is invoked with the user's input in response to the `query`.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "A callback function that is invoked with the user's input in response to the `query`."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>The <code>rl.question()</code> method displays the <code>query</code> by writing it to the <code>output</code>,\nwaits for user input to be provided on <code>input</code>, then invokes the <code>callback</code>\nfunction passing the provided input as the first argument.</p>\n<p>When called, <code>rl.question()</code> will resume the <code>input</code> stream if it has been\npaused.</p>\n<p>If the <code>readline.Interface</code> was created with <code>output</code> set to <code>null</code> or\n<code>undefined</code> the <code>query</code> is not written.</p>\n<p>The <code>callback</code> function passed to <code>rl.question()</code> does not follow the typical\npattern of accepting an <code>Error</code> object or <code>null</code> as the first argument.\nThe <code>callback</code> is called with the provided answer as the only argument.</p>\n<p>An error will be thrown if calling <code>rl.question()</code> after <code>rl.close()</code>.</p>\n<p>Example usage:</p>\n<pre><code class=\"language-js\">rl.question('What is your favorite food? ', (answer) => {\n  console.log(`Oh, so your favorite food is ${answer}`);\n});\n</code></pre>\n<p>Using an <code>AbortController</code> to cancel a question.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\nconst signal = ac.signal;\n\nrl.question('What is your favorite food? ', { signal }, (answer) => {\n  console.log(`Oh, so your favorite food is ${answer}`);\n});\n\nsignal.addEventListener('abort', () => {\n  console.log('The food question timed out');\n}, { once: true });\n\nsetTimeout(() => ac.abort(), 10000);\n</code></pre>"
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`readline.clearLine(stream, dir[, callback])`",
              "name": "clearLine",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v12.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28674",
                    "description": "The stream's write() callback and return value are exposed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {stream.Writable}",
                      "name": "stream",
                      "type": "stream.Writable"
                    },
                    {
                      "textRaw": "`dir` {number}",
                      "name": "dir",
                      "type": "number",
                      "options": [
                        {
                          "textRaw": "`-1`: to the left from cursor",
                          "name": "-1",
                          "desc": "to the left from cursor"
                        },
                        {
                          "textRaw": "`1`: to the right from cursor",
                          "name": "1",
                          "desc": "to the right from cursor"
                        },
                        {
                          "textRaw": "`0`: the entire line",
                          "name": "0",
                          "desc": "the entire line"
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                  }
                }
              ],
              "desc": "<p>The <code>readline.clearLine()</code> method clears current line of given <a href=\"tty.html\">TTY</a> stream\nin a specified direction identified by <code>dir</code>.</p>"
            },
            {
              "textRaw": "`readline.clearScreenDown(stream[, callback])`",
              "name": "clearScreenDown",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v12.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28641",
                    "description": "The stream's write() callback and return value are exposed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {stream.Writable}",
                      "name": "stream",
                      "type": "stream.Writable"
                    },
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                  }
                }
              ],
              "desc": "<p>The <code>readline.clearScreenDown()</code> method clears the given <a href=\"tty.html\">TTY</a> stream from\nthe current position of the cursor down.</p>"
            },
            {
              "textRaw": "`readline.createInterface(options)`",
              "name": "createInterface",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.98"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.14.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37932",
                    "description": "The `signal` option is supported now."
                  },
                  {
                    "version": [
                      "v15.8.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33662",
                    "description": "The `history` option is supported now."
                  },
                  {
                    "version": "v13.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31318",
                    "description": "The `tabSize` option is supported now."
                  },
                  {
                    "version": [
                      "v8.3.0",
                      "v6.11.4"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/13497",
                    "description": "Remove max limit of `crlfDelay` option."
                  },
                  {
                    "version": "v6.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8109",
                    "description": "The `crlfDelay` option is supported now."
                  },
                  {
                    "version": "v6.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7125",
                    "description": "The `prompt` option is supported now."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6352",
                    "description": "The `historySize` option can be `0` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`input` {stream.Readable} The Readable stream to listen to. This option is _required_.",
                          "name": "input",
                          "type": "stream.Readable",
                          "desc": "The Readable stream to listen to. This option is _required_."
                        },
                        {
                          "textRaw": "`output` {stream.Writable} The Writable stream to write readline data to.",
                          "name": "output",
                          "type": "stream.Writable",
                          "desc": "The Writable stream to write readline data to."
                        },
                        {
                          "textRaw": "`completer` {Function} An optional function used for Tab autocompletion.",
                          "name": "completer",
                          "type": "Function",
                          "desc": "An optional function used for Tab autocompletion."
                        },
                        {
                          "textRaw": "`terminal` {boolean} `true` if the `input` and `output` streams should be treated like a TTY, and have ANSI/VT100 escape codes written to it. **Default:** checking `isTTY` on the `output` stream upon instantiation.",
                          "name": "terminal",
                          "type": "boolean",
                          "default": "checking `isTTY` on the `output` stream upon instantiation",
                          "desc": "`true` if the `input` and `output` streams should be treated like a TTY, and have ANSI/VT100 escape codes written to it."
                        },
                        {
                          "textRaw": "`history` {string[]} Initial list of history lines. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. **Default:** `[]`.",
                          "name": "history",
                          "type": "string[]",
                          "default": "`[]`",
                          "desc": "Initial list of history lines. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all."
                        },
                        {
                          "textRaw": "`historySize` {number} Maximum number of history lines retained. To disable the history set this value to `0`. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. **Default:** `30`.",
                          "name": "historySize",
                          "type": "number",
                          "default": "`30`",
                          "desc": "Maximum number of history lines retained. To disable the history set this value to `0`. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all."
                        },
                        {
                          "textRaw": "`removeHistoryDuplicates` {boolean} If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list. **Default:** `false`.",
                          "name": "removeHistoryDuplicates",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list."
                        },
                        {
                          "textRaw": "`prompt` {string} The prompt string to use. **Default:** `'> '`.",
                          "name": "prompt",
                          "type": "string",
                          "default": "`'> '`",
                          "desc": "The prompt string to use."
                        },
                        {
                          "textRaw": "`crlfDelay` {number} If the delay between `\\r` and `\\n` exceeds `crlfDelay` milliseconds, both `\\r` and `\\n` will be treated as separate end-of-line input. `crlfDelay` will be coerced to a number no less than `100`. It can be set to `Infinity`, in which case `\\r` followed by `\\n` will always be considered a single newline (which may be reasonable for reading files with `\\r\\n` line delimiter). **Default:** `100`.",
                          "name": "crlfDelay",
                          "type": "number",
                          "default": "`100`",
                          "desc": "If the delay between `\\r` and `\\n` exceeds `crlfDelay` milliseconds, both `\\r` and `\\n` will be treated as separate end-of-line input. `crlfDelay` will be coerced to a number no less than `100`. It can be set to `Infinity`, in which case `\\r` followed by `\\n` will always be considered a single newline (which may be reasonable for reading files with `\\r\\n` line delimiter)."
                        },
                        {
                          "textRaw": "`escapeCodeTimeout` {number} The duration `readline` will wait for a character (when reading an ambiguous key sequence in milliseconds one that can both form a complete key sequence using the input read so far and can take additional input to complete a longer key sequence). **Default:** `500`.",
                          "name": "escapeCodeTimeout",
                          "type": "number",
                          "default": "`500`",
                          "desc": "The duration `readline` will wait for a character (when reading an ambiguous key sequence in milliseconds one that can both form a complete key sequence using the input read so far and can take additional input to complete a longer key sequence)."
                        },
                        {
                          "textRaw": "`tabSize` {integer} The number of spaces a tab is equal to (minimum 1). **Default:** `8`.",
                          "name": "tabSize",
                          "type": "integer",
                          "default": "`8`",
                          "desc": "The number of spaces a tab is equal to (minimum 1)."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} Allows closing the interface using an AbortSignal. Aborting the signal will internally call `close` on the interface.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Allows closing the interface using an AbortSignal. Aborting the signal will internally call `close` on the interface."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {readline.Interface}",
                    "name": "return",
                    "type": "readline.Interface"
                  }
                }
              ],
              "desc": "<p>The <code>readline.createInterface()</code> method creates a new <code>readline.Interface</code>\ninstance.</p>\n<pre><code class=\"language-mjs\">import { createInterface } from 'node:readline';\nimport { stdin, stdout } from 'node:process';\nconst rl = createInterface({\n  input: stdin,\n  output: stdout,\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { createInterface } = require('node:readline');\nconst rl = createInterface({\n  input: process.stdin,\n  output: process.stdout,\n});\n</code></pre>\n<p>Once the <code>readline.Interface</code> instance is created, the most common case is to\nlisten for the <code>'line'</code> event:</p>\n<pre><code class=\"language-js\">rl.on('line', (line) => {\n  console.log(`Received: ${line}`);\n});\n</code></pre>\n<p>If <code>terminal</code> is <code>true</code> for this instance then the <code>output</code> stream will get\nthe best compatibility if it defines an <code>output.columns</code> property and emits\na <code>'resize'</code> event on the <code>output</code> if or when the columns ever change\n(<a href=\"process.html#processstdout\"><code>process.stdout</code></a> does this automatically when it is a TTY).</p>\n<p>When creating a <code>readline.Interface</code> using <code>stdin</code> as input, the program\nwill not terminate until it receives an <a href=\"https://en.wikipedia.org/wiki/End-of-file#EOF_character\">EOF character</a>. To exit without\nwaiting for user input, call <code>process.stdin.unref()</code>.</p>",
              "modules": [
                {
                  "textRaw": "Use of the `completer` function",
                  "name": "use_of_the_`completer`_function",
                  "type": "module",
                  "desc": "<p>The <code>completer</code> function takes the current line entered by the user\nas an argument, and returns an <code>Array</code> with 2 entries:</p>\n<ul>\n<li>An <code>Array</code> with matching entries for the completion.</li>\n<li>The substring that was used for the matching.</li>\n</ul>\n<p>For instance: <code>[[substr1, substr2, ...], originalsubstring]</code>.</p>\n<pre><code class=\"language-js\">function completer(line) {\n  const completions = '.help .error .exit .quit .q'.split(' ');\n  const hits = completions.filter((c) => c.startsWith(line));\n  // Show all completions if none found\n  return [hits.length ? hits : completions, line];\n}\n</code></pre>\n<p>The <code>completer</code> function can be called asynchronously if it accepts two\narguments:</p>\n<pre><code class=\"language-js\">function completer(linePartial, callback) {\n  callback(null, [['123'], linePartial]);\n}\n</code></pre>",
                  "displayName": "Use of the `completer` function"
                }
              ]
            },
            {
              "textRaw": "`readline.cursorTo(stream, x[, y][, callback])`",
              "name": "cursorTo",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v12.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28674",
                    "description": "The stream's write() callback and return value are exposed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {stream.Writable}",
                      "name": "stream",
                      "type": "stream.Writable"
                    },
                    {
                      "textRaw": "`x` {number}",
                      "name": "x",
                      "type": "number"
                    },
                    {
                      "textRaw": "`y` {number}",
                      "name": "y",
                      "type": "number",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                  }
                }
              ],
              "desc": "<p>The <code>readline.cursorTo()</code> method moves cursor to the specified position in a\ngiven <a href=\"tty.html\">TTY</a> <code>stream</code>.</p>"
            },
            {
              "textRaw": "`readline.moveCursor(stream, dx, dy[, callback])`",
              "name": "moveCursor",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v12.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28674",
                    "description": "The stream's write() callback and return value are exposed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {stream.Writable}",
                      "name": "stream",
                      "type": "stream.Writable"
                    },
                    {
                      "textRaw": "`dx` {number}",
                      "name": "dx",
                      "type": "number"
                    },
                    {
                      "textRaw": "`dy` {number}",
                      "name": "dy",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`false` if `stream` wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                  }
                }
              ],
              "desc": "<p>The <code>readline.moveCursor()</code> method moves the cursor <em>relative</em> to its current\nposition in a given <a href=\"tty.html\">TTY</a> <code>stream</code>.</p>"
            }
          ],
          "displayName": "Callback API"
        },
        {
          "textRaw": "Example: Tiny CLI",
          "name": "example:_tiny_cli",
          "type": "module",
          "desc": "<p>The following example illustrates the use of <code>readline.Interface</code> class to\nimplement a small command-line interface:</p>\n<pre><code class=\"language-mjs\">import { createInterface } from 'node:readline';\nimport { exit, stdin, stdout } from 'node:process';\nconst rl = createInterface({\n  input: stdin,\n  output: stdout,\n  prompt: 'OHAI> ',\n});\n\nrl.prompt();\n\nrl.on('line', (line) => {\n  switch (line.trim()) {\n    case 'hello':\n      console.log('world!');\n      break;\n    default:\n      console.log(`Say what? I might have heard '${line.trim()}'`);\n      break;\n  }\n  rl.prompt();\n}).on('close', () => {\n  console.log('Have a great day!');\n  exit(0);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { createInterface } = require('node:readline');\nconst rl = createInterface({\n  input: process.stdin,\n  output: process.stdout,\n  prompt: 'OHAI> ',\n});\n\nrl.prompt();\n\nrl.on('line', (line) => {\n  switch (line.trim()) {\n    case 'hello':\n      console.log('world!');\n      break;\n    default:\n      console.log(`Say what? I might have heard '${line.trim()}'`);\n      break;\n  }\n  rl.prompt();\n}).on('close', () => {\n  console.log('Have a great day!');\n  process.exit(0);\n});\n</code></pre>",
          "displayName": "Example: Tiny CLI"
        },
        {
          "textRaw": "Example: Read file stream line-by-Line",
          "name": "example:_read_file_stream_line-by-line",
          "type": "module",
          "desc": "<p>A common use case for <code>readline</code> is to consume an input file one line at a\ntime. The easiest way to do so is leveraging the <a href=\"fs.html#class-fsreadstream\"><code>fs.ReadStream</code></a> API as\nwell as a <code>for await...of</code> loop:</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\nimport { createInterface } from 'node:readline';\n\nasync function processLineByLine() {\n  const fileStream = createReadStream('input.txt');\n\n  const rl = createInterface({\n    input: fileStream,\n    crlfDelay: Infinity,\n  });\n  // Note: we use the crlfDelay option to recognize all instances of CR LF\n  // ('\\r\\n') in input.txt as a single line break.\n\n  for await (const line of rl) {\n    // Each line in input.txt will be successively available here as `line`.\n    console.log(`Line from file: ${line}`);\n  }\n}\n\nprocessLineByLine();\n</code></pre>\n<pre><code class=\"language-cjs\">const { createReadStream } = require('node:fs');\nconst { createInterface } = require('node:readline');\n\nasync function processLineByLine() {\n  const fileStream = createReadStream('input.txt');\n\n  const rl = createInterface({\n    input: fileStream,\n    crlfDelay: Infinity,\n  });\n  // Note: we use the crlfDelay option to recognize all instances of CR LF\n  // ('\\r\\n') in input.txt as a single line break.\n\n  for await (const line of rl) {\n    // Each line in input.txt will be successively available here as `line`.\n    console.log(`Line from file: ${line}`);\n  }\n}\n\nprocessLineByLine();\n</code></pre>\n<p>Alternatively, one could use the <a href=\"#event-line\"><code>'line'</code></a> event:</p>\n<pre><code class=\"language-mjs\">import { createReadStream } from 'node:fs';\nimport { createInterface } from 'node:readline';\n\nconst rl = createInterface({\n  input: createReadStream('sample.txt'),\n  crlfDelay: Infinity,\n});\n\nrl.on('line', (line) => {\n  console.log(`Line from file: ${line}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { createReadStream } = require('node:fs');\nconst { createInterface } = require('node:readline');\n\nconst rl = createInterface({\n  input: createReadStream('sample.txt'),\n  crlfDelay: Infinity,\n});\n\nrl.on('line', (line) => {\n  console.log(`Line from file: ${line}`);\n});\n</code></pre>\n<p>Currently, <code>for await...of</code> loop can be a bit slower. If <code>async</code> / <code>await</code>\nflow and speed are both essential, a mixed approach can be applied:</p>\n<pre><code class=\"language-mjs\">import { once } from 'node:events';\nimport { createReadStream } from 'node:fs';\nimport { createInterface } from 'node:readline';\n\n(async function processLineByLine() {\n  try {\n    const rl = createInterface({\n      input: createReadStream('big-file.txt'),\n      crlfDelay: Infinity,\n    });\n\n    rl.on('line', (line) => {\n      // Process the line.\n    });\n\n    await once(rl, 'close');\n\n    console.log('File processed.');\n  } catch (err) {\n    console.error(err);\n  }\n})();\n</code></pre>\n<pre><code class=\"language-cjs\">const { once } = require('node:events');\nconst { createReadStream } = require('node:fs');\nconst { createInterface } = require('node:readline');\n\n(async function processLineByLine() {\n  try {\n    const rl = createInterface({\n      input: createReadStream('big-file.txt'),\n      crlfDelay: Infinity,\n    });\n\n    rl.on('line', (line) => {\n      // Process the line.\n    });\n\n    await once(rl, 'close');\n\n    console.log('File processed.');\n  } catch (err) {\n    console.error(err);\n  }\n})();\n</code></pre>",
          "displayName": "Example: Read file stream line-by-Line"
        },
        {
          "textRaw": "TTY keybindings",
          "name": "tty_keybindings",
          "type": "module",
          "desc": "<table>\n  <tr>\n    <th>Keybindings</th>\n    <th>Description</th>\n    <th>Notes</th>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Backspace</kbd></td>\n    <td>Delete line left</td>\n    <td>Doesn't work on Linux, Mac and Windows</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Delete</kbd></td>\n    <td>Delete line right</td>\n    <td>Doesn't work on Mac</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>C</kbd></td>\n    <td>Emit <code>SIGINT</code> or close the readline instance</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>H</kbd></td>\n    <td>Delete left</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>D</kbd></td>\n    <td>Delete right or close the readline instance in case the current line is empty / EOF</td>\n    <td>Doesn't work on Windows</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>U</kbd></td>\n    <td>Delete from the current position to the line start</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>K</kbd></td>\n    <td>Delete from the current position to the end of line</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>Y</kbd></td>\n    <td>Yank (Recall) the previously deleted text</td>\n    <td>Only works with text deleted by <kbd>Ctrl</kbd>+<kbd>U</kbd> or <kbd>Ctrl</kbd>+<kbd>K</kbd></td>\n  </tr>\n  <tr>\n    <td><kbd>Meta</kbd>+<kbd>Y</kbd></td>\n    <td>Cycle among previously deleted texts</td>\n    <td>Only available when the last keystroke is <kbd>Ctrl</kbd>+<kbd>Y</kbd> or <kbd>Meta</kbd>+<kbd>Y</kbd></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>A</kbd></td>\n    <td>Go to start of line</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>E</kbd></td>\n    <td>Go to end of line</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>B</kbd></td>\n    <td>Back one character</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>F</kbd></td>\n    <td>Forward one character</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>L</kbd></td>\n    <td>Clear screen</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>N</kbd></td>\n    <td>Next history item</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>P</kbd></td>\n    <td>Previous history item</td>\n    <td></td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>-</kbd></td>\n    <td>Undo previous change</td>\n    <td>Any keystroke that emits key code <code>0x1F</code> will do this action.\n    In many terminals, for example <code>xterm</code>,\n    this is bound to <kbd>Ctrl</kbd>+<kbd>-</kbd>.</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>6</kbd></td>\n    <td>Redo previous change</td>\n    <td>Many terminals don't have a default redo keystroke.\n    We choose key code <code>0x1E</code> to perform redo.\n    In <code>xterm</code>, it is bound to <kbd>Ctrl</kbd>+<kbd>6</kbd>\n    by default.</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>Z</kbd></td>\n    <td>Moves running process into background. Type\n    <code>fg</code> and press <kbd>Enter</kbd>\n    to return.</td>\n    <td>Doesn't work on Windows</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>W</kbd> or <kbd>Ctrl</kbd>\n   +<kbd>Backspace</kbd></td>\n    <td>Delete backward to a word boundary</td>\n    <td><kbd>Ctrl</kbd>+<kbd>Backspace</kbd> Doesn't\n    work on Linux, Mac and Windows</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>Delete</kbd></td>\n    <td>Delete forward to a word boundary</td>\n    <td>Doesn't work on Mac</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>Left arrow</kbd> or\n    <kbd>Meta</kbd>+<kbd>B</kbd></td>\n    <td>Word left</td>\n    <td><kbd>Ctrl</kbd>+<kbd>Left arrow</kbd> Doesn't work\n    on Mac</td>\n  </tr>\n  <tr>\n    <td><kbd>Ctrl</kbd>+<kbd>Right arrow</kbd> or\n    <kbd>Meta</kbd>+<kbd>F</kbd></td>\n    <td>Word right</td>\n    <td><kbd>Ctrl</kbd>+<kbd>Right arrow</kbd> Doesn't work\n    on Mac</td>\n  </tr>\n  <tr>\n    <td><kbd>Meta</kbd>+<kbd>D</kbd> or <kbd>Meta</kbd>\n   +<kbd>Delete</kbd></td>\n    <td>Delete word right</td>\n    <td><kbd>Meta</kbd>+<kbd>Delete</kbd> Doesn't work\n    on windows</td>\n  </tr>\n  <tr>\n    <td><kbd>Meta</kbd>+<kbd>Backspace</kbd></td>\n    <td>Delete word left</td>\n    <td>Doesn't work on Mac</td>\n  </tr>\n</table>",
          "displayName": "TTY keybindings"
        }
      ],
      "methods": [
        {
          "textRaw": "`readline.emitKeypressEvents(stream[, interface])`",
          "name": "emitKeypressEvents",
          "type": "method",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`stream` {stream.Readable}",
                  "name": "stream",
                  "type": "stream.Readable"
                },
                {
                  "textRaw": "`interface` {readline.InterfaceConstructor}",
                  "name": "interface",
                  "type": "readline.InterfaceConstructor",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>readline.emitKeypressEvents()</code> method causes the given <a href=\"stream.html#readable-streams\">Readable</a>\nstream to begin emitting <code>'keypress'</code> events corresponding to received input.</p>\n<p>Optionally, <code>interface</code> specifies a <code>readline.Interface</code> instance for which\nautocompletion is disabled when copy-pasted input is detected.</p>\n<p>If the <code>stream</code> is a <a href=\"tty.html\">TTY</a>, then it must be in raw mode.</p>\n<p>This is automatically called by any readline instance on its <code>input</code> if the\n<code>input</code> is a terminal. Closing the <code>readline</code> instance does not stop\nthe <code>input</code> from emitting <code>'keypress'</code> events.</p>\n<pre><code class=\"language-js\">readline.emitKeypressEvents(process.stdin);\nif (process.stdin.isTTY)\n  process.stdin.setRawMode(true);\n</code></pre>"
        }
      ],
      "displayName": "Readline",
      "source": "doc/api/readline.md"
    },
    {
      "textRaw": "REPL",
      "name": "repl",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:repl</code> module provides a Read-Eval-Print-Loop (REPL) implementation\nthat is available both as a standalone program or includible in other\napplications. It can be accessed using:</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Design and features",
          "name": "design_and_features",
          "type": "module",
          "desc": "<p>The <code>node:repl</code> module exports the <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> class. While running,\ninstances of <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> will accept individual lines of user input,\nevaluate those according to a user-defined evaluation function, then output the\nresult. Input and output may be from <code>stdin</code> and <code>stdout</code>, respectively, or may\nbe connected to any Node.js <a href=\"stream.html\">stream</a>.</p>\n<p>Instances of <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> support automatic completion of inputs,\ncompletion preview, simplistic Emacs-style line editing, multi-line inputs,\n<a href=\"https://en.wikipedia.org/wiki/Z_shell\">ZSH</a>-like reverse-i-search, <a href=\"https://en.wikipedia.org/wiki/Z_shell\">ZSH</a>-like substring-based history search,\nANSI-styled output, saving and restoring current REPL session state, error\nrecovery, and customizable evaluation functions. Terminals that do not support\nANSI styles and Emacs-style line editing automatically fall back to a limited\nfeature set.</p>",
          "modules": [
            {
              "textRaw": "Commands and special keys",
              "name": "commands_and_special_keys",
              "type": "module",
              "desc": "<p>The following special commands are supported by all REPL instances:</p>\n<ul>\n<li><code>.break</code>: When in the process of inputting a multi-line expression, enter\nthe <code>.break</code> command (or press <kbd>Ctrl</kbd>+<kbd>C</kbd>) to abort\nfurther input or processing of that expression.</li>\n<li><code>.clear</code>: Resets the REPL <code>context</code> to an empty object and clears any\nmulti-line expression being input.</li>\n<li><code>.exit</code>: Close the I/O stream, causing the REPL to exit.</li>\n<li><code>.help</code>: Show this list of special commands.</li>\n<li><code>.save</code>: Save the current REPL session to a file:\n<code>> .save ./file/to/save.js</code></li>\n<li><code>.load</code>: Load a file into the current REPL session.\n<code>> .load ./file/to/load.js</code></li>\n<li><code>.editor</code>: Enter editor mode (<kbd>Ctrl</kbd>+<kbd>D</kbd> to\nfinish, <kbd>Ctrl</kbd>+<kbd>C</kbd> to cancel).</li>\n</ul>\n<pre><code class=\"language-console\">> .editor\n// Entering editor mode (^D to finish, ^C to cancel)\nfunction welcome(name) {\n  return `Hello ${name}!`;\n}\n\nwelcome('Node.js User');\n\n// ^D\n'Hello Node.js User!'\n>\n</code></pre>\n<p>The following key combinations in the REPL have these special effects:</p>\n<ul>\n<li><kbd>Ctrl</kbd>+<kbd>C</kbd>: When pressed once, has the same effect as the\n<code>.break</code> command.\nWhen pressed twice on a blank line, has the same effect as the <code>.exit</code>\ncommand.</li>\n<li><kbd>Ctrl</kbd>+<kbd>D</kbd>: Has the same effect as the <code>.exit</code> command.</li>\n<li><kbd>Tab</kbd>: When pressed on a blank line, displays global and local\n(scope) variables. When pressed while entering other input, displays relevant\nautocompletion options.</li>\n</ul>\n<p>For key bindings related to the reverse-i-search, see <a href=\"#reverse-i-search\"><code>reverse-i-search</code></a>.\nFor all other key bindings, see <a href=\"readline.html#tty-keybindings\">TTY keybindings</a>.</p>",
              "displayName": "Commands and special keys"
            },
            {
              "textRaw": "Default evaluation",
              "name": "default_evaluation",
              "type": "module",
              "desc": "<p>By default, all instances of <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> use an evaluation function\nthat evaluates JavaScript expressions and provides access to Node.js built-in\nmodules. This default behavior can be overridden by passing in an alternative\nevaluation function when the <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> instance is created.</p>",
              "modules": [
                {
                  "textRaw": "JavaScript expressions",
                  "name": "javascript_expressions",
                  "type": "module",
                  "desc": "<p>The default evaluator supports direct evaluation of JavaScript expressions:</p>\n<pre><code class=\"language-console\">> 1 + 1\n2\n> const m = 2\nundefined\n> m + 1\n3\n</code></pre>\n<p>Unless otherwise scoped within blocks or functions, variables declared\neither implicitly or using the <code>const</code>, <code>let</code>, or <code>var</code> keywords\nare declared at the global scope.</p>",
                  "displayName": "JavaScript expressions"
                },
                {
                  "textRaw": "Global and local scope",
                  "name": "global_and_local_scope",
                  "type": "module",
                  "desc": "<p>The default evaluator provides access to any variables that exist in the global\nscope. It is possible to expose a variable to the REPL explicitly by assigning\nit to the <code>context</code> object associated with each <code>REPLServer</code>:</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\nconst msg = 'message';\n\nrepl.start('> ').context.m = msg;\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\nconst msg = 'message';\n\nrepl.start('> ').context.m = msg;\n</code></pre>\n<p>Properties in the <code>context</code> object appear as local within the REPL:</p>\n<pre><code class=\"language-console\">$ node repl_test.js\n> m\n'message'\n</code></pre>\n<p>Context properties are not read-only by default. To specify read-only globals,\ncontext properties must be defined using <code>Object.defineProperty()</code>:</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\nconst msg = 'message';\n\nconst r = repl.start('> ');\nObject.defineProperty(r.context, 'm', {\n  configurable: false,\n  enumerable: true,\n  value: msg,\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\nconst msg = 'message';\n\nconst r = repl.start('> ');\nObject.defineProperty(r.context, 'm', {\n  configurable: false,\n  enumerable: true,\n  value: msg,\n});\n</code></pre>",
                  "displayName": "Global and local scope"
                },
                {
                  "textRaw": "Accessing core Node.js modules",
                  "name": "accessing_core_node.js_modules",
                  "type": "module",
                  "desc": "<p>The default evaluator will automatically load Node.js core modules into the\nREPL environment when used. For instance, unless otherwise declared as a\nglobal or scoped variable, the input <code>fs</code> will be evaluated on-demand as\n<code>global.fs = require('node:fs')</code>.</p>\n<pre><code class=\"language-console\">> fs.createReadStream('./some/file');\n</code></pre>",
                  "displayName": "Accessing core Node.js modules"
                },
                {
                  "textRaw": "Global uncaught exceptions",
                  "name": "global_uncaught_exceptions",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": "v12.3.0",
                        "pr-url": "https://github.com/nodejs/node/pull/27151",
                        "description": "The `'uncaughtException'` event is from now on triggered if the repl is used as standalone program."
                      }
                    ]
                  },
                  "desc": "<p>The REPL uses the <a href=\"domain.html\"><code>domain</code></a> module to catch all uncaught exceptions for that\nREPL session.</p>\n<p>This use of the <a href=\"domain.html\"><code>domain</code></a> module in the REPL has these side effects:</p>\n<ul>\n<li>\n<p>Uncaught exceptions only emit the <a href=\"process.html#event-uncaughtexception\"><code>'uncaughtException'</code></a> event in the\nstandalone REPL. Adding a listener for this event in a REPL within\nanother Node.js program results in <a href=\"errors.html#err_invalid_repl_input\"><code>ERR_INVALID_REPL_INPUT</code></a>.</p>\n<pre><code class=\"language-js\">const r = repl.start();\n\nr.write('process.on(\"uncaughtException\", () => console.log(\"Foobar\"));\\n');\n// Output stream includes:\n//   TypeError [ERR_INVALID_REPL_INPUT]: Listeners for `uncaughtException`\n//   cannot be used in the REPL\n\nr.close();\n</code></pre>\n</li>\n<li>\n<p>Trying to use <a href=\"process.html#processsetuncaughtexceptioncapturecallbackfn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> throws\nan <a href=\"errors.html#err_domain_cannot_set_uncaught_exception_capture\"><code>ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE</code></a> error.</p>\n</li>\n</ul>",
                  "displayName": "Global uncaught exceptions"
                },
                {
                  "textRaw": "Assignment of the `_` (underscore) variable",
                  "name": "assignment_of_the_`_`_(underscore)_variable",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": "v9.8.0",
                        "pr-url": "https://github.com/nodejs/node/pull/18919",
                        "description": "Added `_error` support."
                      }
                    ]
                  },
                  "desc": "<p>The default evaluator will, by default, assign the result of the most recently\nevaluated expression to the special variable <code>_</code> (underscore).\nExplicitly setting <code>_</code> to a value will disable this behavior.</p>\n<pre><code class=\"language-console\">> [ 'a', 'b', 'c' ]\n[ 'a', 'b', 'c' ]\n> _.length\n3\n> _ += 1\nExpression assignment to _ now disabled.\n4\n> 1 + 1\n2\n> _\n4\n</code></pre>\n<p>Similarly, <code>_error</code> will refer to the last seen error, if there was any.\nExplicitly setting <code>_error</code> to a value will disable this behavior.</p>\n<pre><code class=\"language-console\">> throw new Error('foo');\nUncaught Error: foo\n> _error.message\n'foo'\n</code></pre>",
                  "displayName": "Assignment of the `_` (underscore) variable"
                },
                {
                  "textRaw": "`await` keyword",
                  "name": "`await`_keyword",
                  "type": "module",
                  "desc": "<p>Support for the <code>await</code> keyword is enabled at the top level.</p>\n<pre><code class=\"language-console\">> await Promise.resolve(123)\n123\n> await Promise.reject(new Error('REPL await'))\nUncaught Error: REPL await\n    at REPL2:1:54\n> const timeout = util.promisify(setTimeout);\nundefined\n> const old = Date.now(); await timeout(1000); console.log(Date.now() - old);\n1002\nundefined\n</code></pre>\n<p>One known limitation of using the <code>await</code> keyword in the REPL is that\nit will invalidate the lexical scoping of the <code>const</code> keywords.</p>\n<p>For example:</p>\n<pre><code class=\"language-console\">> const m = await Promise.resolve(123)\nundefined\n> m\n123\n> m = await Promise.resolve(234)\n234\n// redeclaring the constant does error\n> const m = await Promise.resolve(345)\nUncaught SyntaxError: Identifier 'm' has already been declared\n</code></pre>\n<p><a href=\"cli.html#--no-experimental-repl-await\"><code>--no-experimental-repl-await</code></a> shall disable top-level await in REPL.</p>",
                  "displayName": "`await` keyword"
                }
              ],
              "displayName": "Default evaluation"
            },
            {
              "textRaw": "Reverse-i-search",
              "name": "reverse-i-search",
              "type": "module",
              "meta": {
                "added": [
                  "v13.6.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>The REPL supports bi-directional reverse-i-search similar to <a href=\"https://en.wikipedia.org/wiki/Z_shell\">ZSH</a>. It is\ntriggered with <kbd>Ctrl</kbd>+<kbd>R</kbd> to search backward\nand <kbd>Ctrl</kbd>+<kbd>S</kbd> to search forwards.</p>\n<p>Duplicated history entries will be skipped.</p>\n<p>Entries are accepted as soon as any key is pressed that doesn't correspond\nwith the reverse search. Cancelling is possible by pressing <kbd>Esc</kbd>\nor <kbd>Ctrl</kbd>+<kbd>C</kbd>.</p>\n<p>Changing the direction immediately searches for the next entry in the expected\ndirection from the current position on.</p>",
              "displayName": "Reverse-i-search"
            },
            {
              "textRaw": "Custom evaluation functions",
              "name": "custom_evaluation_functions",
              "type": "module",
              "desc": "<p>When a new <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> is created, a custom evaluation function may be\nprovided. This can be used, for instance, to implement fully customized REPL\napplications.</p>\n<p>An evaluation function accepts the following four arguments:</p>\n<ul>\n<li><code>code</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The code to be executed (e.g. <code>1 + 1</code>).</li>\n<li><code>context</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The context in which the code is executed. This can either be the JavaScript <code>global</code>\ncontext or a context specific to the REPL instance, depending on the <code>useGlobal</code> option.</li>\n<li><code>replResourceName</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> An identifier for the REPL resource associated with the current code\nevaluation. This can be useful for debugging purposes.</li>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> A function to invoke once the code evaluation is complete. The callback takes two parameters:\n<ul>\n<li>An error object to provide if an error occurred during evaluation, or <code>null</code>/<code>undefined</code> if no error occurred.</li>\n<li>The result of the code evaluation (this is not relevant if an error is provided).</li>\n</ul>\n</li>\n</ul>\n<p>The following illustrates an example of a REPL that squares a given number, an error is instead printed\nif the provided input is not actually a number:</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\n\nfunction byThePowerOfTwo(number) {\n  return number * number;\n}\n\nfunction myEval(code, context, replResourceName, callback) {\n  if (isNaN(code)) {\n    callback(new Error(`${code.trim()} is not a number`));\n  } else {\n    callback(null, byThePowerOfTwo(code));\n  }\n}\n\nrepl.start({ prompt: 'Enter a number: ', eval: myEval });\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\n\nfunction byThePowerOfTwo(number) {\n  return number * number;\n}\n\nfunction myEval(code, context, replResourceName, callback) {\n  if (isNaN(code)) {\n    callback(new Error(`${code.trim()} is not a number`));\n  } else {\n    callback(null, byThePowerOfTwo(code));\n  }\n}\n\nrepl.start({ prompt: 'Enter a number: ', eval: myEval });\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Recoverable errors",
                  "name": "recoverable_errors",
                  "type": "module",
                  "desc": "<p>At the REPL prompt, pressing <kbd>Enter</kbd> sends the current line of input to\nthe <code>eval</code> function. In order to support multi-line input, the <code>eval</code> function\ncan return an instance of <code>repl.Recoverable</code> to the provided callback function:</p>\n<pre><code class=\"language-js\">function myEval(cmd, context, filename, callback) {\n  let result;\n  try {\n    result = vm.runInThisContext(cmd);\n  } catch (e) {\n    if (isRecoverableError(e)) {\n      return callback(new repl.Recoverable(e));\n    }\n  }\n  callback(null, result);\n}\n\nfunction isRecoverableError(error) {\n  if (error.name === 'SyntaxError') {\n    return /^(Unexpected end of input|Unexpected token)/.test(error.message);\n  }\n  return false;\n}\n</code></pre>",
                  "displayName": "Recoverable errors"
                }
              ],
              "displayName": "Custom evaluation functions"
            },
            {
              "textRaw": "Customizing REPL output",
              "name": "customizing_repl_output",
              "type": "module",
              "desc": "<p>By default, <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> instances format output using the\n<a href=\"util.html#utilinspectobject-options\"><code>util.inspect()</code></a> method before writing the output to the provided <code>Writable</code>\nstream (<code>process.stdout</code> by default). The <code>showProxy</code> inspection option is set\nto true by default and the <code>colors</code> option is set to true depending on the\nREPL's <code>useColors</code> option.</p>\n<p>The <code>useColors</code> boolean option can be specified at construction to instruct the\ndefault writer to use ANSI style codes to colorize the output from the\n<code>util.inspect()</code> method.</p>\n<p>If the REPL is run as standalone program, it is also possible to change the\nREPL's <a href=\"util.html#utilinspectobject-options\">inspection defaults</a> from inside the REPL by using the\n<code>inspect.replDefaults</code> property which mirrors the <code>defaultOptions</code> from\n<a href=\"util.html#utilinspectobject-options\"><code>util.inspect()</code></a>.</p>\n<pre><code class=\"language-console\">> util.inspect.replDefaults.compact = false;\nfalse\n> [1]\n[\n  1\n]\n>\n</code></pre>\n<p>To fully customize the output of a <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> instance pass in a new\nfunction for the <code>writer</code> option on construction. The following example, for\ninstance, simply converts any input text to upper case:</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\n\nconst r = repl.start({ prompt: '> ', eval: myEval, writer: myWriter });\n\nfunction myEval(cmd, context, filename, callback) {\n  callback(null, cmd);\n}\n\nfunction myWriter(output) {\n  return output.toUpperCase();\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\n\nconst r = repl.start({ prompt: '> ', eval: myEval, writer: myWriter });\n\nfunction myEval(cmd, context, filename, callback) {\n  callback(null, cmd);\n}\n\nfunction myWriter(output) {\n  return output.toUpperCase();\n}\n</code></pre>",
              "displayName": "Customizing REPL output"
            }
          ],
          "displayName": "Design and features"
        },
        {
          "textRaw": "The Node.js REPL",
          "name": "the_node.js_repl",
          "type": "module",
          "desc": "<p>Node.js itself uses the <code>node:repl</code> module to provide its own interactive\ninterface for executing JavaScript. This can be used by executing the Node.js\nbinary without passing any arguments (or by passing the <code>-i</code> argument):</p>\n<pre><code class=\"language-console\">$ node\n> const a = [1, 2, 3];\nundefined\n> a\n[ 1, 2, 3 ]\n> a.forEach((v) => {\n...   console.log(v);\n...   });\n1\n2\n3\n</code></pre>",
          "modules": [
            {
              "textRaw": "Environment variable options",
              "name": "environment_variable_options",
              "type": "module",
              "desc": "<p>Various behaviors of the Node.js REPL can be customized using the following\nenvironment variables:</p>\n<ul>\n<li><code>NODE_REPL_HISTORY</code>: When a valid path is given, persistent REPL history\nwill be saved to the specified file rather than <code>.node_repl_history</code> in the\nuser's home directory. Setting this value to <code>''</code> (an empty string) will\ndisable persistent REPL history. Whitespace will be trimmed from the value.\nOn Windows platforms environment variables with empty values are invalid so\nset this variable to one or more spaces to disable persistent REPL history.</li>\n<li><code>NODE_REPL_HISTORY_SIZE</code>: Controls how many lines of history will be\npersisted if history is available. Must be a positive number.\n<strong>Default:</strong> <code>1000</code>.</li>\n<li><code>NODE_REPL_MODE</code>: May be either <code>'sloppy'</code> or <code>'strict'</code>. <strong>Default:</strong>\n<code>'sloppy'</code>, which will allow non-strict mode code to be run.</li>\n</ul>",
              "displayName": "Environment variable options"
            },
            {
              "textRaw": "Persistent history",
              "name": "persistent_history",
              "type": "module",
              "desc": "<p>By default, the Node.js REPL will persist history between <code>node</code> REPL sessions\nby saving inputs to a <code>.node_repl_history</code> file located in the user's home\ndirectory. This can be disabled by setting the environment variable\n<code>NODE_REPL_HISTORY=''</code>.</p>",
              "displayName": "Persistent history"
            },
            {
              "textRaw": "Using the Node.js REPL with advanced line-editors",
              "name": "using_the_node.js_repl_with_advanced_line-editors",
              "type": "module",
              "desc": "<p>For advanced line-editors, start Node.js with the environment variable\n<code>NODE_NO_READLINE=1</code>. This will start the main and debugger REPL in canonical\nterminal settings, which will allow use with <code>rlwrap</code>.</p>\n<p>For example, the following can be added to a <code>.bashrc</code> file:</p>\n<pre><code class=\"language-bash\">alias node=\"env NODE_NO_READLINE=1 rlwrap node\"\n</code></pre>",
              "displayName": "Using the Node.js REPL with advanced line-editors"
            },
            {
              "textRaw": "Starting multiple REPL instances in the same process",
              "name": "starting_multiple_repl_instances_in_the_same_process",
              "type": "module",
              "desc": "<p>It is possible to create and run multiple REPL instances against a single\nrunning instance of Node.js that share a single <code>global</code> object (by setting\nthe <code>useGlobal</code> option to <code>true</code>) but have separate I/O interfaces.</p>\n<p>The following example, for instance, provides separate REPLs on <code>stdin</code>, a Unix\nsocket, and a TCP socket, all sharing the same <code>global</code> object:</p>\n<pre><code class=\"language-mjs\">import net from 'node:net';\nimport repl from 'node:repl';\nimport process from 'node:process';\nimport fs from 'node:fs';\n\nlet connections = 0;\n\nrepl.start({\n  prompt: 'Node.js via stdin> ',\n  useGlobal: true,\n  input: process.stdin,\n  output: process.stdout,\n});\n\nconst unixSocketPath = '/tmp/node-repl-sock';\n\n// If the socket file already exists let's remove it\nfs.rmSync(unixSocketPath, { force: true });\n\nnet.createServer((socket) => {\n  connections += 1;\n  repl.start({\n    prompt: 'Node.js via Unix socket> ',\n    useGlobal: true,\n    input: socket,\n    output: socket,\n  }).on('exit', () => {\n    socket.end();\n  });\n}).listen(unixSocketPath);\n\nnet.createServer((socket) => {\n  connections += 1;\n  repl.start({\n    prompt: 'Node.js via TCP socket> ',\n    useGlobal: true,\n    input: socket,\n    output: socket,\n  }).on('exit', () => {\n    socket.end();\n  });\n}).listen(5001);\n</code></pre>\n<pre><code class=\"language-cjs\">const net = require('node:net');\nconst repl = require('node:repl');\nconst fs = require('node:fs');\n\nlet connections = 0;\n\nrepl.start({\n  prompt: 'Node.js via stdin> ',\n  useGlobal: true,\n  input: process.stdin,\n  output: process.stdout,\n});\n\nconst unixSocketPath = '/tmp/node-repl-sock';\n\n// If the socket file already exists let's remove it\nfs.rmSync(unixSocketPath, { force: true });\n\nnet.createServer((socket) => {\n  connections += 1;\n  repl.start({\n    prompt: 'Node.js via Unix socket> ',\n    useGlobal: true,\n    input: socket,\n    output: socket,\n  }).on('exit', () => {\n    socket.end();\n  });\n}).listen(unixSocketPath);\n\nnet.createServer((socket) => {\n  connections += 1;\n  repl.start({\n    prompt: 'Node.js via TCP socket> ',\n    useGlobal: true,\n    input: socket,\n    output: socket,\n  }).on('exit', () => {\n    socket.end();\n  });\n}).listen(5001);\n</code></pre>\n<p>Running this application from the command line will start a REPL on stdin.\nOther REPL clients may connect through the Unix socket or TCP socket. <code>telnet</code>,\nfor instance, is useful for connecting to TCP sockets, while <code>socat</code> can be used\nto connect to both Unix and TCP sockets.</p>\n<p>By starting a REPL from a Unix socket-based server instead of stdin, it is\npossible to connect to a long-running Node.js process without restarting it.</p>",
              "displayName": "Starting multiple REPL instances in the same process"
            },
            {
              "textRaw": "Examples",
              "name": "examples",
              "type": "module",
              "modules": [
                {
                  "textRaw": "Full-featured \"terminal\" REPL over `net.Server` and `net.Socket`",
                  "name": "full-featured_\"terminal\"_repl_over_`net.server`_and_`net.socket`",
                  "type": "module",
                  "desc": "<p>This is an example on how to run a \"full-featured\" (terminal) REPL using\n<a href=\"net.html#class-netserver\"><code>net.Server</code></a> and <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a></p>\n<p>The following script starts an HTTP server on port <code>1337</code> that allows\nclients to establish socket connections to its REPL instance.</p>\n<pre><code class=\"language-mjs\">// repl-server.js\nimport repl from 'node:repl';\nimport net from 'node:net';\n\nnet\n  .createServer((socket) => {\n    const r = repl.start({\n      prompt: `socket ${socket.remoteAddress}:${socket.remotePort}> `,\n      input: socket,\n      output: socket,\n      terminal: true,\n      useGlobal: false,\n    });\n    r.on('exit', () => {\n      socket.end();\n    });\n    r.context.socket = socket;\n  })\n  .listen(1337);\n</code></pre>\n<pre><code class=\"language-cjs\">// repl-server.js\nconst repl = require('node:repl');\nconst net = require('node:net');\n\nnet\n  .createServer((socket) => {\n    const r = repl.start({\n      prompt: `socket ${socket.remoteAddress}:${socket.remotePort}> `,\n      input: socket,\n      output: socket,\n      terminal: true,\n      useGlobal: false,\n    });\n    r.on('exit', () => {\n      socket.end();\n    });\n    r.context.socket = socket;\n  })\n  .listen(1337);\n</code></pre>\n<p>While the following implements a client that can create a socket connection\nwith the above defined server over port <code>1337</code>.</p>\n<pre><code class=\"language-mjs\">// repl-client.js\nimport net from 'node:net';\nimport process from 'node:process';\n\nconst sock = net.connect(1337);\n\nprocess.stdin.pipe(sock);\nsock.pipe(process.stdout);\n\nsock.on('connect', () => {\n  process.stdin.resume();\n  process.stdin.setRawMode(true);\n});\n\nsock.on('close', () => {\n  process.stdin.setRawMode(false);\n  process.stdin.pause();\n  sock.removeListener('close', done);\n});\n\nprocess.stdin.on('end', () => {\n  sock.destroy();\n  console.log();\n});\n\nprocess.stdin.on('data', (b) => {\n  if (b.length === 1 &#x26;&#x26; b[0] === 4) {\n    process.stdin.emit('end');\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// repl-client.js\nconst net = require('node:net');\n\nconst sock = net.connect(1337);\n\nprocess.stdin.pipe(sock);\nsock.pipe(process.stdout);\n\nsock.on('connect', () => {\n  process.stdin.resume();\n  process.stdin.setRawMode(true);\n});\n\nsock.on('close', () => {\n  process.stdin.setRawMode(false);\n  process.stdin.pause();\n  sock.removeListener('close', done);\n});\n\nprocess.stdin.on('end', () => {\n  sock.destroy();\n  console.log();\n});\n\nprocess.stdin.on('data', (b) => {\n  if (b.length === 1 &#x26;&#x26; b[0] === 4) {\n    process.stdin.emit('end');\n  }\n});\n</code></pre>\n<p>To run the example open two different terminals on your machine, start the server\nwith <code>node repl-server.js</code> in one terminal and <code>node repl-client.js</code> on the other.</p>\n<p>Original code from <a href=\"https://gist.github.com/TooTallNate/2209310\">https://gist.github.com/TooTallNate/2209310</a>.</p>",
                  "displayName": "Full-featured \"terminal\" REPL over `net.Server` and `net.Socket`"
                },
                {
                  "textRaw": "REPL over `curl`",
                  "name": "repl_over_`curl`",
                  "type": "module",
                  "desc": "<p>This is an example on how to run a REPL instance over <a href=\"https://curl.haxx.se/docs/manpage.html\"><code>curl()</code></a></p>\n<p>The following script starts an HTTP server on port <code>8000</code> that can accept\na connection established via <a href=\"https://curl.haxx.se/docs/manpage.html\"><code>curl()</code></a>.</p>\n<pre><code class=\"language-mjs\">import http from 'node:http';\nimport repl from 'node:repl';\n\nconst server = http.createServer((req, res) => {\n  res.setHeader('content-type', 'multipart/octet-stream');\n\n  repl.start({\n    prompt: 'curl repl> ',\n    input: req,\n    output: res,\n    terminal: false,\n    useColors: true,\n    useGlobal: false,\n  });\n});\n\nserver.listen(8000);\n</code></pre>\n<pre><code class=\"language-cjs\">const http = require('node:http');\nconst repl = require('node:repl');\n\nconst server = http.createServer((req, res) => {\n  res.setHeader('content-type', 'multipart/octet-stream');\n\n  repl.start({\n    prompt: 'curl repl> ',\n    input: req,\n    output: res,\n    terminal: false,\n    useColors: true,\n    useGlobal: false,\n  });\n});\n\nserver.listen(8000);\n</code></pre>\n<p>When the above script is running you can then use <a href=\"https://curl.haxx.se/docs/manpage.html\"><code>curl()</code></a> to connect to\nthe server and connect to its REPL instance by running <code>curl --no-progress-meter -sSNT. localhost:8000</code>.</p>\n<p><strong>Warning</strong> This example is intended purely for educational purposes to demonstrate how\nNode.js REPLs can be started using different I/O streams.\nIt should <strong>not</strong> be used in production environments or any context where security\nis a concern without additional protective measures.\nIf you need to implement REPLs in a real-world application, consider alternative\napproaches that mitigate these risks, such as using secure input mechanisms and\navoiding open network interfaces.</p>\n<p>Original code from <a href=\"https://gist.github.com/TooTallNate/2053342\">https://gist.github.com/TooTallNate/2053342</a>.</p>",
                  "displayName": "REPL over `curl`"
                }
              ],
              "displayName": "Examples"
            }
          ],
          "displayName": "The Node.js REPL"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `REPLServer`",
          "name": "REPLServer",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.91"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> See <a href=\"#replstartoptions\"><code>repl.start()</code></a></li>\n<li>Extends: <a href=\"readline.html#class-readlineinterface\"><code>&#x3C;readline.Interface></code></a></li>\n</ul>\n<p>Instances of <code>repl.REPLServer</code> are created using the <a href=\"#replstartoptions\"><code>repl.start()</code></a> method\nor directly using the JavaScript <code>new</code> keyword.</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\n\nconst options = { useColors: true };\n\nconst firstInstance = repl.start(options);\nconst secondInstance = new repl.REPLServer(options);\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\n\nconst options = { useColors: true };\n\nconst firstInstance = repl.start(options);\nconst secondInstance = new repl.REPLServer(options);\n</code></pre>",
          "events": [
            {
              "textRaw": "Event: `'exit'`",
              "name": "exit",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'exit'</code> event is emitted when the REPL is exited either by receiving the\n<code>.exit</code> command as input, the user pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> twice\nto signal <code>SIGINT</code>,\nor by pressing <kbd>Ctrl</kbd>+<kbd>D</kbd> to signal <code>'end'</code> on the input\nstream. The listener\ncallback is invoked without any arguments.</p>\n<pre><code class=\"language-js\">replServer.on('exit', () => {\n  console.log('Received \"exit\" event from repl!');\n  process.exit();\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'reset'`",
              "name": "reset",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'reset'</code> event is emitted when the REPL's context is reset. This occurs\nwhenever the <code>.clear</code> command is received as input <em>unless</em> the REPL is using\nthe default evaluator and the <code>repl.REPLServer</code> instance was created with the\n<code>useGlobal</code> option set to <code>true</code>. The listener callback will be called with a\nreference to the <code>context</code> object as the only argument.</p>\n<p>This can be used primarily to re-initialize REPL context to some pre-defined\nstate:</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\n\nfunction initializeContext(context) {\n  context.m = 'test';\n}\n\nconst r = repl.start({ prompt: '> ' });\ninitializeContext(r.context);\n\nr.on('reset', initializeContext);\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\n\nfunction initializeContext(context) {\n  context.m = 'test';\n}\n\nconst r = repl.start({ prompt: '> ' });\ninitializeContext(r.context);\n\nr.on('reset', initializeContext);\n</code></pre>\n<p>When this code is executed, the global <code>'m'</code> variable can be modified but then\nreset to its initial value using the <code>.clear</code> command:</p>\n<pre><code class=\"language-console\">$ ./node example.js\n> m\n'test'\n> m = 1\n1\n> m\n1\n> .clear\nClearing context...\n> m\n'test'\n>\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`replServer.defineCommand(keyword, cmd)`",
              "name": "defineCommand",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`keyword` {string} The command keyword (_without_ a leading `.` character).",
                      "name": "keyword",
                      "type": "string",
                      "desc": "The command keyword (_without_ a leading `.` character)."
                    },
                    {
                      "textRaw": "`cmd` {Object|Function} The function to invoke when the command is processed.",
                      "name": "cmd",
                      "type": "Object|Function",
                      "desc": "The function to invoke when the command is processed."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>replServer.defineCommand()</code> method is used to add new <code>.</code>-prefixed commands\nto the REPL instance. Such commands are invoked by typing a <code>.</code> followed by the\n<code>keyword</code>. The <code>cmd</code> is either a <code>Function</code> or an <code>Object</code> with the following\nproperties:</p>\n<ul>\n<li><code>help</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Help text to be displayed when <code>.help</code> is entered (Optional).</li>\n<li><code>action</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> The function to execute, optionally accepting a single\nstring argument.</li>\n</ul>\n<p>The following example shows two new commands added to the REPL instance:</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\n\nconst replServer = repl.start({ prompt: '> ' });\nreplServer.defineCommand('sayhello', {\n  help: 'Say hello',\n  action(name) {\n    this.clearBufferedCommand();\n    console.log(`Hello, ${name}!`);\n    this.displayPrompt();\n  },\n});\nreplServer.defineCommand('saybye', function saybye() {\n  console.log('Goodbye!');\n  this.close();\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\n\nconst replServer = repl.start({ prompt: '> ' });\nreplServer.defineCommand('sayhello', {\n  help: 'Say hello',\n  action(name) {\n    this.clearBufferedCommand();\n    console.log(`Hello, ${name}!`);\n    this.displayPrompt();\n  },\n});\nreplServer.defineCommand('saybye', function saybye() {\n  console.log('Goodbye!');\n  this.close();\n});\n</code></pre>\n<p>The new commands can then be used from within the REPL instance:</p>\n<pre><code class=\"language-console\">> .sayhello Node.js User\nHello, Node.js User!\n> .saybye\nGoodbye!\n</code></pre>"
            },
            {
              "textRaw": "`replServer.displayPrompt([preserveCursor])`",
              "name": "displayPrompt",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.91"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`preserveCursor` {boolean}",
                      "name": "preserveCursor",
                      "type": "boolean",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>replServer.displayPrompt()</code> method readies the REPL instance for input\nfrom the user, printing the configured <code>prompt</code> to a new line in the <code>output</code>\nand resuming the <code>input</code> to accept new input.</p>\n<p>When multi-line input is being entered, a pipe <code>'|'</code> is printed rather than the\n'prompt'.</p>\n<p>When <code>preserveCursor</code> is <code>true</code>, the cursor placement will not be reset to <code>0</code>.</p>\n<p>The <code>replServer.displayPrompt</code> method is primarily intended to be called from\nwithin the action function for commands registered using the\n<code>replServer.defineCommand()</code> method.</p>"
            },
            {
              "textRaw": "`replServer.clearBufferedCommand()`",
              "name": "clearBufferedCommand",
              "type": "method",
              "meta": {
                "added": [
                  "v9.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>The <code>replServer.clearBufferedCommand()</code> method clears any command that has been\nbuffered but not yet executed. This method is primarily intended to be\ncalled from within the action function for commands registered using the\n<code>replServer.defineCommand()</code> method.</p>"
            },
            {
              "textRaw": "`replServer.setupHistory(historyConfig, callback)`",
              "name": "setupHistory",
              "type": "method",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58225",
                    "description": "Updated the `historyConfig` parameter to accept an object with `filePath`, `size`, `removeHistoryDuplicates` and `onHistoryFileLoaded` properties."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`historyConfig` {Object|string} the path to the history file If it is a string, it is the path to the history file. If it is an object, it can have the following properties:",
                      "name": "historyConfig",
                      "type": "Object|string",
                      "desc": "the path to the history file If it is a string, it is the path to the history file. If it is an object, it can have the following properties:",
                      "options": [
                        {
                          "textRaw": "`filePath` {string} the path to the history file",
                          "name": "filePath",
                          "type": "string",
                          "desc": "the path to the history file"
                        },
                        {
                          "textRaw": "`size` {number} Maximum number of history lines retained. To disable the history set this value to `0`. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all. **Default:** `30`.",
                          "name": "size",
                          "type": "number",
                          "default": "`30`",
                          "desc": "Maximum number of history lines retained. To disable the history set this value to `0`. This option makes sense only if `terminal` is set to `true` by the user or by an internal `output` check, otherwise the history caching mechanism is not initialized at all."
                        },
                        {
                          "textRaw": "`removeHistoryDuplicates` {boolean} If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list. **Default:** `false`.",
                          "name": "removeHistoryDuplicates",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, when a new input line added to the history list duplicates an older one, this removes the older line from the list."
                        },
                        {
                          "textRaw": "`onHistoryFileLoaded` {Function} called when history writes are ready or upon error",
                          "name": "onHistoryFileLoaded",
                          "type": "Function",
                          "desc": "called when history writes are ready or upon error",
                          "options": [
                            {
                              "textRaw": "`err` {Error}",
                              "name": "err",
                              "type": "Error"
                            },
                            {
                              "textRaw": "`repl` {repl.REPLServer}",
                              "name": "repl",
                              "type": "repl.REPLServer"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function} called when history writes are ready or upon error (Optional if provided as `onHistoryFileLoaded` in `historyConfig`)",
                      "name": "callback",
                      "type": "Function",
                      "desc": "called when history writes are ready or upon error (Optional if provided as `onHistoryFileLoaded` in `historyConfig`)",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`repl` {repl.REPLServer}",
                          "name": "repl",
                          "type": "repl.REPLServer"
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Initializes a history log file for the REPL instance. When executing the\nNode.js binary and using the command-line REPL, a history file is initialized\nby default. However, this is not the case when creating a REPL\nprogrammatically. Use this method to initialize a history log file when working\nwith REPL instances programmatically.</p>"
            }
          ]
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {string[]}",
          "name": "builtinModules",
          "type": "string[]",
          "meta": {
            "added": [
              "v14.5.0"
            ],
            "changes": [],
            "deprecated": [
              "v24.0.0",
              "v22.16.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated. Use `module.builtinModules` instead.",
          "desc": "<p>A list of the names of some Node.js modules, e.g., <code>'http'</code>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/repl-builtin-modules\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/repl-builtin-modules\n</code></pre>"
        }
      ],
      "methods": [
        {
          "textRaw": "`repl.start([options])`",
          "name": "start",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.91"
            ],
            "changes": [
              {
                "version": "v25.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/62188",
                "description": "The `handleError` parameter has been added."
              },
              {
                "version": "v24.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/58003",
                "description": "Added the possibility to add/edit/remove multilines while adding a multiline command."
              },
              {
                "version": "v24.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/57400",
                "description": "The multi-line indicator is now \"|\" instead of \"...\". Added support for multi-line history. It is now possible to \"fix\" multi-line commands with syntax errors by visiting the history and editing the command. When visiting the multiline history from an old node version, the multiline structure is not preserved."
              },
              {
                "version": [
                  "v13.4.0",
                  "v12.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/30811",
                "description": "The `preview` option is now available."
              },
              {
                "version": "v12.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/26518",
                "description": "The `terminal` option now follows the default description in all cases and `useColors` checks `hasColors()` if available."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/19187",
                "description": "The `REPL_MAGIC_MODE` `replMode` was removed."
              },
              {
                "version": "v6.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/6635",
                "description": "The `breakEvalOnSigint` option is supported now."
              },
              {
                "version": "v5.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/5388",
                "description": "The `options` parameter is optional now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object|string}",
                  "name": "options",
                  "type": "Object|string",
                  "options": [
                    {
                      "textRaw": "`prompt` {string} The input prompt to display. **Default:** `'> '` (with a trailing space).",
                      "name": "prompt",
                      "type": "string",
                      "default": "`'> '` (with a trailing space)",
                      "desc": "The input prompt to display."
                    },
                    {
                      "textRaw": "`input` {stream.Readable} The `Readable` stream from which REPL input will be read. **Default:** `process.stdin`.",
                      "name": "input",
                      "type": "stream.Readable",
                      "default": "`process.stdin`",
                      "desc": "The `Readable` stream from which REPL input will be read."
                    },
                    {
                      "textRaw": "`output` {stream.Writable} The `Writable` stream to which REPL output will be written. **Default:** `process.stdout`.",
                      "name": "output",
                      "type": "stream.Writable",
                      "default": "`process.stdout`",
                      "desc": "The `Writable` stream to which REPL output will be written."
                    },
                    {
                      "textRaw": "`terminal` {boolean} If `true`, specifies that the `output` should be treated as a TTY terminal. **Default:** checking the value of the `isTTY` property on the `output` stream upon instantiation.",
                      "name": "terminal",
                      "type": "boolean",
                      "default": "checking the value of the `isTTY` property on the `output` stream upon instantiation",
                      "desc": "If `true`, specifies that the `output` should be treated as a TTY terminal."
                    },
                    {
                      "textRaw": "`eval` {Function} The function to be used when evaluating each given line of input. **Default:** an async wrapper for the JavaScript `eval()` function. An `eval` function can error with `repl.Recoverable` to indicate the input was incomplete and prompt for additional lines. See the custom evaluation functions section for more details.",
                      "name": "eval",
                      "type": "Function",
                      "default": "an async wrapper for the JavaScript `eval()` function. An `eval` function can error with `repl.Recoverable` to indicate the input was incomplete and prompt for additional lines. See the custom evaluation functions section for more details",
                      "desc": "The function to be used when evaluating each given line of input."
                    },
                    {
                      "textRaw": "`useColors` {boolean} If `true`, specifies that the default `writer` function should include ANSI color styling to REPL output. If a custom `writer` function is provided then this has no effect. **Default:** checking color support on the `output` stream if the REPL instance's `terminal` value is `true`.",
                      "name": "useColors",
                      "type": "boolean",
                      "default": "checking color support on the `output` stream if the REPL instance's `terminal` value is `true`",
                      "desc": "If `true`, specifies that the default `writer` function should include ANSI color styling to REPL output. If a custom `writer` function is provided then this has no effect."
                    },
                    {
                      "textRaw": "`useGlobal` {boolean} If `true`, specifies that the default evaluation function will use the JavaScript `global` as the context as opposed to creating a new separate context for the REPL instance. The node CLI REPL sets this value to `true`. **Default:** `false`.",
                      "name": "useGlobal",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, specifies that the default evaluation function will use the JavaScript `global` as the context as opposed to creating a new separate context for the REPL instance. The node CLI REPL sets this value to `true`."
                    },
                    {
                      "textRaw": "`ignoreUndefined` {boolean} If `true`, specifies that the default writer will not output the return value of a command if it evaluates to `undefined`. **Default:** `false`.",
                      "name": "ignoreUndefined",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, specifies that the default writer will not output the return value of a command if it evaluates to `undefined`."
                    },
                    {
                      "textRaw": "`writer` {Function} The function to invoke to format the output of each command before writing to `output`. **Default:** `util.inspect()`.",
                      "name": "writer",
                      "type": "Function",
                      "default": "`util.inspect()`",
                      "desc": "The function to invoke to format the output of each command before writing to `output`."
                    },
                    {
                      "textRaw": "`completer` {Function} An optional function used for custom Tab auto completion. See `readline.InterfaceCompleter` for an example.",
                      "name": "completer",
                      "type": "Function",
                      "desc": "An optional function used for custom Tab auto completion. See `readline.InterfaceCompleter` for an example."
                    },
                    {
                      "textRaw": "`replMode` {symbol} A flag that specifies whether the default evaluator executes all JavaScript commands in strict mode or default (sloppy) mode. Acceptable values are:",
                      "name": "replMode",
                      "type": "symbol",
                      "desc": "A flag that specifies whether the default evaluator executes all JavaScript commands in strict mode or default (sloppy) mode. Acceptable values are:",
                      "options": [
                        {
                          "textRaw": "`repl.REPL_MODE_SLOPPY` to evaluate expressions in sloppy mode.",
                          "name": "repl.REPL_MODE_SLOPPY",
                          "desc": "to evaluate expressions in sloppy mode."
                        },
                        {
                          "textRaw": "`repl.REPL_MODE_STRICT` to evaluate expressions in strict mode. This is equivalent to prefacing every repl statement with `'use strict'`.",
                          "name": "repl.REPL_MODE_STRICT",
                          "desc": "to evaluate expressions in strict mode. This is equivalent to prefacing every repl statement with `'use strict'`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`breakEvalOnSigint` {boolean} Stop evaluating the current piece of code when `SIGINT` is received, such as when <kbd>Ctrl</kbd>+<kbd>C</kbd> is pressed. This cannot be used together with a custom `eval` function. **Default:** `false`.",
                      "name": "breakEvalOnSigint",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Stop evaluating the current piece of code when `SIGINT` is received, such as when <kbd>Ctrl</kbd>+<kbd>C</kbd> is pressed. This cannot be used together with a custom `eval` function."
                    },
                    {
                      "textRaw": "`preview` {boolean} Defines if the repl prints autocomplete and output previews or not. **Default:** `true` with the default eval function and `false` in case a custom eval function is used. If `terminal` is falsy, then there are no previews and the value of `preview` has no effect.",
                      "name": "preview",
                      "type": "boolean",
                      "default": "`true` with the default eval function and `false` in case a custom eval function is used. If `terminal` is falsy, then there are no previews and the value of `preview` has no effect",
                      "desc": "Defines if the repl prints autocomplete and output previews or not."
                    },
                    {
                      "textRaw": "`handleError` {Function} This function customizes error handling in the REPL. It receives the thrown exception as its first argument and must return one of the following values synchronously:",
                      "name": "handleError",
                      "type": "Function",
                      "desc": "This function customizes error handling in the REPL. It receives the thrown exception as its first argument and must return one of the following values synchronously:",
                      "options": [
                        {
                          "textRaw": "`'print'` to print the error to the output stream (default behavior).",
                          "desc": "`'print'` to print the error to the output stream (default behavior)."
                        },
                        {
                          "textRaw": "`'ignore'` to skip all remaining error handling.",
                          "desc": "`'ignore'` to skip all remaining error handling."
                        },
                        {
                          "textRaw": "`'unhandled'` to treat the exception as fully unhandled. In this case, the error will be passed to process-wide exception handlers, such as the `'uncaughtException'` event. The `'unhandled'` value may or may not be desirable in situations where the `REPLServer` instance has been closed, depending on the particular use case.",
                          "desc": "`'unhandled'` to treat the exception as fully unhandled. In this case, the error will be passed to process-wide exception handlers, such as the `'uncaughtException'` event. The `'unhandled'` value may or may not be desirable in situations where the `REPLServer` instance has been closed, depending on the particular use case."
                        }
                      ]
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {repl.REPLServer}",
                "name": "return",
                "type": "repl.REPLServer"
              }
            }
          ],
          "desc": "<p>The <code>repl.start()</code> method creates and starts a <a href=\"#class-replserver\"><code>repl.REPLServer</code></a> instance.</p>\n<p>If <code>options</code> is a string, then it specifies the input prompt:</p>\n<pre><code class=\"language-mjs\">import repl from 'node:repl';\n\n// a Unix style prompt\nrepl.start('$ ');\n</code></pre>\n<pre><code class=\"language-cjs\">const repl = require('node:repl');\n\n// a Unix style prompt\nrepl.start('$ ');\n</code></pre>"
        }
      ],
      "displayName": "REPL",
      "source": "doc/api/repl.md"
    },
    {
      "textRaw": "Single executable applications",
      "name": "single_executable_applications",
      "introduced_in": "v19.7.0",
      "type": "module",
      "meta": {
        "added": [
          "v19.7.0",
          "v18.16.0"
        ],
        "changes": [
          {
            "version": "v25.5.0",
            "pr-url": "https://github.com/nodejs/node/pull/61167",
            "description": "Added built-in single executable application generation via the CLI flag `--build-sea`."
          },
          {
            "version": "v20.6.0",
            "pr-url": "https://github.com/nodejs/node/pull/46824",
            "description": "Added support for \"useSnapshot\"."
          },
          {
            "version": "v20.6.0",
            "pr-url": "https://github.com/nodejs/node/pull/48191",
            "description": "Added support for \"useCodeCache\"."
          }
        ]
      },
      "stability": 1.1,
      "stabilityText": "Active development",
      "desc": "<p>This feature allows the distribution of a Node.js application conveniently to a\nsystem that does not have Node.js installed.</p>\n<p>Node.js supports the creation of <a href=\"https://github.com/nodejs/single-executable\">single executable applications</a> by allowing\nthe injection of a blob prepared by Node.js, which can contain a bundled script,\ninto the <code>node</code> binary. During start up, the program checks if anything has been\ninjected. If the blob is found, it executes the script in the blob. Otherwise\nNode.js operates as it normally does.</p>\n<p>The single executable application feature supports running a\nsingle embedded script using the <a href=\"modules.html#modules-commonjs-modules\">CommonJS</a> or the <a href=\"esm.html#modules-ecmascript-modules\">ECMAScript Modules</a> module system.</p>\n<p>Users can create a single executable application from their bundled script\nwith the <code>node</code> binary itself and any tool which can inject resources into the\nbinary.</p>\n<ol>\n<li>\n<p>Create a JavaScript file:</p>\n<pre><code class=\"language-bash\">echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js\n</code></pre>\n</li>\n<li>\n<p>Create a configuration file building a blob that can be injected into the\nsingle executable application (see\n<a href=\"#1-generating-single-executable-preparation-blobs\">Generating single executable preparation blobs</a> for details):</p>\n<ul>\n<li>On systems other than Windows:</li>\n</ul>\n<pre><code class=\"language-bash\">echo '{ \"main\": \"hello.js\", \"output\": \"sea\" }' > sea-config.json\n</code></pre>\n<ul>\n<li>On Windows:</li>\n</ul>\n<pre><code class=\"language-bash\">echo '{ \"main\": \"hello.js\", \"output\": \"sea.exe\" }' > sea-config.json\n</code></pre>\n<p>The <code>.exe</code> extension is necessary.</p>\n</li>\n<li>\n<p>Generate the target executable:</p>\n<pre><code class=\"language-bash\">node --build-sea sea-config.json\n</code></pre>\n</li>\n<li>\n<p>Sign the binary (macOS and Windows only):</p>\n<ul>\n<li>On macOS:</li>\n</ul>\n<pre><code class=\"language-bash\">codesign --sign - hello\n</code></pre>\n<ul>\n<li>On Windows (optional):</li>\n</ul>\n<p>A certificate needs to be present for this to work. However, the unsigned\nbinary would still be runnable.</p>\n<pre><code class=\"language-powershell\">signtool sign /fd SHA256 hello.exe\n</code></pre>\n</li>\n<li>\n<p>Run the binary:</p>\n<ul>\n<li>On systems other than Windows</li>\n</ul>\n<pre><code class=\"language-console\">$ ./hello world\nHello, world!\n</code></pre>\n<ul>\n<li>On Windows</li>\n</ul>\n<pre><code class=\"language-console\">$ .\\hello.exe world\nHello, world!\n</code></pre>\n</li>\n</ol>",
      "modules": [
        {
          "textRaw": "Generating single executable applications with `--build-sea`",
          "name": "generating_single_executable_applications_with_`--build-sea`",
          "type": "module",
          "desc": "<p>To generate a single executable application directly, the <code>--build-sea</code> flag can be\nused. It takes a path to a configuration file in JSON format. If the path passed to it\nisn't absolute, Node.js will use the path relative to the current working directory.</p>\n<p>The configuration currently reads the following top-level fields:</p>\n<pre><code class=\"language-json\">{\n  \"main\": \"/path/to/bundled/script.js\",\n  \"mainFormat\": \"commonjs\", // Default: \"commonjs\", options: \"commonjs\", \"module\"\n  \"executable\": \"/path/to/node/binary\", // Optional, if not specified, uses the current Node.js binary\n  \"output\": \"/path/to/write/the/generated/executable\",\n  \"disableExperimentalSEAWarning\": true, // Default: false\n  \"useSnapshot\": false,  // Default: false\n  \"useCodeCache\": true, // Default: false\n  \"execArgv\": [\"--no-warnings\", \"--max-old-space-size=4096\"], // Optional\n  \"execArgvExtension\": \"env\", // Default: \"env\", options: \"none\", \"env\", \"cli\"\n  \"assets\": {  // Optional\n    \"a.dat\": \"/path/to/a.dat\",\n    \"b.txt\": \"/path/to/b.txt\"\n  }\n}\n</code></pre>\n<p>If the paths are not absolute, Node.js will use the path relative to the\ncurrent working directory. The version of the Node.js binary used to produce\nthe blob must be the same as the one to which the blob will be injected.</p>\n<p>Note: When generating cross-platform SEAs (e.g., generating a SEA\nfor <code>linux-x64</code> on <code>darwin-arm64</code>), <code>useCodeCache</code> and <code>useSnapshot</code>\nmust be set to false to avoid generating incompatible executables.\nSince code cache and snapshots can only be loaded on the same platform\nwhere they are compiled, the generated executable might crash on startup when\ntrying to load code cache or snapshots built on a different platform.</p>",
          "modules": [
            {
              "textRaw": "Assets",
              "name": "assets",
              "type": "module",
              "desc": "<p>Users can include assets by adding a key-path dictionary to the configuration\nas the <code>assets</code> field. At build time, Node.js would read the assets from the\nspecified paths and bundle them into the preparation blob. In the generated\nexecutable, users can retrieve the assets using the <a href=\"#seagetassetkey-encoding\"><code>sea.getAsset()</code></a> and\n<a href=\"#seagetassetasblobkey-options\"><code>sea.getAssetAsBlob()</code></a> APIs.</p>\n<pre><code class=\"language-json\">{\n  \"main\": \"/path/to/bundled/script.js\",\n  \"output\": \"/path/to/write/the/generated/executable\",\n  \"assets\": {\n    \"a.jpg\": \"/path/to/a.jpg\",\n    \"b.txt\": \"/path/to/b.txt\"\n  }\n}\n</code></pre>\n<p>The single-executable application can access the assets as follows:</p>\n<pre><code class=\"language-cjs\">const { getAsset, getAssetAsBlob, getRawAsset, getAssetKeys } = require('node:sea');\n// Get all asset keys.\nconst keys = getAssetKeys();\nconsole.log(keys); // ['a.jpg', 'b.txt']\n// Returns a copy of the data in an ArrayBuffer.\nconst image = getAsset('a.jpg');\n// Returns a string decoded from the asset as UTF8.\nconst text = getAsset('b.txt', 'utf8');\n// Returns a Blob containing the asset.\nconst blob = getAssetAsBlob('a.jpg');\n// Returns an ArrayBuffer containing the raw asset without copying.\nconst raw = getRawAsset('a.jpg');\n</code></pre>\n<p>See documentation of the <a href=\"#seagetassetkey-encoding\"><code>sea.getAsset()</code></a>, <a href=\"#seagetassetasblobkey-options\"><code>sea.getAssetAsBlob()</code></a>,\n<a href=\"#seagetrawassetkey\"><code>sea.getRawAsset()</code></a> and <a href=\"#seagetassetkeys\"><code>sea.getAssetKeys()</code></a> APIs for more information.</p>",
              "displayName": "Assets"
            },
            {
              "textRaw": "Startup snapshot support",
              "name": "startup_snapshot_support",
              "type": "module",
              "desc": "<p>The <code>useSnapshot</code> field can be used to enable startup snapshot support. In this\ncase, the <code>main</code> script would not be executed when the final executable is launched.\nInstead, it would be run when the single executable application preparation\nblob is generated on the building machine. The generated preparation blob would\nthen include a snapshot capturing the states initialized by the <code>main</code> script.\nThe final executable, with the preparation blob injected, would deserialize\nthe snapshot at run time.</p>\n<p>When <code>useSnapshot</code> is true, the main script must invoke the\n<a href=\"v8.html#v8startupsnapshotsetdeserializemainfunctioncallback-data\"><code>v8.startupSnapshot.setDeserializeMainFunction()</code></a> API to configure code\nthat needs to be run when the final executable is launched by the users.</p>\n<p>The typical pattern for an application to use snapshot in a single executable\napplication is:</p>\n<ol>\n<li>At build time, on the building machine, the main script is run to\ninitialize the heap to a state that's ready to take user input. The script\nshould also configure a main function with\n<a href=\"v8.html#v8startupsnapshotsetdeserializemainfunctioncallback-data\"><code>v8.startupSnapshot.setDeserializeMainFunction()</code></a>. This function will be\ncompiled and serialized into the snapshot, but not invoked at build time.</li>\n<li>At run time, the main function will be run on top of the deserialized heap\non the user machine to process user input and generate output.</li>\n</ol>\n<p>The general constraints of the startup snapshot scripts also apply to the main\nscript when it's used to build snapshot for the single executable application,\nand the main script can use the <a href=\"v8.html#startup-snapshot-api\"><code>v8.startupSnapshot</code> API</a> to adapt to\nthese constraints. See\n<a href=\"cli.html#--build-snapshot\">documentation about startup snapshot support in Node.js</a>.</p>",
              "displayName": "Startup snapshot support"
            },
            {
              "textRaw": "V8 code cache support",
              "name": "v8_code_cache_support",
              "type": "module",
              "desc": "<p>When <code>useCodeCache</code> is set to <code>true</code> in the configuration, during the generation\nof the single executable preparation blob, Node.js will compile the <code>main</code>\nscript to generate the V8 code cache. The generated code cache would be part of\nthe preparation blob and get injected into the final executable. When the single\nexecutable application is launched, instead of compiling the <code>main</code> script from\nscratch, Node.js would use the code cache to speed up the compilation, then\nexecute the script, which would improve the startup performance.</p>\n<p><strong>Note:</strong> <code>import()</code> does not work when <code>useCodeCache</code> is <code>true</code>.</p>",
              "displayName": "V8 code cache support"
            },
            {
              "textRaw": "Execution arguments",
              "name": "execution_arguments",
              "type": "module",
              "desc": "<p>The <code>execArgv</code> field can be used to specify Node.js-specific\narguments that will be automatically applied when the single\nexecutable application starts. This allows application developers\nto configure Node.js runtime options without requiring end users\nto be aware of these flags.</p>\n<p>For example, the following configuration:</p>\n<pre><code class=\"language-json\">{\n  \"main\": \"/path/to/bundled/script.js\",\n  \"output\": \"/path/to/write/the/generated/executable\",\n  \"execArgv\": [\"--no-warnings\", \"--max-old-space-size=2048\"]\n}\n</code></pre>\n<p>will instruct the SEA to be launched with the <code>--no-warnings</code> and\n<code>--max-old-space-size=2048</code> flags. In the scripts embedded in the executable, these flags\ncan be accessed using the <code>process.execArgv</code> property:</p>\n<pre><code class=\"language-js\">// If the executable is launched with `sea user-arg1 user-arg2`\nconsole.log(process.execArgv);\n// Prints: ['--no-warnings', '--max-old-space-size=2048']\nconsole.log(process.argv);\n// Prints ['/path/to/sea', 'path/to/sea', 'user-arg1', 'user-arg2']\n</code></pre>\n<p>The user-provided arguments are in the <code>process.argv</code> array starting from index 2,\nsimilar to what would happen if the application is started with:</p>\n<pre><code class=\"language-console\">node --no-warnings --max-old-space-size=2048 /path/to/bundled/script.js user-arg1 user-arg2\n</code></pre>",
              "displayName": "Execution arguments"
            },
            {
              "textRaw": "Execution argument extension",
              "name": "execution_argument_extension",
              "type": "module",
              "desc": "<p>The <code>execArgvExtension</code> field controls how additional execution arguments can be\nprovided beyond those specified in the <code>execArgv</code> field. It accepts one of three string values:</p>\n<ul>\n<li><code>\"none\"</code>: No extension is allowed. Only the arguments specified in <code>execArgv</code> will be used,\nand the <code>NODE_OPTIONS</code> environment variable will be ignored.</li>\n<li><code>\"env\"</code>: <em>(Default)</em> The <code>NODE_OPTIONS</code> environment variable can extend the execution arguments.\nThis is the default behavior to maintain backward compatibility.</li>\n<li><code>\"cli\"</code>: The executable can be launched with <code>--node-options=\"--flag1 --flag2\"</code>, and those flags\nwill be parsed as execution arguments for Node.js instead of being passed to the user script.\nThis allows using arguments that are not supported by the <code>NODE_OPTIONS</code> environment variable.</li>\n</ul>\n<p>For example, with <code>\"execArgvExtension\": \"cli\"</code>:</p>\n<pre><code class=\"language-json\">{\n  \"main\": \"/path/to/bundled/script.js\",\n  \"output\": \"/path/to/write/the/generated/executable\",\n  \"execArgv\": [\"--no-warnings\"],\n  \"execArgvExtension\": \"cli\"\n}\n</code></pre>\n<p>The executable can be launched as:</p>\n<pre><code class=\"language-console\">./my-sea --node-options=\"--trace-exit\" user-arg1 user-arg2\n</code></pre>\n<p>This would be equivalent to running:</p>\n<pre><code class=\"language-console\">node --no-warnings --trace-exit /path/to/bundled/script.js user-arg1 user-arg2\n</code></pre>",
              "displayName": "Execution argument extension"
            }
          ],
          "displayName": "Generating single executable applications with `--build-sea`"
        },
        {
          "textRaw": "Single-executable application API",
          "name": "single-executable_application_api",
          "type": "module",
          "desc": "<p>The <code>node:sea</code> builtin allows interaction with the single-executable application\nfrom the JavaScript main script embedded into the executable.</p>",
          "methods": [
            {
              "textRaw": "`sea.isSea()`",
              "name": "isSea",
              "type": "method",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean} Whether this script is running inside a single-executable application.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "Whether this script is running inside a single-executable application."
                  }
                }
              ]
            },
            {
              "textRaw": "`sea.getAsset(key[, encoding])`",
              "name": "getAsset",
              "type": "method",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {string} the key for the asset in the dictionary specified by the `assets` field in the single-executable application configuration.",
                      "name": "key",
                      "type": "string",
                      "desc": "the key for the asset in the dictionary specified by the `assets` field in the single-executable application configuration."
                    },
                    {
                      "textRaw": "`encoding` {string} If specified, the asset will be decoded as a string. Any encoding supported by the `TextDecoder` is accepted. If unspecified, an `ArrayBuffer` containing a copy of the asset would be returned instead.",
                      "name": "encoding",
                      "type": "string",
                      "desc": "If specified, the asset will be decoded as a string. Any encoding supported by the `TextDecoder` is accepted. If unspecified, an `ArrayBuffer` containing a copy of the asset would be returned instead.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|ArrayBuffer}",
                    "name": "return",
                    "type": "string|ArrayBuffer"
                  }
                }
              ],
              "desc": "<p>This method can be used to retrieve the assets configured to be bundled into the\nsingle-executable application at build time.\nAn error is thrown when no matching asset can be found.</p>"
            },
            {
              "textRaw": "`sea.getAssetAsBlob(key[, options])`",
              "name": "getAssetAsBlob",
              "type": "method",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {string} the key for the asset in the dictionary specified by the `assets` field in the single-executable application configuration.",
                      "name": "key",
                      "type": "string",
                      "desc": "the key for the asset in the dictionary specified by the `assets` field in the single-executable application configuration."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`type` {string} An optional mime type for the blob.",
                          "name": "type",
                          "type": "string",
                          "desc": "An optional mime type for the blob."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Blob}",
                    "name": "return",
                    "type": "Blob"
                  }
                }
              ],
              "desc": "<p>Similar to <a href=\"#seagetassetkey-encoding\"><code>sea.getAsset()</code></a>, but returns the result in a <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a>.\nAn error is thrown when no matching asset can be found.</p>"
            },
            {
              "textRaw": "`sea.getRawAsset(key)`",
              "name": "getRawAsset",
              "type": "method",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {string} the key for the asset in the dictionary specified by the `assets` field in the single-executable application configuration.",
                      "name": "key",
                      "type": "string",
                      "desc": "the key for the asset in the dictionary specified by the `assets` field in the single-executable application configuration."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ArrayBuffer}",
                    "name": "return",
                    "type": "ArrayBuffer"
                  }
                }
              ],
              "desc": "<p>This method can be used to retrieve the assets configured to be bundled into the\nsingle-executable application at build time.\nAn error is thrown when no matching asset can be found.</p>\n<p>Unlike <code>sea.getAsset()</code> or <code>sea.getAssetAsBlob()</code>, this method does not\nreturn a copy. Instead, it returns the raw asset bundled inside the executable.</p>\n<p>For now, users should avoid writing to the returned array buffer. If the\ninjected section is not marked as writable or not aligned properly,\nwrites to the returned array buffer is likely to result in a crash.</p>"
            },
            {
              "textRaw": "`sea.getAssetKeys()`",
              "name": "getAssetKeys",
              "type": "method",
              "meta": {
                "added": [
                  "v24.8.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns {string[]} An array containing all the keys of the assets embedded in the executable. If no assets are embedded, returns an empty array.",
                    "name": "return",
                    "type": "string[]",
                    "desc": "An array containing all the keys of the assets embedded in the executable. If no assets are embedded, returns an empty array."
                  }
                }
              ],
              "desc": "<p>This method can be used to retrieve an array of all the keys of assets\nembedded into the single-executable application.\nAn error is thrown when not running inside a single-executable application.</p>"
            }
          ],
          "displayName": "Single-executable application API"
        },
        {
          "textRaw": "In the injected main script",
          "name": "in_the_injected_main_script",
          "type": "module",
          "modules": [
            {
              "textRaw": "Module format of the injected main script",
              "name": "module_format_of_the_injected_main_script",
              "type": "module",
              "desc": "<p>To specify how Node.js should interpret the injected main script, use the\n<code>mainFormat</code> field in the single-executable application configuration.\nThe accepted values are:</p>\n<ul>\n<li><code>\"commonjs\"</code>: The injected main script is treated as a CommonJS module.</li>\n<li><code>\"module\"</code>: The injected main script is treated as an ECMAScript module.</li>\n</ul>\n<p>If the <code>mainFormat</code> field is not specified, it defaults to <code>\"commonjs\"</code>.</p>\n<p>Currently, <code>\"mainFormat\": \"module\"</code> cannot be used together with <code>\"useSnapshot\"</code>.</p>",
              "displayName": "Module format of the injected main script"
            },
            {
              "textRaw": "Module loading in the injected main script",
              "name": "module_loading_in_the_injected_main_script",
              "type": "module",
              "desc": "<p>In the injected main script, module loading does not read from the file system.\nBy default, both <code>require()</code> and <code>import</code> statements would only be able to load\nthe built-in modules. Attempting to load a module that can only be found in the\nfile system will throw an error.</p>\n<p>Users can bundle their application into a standalone JavaScript file to inject\ninto the executable. This also ensures a more deterministic dependency graph.</p>\n<p>To load modules from the file system in the injected main script, users can\ncreate a <code>require</code> function that can load from the file system using\n<code>module.createRequire()</code>. For example, in a CommonJS entry point:</p>\n<pre><code class=\"language-js\">const { createRequire } = require('node:module');\nrequire = createRequire(__filename);\n</code></pre>",
              "displayName": "Module loading in the injected main script"
            },
            {
              "textRaw": "`require()` in the injected main script",
              "name": "`require()`_in_the_injected_main_script",
              "type": "module",
              "desc": "<p><code>require()</code> in the injected main script is not the same as the <a href=\"modules.html#requireid\"><code>require()</code></a>\navailable to modules that are not injected.\nCurrently, it does not have any of the properties that non-injected\n<a href=\"modules.html#requireid\"><code>require()</code></a> has except <a href=\"modules.html#accessing-the-main-module\"><code>require.main</code></a>.</p>",
              "displayName": "`require()` in the injected main script"
            },
            {
              "textRaw": "`__filename` and `module.filename` in the injected main script",
              "name": "`__filename`_and_`module.filename`_in_the_injected_main_script",
              "type": "module",
              "desc": "<p>The values of <code>__filename</code> and <code>module.filename</code> in the injected main script\nare equal to <a href=\"process.html#processexecpath\"><code>process.execPath</code></a>.</p>",
              "displayName": "`__filename` and `module.filename` in the injected main script"
            },
            {
              "textRaw": "`__dirname` in the injected main script",
              "name": "`__dirname`_in_the_injected_main_script",
              "type": "module",
              "desc": "<p>The value of <code>__dirname</code> in the injected main script is equal to the directory\nname of <a href=\"process.html#processexecpath\"><code>process.execPath</code></a>.</p>",
              "displayName": "`__dirname` in the injected main script"
            },
            {
              "textRaw": "`import.meta` in the injected main script",
              "name": "`import.meta`_in_the_injected_main_script",
              "type": "module",
              "desc": "<p>When using <code>\"mainFormat\": \"module\"</code>, <code>import.meta</code> is available in the\ninjected main script with the following properties:</p>\n<ul>\n<li><code>import.meta.url</code>: A <code>file:</code> URL corresponding to <a href=\"process.html#processexecpath\"><code>process.execPath</code></a>.</li>\n<li><code>import.meta.filename</code>: Equal to <a href=\"process.html#processexecpath\"><code>process.execPath</code></a>.</li>\n<li><code>import.meta.dirname</code>: The directory name of <a href=\"process.html#processexecpath\"><code>process.execPath</code></a>.</li>\n<li><code>import.meta.main</code>: <code>true</code>.</li>\n</ul>\n<p><code>import.meta.resolve</code> is currently not supported.</p>",
              "displayName": "`import.meta` in the injected main script"
            },
            {
              "textRaw": "`import()` in the injected main script",
              "name": "`import()`_in_the_injected_main_script",
              "type": "module",
              "desc": "<p>When using <code>\"mainFormat\": \"module\"</code>, <code>import()</code> can be used to dynamically\nload built-in modules. Attempting to use <code>import()</code> to load modules from\nthe file system will throw an error.</p>",
              "displayName": "`import()` in the injected main script"
            },
            {
              "textRaw": "Using native addons in the injected main script",
              "name": "using_native_addons_in_the_injected_main_script",
              "type": "module",
              "desc": "<p>Native addons can be bundled as assets into the single-executable application\nby specifying them in the <code>assets</code> field of the configuration file used to\ngenerate the single-executable application preparation blob.\nThe addon can then be loaded in the injected main script by writing the asset\nto a temporary file and loading it with <code>process.dlopen()</code>.</p>\n<pre><code class=\"language-json\">{\n  \"main\": \"/path/to/bundled/script.js\",\n  \"output\": \"/path/to/write/the/generated/executable\",\n  \"assets\": {\n    \"myaddon.node\": \"/path/to/myaddon/build/Release/myaddon.node\"\n  }\n}\n</code></pre>\n<pre><code class=\"language-js\">// script.js\nconst fs = require('node:fs');\nconst os = require('node:os');\nconst path = require('node:path');\nconst { getRawAsset } = require('node:sea');\nconst addonPath = path.join(os.tmpdir(), 'myaddon.node');\nfs.writeFileSync(addonPath, new Uint8Array(getRawAsset('myaddon.node')));\nconst myaddon = { exports: {} };\nprocess.dlopen(myaddon, addonPath);\nconsole.log(myaddon.exports);\nfs.rmSync(addonPath);\n</code></pre>\n<p>Known caveat: if the single-executable application is produced by postject running on a Linux arm64 docker container,\n<a href=\"https://github.com/nodejs/postject/issues/105\">the produced ELF binary does not have the correct hash table to load the addons</a> and\nwill crash on <code>process.dlopen()</code>. Build the single-executable application on other platforms, or at least on\na non-container Linux arm64 environment to work around this issue.</p>",
              "displayName": "Using native addons in the injected main script"
            }
          ],
          "displayName": "In the injected main script"
        },
        {
          "textRaw": "Notes",
          "name": "notes",
          "type": "module",
          "modules": [
            {
              "textRaw": "Single executable application creation process",
              "name": "single_executable_application_creation_process",
              "type": "module",
              "desc": "<p>The process documented here is subject to change.</p>",
              "modules": [
                {
                  "textRaw": "1. Generating single executable preparation blobs",
                  "name": "1._generating_single_executable_preparation_blobs",
                  "type": "module",
                  "desc": "<p>To build a single executable application, Node.js would first generate a blob\nthat contains all the necessary information to run the bundled script.\nWhen using <code>--build-sea</code>, this step is done internally along with the injection.</p>",
                  "modules": [
                    {
                      "textRaw": "Dumping the preparation blob to disk",
                      "name": "dumping_the_preparation_blob_to_disk",
                      "type": "module",
                      "desc": "<p>Before <code>--build-sea</code> was introduced, an older workflow was introduced to write the\npreparation blob to disk for injection by external tools. This can still\nbe used for verification purposes.</p>\n<p>To dump the preparation blob to disk for verification, use <code>--experimental-sea-config</code>.\nThis writes a file that can be injected into a Node.js binary using tools like <a href=\"https://github.com/nodejs/postject\">postject</a>.</p>\n<p>The configuration is similar to that of <code>--build-sea</code>, except that the\n<code>output</code> field specifies the path to write the generated blob file instead of\nthe final executable.</p>\n<pre><code class=\"language-json\">{\n  \"main\": \"/path/to/bundled/script.js\",\n  // Instead of the final executable, this is the path to write the blob.\n  \"output\": \"/path/to/write/the/generated/blob.blob\"\n}\n</code></pre>",
                      "displayName": "Dumping the preparation blob to disk"
                    }
                  ],
                  "displayName": "1. Generating single executable preparation blobs"
                },
                {
                  "textRaw": "2. Injecting the preparation blob into the `node` binary",
                  "name": "2._injecting_the_preparation_blob_into_the_`node`_binary",
                  "type": "module",
                  "desc": "<p>To complete the creation of a single executable application, the generated blob\nneeds to be injected into a copy of the <code>node</code> binary, as documented below.</p>\n<p>When using <code>--build-sea</code>, this step is done internally along with the blob generation.</p>\n<ul>\n<li>If the <code>node</code> binary is a <a href=\"https://en.wikipedia.org/wiki/Portable_Executable\">PE</a> file, the blob should be injected as a resource\nnamed <code>NODE_SEA_BLOB</code>.</li>\n<li>If the <code>node</code> binary is a <a href=\"https://en.wikipedia.org/wiki/Mach-O\">Mach-O</a> file, the blob should be injected as a section\nnamed <code>NODE_SEA_BLOB</code> in the <code>NODE_SEA</code> segment.</li>\n<li>If the <code>node</code> binary is an <a href=\"https://en.wikipedia.org/wiki/Executable_and_Linkable_Format\">ELF</a> file, the blob should be injected as a note\nnamed <code>NODE_SEA_BLOB</code>.</li>\n</ul>\n<p>Then, the SEA building process searches the binary for the\n<code>NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2:0</code> <a href=\"https://www.electronjs.org/docs/latest/tutorial/fuses\">fuse</a> string and flip the\nlast character to <code>1</code> to indicate that a resource has been injected.</p>",
                  "modules": [
                    {
                      "textRaw": "Injecting the preparation blob manually",
                      "name": "injecting_the_preparation_blob_manually",
                      "type": "module",
                      "desc": "<p>Before <code>--build-sea</code> was introduced, an older workflow was introduced to allow\nexternal tools to inject the generated blob into a copy of the <code>node</code> binary.</p>\n<p>For example, with <a href=\"https://github.com/nodejs/postject\">postject</a>:</p>\n<ol>\n<li>\n<p>Create a copy of the <code>node</code> executable and name it according to your needs:</p>\n<ul>\n<li>On systems other than Windows:</li>\n</ul>\n<pre><code class=\"language-bash\">cp $(command -v node) hello\n</code></pre>\n<ul>\n<li>On Windows:</li>\n</ul>\n<pre><code class=\"language-text\">node -e \"require('fs').copyFileSync(process.execPath, 'hello.exe')\"\n</code></pre>\n<p>The <code>.exe</code> extension is necessary.</p>\n</li>\n<li>\n<p>Remove the signature of the binary (macOS and Windows only):</p>\n<ul>\n<li>On macOS:</li>\n</ul>\n<pre><code class=\"language-bash\">codesign --remove-signature hello\n</code></pre>\n<ul>\n<li>On Windows (optional):</li>\n</ul>\n<p><a href=\"https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool\">signtool</a> can be used from the installed <a href=\"https://developer.microsoft.com/en-us/windows/downloads/windows-sdk/\">Windows SDK</a>. If this step is\nskipped, ignore any signature-related warning from postject.</p>\n<pre><code class=\"language-powershell\">signtool remove /s hello.exe\n</code></pre>\n</li>\n<li>\n<p>Inject the blob into the copied binary by running <code>postject</code> with\nthe following options:</p>\n<ul>\n<li><code>hello</code> / <code>hello.exe</code> - The name of the copy of the <code>node</code> executable\ncreated in step 4.</li>\n<li><code>NODE_SEA_BLOB</code> - The name of the resource / note / section in the binary\nwhere the contents of the blob will be stored.</li>\n<li><code>sea-prep.blob</code> - The name of the blob created in step 1.</li>\n<li><code>--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2</code> - The\n<a href=\"https://www.electronjs.org/docs/latest/tutorial/fuses\">fuse</a> used by the Node.js project to detect if a file has been injected.</li>\n<li><code>--macho-segment-name NODE_SEA</code> (only needed on macOS) - The name of the\nsegment in the binary where the contents of the blob will be\nstored.</li>\n</ul>\n<p>To summarize, here is the required command for each platform:</p>\n<ul>\n<li>\n<p>On Linux:</p>\n<pre><code class=\"language-bash\">npx postject hello NODE_SEA_BLOB sea-prep.blob \\\n    --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2\n</code></pre>\n</li>\n<li>\n<p>On Windows - PowerShell:</p>\n<pre><code class=\"language-powershell\">npx postject hello.exe NODE_SEA_BLOB sea-prep.blob `\n    --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2\n</code></pre>\n</li>\n<li>\n<p>On Windows - Command Prompt:</p>\n<pre><code class=\"language-text\">npx postject hello.exe NODE_SEA_BLOB sea-prep.blob ^\n    --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2\n</code></pre>\n</li>\n<li>\n<p>On macOS:</p>\n<pre><code class=\"language-bash\">npx postject hello NODE_SEA_BLOB sea-prep.blob \\\n    --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \\\n    --macho-segment-name NODE_SEA\n</code></pre>\n</li>\n</ul>\n</li>\n</ol>",
                      "displayName": "Injecting the preparation blob manually"
                    }
                  ],
                  "displayName": "2. Injecting the preparation blob into the `node` binary"
                }
              ],
              "displayName": "Single executable application creation process"
            },
            {
              "textRaw": "Platform support",
              "name": "platform_support",
              "type": "module",
              "desc": "<p>Single-executable support is tested regularly on CI only on the following\nplatforms:</p>\n<ul>\n<li>Windows</li>\n<li>macOS (arm64 only; x64 is not currently supported and is skipped in the\ntests)</li>\n<li>Linux (all distributions <a href=\"https://github.com/nodejs/node/blob/main/BUILDING.md#platform-list\">supported by Node.js</a> except Alpine and all\narchitectures <a href=\"https://github.com/nodejs/node/blob/main/BUILDING.md#platform-list\">supported by Node.js</a> except s390x)</li>\n</ul>\n<p>This is due to a lack of better tools to generate single-executables that can be\nused to test this feature on other platforms.</p>\n<p>Suggestions for other resource injection tools/workflows are welcomed. Please\nstart a discussion at <a href=\"https://github.com/nodejs/single-executable/discussions\">https://github.com/nodejs/single-executable/discussions</a>\nto help us document them.</p>",
              "displayName": "Platform support"
            }
          ],
          "displayName": "Notes"
        }
      ],
      "displayName": "Single executable applications",
      "source": "doc/api/single-executable-applications.md"
    },
    {
      "textRaw": "SQLite",
      "name": "sqlite",
      "introduced_in": "v22.5.0",
      "type": "module",
      "meta": {
        "added": [
          "v22.5.0"
        ],
        "changes": [
          {
            "version": "v25.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/61262",
            "description": "SQLite is now a release candidate."
          },
          {
            "version": [
              "v23.4.0",
              "v22.13.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/55890",
            "description": "SQLite is no longer behind `--experimental-sqlite` but still experimental."
          }
        ]
      },
      "stability": 1.2,
      "stabilityText": "Release candidate.",
      "desc": "<p>The <code>node:sqlite</code> module facilitates working with SQLite databases.\nTo access it:</p>\n<pre><code class=\"language-mjs\">import sqlite from 'node:sqlite';\n</code></pre>\n<pre><code class=\"language-cjs\">const sqlite = require('node:sqlite');\n</code></pre>\n<p>This module is only available under the <code>node:</code> scheme.</p>\n<p>The following example shows the basic usage of the <code>node:sqlite</code> module to open\nan in-memory database, write data to the database, and then read the data back.</p>\n<pre><code class=\"language-mjs\">import { DatabaseSync } from 'node:sqlite';\nconst database = new DatabaseSync(':memory:');\n\n// Execute SQL statements from strings.\ndatabase.exec(`\n  CREATE TABLE data(\n    key INTEGER PRIMARY KEY,\n    value TEXT\n  ) STRICT\n`);\n// Create a prepared statement to insert data into the database.\nconst insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)');\n// Execute the prepared statement with bound values.\ninsert.run(1, 'hello');\ninsert.run(2, 'world');\n// Create a prepared statement to read data from the database.\nconst query = database.prepare('SELECT * FROM data ORDER BY key');\n// Execute the prepared statement and log the result set.\nconsole.log(query.all());\n// Prints: [ { key: 1, value: 'hello' }, { key: 2, value: 'world' } ]\n</code></pre>\n<pre><code class=\"language-cjs\">const { DatabaseSync } = require('node:sqlite');\nconst database = new DatabaseSync(':memory:');\n\n// Execute SQL statements from strings.\ndatabase.exec(`\n  CREATE TABLE data(\n    key INTEGER PRIMARY KEY,\n    value TEXT\n  ) STRICT\n`);\n// Create a prepared statement to insert data into the database.\nconst insert = database.prepare('INSERT INTO data (key, value) VALUES (?, ?)');\n// Execute the prepared statement with bound values.\ninsert.run(1, 'hello');\ninsert.run(2, 'world');\n// Create a prepared statement to read data from the database.\nconst query = database.prepare('SELECT * FROM data ORDER BY key');\n// Execute the prepared statement and log the result set.\nconsole.log(query.all());\n// Prints: [ { key: 1, value: 'hello' }, { key: 2, value: 'world' } ]\n</code></pre>",
      "modules": [
        {
          "textRaw": "Type conversion between JavaScript and SQLite",
          "name": "type_conversion_between_javascript_and_sqlite",
          "type": "module",
          "desc": "<p>When Node.js writes to or reads from SQLite, it is necessary to convert between\nJavaScript data types and SQLite's <a href=\"https://www.sqlite.org/datatype3.html\">data types</a>. Because JavaScript supports\nmore data types than SQLite, only a subset of JavaScript types are supported.\nAttempting to write an unsupported data type to SQLite will result in an\nexception.</p>\n<table>\n<thead>\n<tr>\n<th>Storage class</th>\n<th>JavaScript to SQLite</th>\n<th>SQLite to JavaScript</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>NULL</code></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a></td>\n</tr>\n<tr>\n<td><code>INTEGER</code></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#bigint_type\"><code>&#x3C;bigint></code></a> <em>(configurable)</em></td>\n</tr>\n<tr>\n<td><code>REAL</code></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></td>\n</tr>\n<tr>\n<td><code>TEXT</code></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></td>\n</tr>\n<tr>\n<td><code>BLOB</code></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a></td>\n<td><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a></td>\n</tr>\n</tbody>\n</table>\n<p>APIs that read values from SQLite have a configuration option that determines\nwhether <code>INTEGER</code> values are converted to <code>number</code> or <code>bigint</code> in JavaScript,\nsuch as the <code>readBigInts</code> option for statements and the <code>useBigIntArguments</code>\noption for user-defined functions. If Node.js reads an <code>INTEGER</code> value from\nSQLite that is outside the JavaScript <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isSafeInteger\">safe integer</a> range, and the option to\nread BigInts is not enabled, then an <code>ERR_OUT_OF_RANGE</code> error will be thrown.</p>",
          "displayName": "Type conversion between JavaScript and SQLite"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `DatabaseSync`",
          "name": "DatabaseSync",
          "type": "class",
          "meta": {
            "added": [
              "v22.5.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57752",
                "description": "Add `timeout` option."
              },
              {
                "version": [
                  "v23.10.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/56991",
                "description": "The `path` argument now supports Buffer and URL objects."
              }
            ]
          },
          "desc": "<p>This class represents a single <a href=\"https://www.sqlite.org/c3ref/sqlite3.html\">connection</a> to a SQLite database. All APIs\nexposed by this class execute synchronously.</p>",
          "signatures": [
            {
              "textRaw": "`new DatabaseSync(path[, options])`",
              "name": "DatabaseSync",
              "type": "ctor",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/61266",
                    "description": "Enable `defensive` by default."
                  },
                  {
                    "version": [
                      "v25.1.0",
                      "v24.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60217",
                    "description": "Add `defensive` option."
                  },
                  {
                    "version": [
                      "v24.4.0",
                      "v22.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58697",
                    "description": "Add new SQLite database options."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`path` {string|Buffer|URL} The path of the database. A SQLite database can be stored in a file or completely in memory. To use a file-backed database, the path should be a file path. To use an in-memory database, the path should be the special name `':memory:'`.",
                  "name": "path",
                  "type": "string|Buffer|URL",
                  "desc": "The path of the database. A SQLite database can be stored in a file or completely in memory. To use a file-backed database, the path should be a file path. To use an in-memory database, the path should be the special name `':memory:'`."
                },
                {
                  "textRaw": "`options` {Object} Configuration options for the database connection. The following options are supported:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Configuration options for the database connection. The following options are supported:",
                  "options": [
                    {
                      "textRaw": "`open` {boolean} If `true`, the database is opened by the constructor. When this value is `false`, the database must be opened via the `open()` method. **Default:** `true`.",
                      "name": "open",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If `true`, the database is opened by the constructor. When this value is `false`, the database must be opened via the `open()` method."
                    },
                    {
                      "textRaw": "`readOnly` {boolean} If `true`, the database is opened in read-only mode. If the database does not exist, opening it will fail. **Default:** `false`.",
                      "name": "readOnly",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, the database is opened in read-only mode. If the database does not exist, opening it will fail."
                    },
                    {
                      "textRaw": "`enableForeignKeyConstraints` {boolean} If `true`, foreign key constraints are enabled. This is recommended but can be disabled for compatibility with legacy database schemas. The enforcement of foreign key constraints can be enabled and disabled after opening the database using `PRAGMA foreign_keys`. **Default:** `true`.",
                      "name": "enableForeignKeyConstraints",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If `true`, foreign key constraints are enabled. This is recommended but can be disabled for compatibility with legacy database schemas. The enforcement of foreign key constraints can be enabled and disabled after opening the database using `PRAGMA foreign_keys`."
                    },
                    {
                      "textRaw": "`enableDoubleQuotedStringLiterals` {boolean} If `true`, SQLite will accept double-quoted string literals. This is not recommended but can be enabled for compatibility with legacy database schemas. **Default:** `false`.",
                      "name": "enableDoubleQuotedStringLiterals",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, SQLite will accept double-quoted string literals. This is not recommended but can be enabled for compatibility with legacy database schemas."
                    },
                    {
                      "textRaw": "`allowExtension` {boolean} If `true`, the `loadExtension` SQL function and the `loadExtension()` method are enabled. You can call `enableLoadExtension(false)` later to disable this feature. **Default:** `false`.",
                      "name": "allowExtension",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, the `loadExtension` SQL function and the `loadExtension()` method are enabled. You can call `enableLoadExtension(false)` later to disable this feature."
                    },
                    {
                      "textRaw": "`timeout` {number} The busy timeout in milliseconds. This is the maximum amount of time that SQLite will wait for a database lock to be released before returning an error. **Default:** `0`.",
                      "name": "timeout",
                      "type": "number",
                      "default": "`0`",
                      "desc": "The busy timeout in milliseconds. This is the maximum amount of time that SQLite will wait for a database lock to be released before returning an error."
                    },
                    {
                      "textRaw": "`readBigInts` {boolean} If `true`, integer fields are read as JavaScript `BigInt` values. If `false`, integer fields are read as JavaScript numbers. **Default:** `false`.",
                      "name": "readBigInts",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, integer fields are read as JavaScript `BigInt` values. If `false`, integer fields are read as JavaScript numbers."
                    },
                    {
                      "textRaw": "`returnArrays` {boolean} If `true`, query results are returned as arrays instead of objects. **Default:** `false`.",
                      "name": "returnArrays",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, query results are returned as arrays instead of objects."
                    },
                    {
                      "textRaw": "`allowBareNamedParameters` {boolean} If `true`, allows binding named parameters without the prefix character (e.g., `foo` instead of `:foo`). **Default:** `true`.",
                      "name": "allowBareNamedParameters",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If `true`, allows binding named parameters without the prefix character (e.g., `foo` instead of `:foo`)."
                    },
                    {
                      "textRaw": "`allowUnknownNamedParameters` {boolean} If `true`, unknown named parameters are ignored when binding. If `false`, an exception is thrown for unknown named parameters. **Default:** `false`.",
                      "name": "allowUnknownNamedParameters",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, unknown named parameters are ignored when binding. If `false`, an exception is thrown for unknown named parameters."
                    },
                    {
                      "textRaw": "`defensive` {boolean} If `true`, enables the defensive flag. When the defensive flag is enabled, language features that allow ordinary SQL to deliberately corrupt the database file are disabled. The defensive flag can also be set using `enableDefensive()`. **Default:** `true`.",
                      "name": "defensive",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If `true`, enables the defensive flag. When the defensive flag is enabled, language features that allow ordinary SQL to deliberately corrupt the database file are disabled. The defensive flag can also be set using `enableDefensive()`."
                    },
                    {
                      "textRaw": "`limits` {Object} Configuration for various SQLite limits. These limits can be used to prevent excessive resource consumption when handling potentially malicious input. See Run-Time Limits and Limit Constants in the SQLite documentation for details. Default values are determined by SQLite's compile-time defaults and may vary depending on how SQLite was built. The following properties are supported:",
                      "name": "limits",
                      "type": "Object",
                      "desc": "Configuration for various SQLite limits. These limits can be used to prevent excessive resource consumption when handling potentially malicious input. See Run-Time Limits and Limit Constants in the SQLite documentation for details. Default values are determined by SQLite's compile-time defaults and may vary depending on how SQLite was built. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`length` {number} Maximum length of a string or BLOB.",
                          "name": "length",
                          "type": "number",
                          "desc": "Maximum length of a string or BLOB."
                        },
                        {
                          "textRaw": "`sqlLength` {number} Maximum length of an SQL statement.",
                          "name": "sqlLength",
                          "type": "number",
                          "desc": "Maximum length of an SQL statement."
                        },
                        {
                          "textRaw": "`column` {number} Maximum number of columns.",
                          "name": "column",
                          "type": "number",
                          "desc": "Maximum number of columns."
                        },
                        {
                          "textRaw": "`exprDepth` {number} Maximum depth of an expression tree.",
                          "name": "exprDepth",
                          "type": "number",
                          "desc": "Maximum depth of an expression tree."
                        },
                        {
                          "textRaw": "`compoundSelect` {number} Maximum number of terms in a compound SELECT.",
                          "name": "compoundSelect",
                          "type": "number",
                          "desc": "Maximum number of terms in a compound SELECT."
                        },
                        {
                          "textRaw": "`vdbeOp` {number} Maximum number of VDBE instructions.",
                          "name": "vdbeOp",
                          "type": "number",
                          "desc": "Maximum number of VDBE instructions."
                        },
                        {
                          "textRaw": "`functionArg` {number} Maximum number of function arguments.",
                          "name": "functionArg",
                          "type": "number",
                          "desc": "Maximum number of function arguments."
                        },
                        {
                          "textRaw": "`attach` {number} Maximum number of attached databases.",
                          "name": "attach",
                          "type": "number",
                          "desc": "Maximum number of attached databases."
                        },
                        {
                          "textRaw": "`likePatternLength` {number} Maximum length of a LIKE pattern.",
                          "name": "likePatternLength",
                          "type": "number",
                          "desc": "Maximum length of a LIKE pattern."
                        },
                        {
                          "textRaw": "`variableNumber` {number} Maximum number of SQL variables.",
                          "name": "variableNumber",
                          "type": "number",
                          "desc": "Maximum number of SQL variables."
                        },
                        {
                          "textRaw": "`triggerDepth` {number} Maximum trigger recursion depth.",
                          "name": "triggerDepth",
                          "type": "number",
                          "desc": "Maximum trigger recursion depth."
                        }
                      ]
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Constructs a new <code>DatabaseSync</code> instance.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`database.aggregate(name, options)`",
              "name": "aggregate",
              "type": "method",
              "meta": {
                "added": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the SQLite function to create.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the SQLite function to create."
                    },
                    {
                      "textRaw": "`options` {Object} Function configuration settings.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Function configuration settings.",
                      "options": [
                        {
                          "textRaw": "`deterministic` {boolean} If `true`, the `SQLITE_DETERMINISTIC` flag is set on the created function. **Default:** `false`.",
                          "name": "deterministic",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the `SQLITE_DETERMINISTIC` flag is set on the created function."
                        },
                        {
                          "textRaw": "`directOnly` {boolean} If `true`, the `SQLITE_DIRECTONLY` flag is set on the created function. **Default:** `false`.",
                          "name": "directOnly",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the `SQLITE_DIRECTONLY` flag is set on the created function."
                        },
                        {
                          "textRaw": "`useBigIntArguments` {boolean} If `true`, integer arguments to `options.step` and `options.inverse` are converted to `BigInt`s. If `false`, integer arguments are passed as JavaScript numbers. **Default:** `false`.",
                          "name": "useBigIntArguments",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, integer arguments to `options.step` and `options.inverse` are converted to `BigInt`s. If `false`, integer arguments are passed as JavaScript numbers."
                        },
                        {
                          "textRaw": "`varargs` {boolean} If `true`, `options.step` and `options.inverse` may be invoked with any number of arguments (between zero and `SQLITE_MAX_FUNCTION_ARG`). If `false`, `inverse` and `step` must be invoked with exactly `length` arguments. **Default:** `false`.",
                          "name": "varargs",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, `options.step` and `options.inverse` may be invoked with any number of arguments (between zero and `SQLITE_MAX_FUNCTION_ARG`). If `false`, `inverse` and `step` must be invoked with exactly `length` arguments."
                        },
                        {
                          "textRaw": "`start` {number|string|null|Array|Object|Function} The identity value for the aggregation function. This value is used when the aggregation function is initialized. When a {Function} is passed the identity will be its return value.",
                          "name": "start",
                          "type": "number|string|null|Array|Object|Function",
                          "desc": "The identity value for the aggregation function. This value is used when the aggregation function is initialized. When a {Function} is passed the identity will be its return value."
                        },
                        {
                          "textRaw": "`step` {Function} The function to call for each row in the aggregation. The function receives the current state and the row value. The return value of this function should be the new state.",
                          "name": "step",
                          "type": "Function",
                          "desc": "The function to call for each row in the aggregation. The function receives the current state and the row value. The return value of this function should be the new state."
                        },
                        {
                          "textRaw": "`result` {Function} The function to call to get the result of the aggregation. The function receives the final state and should return the result of the aggregation.",
                          "name": "result",
                          "type": "Function",
                          "desc": "The function to call to get the result of the aggregation. The function receives the final state and should return the result of the aggregation."
                        },
                        {
                          "textRaw": "`inverse` {Function} When this function is provided, the `aggregate` method will work as a window function. The function receives the current state and the dropped row value. The return value of this function should be the new state.",
                          "name": "inverse",
                          "type": "Function",
                          "desc": "When this function is provided, the `aggregate` method will work as a window function. The function receives the current state and the dropped row value. The return value of this function should be the new state."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Registers a new aggregate function with the SQLite database. This method is a wrapper around\n<a href=\"https://www.sqlite.org/c3ref/create_function.html\"><code>sqlite3_create_window_function()</code></a>.</p>\n<p>When used as a window function, the <code>result</code> function will be called multiple times.</p>\n<pre><code class=\"language-cjs\">const { DatabaseSync } = require('node:sqlite');\n\nconst db = new DatabaseSync(':memory:');\ndb.exec(`\n  CREATE TABLE t3(x, y);\n  INSERT INTO t3 VALUES ('a', 4),\n                        ('b', 5),\n                        ('c', 3),\n                        ('d', 8),\n                        ('e', 1);\n`);\n\ndb.aggregate('sumint', {\n  start: 0,\n  step: (acc, value) => acc + value,\n});\n\ndb.prepare('SELECT sumint(y) as total FROM t3').get(); // { total: 21 }\n</code></pre>\n<pre><code class=\"language-mjs\">import { DatabaseSync } from 'node:sqlite';\n\nconst db = new DatabaseSync(':memory:');\ndb.exec(`\n  CREATE TABLE t3(x, y);\n  INSERT INTO t3 VALUES ('a', 4),\n                        ('b', 5),\n                        ('c', 3),\n                        ('d', 8),\n                        ('e', 1);\n`);\n\ndb.aggregate('sumint', {\n  start: 0,\n  step: (acc, value) => acc + value,\n});\n\ndb.prepare('SELECT sumint(y) as total FROM t3').get(); // { total: 21 }\n</code></pre>"
            },
            {
              "textRaw": "`database.close()`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes the database connection. An exception is thrown if the database is not\nopen. This method is a wrapper around <a href=\"https://www.sqlite.org/c3ref/close.html\"><code>sqlite3_close_v2()</code></a>.</p>"
            },
            {
              "textRaw": "`database.loadExtension(path[, entryPoint])`",
              "name": "loadExtension",
              "type": "method",
              "meta": {
                "added": [
                  "v23.5.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string} The path to the shared library to load.",
                      "name": "path",
                      "type": "string",
                      "desc": "The path to the shared library to load."
                    },
                    {
                      "textRaw": "`entryPoint` {string} The name of the extension's entry-point function. When omitted, SQLite derives the entry point from the shared library's filename; pass this argument explicitly when the derived name does not match.",
                      "name": "entryPoint",
                      "type": "string",
                      "desc": "The name of the extension's entry-point function. When omitted, SQLite derives the entry point from the shared library's filename; pass this argument explicitly when the derived name does not match.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Loads a shared library into the database connection. This method is a wrapper\naround <a href=\"https://www.sqlite.org/c3ref/load_extension.html\"><code>sqlite3_load_extension()</code></a>. It is required to enable the\n<code>allowExtension</code> option when constructing the <code>DatabaseSync</code> instance.</p>\n<pre><code class=\"language-mjs\">import { DatabaseSync } from 'node:sqlite';\nconst database = new DatabaseSync(':memory:', { allowExtension: true });\n\n// Load using the entry point derived from the filename.\ndatabase.loadExtension('./decimal.dylib');\n\n// Override the entry point when the derived name does not match.\ndatabase.loadExtension('./base64.dylib', 'sqlite3_base64_init');\n</code></pre>\n<pre><code class=\"language-cjs\">const { DatabaseSync } = require('node:sqlite');\nconst database = new DatabaseSync(':memory:', { allowExtension: true });\n\n// Load using the entry point derived from the filename.\ndatabase.loadExtension('./decimal.dylib');\n\n// Override the entry point when the derived name does not match.\ndatabase.loadExtension('./base64.dylib', 'sqlite3_base64_init');\n</code></pre>"
            },
            {
              "textRaw": "`database.enableLoadExtension(allow)`",
              "name": "enableLoadExtension",
              "type": "method",
              "meta": {
                "added": [
                  "v23.5.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`allow` {boolean} Whether to allow loading extensions.",
                      "name": "allow",
                      "type": "boolean",
                      "desc": "Whether to allow loading extensions."
                    }
                  ]
                }
              ],
              "desc": "<p>Enables or disables the <code>loadExtension</code> SQL function, and the <code>loadExtension()</code>\nmethod. When <code>allowExtension</code> is <code>false</code> when constructing, you cannot enable\nloading extensions for security reasons.</p>"
            },
            {
              "textRaw": "`database.enableDefensive(active)`",
              "name": "enableDefensive",
              "type": "method",
              "meta": {
                "added": [
                  "v25.1.0",
                  "v24.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`active` {boolean} Whether to set the defensive flag.",
                      "name": "active",
                      "type": "boolean",
                      "desc": "Whether to set the defensive flag."
                    }
                  ]
                }
              ],
              "desc": "<p>Enables or disables the defensive flag. When the defensive flag is active,\nlanguage features that allow ordinary SQL to deliberately corrupt the database file are disabled.\nSee <a href=\"https://www.sqlite.org/c3ref/c_dbconfig_defensive.html#sqlitedbconfigdefensive\"><code>SQLITE_DBCONFIG_DEFENSIVE</code></a> in the SQLite documentation for details.</p>"
            },
            {
              "textRaw": "`database.location([dbName])`",
              "name": "location",
              "type": "method",
              "meta": {
                "added": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`dbName` {string} Name of the database. This can be `'main'` (the default primary database) or any other database that has been added with `ATTACH DATABASE` **Default:** `'main'`.",
                      "name": "dbName",
                      "type": "string",
                      "default": "`'main'`",
                      "desc": "Name of the database. This can be `'main'` (the default primary database) or any other database that has been added with `ATTACH DATABASE`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|null} The location of the database file. When using an in-memory database, this method returns null.",
                    "name": "return",
                    "type": "string|null",
                    "desc": "The location of the database file. When using an in-memory database, this method returns null."
                  }
                }
              ],
              "desc": "<p>This method is a wrapper around <a href=\"https://sqlite.org/c3ref/db_filename.html\"><code>sqlite3_db_filename()</code></a></p>"
            },
            {
              "textRaw": "`database.exec(sql)`",
              "name": "exec",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`sql` {string} A SQL string to execute.",
                      "name": "sql",
                      "type": "string",
                      "desc": "A SQL string to execute."
                    }
                  ]
                }
              ],
              "desc": "<p>This method allows one or more SQL statements to be executed without returning\nany results. This method is useful when executing SQL statements read from a\nfile. This method is a wrapper around <a href=\"https://www.sqlite.org/c3ref/exec.html\"><code>sqlite3_exec()</code></a>.</p>"
            },
            {
              "textRaw": "`database.function(name[, options], fn)`",
              "name": "function",
              "type": "method",
              "meta": {
                "added": [
                  "v23.5.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the SQLite function to create.",
                      "name": "name",
                      "type": "string",
                      "desc": "The name of the SQLite function to create."
                    },
                    {
                      "textRaw": "`options` {Object} Optional configuration settings for the function. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Optional configuration settings for the function. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`deterministic` {boolean} If `true`, the `SQLITE_DETERMINISTIC` flag is set on the created function. **Default:** `false`.",
                          "name": "deterministic",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the `SQLITE_DETERMINISTIC` flag is set on the created function."
                        },
                        {
                          "textRaw": "`directOnly` {boolean} If `true`, the `SQLITE_DIRECTONLY` flag is set on the created function. **Default:** `false`.",
                          "name": "directOnly",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, the `SQLITE_DIRECTONLY` flag is set on the created function."
                        },
                        {
                          "textRaw": "`useBigIntArguments` {boolean} If `true`, integer arguments to `function` are converted to `BigInt`s. If `false`, integer arguments are passed as JavaScript numbers. **Default:** `false`.",
                          "name": "useBigIntArguments",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, integer arguments to `function` are converted to `BigInt`s. If `false`, integer arguments are passed as JavaScript numbers."
                        },
                        {
                          "textRaw": "`varargs` {boolean} If `true`, `function` may be invoked with any number of arguments (between zero and `SQLITE_MAX_FUNCTION_ARG`). If `false`, `function` must be invoked with exactly `function.length` arguments. **Default:** `false`.",
                          "name": "varargs",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, `function` may be invoked with any number of arguments (between zero and `SQLITE_MAX_FUNCTION_ARG`). If `false`, `function` must be invoked with exactly `function.length` arguments."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`fn` {Function} The JavaScript function to call when the SQLite function is invoked. The return value of this function should be a valid SQLite data type: see Type conversion between JavaScript and SQLite. The result defaults to `NULL` if the return value is `undefined`.",
                      "name": "fn",
                      "type": "Function",
                      "desc": "The JavaScript function to call when the SQLite function is invoked. The return value of this function should be a valid SQLite data type: see Type conversion between JavaScript and SQLite. The result defaults to `NULL` if the return value is `undefined`."
                    }
                  ]
                }
              ],
              "desc": "<p>This method is used to create SQLite user-defined functions. This method is a\nwrapper around <a href=\"https://www.sqlite.org/c3ref/create_function.html\"><code>sqlite3_create_function_v2()</code></a>.</p>"
            },
            {
              "textRaw": "`database.setAuthorizer(callback)`",
              "name": "setAuthorizer",
              "type": "method",
              "meta": {
                "added": [
                  "v24.10.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function|null} The authorizer function to set, or `null` to clear the current authorizer.",
                      "name": "callback",
                      "type": "Function|null",
                      "desc": "The authorizer function to set, or `null` to clear the current authorizer."
                    }
                  ]
                }
              ],
              "desc": "<p>Sets an authorizer callback that SQLite will invoke whenever it attempts to\naccess data or modify the database schema through prepared statements.\nThis can be used to implement security policies, audit access, or restrict certain operations.\nThis method is a wrapper around <a href=\"https://sqlite.org/c3ref/set_authorizer.html\"><code>sqlite3_set_authorizer()</code></a>.</p>\n<p>When invoked, the callback receives five arguments:</p>\n<ul>\n<li><code>actionCode</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The type of operation being performed (e.g., <code>SQLITE_INSERT</code>, <code>SQLITE_UPDATE</code>, <code>SQLITE_SELECT</code>).</li>\n<li><code>arg1</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> The first argument (context-dependent, often a table name).</li>\n<li><code>arg2</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> The second argument (context-dependent, often a column name).</li>\n<li><code>dbName</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> The name of the database.</li>\n<li><code>triggerOrView</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#null_type\"><code>&#x3C;null></code></a> The name of the trigger or view causing the access.</li>\n</ul>\n<p>The callback must return one of the following constants:</p>\n<ul>\n<li><code>SQLITE_OK</code> - Allow the operation.</li>\n<li><code>SQLITE_DENY</code> - Deny the operation (causes an error).</li>\n<li><code>SQLITE_IGNORE</code> - Ignore the operation (silently skip).</li>\n</ul>\n<pre><code class=\"language-cjs\">const { DatabaseSync, constants } = require('node:sqlite');\nconst db = new DatabaseSync(':memory:');\n\n// Set up an authorizer that denies all table creation\ndb.setAuthorizer((actionCode) => {\n  if (actionCode === constants.SQLITE_CREATE_TABLE) {\n    return constants.SQLITE_DENY;\n  }\n  return constants.SQLITE_OK;\n});\n\n// This will work\ndb.prepare('SELECT 1').get();\n\n// This will throw an error due to authorization denial\ntry {\n  db.exec('CREATE TABLE blocked (id INTEGER)');\n} catch (err) {\n  console.log('Operation blocked:', err.message);\n}\n</code></pre>\n<pre><code class=\"language-mjs\">import { DatabaseSync, constants } from 'node:sqlite';\nconst db = new DatabaseSync(':memory:');\n\n// Set up an authorizer that denies all table creation\ndb.setAuthorizer((actionCode) => {\n  if (actionCode === constants.SQLITE_CREATE_TABLE) {\n    return constants.SQLITE_DENY;\n  }\n  return constants.SQLITE_OK;\n});\n\n// This will work\ndb.prepare('SELECT 1').get();\n\n// This will throw an error due to authorization denial\ntry {\n  db.exec('CREATE TABLE blocked (id INTEGER)');\n} catch (err) {\n  console.log('Operation blocked:', err.message);\n}\n</code></pre>"
            },
            {
              "textRaw": "`database.open()`",
              "name": "open",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Opens the database specified in the <code>path</code> argument of the <code>DatabaseSync</code>\nconstructor. This method should only be used when the database is not opened via\nthe constructor. An exception is thrown if the database is already open.</p>"
            },
            {
              "textRaw": "`database.serialize([dbName])`",
              "name": "serialize",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`dbName` {string} Name of the database to serialize. This can be `'main'` (the default primary database) or any other database that has been added with `ATTACH DATABASE`. **Default:** `'main'`.",
                      "name": "dbName",
                      "type": "string",
                      "default": "`'main'`",
                      "desc": "Name of the database to serialize. This can be `'main'` (the default primary database) or any other database that has been added with `ATTACH DATABASE`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Uint8Array} A binary representation of the database.",
                    "name": "return",
                    "type": "Uint8Array",
                    "desc": "A binary representation of the database."
                  }
                }
              ],
              "desc": "<p>Serializes the database into a binary representation, returned as a\n<code>Uint8Array</code>. This is useful for saving, cloning, or transferring an in-memory\ndatabase. This method is a wrapper around <a href=\"https://sqlite.org/c3ref/serialize.html\"><code>sqlite3_serialize()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { DatabaseSync } from 'node:sqlite';\n\nconst db = new DatabaseSync(':memory:');\ndb.exec('CREATE TABLE t(key INTEGER PRIMARY KEY, value TEXT)');\ndb.exec(\"INSERT INTO t VALUES (1, 'hello')\");\nconst buffer = db.serialize();\nconsole.log(buffer.length); // Prints the byte length of the database\n</code></pre>\n<pre><code class=\"language-cjs\">const { DatabaseSync } = require('node:sqlite');\n\nconst db = new DatabaseSync(':memory:');\ndb.exec('CREATE TABLE t(key INTEGER PRIMARY KEY, value TEXT)');\ndb.exec(\"INSERT INTO t VALUES (1, 'hello')\");\nconst buffer = db.serialize();\nconsole.log(buffer.length); // Prints the byte length of the database\n</code></pre>"
            },
            {
              "textRaw": "`database.deserialize(buffer[, options])`",
              "name": "deserialize",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Uint8Array} A binary representation of a database, such as the output of `database.serialize()`.",
                      "name": "buffer",
                      "type": "Uint8Array",
                      "desc": "A binary representation of a database, such as the output of `database.serialize()`."
                    },
                    {
                      "textRaw": "`options` {Object} Optional configuration for the deserialization.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Optional configuration for the deserialization.",
                      "options": [
                        {
                          "textRaw": "`dbName` {string} Name of the database to deserialize into. **Default:** `'main'`.",
                          "name": "dbName",
                          "type": "string",
                          "default": "`'main'`",
                          "desc": "Name of the database to deserialize into."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Loads a serialized database into this connection, replacing the current\ndatabase. The deserialized database is writable. Existing prepared statements\nare finalized before deserialization is attempted, even if the operation\nsubsequently fails. This method is a wrapper around\n<a href=\"https://sqlite.org/c3ref/deserialize.html\"><code>sqlite3_deserialize()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { DatabaseSync } from 'node:sqlite';\n\nconst original = new DatabaseSync(':memory:');\noriginal.exec('CREATE TABLE t(key INTEGER PRIMARY KEY, value TEXT)');\noriginal.exec(\"INSERT INTO t VALUES (1, 'hello')\");\nconst buffer = original.serialize();\noriginal.close();\n\nconst clone = new DatabaseSync(':memory:');\nclone.deserialize(buffer);\nconsole.log(clone.prepare('SELECT value FROM t').get());\n// Prints: { value: 'hello' }\n</code></pre>\n<pre><code class=\"language-cjs\">const { DatabaseSync } = require('node:sqlite');\n\nconst original = new DatabaseSync(':memory:');\noriginal.exec('CREATE TABLE t(key INTEGER PRIMARY KEY, value TEXT)');\noriginal.exec(\"INSERT INTO t VALUES (1, 'hello')\");\nconst buffer = original.serialize();\noriginal.close();\n\nconst clone = new DatabaseSync(':memory:');\nclone.deserialize(buffer);\nconsole.log(clone.prepare('SELECT value FROM t').get());\n// Prints: { value: 'hello' }\n</code></pre>"
            },
            {
              "textRaw": "`database.prepare(sql[, options])`",
              "name": "prepare",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`sql` {string} A SQL string to compile to a prepared statement.",
                      "name": "sql",
                      "type": "string",
                      "desc": "A SQL string to compile to a prepared statement."
                    },
                    {
                      "textRaw": "`options` {Object} Optional configuration for the prepared statement.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Optional configuration for the prepared statement.",
                      "options": [
                        {
                          "textRaw": "`readBigInts` {boolean} If `true`, integer fields are read as `BigInt`s. **Default:** inherited from database options or `false`.",
                          "name": "readBigInts",
                          "type": "boolean",
                          "default": "inherited from database options or `false`",
                          "desc": "If `true`, integer fields are read as `BigInt`s."
                        },
                        {
                          "textRaw": "`returnArrays` {boolean} If `true`, results are returned as arrays. **Default:** inherited from database options or `false`.",
                          "name": "returnArrays",
                          "type": "boolean",
                          "default": "inherited from database options or `false`",
                          "desc": "If `true`, results are returned as arrays."
                        },
                        {
                          "textRaw": "`allowBareNamedParameters` {boolean} If `true`, allows binding named parameters without the prefix character. **Default:** inherited from database options or `true`.",
                          "name": "allowBareNamedParameters",
                          "type": "boolean",
                          "default": "inherited from database options or `true`",
                          "desc": "If `true`, allows binding named parameters without the prefix character."
                        },
                        {
                          "textRaw": "`allowUnknownNamedParameters` {boolean} If `true`, unknown named parameters are ignored. **Default:** inherited from database options or `false`.",
                          "name": "allowUnknownNamedParameters",
                          "type": "boolean",
                          "default": "inherited from database options or `false`",
                          "desc": "If `true`, unknown named parameters are ignored."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {StatementSync} The prepared statement.",
                    "name": "return",
                    "type": "StatementSync",
                    "desc": "The prepared statement."
                  }
                }
              ],
              "desc": "<p>Compiles a SQL statement into a <a href=\"https://www.sqlite.org/c3ref/stmt.html\">prepared statement</a>. This method is a wrapper\naround <a href=\"https://www.sqlite.org/c3ref/prepare.html\"><code>sqlite3_prepare_v2()</code></a>.</p>"
            },
            {
              "textRaw": "`database.createTagStore([maxSize])`",
              "name": "createTagStore",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`maxSize` {integer} The maximum number of prepared statements to cache. **Default:** `1000`.",
                      "name": "maxSize",
                      "type": "integer",
                      "default": "`1000`",
                      "desc": "The maximum number of prepared statements to cache.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {SQLTagStore} A new SQL tag store for caching prepared statements.",
                    "name": "return",
                    "type": "SQLTagStore",
                    "desc": "A new SQL tag store for caching prepared statements."
                  }
                }
              ],
              "desc": "<p>Creates a new <a href=\"#class-sqltagstore\"><code>SQLTagStore</code></a>, which is a Least Recently Used (LRU) cache\nfor storing prepared statements. This allows for the efficient reuse of\nprepared statements by tagging them with a unique identifier.</p>\n<p>When a tagged SQL literal is executed, the <code>SQLTagStore</code> checks if a prepared\nstatement for the corresponding SQL query string already exists in the cache.\nIf it does, the cached statement is used. If not, a new prepared statement is\ncreated, executed, and then stored in the cache for future use. This mechanism\nhelps to avoid the overhead of repeatedly parsing and preparing the same SQL\nstatements.</p>\n<p>Tagged statements bind the placeholder values from the template literal as\nparameters to the underlying prepared statement. For example:</p>\n<pre><code class=\"language-js\">sqlTagStore.get`SELECT ${value}`;\n</code></pre>\n<p>is equivalent to:</p>\n<pre><code class=\"language-js\">db.prepare('SELECT ?').get(value);\n</code></pre>\n<p>However, in the first example, the tag store will cache the underlying prepared\nstatement for future use.</p>\n<blockquote>\n<p><strong>Note:</strong> The <code>${value}</code> syntax in tagged statements <em>binds</em> a parameter to\nthe prepared statement. This differs from its behavior in <em>untagged</em> template\nliterals, where it performs string interpolation.</p>\n<pre><code class=\"language-js\">// This a safe example of binding a parameter to a tagged statement.\nsqlTagStore.run`INSERT INTO t1 (id) VALUES (${id})`;\n\n// This is an *unsafe* example of an untagged template string.\n// `id` is interpolated into the query text as a string.\n// This can lead to SQL injection and data corruption.\ndb.run(`INSERT INTO t1 (id) VALUES (${id})`);\n</code></pre>\n</blockquote>\n<p>The tag store will match a statement from the cache if the query strings\n(including the positions of any bound placeholders) are identical.</p>\n<pre><code class=\"language-js\">// The following statements will match in the cache:\nsqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;\nsqlTagStore.get`SELECT * FROM t1 WHERE id = ${12345} AND active = 1`;\n\n// The following statements will not match, as the query strings\n// and bound placeholders differ:\nsqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;\nsqlTagStore.get`SELECT * FROM t1 WHERE id = 12345 AND active = 1`;\n\n// The following statements will not match, as matches are case-sensitive:\nsqlTagStore.get`SELECT * FROM t1 WHERE id = ${id} AND active = 1`;\nsqlTagStore.get`select * from t1 where id = ${id} and active = 1`;\n</code></pre>\n<p>The only way of binding parameters in tagged statements is with the <code>${value}</code>\nsyntax. Do not add parameter binding placeholders (<code>?</code> etc.) to the SQL query\nstring itself.</p>\n<pre><code class=\"language-mjs\">import { DatabaseSync } from 'node:sqlite';\n\nconst db = new DatabaseSync(':memory:');\nconst sql = db.createTagStore();\n\ndb.exec('CREATE TABLE users (id INT, name TEXT)');\n\n// Using the 'run' method to insert data.\n// The tagged literal is used to identify the prepared statement.\nsql.run`INSERT INTO users VALUES (1, 'Alice')`;\nsql.run`INSERT INTO users VALUES (2, 'Bob')`;\n\n// Using the 'get' method to retrieve a single row.\nconst name = 'Alice';\nconst user = sql.get`SELECT * FROM users WHERE name = ${name}`;\nconsole.log(user); // { id: 1, name: 'Alice' }\n\n// Using the 'all' method to retrieve all rows.\nconst allUsers = sql.all`SELECT * FROM users ORDER BY id`;\nconsole.log(allUsers);\n// [\n//   { id: 1, name: 'Alice' },\n//   { id: 2, name: 'Bob' }\n// ]\n</code></pre>\n<pre><code class=\"language-cjs\">const { DatabaseSync } = require('node:sqlite');\n\nconst db = new DatabaseSync(':memory:');\nconst sql = db.createTagStore();\n\ndb.exec('CREATE TABLE users (id INT, name TEXT)');\n\n// Using the 'run' method to insert data.\n// The tagged literal is used to identify the prepared statement.\nsql.run`INSERT INTO users VALUES (1, 'Alice')`;\nsql.run`INSERT INTO users VALUES (2, 'Bob')`;\n\n// Using the 'get' method to retrieve a single row.\nconst name = 'Alice';\nconst user = sql.get`SELECT * FROM users WHERE name = ${name}`;\nconsole.log(user); // { id: 1, name: 'Alice' }\n\n// Using the 'all' method to retrieve all rows.\nconst allUsers = sql.all`SELECT * FROM users ORDER BY id`;\nconsole.log(allUsers);\n// [\n//   { id: 1, name: 'Alice' },\n//   { id: 2, name: 'Bob' }\n// ]\n</code></pre>"
            },
            {
              "textRaw": "`database.createSession([options])`",
              "name": "createSession",
              "type": "method",
              "meta": {
                "added": [
                  "v23.3.0",
                  "v22.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} The configuration options for the session.",
                      "name": "options",
                      "type": "Object",
                      "desc": "The configuration options for the session.",
                      "options": [
                        {
                          "textRaw": "`table` {string} A specific table to track changes for. By default, changes to all tables are tracked.",
                          "name": "table",
                          "type": "string",
                          "desc": "A specific table to track changes for. By default, changes to all tables are tracked."
                        },
                        {
                          "textRaw": "`db` {string} Name of the database to track. This is useful when multiple databases have been added using `ATTACH DATABASE`. **Default**: `'main'`.",
                          "name": "db",
                          "type": "string",
                          "desc": "Name of the database to track. This is useful when multiple databases have been added using `ATTACH DATABASE`. **Default**: `'main'`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Session} A session handle.",
                    "name": "return",
                    "type": "Session",
                    "desc": "A session handle."
                  }
                }
              ],
              "desc": "<p>Creates and attaches a session to the database. This method is a wrapper around <a href=\"https://www.sqlite.org/session/sqlite3session_create.html\"><code>sqlite3session_create()</code></a> and <a href=\"https://www.sqlite.org/session/sqlite3session_attach.html\"><code>sqlite3session_attach()</code></a>.</p>"
            },
            {
              "textRaw": "`database.applyChangeset(changeset[, options])`",
              "name": "applyChangeset",
              "type": "method",
              "meta": {
                "added": [
                  "v23.3.0",
                  "v22.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`changeset` {Uint8Array} A binary changeset or patchset.",
                      "name": "changeset",
                      "type": "Uint8Array",
                      "desc": "A binary changeset or patchset."
                    },
                    {
                      "textRaw": "`options` {Object} The configuration options for how the changes will be applied.",
                      "name": "options",
                      "type": "Object",
                      "desc": "The configuration options for how the changes will be applied.",
                      "options": [
                        {
                          "textRaw": "`filter` {Function} for each table affected by at least one change in the changeset, the `filter` callback is invoked with the table name as the first argument. If the return value is falsy, then no attempt is made to apply any changes to the table. Otherwise, if the return value is truthy or no `filter` callback is provided, all changes related to the table are attempted.",
                          "name": "filter",
                          "type": "Function",
                          "desc": "for each table affected by at least one change in the changeset, the `filter` callback is invoked with the table name as the first argument. If the return value is falsy, then no attempt is made to apply any changes to the table. Otherwise, if the return value is truthy or no `filter` callback is provided, all changes related to the table are attempted."
                        },
                        {
                          "textRaw": "`onConflict` {Function} A function that determines how to handle conflicts. The function receives one argument, which can be one of the following values:The function should return one of the following values:`SQLITE_CHANGESET_OMIT`: Omit conflicting changes.`SQLITE_CHANGESET_REPLACE`: Replace existing values with conflicting changes (only valid with `SQLITE_CHANGESET_DATA` or `SQLITE_CHANGESET_CONFLICT` conflicts).`SQLITE_CHANGESET_ABORT`: Abort on conflict and roll back the database.When an error is thrown in the conflict handler or when any other value is returned from the handler, applying the changeset is aborted and the database is rolled back.**Default**: A function that returns `SQLITE_CHANGESET_ABORT`.",
                          "name": "onConflict",
                          "type": "Function",
                          "desc": "A function that determines how to handle conflicts. The function receives one argument, which can be one of the following values:The function should return one of the following values:`SQLITE_CHANGESET_OMIT`: Omit conflicting changes.`SQLITE_CHANGESET_REPLACE`: Replace existing values with conflicting changes (only valid with `SQLITE_CHANGESET_DATA` or `SQLITE_CHANGESET_CONFLICT` conflicts).`SQLITE_CHANGESET_ABORT`: Abort on conflict and roll back the database.When an error is thrown in the conflict handler or when any other value is returned from the handler, applying the changeset is aborted and the database is rolled back.**Default**: A function that returns `SQLITE_CHANGESET_ABORT`.",
                          "options": [
                            {
                              "textRaw": "`SQLITE_CHANGESET_DATA`: A `DELETE` or `UPDATE` change does not contain the expected \"before\" values.",
                              "name": "SQLITE_CHANGESET_DATA",
                              "desc": "A `DELETE` or `UPDATE` change does not contain the expected \"before\" values."
                            },
                            {
                              "textRaw": "`SQLITE_CHANGESET_NOTFOUND`: A row matching the primary key of the `DELETE` or `UPDATE` change does not exist.",
                              "name": "SQLITE_CHANGESET_NOTFOUND",
                              "desc": "A row matching the primary key of the `DELETE` or `UPDATE` change does not exist."
                            },
                            {
                              "textRaw": "`SQLITE_CHANGESET_CONFLICT`: An `INSERT` change results in a duplicate primary key.",
                              "name": "SQLITE_CHANGESET_CONFLICT",
                              "desc": "An `INSERT` change results in a duplicate primary key."
                            },
                            {
                              "textRaw": "`SQLITE_CHANGESET_FOREIGN_KEY`: Applying a change would result in a foreign key violation.",
                              "name": "SQLITE_CHANGESET_FOREIGN_KEY",
                              "desc": "Applying a change would result in a foreign key violation."
                            },
                            {
                              "textRaw": "`SQLITE_CHANGESET_CONSTRAINT`: Applying a change results in a `UNIQUE`, `CHECK`, or `NOT NULL` constraint violation.",
                              "name": "SQLITE_CHANGESET_CONSTRAINT",
                              "desc": "Applying a change results in a `UNIQUE`, `CHECK`, or `NOT NULL` constraint violation."
                            }
                          ]
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} Whether the changeset was applied successfully without being aborted.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "Whether the changeset was applied successfully without being aborted."
                  }
                }
              ],
              "desc": "<p>An exception is thrown if the database is not\nopen. This method is a wrapper around <a href=\"https://www.sqlite.org/session/sqlite3changeset_apply.html\"><code>sqlite3changeset_apply()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { DatabaseSync } from 'node:sqlite';\n\nconst sourceDb = new DatabaseSync(':memory:');\nconst targetDb = new DatabaseSync(':memory:');\n\nsourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');\ntargetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');\n\nconst session = sourceDb.createSession();\n\nconst insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');\ninsert.run(1, 'hello');\ninsert.run(2, 'world');\n\nconst changeset = session.changeset();\ntargetDb.applyChangeset(changeset);\n// Now that the changeset has been applied, targetDb contains the same data as sourceDb.\n</code></pre>\n<pre><code class=\"language-cjs\">const { DatabaseSync } = require('node:sqlite');\n\nconst sourceDb = new DatabaseSync(':memory:');\nconst targetDb = new DatabaseSync(':memory:');\n\nsourceDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');\ntargetDb.exec('CREATE TABLE data(key INTEGER PRIMARY KEY, value TEXT)');\n\nconst session = sourceDb.createSession();\n\nconst insert = sourceDb.prepare('INSERT INTO data (key, value) VALUES (?, ?)');\ninsert.run(1, 'hello');\ninsert.run(2, 'world');\n\nconst changeset = session.changeset();\ntargetDb.applyChangeset(changeset);\n// Now that the changeset has been applied, targetDb contains the same data as sourceDb.\n</code></pre>"
            },
            {
              "textRaw": "`database[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58467",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes the database connection. If the database connection is already closed\nthen this is a no-op.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean} Whether the database is currently open or not.",
              "name": "isOpen",
              "type": "boolean",
              "meta": {
                "added": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "desc": "Whether the database is currently open or not."
            },
            {
              "textRaw": "Type: {boolean} Whether the database is currently within a transaction. This method is a wrapper around `sqlite3_get_autocommit()`.",
              "name": "isTransaction",
              "type": "boolean",
              "meta": {
                "added": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "desc": "Whether the database is currently within a transaction. This method is a wrapper around `sqlite3_get_autocommit()`."
            },
            {
              "textRaw": "Type: {Object}",
              "name": "limits",
              "type": "Object",
              "meta": {
                "added": [
                  "v25.8.0"
                ],
                "changes": []
              },
              "desc": "<p>An object for getting and setting SQLite database limits at runtime.\nEach property corresponds to an SQLite limit and can be read or written.</p>\n<pre><code class=\"language-js\">const db = new DatabaseSync(':memory:');\n\n// Read current limit\nconsole.log(db.limits.length);\n\n// Set a new limit\ndb.limits.sqlLength = 100000;\n\n// Reset a limit to its compile-time maximum\ndb.limits.sqlLength = Infinity;\n</code></pre>\n<p>Available properties: <code>length</code>, <code>sqlLength</code>, <code>column</code>, <code>exprDepth</code>,\n<code>compoundSelect</code>, <code>vdbeOp</code>, <code>functionArg</code>, <code>attach</code>, <code>likePatternLength</code>,\n<code>variableNumber</code>, <code>triggerDepth</code>.</p>\n<p>Setting a property to <code>Infinity</code> resets the limit to its compile-time maximum value.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Session`",
          "name": "Session",
          "type": "class",
          "meta": {
            "added": [
              "v23.3.0",
              "v22.12.0"
            ],
            "changes": []
          },
          "methods": [
            {
              "textRaw": "`session.changeset()`",
              "name": "changeset",
              "type": "method",
              "meta": {
                "added": [
                  "v23.3.0",
                  "v22.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Uint8Array} Binary changeset that can be applied to other databases.",
                    "name": "return",
                    "type": "Uint8Array",
                    "desc": "Binary changeset that can be applied to other databases."
                  }
                }
              ],
              "desc": "<p>Retrieves a changeset containing all changes since the changeset was created. Can be called multiple times.\nAn exception is thrown if the database or the session is not open. This method is a wrapper around <a href=\"https://www.sqlite.org/session/sqlite3session_changeset.html\"><code>sqlite3session_changeset()</code></a>.</p>"
            },
            {
              "textRaw": "`session.patchset()`",
              "name": "patchset",
              "type": "method",
              "meta": {
                "added": [
                  "v23.3.0",
                  "v22.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Uint8Array} Binary patchset that can be applied to other databases.",
                    "name": "return",
                    "type": "Uint8Array",
                    "desc": "Binary patchset that can be applied to other databases."
                  }
                }
              ],
              "desc": "<p>Similar to the method above, but generates a more compact patchset. See <a href=\"https://www.sqlite.org/sessionintro.html#changesets_and_patchsets\">Changesets and Patchsets</a>\nin the documentation of SQLite. An exception is thrown if the database or the session is not open. This method is a\nwrapper around <a href=\"https://www.sqlite.org/session/sqlite3session_patchset.html\"><code>sqlite3session_patchset()</code></a>.</p>"
            },
            {
              "textRaw": "`session.close()`",
              "name": "close",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes the session. An exception is thrown if the database or the session is not open. This method is a\nwrapper around <a href=\"https://www.sqlite.org/session/sqlite3session_delete.html\"><code>sqlite3session_delete()</code></a>.</p>"
            },
            {
              "textRaw": "`session[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes the session. If the session is already closed, does nothing.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `StatementSync`",
          "name": "StatementSync",
          "type": "class",
          "meta": {
            "added": [
              "v22.5.0"
            ],
            "changes": []
          },
          "desc": "<p>This class represents a single <a href=\"https://www.sqlite.org/c3ref/stmt.html\">prepared statement</a>. This class cannot be\ninstantiated via its constructor. Instead, instances are created via the\n<code>database.prepare()</code> method. All APIs exposed by this class execute\nsynchronously.</p>\n<p>A prepared statement is an efficient binary representation of the SQL used to\ncreate it. Prepared statements are parameterizable, and can be invoked multiple\ntimes with different bound values. Parameters also offer protection against\n<a href=\"https://en.wikipedia.org/wiki/SQL_injection\">SQL injection</a> attacks. For these reasons, prepared statements are preferred\nover hand-crafted SQL strings when handling user input.</p>",
          "methods": [
            {
              "textRaw": "`statement.all([namedParameters][, ...anonymousParameters])`",
              "name": "all",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56385",
                    "description": "Add support for `DataView` and typed array objects for `anonymousParameters`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`namedParameters` {Object} An optional object used to bind named parameters. The keys of this object are used to configure the mapping.",
                      "name": "namedParameters",
                      "type": "Object",
                      "desc": "An optional object used to bind named parameters. The keys of this object are used to configure the mapping.",
                      "optional": true
                    },
                    {
                      "textRaw": "`...anonymousParameters` {null|number|bigint|string|Buffer|TypedArray|DataView} Zero or more values to bind to anonymous parameters.",
                      "name": "...anonymousParameters",
                      "type": "null|number|bigint|string|Buffer|TypedArray|DataView",
                      "desc": "Zero or more values to bind to anonymous parameters.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Array} An array of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of the row.",
                    "name": "return",
                    "type": "Array",
                    "desc": "An array of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of the row."
                  }
                }
              ],
              "desc": "<p>This method executes a prepared statement and returns all results as an array of\nobjects. If the prepared statement does not return any results, this method\nreturns an empty array. The prepared statement <a href=\"https://www.sqlite.org/c3ref/bind_blob.html\">parameters are bound</a> using\nthe values in <code>namedParameters</code> and <code>anonymousParameters</code>.</p>"
            },
            {
              "textRaw": "`statement.columns()`",
              "name": "columns",
              "type": "method",
              "meta": {
                "added": [
                  "v23.11.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Array} An array of objects. Each object corresponds to a column in the prepared statement, and contains the following properties:",
                    "name": "return",
                    "type": "Array",
                    "desc": "An array of objects. Each object corresponds to a column in the prepared statement, and contains the following properties:",
                    "options": [
                      {
                        "textRaw": "`column` {string|null} The unaliased name of the column in the origin table, or `null` if the column is the result of an expression or subquery. This property is the result of `sqlite3_column_origin_name()`.",
                        "name": "column",
                        "type": "string|null",
                        "desc": "The unaliased name of the column in the origin table, or `null` if the column is the result of an expression or subquery. This property is the result of `sqlite3_column_origin_name()`."
                      },
                      {
                        "textRaw": "`database` {string|null} The unaliased name of the origin database, or `null` if the column is the result of an expression or subquery. This property is the result of `sqlite3_column_database_name()`.",
                        "name": "database",
                        "type": "string|null",
                        "desc": "The unaliased name of the origin database, or `null` if the column is the result of an expression or subquery. This property is the result of `sqlite3_column_database_name()`."
                      },
                      {
                        "textRaw": "`name` {string} The name assigned to the column in the result set of a `SELECT` statement. This property is the result of `sqlite3_column_name()`.",
                        "name": "name",
                        "type": "string",
                        "desc": "The name assigned to the column in the result set of a `SELECT` statement. This property is the result of `sqlite3_column_name()`."
                      },
                      {
                        "textRaw": "`table` {string|null} The unaliased name of the origin table, or `null` if the column is the result of an expression or subquery. This property is the result of `sqlite3_column_table_name()`.",
                        "name": "table",
                        "type": "string|null",
                        "desc": "The unaliased name of the origin table, or `null` if the column is the result of an expression or subquery. This property is the result of `sqlite3_column_table_name()`."
                      },
                      {
                        "textRaw": "`type` {string|null} The declared data type of the column, or `null` if the column is the result of an expression or subquery. This property is the result of `sqlite3_column_decltype()`.",
                        "name": "type",
                        "type": "string|null",
                        "desc": "The declared data type of the column, or `null` if the column is the result of an expression or subquery. This property is the result of `sqlite3_column_decltype()`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>This method is used to retrieve information about the columns returned by the\nprepared statement.</p>"
            },
            {
              "textRaw": "`statement.get([namedParameters][, ...anonymousParameters])`",
              "name": "get",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56385",
                    "description": "Add support for `DataView` and typed array objects for `anonymousParameters`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`namedParameters` {Object} An optional object used to bind named parameters. The keys of this object are used to configure the mapping.",
                      "name": "namedParameters",
                      "type": "Object",
                      "desc": "An optional object used to bind named parameters. The keys of this object are used to configure the mapping.",
                      "optional": true
                    },
                    {
                      "textRaw": "`...anonymousParameters` {null|number|bigint|string|Buffer|TypedArray|DataView} Zero or more values to bind to anonymous parameters.",
                      "name": "...anonymousParameters",
                      "type": "null|number|bigint|string|Buffer|TypedArray|DataView",
                      "desc": "Zero or more values to bind to anonymous parameters.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object|undefined} An object corresponding to the first row returned by executing the prepared statement. The keys and values of the object correspond to the column names and values of the row. If no rows were returned from the database then this method returns `undefined`.",
                    "name": "return",
                    "type": "Object|undefined",
                    "desc": "An object corresponding to the first row returned by executing the prepared statement. The keys and values of the object correspond to the column names and values of the row. If no rows were returned from the database then this method returns `undefined`."
                  }
                }
              ],
              "desc": "<p>This method executes a prepared statement and returns the first result as an\nobject. If the prepared statement does not return any results, this method\nreturns <code>undefined</code>. The prepared statement <a href=\"https://www.sqlite.org/c3ref/bind_blob.html\">parameters are bound</a> using the\nvalues in <code>namedParameters</code> and <code>anonymousParameters</code>.</p>"
            },
            {
              "textRaw": "`statement.iterate([namedParameters][, ...anonymousParameters])`",
              "name": "iterate",
              "type": "method",
              "meta": {
                "added": [
                  "v23.4.0",
                  "v22.13.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56385",
                    "description": "Add support for `DataView` and typed array objects for `anonymousParameters`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`namedParameters` {Object} An optional object used to bind named parameters. The keys of this object are used to configure the mapping.",
                      "name": "namedParameters",
                      "type": "Object",
                      "desc": "An optional object used to bind named parameters. The keys of this object are used to configure the mapping.",
                      "optional": true
                    },
                    {
                      "textRaw": "`...anonymousParameters` {null|number|bigint|string|Buffer|TypedArray|DataView} Zero or more values to bind to anonymous parameters.",
                      "name": "...anonymousParameters",
                      "type": "null|number|bigint|string|Buffer|TypedArray|DataView",
                      "desc": "Zero or more values to bind to anonymous parameters.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Iterator} An iterable iterator of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of the row.",
                    "name": "return",
                    "type": "Iterator",
                    "desc": "An iterable iterator of objects. Each object corresponds to a row returned by executing the prepared statement. The keys and values of each object correspond to the column names and values of the row."
                  }
                }
              ],
              "desc": "<p>This method executes a prepared statement and returns an iterator of\nobjects. If the prepared statement does not return any results, this method\nreturns an empty iterator. The prepared statement <a href=\"https://www.sqlite.org/c3ref/bind_blob.html\">parameters are bound</a> using\nthe values in <code>namedParameters</code> and <code>anonymousParameters</code>.</p>"
            },
            {
              "textRaw": "`statement.run([namedParameters][, ...anonymousParameters])`",
              "name": "run",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56385",
                    "description": "Add support for `DataView` and typed array objects for `anonymousParameters`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`namedParameters` {Object} An optional object used to bind named parameters. The keys of this object are used to configure the mapping.",
                      "name": "namedParameters",
                      "type": "Object",
                      "desc": "An optional object used to bind named parameters. The keys of this object are used to configure the mapping.",
                      "optional": true
                    },
                    {
                      "textRaw": "`...anonymousParameters` {null|number|bigint|string|Buffer|TypedArray|DataView} Zero or more values to bind to anonymous parameters.",
                      "name": "...anonymousParameters",
                      "type": "null|number|bigint|string|Buffer|TypedArray|DataView",
                      "desc": "Zero or more values to bind to anonymous parameters.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`changes` {number|bigint} The number of rows modified, inserted, or deleted by the most recently completed `INSERT`, `UPDATE`, or `DELETE` statement. This field is either a number or a `BigInt` depending on the prepared statement's configuration. This property is the result of `sqlite3_changes64()`.",
                        "name": "changes",
                        "type": "number|bigint",
                        "desc": "The number of rows modified, inserted, or deleted by the most recently completed `INSERT`, `UPDATE`, or `DELETE` statement. This field is either a number or a `BigInt` depending on the prepared statement's configuration. This property is the result of `sqlite3_changes64()`."
                      },
                      {
                        "textRaw": "`lastInsertRowid` {number|bigint} The most recently inserted rowid. This field is either a number or a `BigInt` depending on the prepared statement's configuration. This property is the result of `sqlite3_last_insert_rowid()`.",
                        "name": "lastInsertRowid",
                        "type": "number|bigint",
                        "desc": "The most recently inserted rowid. This field is either a number or a `BigInt` depending on the prepared statement's configuration. This property is the result of `sqlite3_last_insert_rowid()`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>This method executes a prepared statement and returns an object summarizing the\nresulting changes. The prepared statement <a href=\"https://www.sqlite.org/c3ref/bind_blob.html\">parameters are bound</a> using the\nvalues in <code>namedParameters</code> and <code>anonymousParameters</code>.</p>"
            },
            {
              "textRaw": "`statement.setAllowBareNamedParameters(enabled)`",
              "name": "setAllowBareNamedParameters",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enabled` {boolean} Enables or disables support for binding named parameters without the prefix character.",
                      "name": "enabled",
                      "type": "boolean",
                      "desc": "Enables or disables support for binding named parameters without the prefix character."
                    }
                  ]
                }
              ],
              "desc": "<p>The names of SQLite parameters begin with a prefix character. By default,\n<code>node:sqlite</code> requires that this prefix character is present when binding\nparameters. However, with the exception of dollar sign character, these\nprefix characters also require extra quoting when used in object keys.</p>\n<p>To improve ergonomics, this method can be used to also allow bare named\nparameters, which do not require the prefix character in JavaScript code. There\nare several caveats to be aware of when enabling bare named parameters:</p>\n<ul>\n<li>The prefix character is still required in SQL.</li>\n<li>The prefix character is still allowed in JavaScript. In fact, prefixed names\nwill have slightly better binding performance.</li>\n<li>Using ambiguous named parameters, such as <code>$k</code> and <code>@k</code>, in the same prepared\nstatement will result in an exception as it cannot be determined how to bind\na bare name.</li>\n</ul>"
            },
            {
              "textRaw": "`statement.setAllowUnknownNamedParameters(enabled)`",
              "name": "setAllowUnknownNamedParameters",
              "type": "method",
              "meta": {
                "added": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enabled` {boolean} Enables or disables support for unknown named parameters.",
                      "name": "enabled",
                      "type": "boolean",
                      "desc": "Enables or disables support for unknown named parameters."
                    }
                  ]
                }
              ],
              "desc": "<p>By default, if an unknown name is encountered while binding parameters, an\nexception is thrown. This method allows unknown named parameters to be ignored.</p>"
            },
            {
              "textRaw": "`statement.setReturnArrays(enabled)`",
              "name": "setReturnArrays",
              "type": "method",
              "meta": {
                "added": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enabled` {boolean} Enables or disables the return of query results as arrays.",
                      "name": "enabled",
                      "type": "boolean",
                      "desc": "Enables or disables the return of query results as arrays."
                    }
                  ]
                }
              ],
              "desc": "<p>When enabled, query results returned by the <code>all()</code>, <code>get()</code>, and <code>iterate()</code> methods will be returned as arrays instead\nof objects.</p>"
            },
            {
              "textRaw": "`statement.setReadBigInts(enabled)`",
              "name": "setReadBigInts",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enabled` {boolean} Enables or disables the use of `BigInt`s when reading `INTEGER` fields from the database.",
                      "name": "enabled",
                      "type": "boolean",
                      "desc": "Enables or disables the use of `BigInt`s when reading `INTEGER` fields from the database."
                    }
                  ]
                }
              ],
              "desc": "<p>When reading from the database, SQLite <code>INTEGER</code>s are mapped to JavaScript\nnumbers by default. However, SQLite <code>INTEGER</code>s can store values larger than\nJavaScript numbers are capable of representing. In such cases, this method can\nbe used to read <code>INTEGER</code> data using JavaScript <code>BigInt</code>s. This method has no\nimpact on database write operations where numbers and <code>BigInt</code>s are both\nsupported at all times.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string} The source SQL expanded to include parameter values.",
              "name": "expandedSQL",
              "type": "string",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The source SQL text of the prepared statement with parameter\nplaceholders replaced by the values that were used during the most recent\nexecution of this prepared statement. This property is a wrapper around\n<a href=\"https://www.sqlite.org/c3ref/expanded_sql.html\"><code>sqlite3_expanded_sql()</code></a>.</p>",
              "shortDesc": "The source SQL expanded to include parameter values."
            },
            {
              "textRaw": "Type: {string} The source SQL used to create this prepared statement.",
              "name": "sourceSQL",
              "type": "string",
              "meta": {
                "added": [
                  "v22.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The source SQL text of the prepared statement. This property is a\nwrapper around <a href=\"https://www.sqlite.org/c3ref/expanded_sql.html\"><code>sqlite3_sql()</code></a>.</p>",
              "shortDesc": "The source SQL used to create this prepared statement."
            }
          ]
        },
        {
          "textRaw": "Class: `SQLTagStore`",
          "name": "SQLTagStore",
          "type": "class",
          "meta": {
            "added": [
              "v24.9.0"
            ],
            "changes": []
          },
          "desc": "<p>This class represents a single LRU (Least Recently Used) cache for storing\nprepared statements.</p>\n<p>Instances of this class are created via the <a href=\"#databasecreatetagstoremaxsize\"><code>database.createTagStore()</code></a>\nmethod, not by using a constructor. The store caches prepared statements based\non the provided SQL query string. When the same query is seen again, the store\nretrieves the cached statement and safely applies the new values through\nparameter binding, thereby preventing attacks like SQL injection.</p>\n<p>The cache has a maxSize that defaults to 1000 statements, but a custom size can\nbe provided (e.g., <code>database.createTagStore(100)</code>). All APIs exposed by this\nclass execute synchronously.</p>",
          "methods": [
            {
              "textRaw": "`sqlTagStore.all(stringElements[, ...boundParameters])`",
              "name": "all",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stringElements` {string[]} Template literal elements containing the SQL query.",
                      "name": "stringElements",
                      "type": "string[]",
                      "desc": "Template literal elements containing the SQL query."
                    },
                    {
                      "textRaw": "`...boundParameters` {null|number|bigint|string|Buffer|TypedArray|DataView} Parameter values to be bound to placeholders in the template string.",
                      "name": "...boundParameters",
                      "type": "null|number|bigint|string|Buffer|TypedArray|DataView",
                      "desc": "Parameter values to be bound to placeholders in the template string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Array} An array of objects representing the rows returned by the query.",
                    "name": "return",
                    "type": "Array",
                    "desc": "An array of objects representing the rows returned by the query."
                  }
                }
              ],
              "desc": "<p>Executes the given SQL query and returns all resulting rows as an array of\nobjects.</p>\n<p>This function is intended to be used as a template literal tag, not to be\ncalled directly.</p>"
            },
            {
              "textRaw": "`sqlTagStore.get(stringElements[, ...boundParameters])`",
              "name": "get",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stringElements` {string[]} Template literal elements containing the SQL query.",
                      "name": "stringElements",
                      "type": "string[]",
                      "desc": "Template literal elements containing the SQL query."
                    },
                    {
                      "textRaw": "`...boundParameters` {null|number|bigint|string|Buffer|TypedArray|DataView} Parameter values to be bound to placeholders in the template string.",
                      "name": "...boundParameters",
                      "type": "null|number|bigint|string|Buffer|TypedArray|DataView",
                      "desc": "Parameter values to be bound to placeholders in the template string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object|undefined} An object representing the first row returned by the query, or `undefined` if no rows are returned.",
                    "name": "return",
                    "type": "Object|undefined",
                    "desc": "An object representing the first row returned by the query, or `undefined` if no rows are returned."
                  }
                }
              ],
              "desc": "<p>Executes the given SQL query and returns the first resulting row as an object.</p>\n<p>This function is intended to be used as a template literal tag, not to be\ncalled directly.</p>"
            },
            {
              "textRaw": "`sqlTagStore.iterate(stringElements[, ...boundParameters])`",
              "name": "iterate",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stringElements` {string[]} Template literal elements containing the SQL query.",
                      "name": "stringElements",
                      "type": "string[]",
                      "desc": "Template literal elements containing the SQL query."
                    },
                    {
                      "textRaw": "`...boundParameters` {null|number|bigint|string|Buffer|TypedArray|DataView} Parameter values to be bound to placeholders in the template string.",
                      "name": "...boundParameters",
                      "type": "null|number|bigint|string|Buffer|TypedArray|DataView",
                      "desc": "Parameter values to be bound to placeholders in the template string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Iterator} An iterator that yields objects representing the rows returned by the query.",
                    "name": "return",
                    "type": "Iterator",
                    "desc": "An iterator that yields objects representing the rows returned by the query."
                  }
                }
              ],
              "desc": "<p>Executes the given SQL query and returns an iterator over the resulting rows.</p>\n<p>This function is intended to be used as a template literal tag, not to be\ncalled directly.</p>"
            },
            {
              "textRaw": "`sqlTagStore.run(stringElements[, ...boundParameters])`",
              "name": "run",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stringElements` {string[]} Template literal elements containing the SQL query.",
                      "name": "stringElements",
                      "type": "string[]",
                      "desc": "Template literal elements containing the SQL query."
                    },
                    {
                      "textRaw": "`...boundParameters` {null|number|bigint|string|Buffer|TypedArray|DataView} Parameter values to be bound to placeholders in the template string.",
                      "name": "...boundParameters",
                      "type": "null|number|bigint|string|Buffer|TypedArray|DataView",
                      "desc": "Parameter values to be bound to placeholders in the template string.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} An object containing information about the execution, including `changes` and `lastInsertRowid`.",
                    "name": "return",
                    "type": "Object",
                    "desc": "An object containing information about the execution, including `changes` and `lastInsertRowid`."
                  }
                }
              ],
              "desc": "<p>Executes the given SQL query, which is expected to not return any rows (e.g., INSERT, UPDATE, DELETE).</p>\n<p>This function is intended to be used as a template literal tag, not to be\ncalled directly.</p>"
            },
            {
              "textRaw": "`sqlTagStore.clear()`",
              "name": "clear",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Resets the LRU cache, clearing all stored prepared statements.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {integer}",
              "name": "size",
              "type": "integer",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.5.0",
                      "v24.13.1"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/60246",
                    "description": "Changed from a method to a getter."
                  }
                ]
              },
              "desc": "<p>A read-only property that returns the number of prepared statements currently in the cache.</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "capacity",
              "type": "integer",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "desc": "<p>A read-only property that returns the maximum number of prepared statements the cache can hold.</p>"
            },
            {
              "textRaw": "Type: {DatabaseSync}",
              "name": "db",
              "type": "DatabaseSync",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "desc": "<p>A read-only property that returns the <code>DatabaseSync</code> object associated with this <code>SQLTagStore</code>.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`sqlite.backup(sourceDb, path[, options])`",
          "name": "backup",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.16.0"
            ],
            "changes": [
              {
                "version": "v23.10.0",
                "pr-url": "https://github.com/nodejs/node/pull/56991",
                "description": "The `path` argument now supports Buffer and URL objects."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`sourceDb` {DatabaseSync} The database to backup. The source database must be open.",
                  "name": "sourceDb",
                  "type": "DatabaseSync",
                  "desc": "The database to backup. The source database must be open."
                },
                {
                  "textRaw": "`path` {string|Buffer|URL} The path where the backup will be created. If the file already exists, the contents will be overwritten.",
                  "name": "path",
                  "type": "string|Buffer|URL",
                  "desc": "The path where the backup will be created. If the file already exists, the contents will be overwritten."
                },
                {
                  "textRaw": "`options` {Object} Optional configuration for the backup. The following properties are supported:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Optional configuration for the backup. The following properties are supported:",
                  "options": [
                    {
                      "textRaw": "`source` {string} Name of the source database. This can be `'main'` (the default primary database) or any other database that have been added with `ATTACH DATABASE` **Default:** `'main'`.",
                      "name": "source",
                      "type": "string",
                      "default": "`'main'`",
                      "desc": "Name of the source database. This can be `'main'` (the default primary database) or any other database that have been added with `ATTACH DATABASE`"
                    },
                    {
                      "textRaw": "`target` {string} Name of the target database. This can be `'main'` (the default primary database) or any other database that have been added with `ATTACH DATABASE` **Default:** `'main'`.",
                      "name": "target",
                      "type": "string",
                      "default": "`'main'`",
                      "desc": "Name of the target database. This can be `'main'` (the default primary database) or any other database that have been added with `ATTACH DATABASE`"
                    },
                    {
                      "textRaw": "`rate` {number} Number of pages to be transmitted in each batch of the backup. **Default:** `100`.",
                      "name": "rate",
                      "type": "number",
                      "default": "`100`",
                      "desc": "Number of pages to be transmitted in each batch of the backup."
                    },
                    {
                      "textRaw": "`progress` {Function} An optional callback function that will be called after each backup step. The argument passed to this callback is an {Object} with `remainingPages` and `totalPages` properties, describing the current progress of the backup operation.",
                      "name": "progress",
                      "type": "Function",
                      "desc": "An optional callback function that will be called after each backup step. The argument passed to this callback is an {Object} with `remainingPages` and `totalPages` properties, describing the current progress of the backup operation."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise} A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an error occurs.",
                "name": "return",
                "type": "Promise",
                "desc": "A promise that fulfills with the total number of backed-up pages upon completion, or rejects if an error occurs."
              }
            }
          ],
          "desc": "<p>This method makes a database backup. This method abstracts the <a href=\"https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupinit\"><code>sqlite3_backup_init()</code></a>, <a href=\"https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupstep\"><code>sqlite3_backup_step()</code></a>\nand <a href=\"https://www.sqlite.org/c3ref/backup_finish.html#sqlite3backupfinish\"><code>sqlite3_backup_finish()</code></a> functions.</p>\n<p>The backed-up database can be used normally during the backup process. Mutations coming from the same connection - same\n<a href=\"sqlite.html#class-databasesync\"><code>&#x3C;DatabaseSync></code></a> - object will be reflected in the backup right away. However, mutations from other connections will cause\nthe backup process to restart.</p>\n<pre><code class=\"language-cjs\">const { backup, DatabaseSync } = require('node:sqlite');\n\n(async () => {\n  const sourceDb = new DatabaseSync('source.db');\n  const totalPagesTransferred = await backup(sourceDb, 'backup.db', {\n    rate: 1, // Copy one page at a time.\n    progress: ({ totalPages, remainingPages }) => {\n      console.log('Backup in progress', { totalPages, remainingPages });\n    },\n  });\n\n  console.log('Backup completed', totalPagesTransferred);\n})();\n</code></pre>\n<pre><code class=\"language-mjs\">import { backup, DatabaseSync } from 'node:sqlite';\n\nconst sourceDb = new DatabaseSync('source.db');\nconst totalPagesTransferred = await backup(sourceDb, 'backup.db', {\n  rate: 1, // Copy one page at a time.\n  progress: ({ totalPages, remainingPages }) => {\n    console.log('Backup in progress', { totalPages, remainingPages });\n  },\n});\n\nconsole.log('Backup completed', totalPagesTransferred);\n</code></pre>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {Object}",
          "name": "constants",
          "type": "Object",
          "meta": {
            "added": [
              "v23.5.0",
              "v22.13.0"
            ],
            "changes": []
          },
          "desc": "<p>An object containing commonly used constants for SQLite operations.</p>",
          "modules": [
            {
              "textRaw": "SQLite constants",
              "name": "sqlite_constants",
              "type": "module",
              "desc": "<p>The following constants are exported by the <code>sqlite.constants</code> object.</p>",
              "modules": [
                {
                  "textRaw": "Conflict resolution constants",
                  "name": "conflict_resolution_constants",
                  "type": "module",
                  "desc": "<p>One of the following constants is available as an argument to the <code>onConflict</code>\nconflict resolution handler passed to <a href=\"#databaseapplychangesetchangeset-options\"><code>database.applyChangeset()</code></a>. See also\n<a href=\"https://www.sqlite.org/session/c_changeset_conflict.html\">Constants Passed To The Conflict Handler</a> in the SQLite documentation.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CHANGESET_DATA</code></td>\n    <td>The conflict handler is invoked with this constant when processing a DELETE or UPDATE change if a row with the required PRIMARY KEY fields is present in the database, but one or more other (non primary-key) fields modified by the update do not contain the expected \"before\" values.</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CHANGESET_NOTFOUND</code></td>\n    <td>The conflict handler is invoked with this constant when processing a DELETE or UPDATE change if a row with the required PRIMARY KEY fields is not present in the database.</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CHANGESET_CONFLICT</code></td>\n    <td>This constant is passed to the conflict handler while processing an INSERT change if the operation would result in duplicate primary key values.</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CHANGESET_CONSTRAINT</code></td>\n    <td>If foreign key handling is enabled, and applying a changeset leaves the database in a state containing foreign key violations, the conflict handler is invoked with this constant exactly once before the changeset is committed. If the conflict handler returns <code>SQLITE_CHANGESET_OMIT</code>, the changes, including those that caused the foreign key constraint violation, are committed. Or, if it returns <code>SQLITE_CHANGESET_ABORT</code>, the changeset is rolled back.</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CHANGESET_FOREIGN_KEY</code></td>\n    <td>If any other constraint violation occurs while applying a change (i.e. a UNIQUE, CHECK or NOT NULL constraint), the conflict handler is invoked with this constant.</td>\n  </tr>\n</table>\n<p>One of the following constants must be returned from the <code>onConflict</code> conflict\nresolution handler passed to <a href=\"#databaseapplychangesetchangeset-options\"><code>database.applyChangeset()</code></a>. See also\n<a href=\"https://www.sqlite.org/session/c_changeset_abort.html\">Constants Returned From The Conflict Handler</a> in the SQLite documentation.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CHANGESET_OMIT</code></td>\n    <td>Conflicting changes are omitted.</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CHANGESET_REPLACE</code></td>\n    <td>Conflicting changes replace existing values. Note that this value can only be returned when the type of conflict is either <code>SQLITE_CHANGESET_DATA</code> or <code>SQLITE_CHANGESET_CONFLICT</code>.</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CHANGESET_ABORT</code></td>\n    <td>Abort when a change encounters a conflict and roll back database.</td>\n  </tr>\n</table>",
                  "displayName": "Conflict resolution constants"
                },
                {
                  "textRaw": "Authorization constants",
                  "name": "authorization_constants",
                  "type": "module",
                  "desc": "<p>The following constants are used with the <a href=\"#databasesetauthorizercallback\"><code>database.setAuthorizer()</code></a> method.</p>",
                  "modules": [
                    {
                      "textRaw": "Authorization result codes",
                      "name": "authorization_result_codes",
                      "type": "module",
                      "desc": "<p>One of the following constants must be returned from the authorizer callback\nfunction passed to <a href=\"#databasesetauthorizercallback\"><code>database.setAuthorizer()</code></a>.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>SQLITE_OK</code></td>\n    <td>Allow the operation to proceed normally.</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DENY</code></td>\n    <td>Deny the operation and cause an error to be returned.</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_IGNORE</code></td>\n    <td>Ignore the operation and continue as if it had never been requested.</td>\n  </tr>\n</table>",
                      "displayName": "Authorization result codes"
                    },
                    {
                      "textRaw": "Authorization action codes",
                      "name": "authorization_action_codes",
                      "type": "module",
                      "desc": "<p>The following constants are passed as the first argument to the authorizer\ncallback function to indicate what type of operation is being authorized.</p>\n<table>\n  <tr>\n    <th>Constant</th>\n    <th>Description</th>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_INDEX</code></td>\n    <td>Create an index</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_TABLE</code></td>\n    <td>Create a table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_TEMP_INDEX</code></td>\n    <td>Create a temporary index</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_TEMP_TABLE</code></td>\n    <td>Create a temporary table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_TEMP_TRIGGER</code></td>\n    <td>Create a temporary trigger</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_TEMP_VIEW</code></td>\n    <td>Create a temporary view</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_TRIGGER</code></td>\n    <td>Create a trigger</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_VIEW</code></td>\n    <td>Create a view</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DELETE</code></td>\n    <td>Delete from a table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_INDEX</code></td>\n    <td>Drop an index</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_TABLE</code></td>\n    <td>Drop a table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_TEMP_INDEX</code></td>\n    <td>Drop a temporary index</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_TEMP_TABLE</code></td>\n    <td>Drop a temporary table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_TEMP_TRIGGER</code></td>\n    <td>Drop a temporary trigger</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_TEMP_VIEW</code></td>\n    <td>Drop a temporary view</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_TRIGGER</code></td>\n    <td>Drop a trigger</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_VIEW</code></td>\n    <td>Drop a view</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_INSERT</code></td>\n    <td>Insert into a table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_PRAGMA</code></td>\n    <td>Execute a PRAGMA statement</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_READ</code></td>\n    <td>Read from a table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_SELECT</code></td>\n    <td>Execute a SELECT statement</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_TRANSACTION</code></td>\n    <td>Begin, commit, or rollback a transaction</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_UPDATE</code></td>\n    <td>Update a table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_ATTACH</code></td>\n    <td>Attach a database</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DETACH</code></td>\n    <td>Detach a database</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_ALTER_TABLE</code></td>\n    <td>Alter a table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_REINDEX</code></td>\n    <td>Reindex</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_ANALYZE</code></td>\n    <td>Analyze the database</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_CREATE_VTABLE</code></td>\n    <td>Create a virtual table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_DROP_VTABLE</code></td>\n    <td>Drop a virtual table</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_FUNCTION</code></td>\n    <td>Use a function</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_SAVEPOINT</code></td>\n    <td>Create, release, or rollback a savepoint</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_COPY</code></td>\n    <td>Copy data (legacy)</td>\n  </tr>\n  <tr>\n    <td><code>SQLITE_RECURSIVE</code></td>\n    <td>Recursive query</td>\n  </tr>\n</table>",
                      "displayName": "Authorization action codes"
                    }
                  ],
                  "displayName": "Authorization constants"
                }
              ],
              "displayName": "SQLite constants"
            }
          ]
        }
      ],
      "displayName": "SQLite",
      "source": "doc/api/sqlite.md"
    },
    {
      "textRaw": "Stream",
      "name": "stream",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>A stream is an abstract interface for working with streaming data in Node.js.\nThe <code>node:stream</code> module provides an API for implementing the stream interface.</p>\n<p>There are many stream objects provided by Node.js. For instance, a\n<a href=\"http.html#class-httpincomingmessage\">request to an HTTP server</a> and <a href=\"process.html#processstdout\"><code>process.stdout</code></a>\nare both stream instances.</p>\n<p>Streams can be readable, writable, or both. All streams are instances of\n<a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a>.</p>\n<p>To access the <code>node:stream</code> module:</p>\n<pre><code class=\"language-js\">const stream = require('node:stream');\n</code></pre>\n<p>The <code>node:stream</code> module is useful for creating new types of stream instances.\nIt is usually not necessary to use the <code>node:stream</code> module to consume streams.</p>",
      "modules": [
        {
          "textRaw": "Organization of this document",
          "name": "organization_of_this_document",
          "type": "module",
          "desc": "<p>This document contains two primary sections and a third section for notes. The\nfirst section explains how to use existing streams within an application. The\nsecond section explains how to create new types of streams.</p>",
          "displayName": "Organization of this document"
        },
        {
          "textRaw": "Types of streams",
          "name": "types_of_streams",
          "type": "module",
          "desc": "<p>There are four fundamental stream types within Node.js:</p>\n<ul>\n<li><a href=\"#class-streamwritable\"><code>Writable</code></a>: streams to which data can be written (for example,\n<a href=\"fs.html#fscreatewritestreampath-options\"><code>fs.createWriteStream()</code></a>).</li>\n<li><a href=\"#class-streamreadable\"><code>Readable</code></a>: streams from which data can be read (for example,\n<a href=\"fs.html#fscreatereadstreampath-options\"><code>fs.createReadStream()</code></a>).</li>\n<li><a href=\"#class-streamduplex\"><code>Duplex</code></a>: streams that are both <code>Readable</code> and <code>Writable</code> (for example,\n<a href=\"net.html#class-netsocket\"><code>net.Socket</code></a>).</li>\n<li><a href=\"#class-streamtransform\"><code>Transform</code></a>: <code>Duplex</code> streams that can modify or transform the data as it\nis written and read (for example, <a href=\"zlib.html#zlibcreatedeflateoptions\"><code>zlib.createDeflate()</code></a>).</li>\n</ul>\n<p>Additionally, this module includes the utility functions\n<a href=\"#streamduplexpairoptions\"><code>stream.duplexPair()</code></a>,\n<a href=\"#streampipelinesource-transforms-destination-callback\"><code>stream.pipeline()</code></a>,\n<a href=\"#streamfinishedstream-options-callback\"><code>stream.finished()</code></a>\n<a href=\"#streamreadablefromiterable-options\"><code>stream.Readable.from()</code></a>, and\n<a href=\"#streamaddabortsignalsignal-stream\"><code>stream.addAbortSignal()</code></a>.</p>",
          "modules": [
            {
              "textRaw": "Streams Promises API",
              "name": "streams_promises_api",
              "type": "module",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>stream/promises</code> API provides an alternative set of asynchronous utility\nfunctions for streams that return <code>Promise</code> objects rather than using\ncallbacks. The API is accessible via <code>require('node:stream/promises')</code>\nor <code>require('node:stream').promises</code>.</p>",
              "displayName": "Streams Promises API"
            },
            {
              "textRaw": "Object mode",
              "name": "object_mode",
              "type": "module",
              "desc": "<p>All streams created by Node.js APIs operate exclusively on strings, <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>,\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> objects:</p>\n<ul>\n<li><code>Strings</code> and <code>Buffers</code> are the most common types used with streams.</li>\n<li><code>TypedArray</code> and <code>DataView</code> lets you handle binary data with types like\n<code>Int32Array</code> or <code>Uint8Array</code>. When you write a TypedArray or DataView to a\nstream, Node.js processes\nthe raw bytes.</li>\n</ul>\n<p>It is possible, however, for stream\nimplementations to work with other types of JavaScript values (with the\nexception of <code>null</code>, which serves a special purpose within streams).\nSuch streams are considered to operate in \"object mode\".</p>\n<p>Stream instances are switched into object mode using the <code>objectMode</code> option\nwhen the stream is created. Attempting to switch an existing stream into\nobject mode is not safe.</p>",
              "displayName": "Object mode"
            }
          ],
          "methods": [
            {
              "textRaw": "`stream.pipeline(streams[, options])`",
              "name": "pipeline",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "streams"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`stream.pipeline(source[, ...transforms], destination[, options])`",
              "name": "pipeline",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v18.0.0",
                      "v17.2.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/40886",
                    "description": "Add the `end` option, which can be set to `false` to prevent automatically closing the destination stream when the source ends."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`source` {Stream|AsyncIterable|Function}",
                      "name": "source",
                      "type": "Stream|AsyncIterable|Function",
                      "options": [
                        {
                          "textRaw": "Returns: {Promise|AsyncIterable}",
                          "name": "return",
                          "type": "Promise|AsyncIterable"
                        }
                      ]
                    },
                    {
                      "textRaw": "`...transforms` {Stream|Function}",
                      "name": "...transforms",
                      "type": "Stream|Function",
                      "options": [
                        {
                          "textRaw": "`source` {AsyncIterable}",
                          "name": "source",
                          "type": "AsyncIterable"
                        },
                        {
                          "textRaw": "Returns: {Promise|AsyncIterable}",
                          "name": "return",
                          "type": "Promise|AsyncIterable"
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`destination` {Stream|Function}",
                      "name": "destination",
                      "type": "Stream|Function",
                      "options": [
                        {
                          "textRaw": "`source` {AsyncIterable}",
                          "name": "source",
                          "type": "AsyncIterable"
                        },
                        {
                          "textRaw": "Returns: {Promise|AsyncIterable}",
                          "name": "return",
                          "type": "Promise|AsyncIterable"
                        }
                      ]
                    },
                    {
                      "textRaw": "`options` {Object} Pipeline options",
                      "name": "options",
                      "type": "Object",
                      "desc": "Pipeline options",
                      "options": [
                        {
                          "textRaw": "`signal` {AbortSignal}",
                          "name": "signal",
                          "type": "AbortSignal"
                        },
                        {
                          "textRaw": "`end` {boolean} End the destination stream when the source stream ends. Transform streams are always ended, even if this value is `false`. **Default:** `true`.",
                          "name": "end",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "End the destination stream when the source stream ends. Transform streams are always ended, even if this value is `false`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills when the pipeline is complete.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills when the pipeline is complete."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-cjs\">const { pipeline } = require('node:stream/promises');\nconst fs = require('node:fs');\nconst zlib = require('node:zlib');\n\nasync function run() {\n  await pipeline(\n    fs.createReadStream('archive.tar'),\n    zlib.createGzip(),\n    fs.createWriteStream('archive.tar.gz'),\n  );\n  console.log('Pipeline succeeded.');\n}\n\nrun().catch(console.error);\n</code></pre>\n<pre><code class=\"language-mjs\">import { pipeline } from 'node:stream/promises';\nimport { createReadStream, createWriteStream } from 'node:fs';\nimport { createGzip } from 'node:zlib';\n\nawait pipeline(\n  createReadStream('archive.tar'),\n  createGzip(),\n  createWriteStream('archive.tar.gz'),\n);\nconsole.log('Pipeline succeeded.');\n</code></pre>\n<p>To use an <code>AbortSignal</code>, pass it inside an options object, as the last argument.\nWhen the signal is aborted, <code>destroy</code> will be called on the underlying pipeline,\nwith an <code>AbortError</code>.</p>\n<pre><code class=\"language-cjs\">const { pipeline } = require('node:stream/promises');\nconst fs = require('node:fs');\nconst zlib = require('node:zlib');\n\nasync function run() {\n  const ac = new AbortController();\n  const signal = ac.signal;\n\n  setImmediate(() => ac.abort());\n  await pipeline(\n    fs.createReadStream('archive.tar'),\n    zlib.createGzip(),\n    fs.createWriteStream('archive.tar.gz'),\n    { signal },\n  );\n}\n\nrun().catch(console.error); // AbortError\n</code></pre>\n<pre><code class=\"language-mjs\">import { pipeline } from 'node:stream/promises';\nimport { createReadStream, createWriteStream } from 'node:fs';\nimport { createGzip } from 'node:zlib';\n\nconst ac = new AbortController();\nconst { signal } = ac;\nsetImmediate(() => ac.abort());\ntry {\n  await pipeline(\n    createReadStream('archive.tar'),\n    createGzip(),\n    createWriteStream('archive.tar.gz'),\n    { signal },\n  );\n} catch (err) {\n  console.error(err); // AbortError\n}\n</code></pre>\n<p>The <code>pipeline</code> API also supports async generators:</p>\n<pre><code class=\"language-cjs\">const { pipeline } = require('node:stream/promises');\nconst fs = require('node:fs');\n\nasync function run() {\n  await pipeline(\n    fs.createReadStream('lowercase.txt'),\n    async function* (source, { signal }) {\n      source.setEncoding('utf8');  // Work with strings rather than `Buffer`s.\n      for await (const chunk of source) {\n        yield await processChunk(chunk, { signal });\n      }\n    },\n    fs.createWriteStream('uppercase.txt'),\n  );\n  console.log('Pipeline succeeded.');\n}\n\nrun().catch(console.error);\n</code></pre>\n<pre><code class=\"language-mjs\">import { pipeline } from 'node:stream/promises';\nimport { createReadStream, createWriteStream } from 'node:fs';\n\nawait pipeline(\n  createReadStream('lowercase.txt'),\n  async function* (source, { signal }) {\n    source.setEncoding('utf8');  // Work with strings rather than `Buffer`s.\n    for await (const chunk of source) {\n      yield await processChunk(chunk, { signal });\n    }\n  },\n  createWriteStream('uppercase.txt'),\n);\nconsole.log('Pipeline succeeded.');\n</code></pre>\n<p>Remember to handle the <code>signal</code> argument passed into the async generator.\nEspecially in the case where the async generator is the source for the\npipeline (i.e. first argument) or the pipeline will never complete.</p>\n<pre><code class=\"language-cjs\">const { pipeline } = require('node:stream/promises');\nconst fs = require('node:fs');\n\nasync function run() {\n  await pipeline(\n    async function* ({ signal }) {\n      await someLongRunningfn({ signal });\n      yield 'asd';\n    },\n    fs.createWriteStream('uppercase.txt'),\n  );\n  console.log('Pipeline succeeded.');\n}\n\nrun().catch(console.error);\n</code></pre>\n<pre><code class=\"language-mjs\">import { pipeline } from 'node:stream/promises';\nimport fs from 'node:fs';\nawait pipeline(\n  async function* ({ signal }) {\n    await someLongRunningfn({ signal });\n    yield 'asd';\n  },\n  fs.createWriteStream('uppercase.txt'),\n);\nconsole.log('Pipeline succeeded.');\n</code></pre>\n<p>The <code>pipeline</code> API provides <a href=\"#streampipelinesource-transforms-destination-callback\">callback version</a>:</p>"
            },
            {
              "textRaw": "`stream.finished(stream[, options])`",
              "name": "finished",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.5.0",
                      "v18.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46205",
                    "description": "Added support for `ReadableStream` and `WritableStream`."
                  },
                  {
                    "version": [
                      "v19.1.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44862",
                    "description": "The `cleanup` option was added."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {Stream|ReadableStream|WritableStream} A readable and/or writable stream/webstream.",
                      "name": "stream",
                      "type": "Stream|ReadableStream|WritableStream",
                      "desc": "A readable and/or writable stream/webstream."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`error` {boolean|undefined}",
                          "name": "error",
                          "type": "boolean|undefined"
                        },
                        {
                          "textRaw": "`readable` {boolean|undefined}",
                          "name": "readable",
                          "type": "boolean|undefined"
                        },
                        {
                          "textRaw": "`writable` {boolean|undefined}",
                          "name": "writable",
                          "type": "boolean|undefined"
                        },
                        {
                          "textRaw": "`signal` {AbortSignal|undefined}",
                          "name": "signal",
                          "type": "AbortSignal|undefined"
                        },
                        {
                          "textRaw": "`cleanup` {boolean|undefined} If `true`, removes the listeners registered by this function before the promise is fulfilled. **Default:** `false`.",
                          "name": "cleanup",
                          "type": "boolean|undefined",
                          "default": "`false`",
                          "desc": "If `true`, removes the listeners registered by this function before the promise is fulfilled."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills when the stream is no longer readable or writable.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills when the stream is no longer readable or writable."
                  }
                }
              ],
              "desc": "<pre><code class=\"language-cjs\">const { finished } = require('node:stream/promises');\nconst fs = require('node:fs');\n\nconst rs = fs.createReadStream('archive.tar');\n\nasync function run() {\n  await finished(rs);\n  console.log('Stream is done reading.');\n}\n\nrun().catch(console.error);\nrs.resume(); // Drain the stream.\n</code></pre>\n<pre><code class=\"language-mjs\">import { finished } from 'node:stream/promises';\nimport { createReadStream } from 'node:fs';\n\nconst rs = createReadStream('archive.tar');\n\nasync function run() {\n  await finished(rs);\n  console.log('Stream is done reading.');\n}\n\nrun().catch(console.error);\nrs.resume(); // Drain the stream.\n</code></pre>\n<p>The <code>finished</code> API also provides a <a href=\"#streamfinishedstream-options-callback\">callback version</a>.</p>\n<p><code>stream.finished()</code> leaves dangling event listeners (in particular\n<code>'error'</code>, <code>'end'</code>, <code>'finish'</code> and <code>'close'</code>) after the returned promise is\nresolved or rejected. The reason for this is so that unexpected <code>'error'</code>\nevents (due to incorrect stream implementations) do not cause unexpected\ncrashes. If this is unwanted behavior then <code>options.cleanup</code> should be set to\n<code>true</code>:</p>\n<pre><code class=\"language-mjs\">await finished(rs, { cleanup: true });\n</code></pre>"
            }
          ],
          "miscs": [
            {
              "textRaw": "Buffering",
              "name": "Buffering",
              "type": "misc",
              "desc": "<p>Both <a href=\"#class-streamwritable\"><code>Writable</code></a> and <a href=\"#class-streamreadable\"><code>Readable</code></a> streams will store data in an internal\nbuffer.</p>\n<p>The amount of data potentially buffered depends on the <code>highWaterMark</code> option\npassed into the stream's constructor. For normal streams, the <code>highWaterMark</code>\noption specifies a <a href=\"#highwatermark-discrepancy-after-calling-readablesetencoding\">total number of bytes</a>. For streams operating\nin object mode, the <code>highWaterMark</code> specifies a total number of objects. For\nstreams operating on (but not decoding) strings, the <code>highWaterMark</code> specifies\na total number of UTF-16 code units.</p>\n<p>Data is buffered in <code>Readable</code> streams when the implementation calls\n<a href=\"#readablepushchunk-encoding\"><code>stream.push(chunk)</code></a>. If the consumer of the Stream does not\ncall <a href=\"#readablereadsize\"><code>stream.read()</code></a>, the data will sit in the internal\nqueue until it is consumed.</p>\n<p>Once the total size of the internal read buffer reaches the threshold specified\nby <code>highWaterMark</code>, the stream will temporarily stop reading data from the\nunderlying resource until the data currently buffered can be consumed (that is,\nthe stream will stop calling the internal <a href=\"#readable_readsize\"><code>readable._read()</code></a> method that is\nused to fill the read buffer).</p>\n<p>Data is buffered in <code>Writable</code> streams when the\n<a href=\"#writablewritechunk-encoding-callback\"><code>writable.write(chunk)</code></a> method is called repeatedly. While the\ntotal size of the internal write buffer is below the threshold set by\n<code>highWaterMark</code>, calls to <code>writable.write()</code> will return <code>true</code>. Once\nthe size of the internal buffer reaches or exceeds the <code>highWaterMark</code>, <code>false</code>\nwill be returned.</p>\n<p>A key goal of the <code>stream</code> API, particularly the <a href=\"#readablepipedestination-options\"><code>stream.pipe()</code></a> method,\nis to limit the buffering of data to acceptable levels such that sources and\ndestinations of differing speeds will not overwhelm the available memory.</p>\n<p>The <code>highWaterMark</code> option is a threshold, not a limit: it dictates the amount\nof data that a stream buffers before it stops asking for more data. It does not\nenforce a strict memory limitation in general. Specific stream implementations\nmay choose to enforce stricter limits but doing so is optional.</p>\n<p>Because <a href=\"#class-streamduplex\"><code>Duplex</code></a> and <a href=\"#class-streamtransform\"><code>Transform</code></a> streams are both <code>Readable</code> and\n<code>Writable</code>, each maintains <em>two</em> separate internal buffers used for reading and\nwriting, allowing each side to operate independently of the other while\nmaintaining an appropriate and efficient flow of data. For example,\n<a href=\"net.html#class-netsocket\"><code>net.Socket</code></a> instances are <a href=\"#class-streamduplex\"><code>Duplex</code></a> streams whose <code>Readable</code> side allows\nconsumption of data received <em>from</em> the socket and whose <code>Writable</code> side allows\nwriting data <em>to</em> the socket. Because data may be written to the socket at a\nfaster or slower rate than data is received, each side should\noperate (and buffer) independently of the other.</p>\n<p>The mechanics of the internal buffering are an internal implementation detail\nand may be changed at any time. However, for certain advanced implementations,\nthe internal buffers can be retrieved using <code>writable.writableBuffer</code> or\n<code>readable.readableBuffer</code>. Use of these undocumented properties is discouraged.</p>"
            }
          ],
          "displayName": "Types of streams"
        }
      ],
      "miscs": [
        {
          "textRaw": "API for stream consumers",
          "name": "API for stream consumers",
          "type": "misc",
          "desc": "<p>Almost all Node.js applications, no matter how simple, use streams in some\nmanner. The following is an example of using streams in a Node.js application\nthat implements an HTTP server:</p>\n<pre><code class=\"language-js\">const http = require('node:http');\n\nconst server = http.createServer((req, res) => {\n  // `req` is an http.IncomingMessage, which is a readable stream.\n  // `res` is an http.ServerResponse, which is a writable stream.\n\n  let body = '';\n  // Get the data as utf8 strings.\n  // If an encoding is not set, Buffer objects will be received.\n  req.setEncoding('utf8');\n\n  // Readable streams emit 'data' events once a listener is added.\n  req.on('data', (chunk) => {\n    body += chunk;\n  });\n\n  // The 'end' event indicates that the entire body has been received.\n  req.on('end', () => {\n    try {\n      const data = JSON.parse(body);\n      // Write back something interesting to the user:\n      res.write(typeof data);\n      res.end();\n    } catch (er) {\n      // uh oh! bad json!\n      res.statusCode = 400;\n      return res.end(`error: ${er.message}`);\n    }\n  });\n});\n\nserver.listen(1337);\n\n// $ curl localhost:1337 -d \"{}\"\n// object\n// $ curl localhost:1337 -d \"\\\"foo\\\"\"\n// string\n// $ curl localhost:1337 -d \"not json\"\n// error: Unexpected token 'o', \"not json\" is not valid JSON\n</code></pre>\n<p><a href=\"#class-streamwritable\"><code>Writable</code></a> streams (such as <code>res</code> in the example) expose methods such as\n<code>write()</code> and <code>end()</code> that are used to write data onto the stream.</p>\n<p><a href=\"#class-streamreadable\"><code>Readable</code></a> streams use the <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a> API for notifying application\ncode when data is available to be read off the stream. That available data can\nbe read from the stream in multiple ways.</p>\n<p>Both <a href=\"#class-streamwritable\"><code>Writable</code></a> and <a href=\"#class-streamreadable\"><code>Readable</code></a> streams use the <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a> API in\nvarious ways to communicate the current state of the stream.</p>\n<p><a href=\"#class-streamduplex\"><code>Duplex</code></a> and <a href=\"#class-streamtransform\"><code>Transform</code></a> streams are both <a href=\"#class-streamwritable\"><code>Writable</code></a> and\n<a href=\"#class-streamreadable\"><code>Readable</code></a>.</p>\n<p>Applications that are either writing data to or consuming data from a stream\nare not required to implement the stream interfaces directly and will generally\nhave no reason to call <code>require('node:stream')</code>.</p>\n<p>Developers wishing to implement new types of streams should refer to the\nsection <a href=\"#api-for-stream-implementers\">API for stream implementers</a>.</p>",
          "miscs": [
            {
              "textRaw": "Writable streams",
              "name": "writable_streams",
              "type": "misc",
              "desc": "<p>Writable streams are an abstraction for a <em>destination</em> to which data is\nwritten.</p>\n<p>Examples of <a href=\"#class-streamwritable\"><code>Writable</code></a> streams include:</p>\n<ul>\n<li><a href=\"http.html#class-httpclientrequest\">HTTP requests, on the client</a></li>\n<li><a href=\"http.html#class-httpserverresponse\">HTTP responses, on the server</a></li>\n<li><a href=\"fs.html#class-fswritestream\">fs write streams</a></li>\n<li><a href=\"zlib.html\">zlib streams</a></li>\n<li><a href=\"crypto.html\">crypto streams</a></li>\n<li><a href=\"net.html#class-netsocket\">TCP sockets</a></li>\n<li><a href=\"child_process.html#subprocessstdin\">child process stdin</a></li>\n<li><a href=\"process.html#processstdout\"><code>process.stdout</code></a>, <a href=\"process.html#processstderr\"><code>process.stderr</code></a></li>\n</ul>\n<p>Some of these examples are actually <a href=\"#class-streamduplex\"><code>Duplex</code></a> streams that implement the\n<a href=\"#class-streamwritable\"><code>Writable</code></a> interface.</p>\n<p>All <a href=\"#class-streamwritable\"><code>Writable</code></a> streams implement the interface defined by the\n<code>stream.Writable</code> class.</p>\n<p>While specific instances of <a href=\"#class-streamwritable\"><code>Writable</code></a> streams may differ in various ways,\nall <code>Writable</code> streams follow the same fundamental usage pattern as illustrated\nin the example below:</p>\n<pre><code class=\"language-js\">const myStream = getWritableStreamSomehow();\nmyStream.write('some data');\nmyStream.write('some more data');\nmyStream.end('done writing data');\n</code></pre>",
              "classes": [
                {
                  "textRaw": "Class: `stream.Writable`",
                  "name": "stream.Writable",
                  "type": "class",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "events": [
                    {
                      "textRaw": "Event: `'close'`",
                      "name": "close",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": [
                          {
                            "version": "v10.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/18438",
                            "description": "Add `emitClose` option to specify if `'close'` is emitted on destroy."
                          }
                        ]
                      },
                      "params": [],
                      "desc": "<p>The <code>'close'</code> event is emitted when the stream and any of its underlying\nresources (a file descriptor, for example) have been closed. The event indicates\nthat no more events will be emitted, and no further computation will occur.</p>\n<p>A <a href=\"#class-streamwritable\"><code>Writable</code></a> stream will always emit the <code>'close'</code> event if it is\ncreated with the <code>emitClose</code> option.</p>"
                    },
                    {
                      "textRaw": "Event: `'drain'`",
                      "name": "drain",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>If a call to <a href=\"#writablewritechunk-encoding-callback\"><code>stream.write(chunk)</code></a> returns <code>false</code>, the\n<code>'drain'</code> event will be emitted when it is appropriate to resume writing data\nto the stream.</p>\n<pre><code class=\"language-js\">// Write the data to the supplied writable stream one million times.\n// Be attentive to back-pressure.\nfunction writeOneMillionTimes(writer, data, encoding, callback) {\n  let i = 1000000;\n  write();\n  function write() {\n    let ok = true;\n    do {\n      i--;\n      if (i === 0) {\n        // Last time!\n        writer.write(data, encoding, callback);\n      } else {\n        // See if we should continue, or wait.\n        // Don't pass the callback, because we're not done yet.\n        ok = writer.write(data, encoding);\n      }\n    } while (i > 0 &#x26;&#x26; ok);\n    if (i > 0) {\n      // Had to stop early!\n      // Write some more once it drains.\n      writer.once('drain', write);\n    }\n  }\n}\n</code></pre>"
                    },
                    {
                      "textRaw": "Event: `'error'`",
                      "name": "error",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [
                        {
                          "textRaw": "Type: {Error}",
                          "name": "type",
                          "type": "Error"
                        }
                      ],
                      "desc": "<p>The <code>'error'</code> event is emitted if an error occurred while writing or piping\ndata. The listener callback is passed a single <code>Error</code> argument when called.</p>\n<p>The stream is closed when the <code>'error'</code> event is emitted unless the\n<a href=\"#new-streamwritableoptions\"><code>autoDestroy</code></a> option was set to <code>false</code> when creating the\nstream.</p>\n<p>After <code>'error'</code>, no further events other than <code>'close'</code> <em>should</em> be emitted\n(including <code>'error'</code> events).</p>"
                    },
                    {
                      "textRaw": "Event: `'finish'`",
                      "name": "finish",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>The <code>'finish'</code> event is emitted after the <a href=\"#writableendchunk-encoding-callback\"><code>stream.end()</code></a> method\nhas been called, and all data has been flushed to the underlying system.</p>\n<pre><code class=\"language-js\">const writer = getWritableStreamSomehow();\nfor (let i = 0; i &#x3C; 100; i++) {\n  writer.write(`hello, #${i}!\\n`);\n}\nwriter.on('finish', () => {\n  console.log('All writes are now complete.');\n});\nwriter.end('This is the end\\n');\n</code></pre>"
                    },
                    {
                      "textRaw": "Event: `'pipe'`",
                      "name": "pipe",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [
                        {
                          "textRaw": "`src` {stream.Readable} source stream that is piping to this writable",
                          "name": "src",
                          "type": "stream.Readable",
                          "desc": "source stream that is piping to this writable"
                        }
                      ],
                      "desc": "<p>The <code>'pipe'</code> event is emitted when the <a href=\"#readablepipedestination-options\"><code>stream.pipe()</code></a> method is called on\na readable stream, adding this writable to its set of destinations.</p>\n<pre><code class=\"language-js\">const writer = getWritableStreamSomehow();\nconst reader = getReadableStreamSomehow();\nwriter.on('pipe', (src) => {\n  console.log('Something is piping into the writer.');\n  assert.equal(src, reader);\n});\nreader.pipe(writer);\n</code></pre>"
                    },
                    {
                      "textRaw": "Event: `'unpipe'`",
                      "name": "unpipe",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [
                        {
                          "textRaw": "`src` {stream.Readable} The source stream that unpiped this writable",
                          "name": "src",
                          "type": "stream.Readable",
                          "desc": "The source stream that unpiped this writable"
                        }
                      ],
                      "desc": "<p>The <code>'unpipe'</code> event is emitted when the <a href=\"#readableunpipedestination\"><code>stream.unpipe()</code></a> method is called\non a <a href=\"#class-streamreadable\"><code>Readable</code></a> stream, removing this <a href=\"#class-streamwritable\"><code>Writable</code></a> from its set of\ndestinations.</p>\n<p>This is also emitted in case this <a href=\"#class-streamwritable\"><code>Writable</code></a> stream emits an error when a\n<a href=\"#class-streamreadable\"><code>Readable</code></a> stream pipes into it.</p>\n<pre><code class=\"language-js\">const writer = getWritableStreamSomehow();\nconst reader = getReadableStreamSomehow();\nwriter.on('unpipe', (src) => {\n  console.log('Something has stopped piping into the writer.');\n  assert.equal(src, reader);\n});\nreader.pipe(writer);\nreader.unpipe(writer);\n</code></pre>"
                    }
                  ],
                  "methods": [
                    {
                      "textRaw": "`writable.cork()`",
                      "name": "cork",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.11.2"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": []
                        }
                      ],
                      "desc": "<p>The <code>writable.cork()</code> method forces all written data to be buffered in memory.\nThe buffered data will be flushed when either the <a href=\"#writableuncork\"><code>stream.uncork()</code></a> or\n<a href=\"#writableendchunk-encoding-callback\"><code>stream.end()</code></a> methods are called.</p>\n<p>The primary intent of <code>writable.cork()</code> is to accommodate a situation in which\nseveral small chunks are written to the stream in rapid succession. Instead of\nimmediately forwarding them to the underlying destination, <code>writable.cork()</code>\nbuffers all the chunks until <code>writable.uncork()</code> is called, which will pass them\nall to <code>writable._writev()</code>, if present. This prevents a head-of-line blocking\nsituation where data is being buffered while waiting for the first small chunk\nto be processed. However, use of <code>writable.cork()</code> without implementing\n<code>writable._writev()</code> may have an adverse effect on throughput.</p>\n<p>See also: <a href=\"#writableuncork\"><code>writable.uncork()</code></a>, <a href=\"#writable_writevchunks-callback\"><code>writable._writev()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`writable.destroy([error])`",
                      "name": "destroy",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": [
                          {
                            "version": "v14.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/29197",
                            "description": "Work as a no-op on a stream that has already been destroyed."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`error` {Error} Optional, an error to emit with `'error'` event.",
                              "name": "error",
                              "type": "Error",
                              "desc": "Optional, an error to emit with `'error'` event.",
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>Destroy the stream. Optionally emit an <code>'error'</code> event, and emit a <code>'close'</code>\nevent (unless <code>emitClose</code> is set to <code>false</code>). After this call, the writable\nstream has ended and subsequent calls to <code>write()</code> or <code>end()</code> will result in\nan <code>ERR_STREAM_DESTROYED</code> error.\nThis is a destructive and immediate way to destroy a stream. Previous calls to\n<code>write()</code> may not have drained, and may trigger an <code>ERR_STREAM_DESTROYED</code> error.\nUse <code>end()</code> instead of destroy if data should flush before close, or wait for\nthe <code>'drain'</code> event before destroying the stream.</p>\n<pre><code class=\"language-cjs\">const { Writable } = require('node:stream');\n\nconst myStream = new Writable();\n\nconst fooErr = new Error('foo error');\nmyStream.destroy(fooErr);\nmyStream.on('error', (fooErr) => console.error(fooErr.message)); // foo error\n</code></pre>\n<pre><code class=\"language-cjs\">const { Writable } = require('node:stream');\n\nconst myStream = new Writable();\n\nmyStream.destroy();\nmyStream.on('error', function wontHappen() {});\n</code></pre>\n<pre><code class=\"language-cjs\">const { Writable } = require('node:stream');\n\nconst myStream = new Writable();\nmyStream.destroy();\n\nmyStream.write('foo', (error) => console.error(error.code));\n// ERR_STREAM_DESTROYED\n</code></pre>\n<p>Once <code>destroy()</code> has been called any further calls will be a no-op and no\nfurther errors except from <code>_destroy()</code> may be emitted as <code>'error'</code>.</p>\n<p>Implementors should not override this method,\nbut instead implement <a href=\"#writable_destroyerr-callback\"><code>writable._destroy()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`writable.end([chunk[, encoding]][, callback])`",
                      "name": "end",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v22.0.0",
                              "v20.13.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/51866",
                            "description": "The `chunk` argument can now be a `TypedArray` or `DataView` instance."
                          },
                          {
                            "version": "v15.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/34101",
                            "description": "The `callback` is invoked before 'finish' or on error."
                          },
                          {
                            "version": "v14.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/29747",
                            "description": "The `callback` is invoked if 'finish' or 'error' is emitted."
                          },
                          {
                            "version": "v10.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/18780",
                            "description": "This method now returns a reference to `writable`."
                          },
                          {
                            "version": "v8.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/11608",
                            "description": "The `chunk` argument can now be a `Uint8Array` instance."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`chunk` {string|Buffer|TypedArray|DataView|any} Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.",
                              "name": "chunk",
                              "type": "string|Buffer|TypedArray|DataView|any",
                              "desc": "Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.",
                              "optional": true
                            },
                            {
                              "textRaw": "`encoding` {string} The encoding if `chunk` is a string",
                              "name": "encoding",
                              "type": "string",
                              "desc": "The encoding if `chunk` is a string",
                              "optional": true
                            },
                            {
                              "textRaw": "`callback` {Function} Callback for when the stream is finished.",
                              "name": "callback",
                              "type": "Function",
                              "desc": "Callback for when the stream is finished.",
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>Calling the <code>writable.end()</code> method signals that no more data will be written\nto the <a href=\"#class-streamwritable\"><code>Writable</code></a>. The optional <code>chunk</code> and <code>encoding</code> arguments allow one\nfinal additional chunk of data to be written immediately before closing the\nstream.</p>\n<p>Calling the <a href=\"#writablewritechunk-encoding-callback\"><code>stream.write()</code></a> method after calling\n<a href=\"#writableendchunk-encoding-callback\"><code>stream.end()</code></a> will raise an error.</p>\n<pre><code class=\"language-js\">// Write 'hello, ' and then end with 'world!'.\nconst fs = require('node:fs');\nconst file = fs.createWriteStream('example.txt');\nfile.write('hello, ');\nfile.end('world!');\n// Writing more now is not allowed!\n</code></pre>"
                    },
                    {
                      "textRaw": "`writable.setDefaultEncoding(encoding)`",
                      "name": "setDefaultEncoding",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.11.15"
                        ],
                        "changes": [
                          {
                            "version": "v6.1.0",
                            "pr-url": "https://github.com/nodejs/node/pull/5040",
                            "description": "This method now returns a reference to `writable`."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`encoding` {string} The new default encoding",
                              "name": "encoding",
                              "type": "string",
                              "desc": "The new default encoding"
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>The <code>writable.setDefaultEncoding()</code> method sets the default <code>encoding</code> for a\n<a href=\"#class-streamwritable\"><code>Writable</code></a> stream.</p>"
                    },
                    {
                      "textRaw": "`writable.uncork()`",
                      "name": "uncork",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.11.2"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": []
                        }
                      ],
                      "desc": "<p>The <code>writable.uncork()</code> method flushes all data buffered since\n<a href=\"#writablecork\"><code>stream.cork()</code></a> was called.</p>\n<p>When using <a href=\"#writablecork\"><code>writable.cork()</code></a> and <code>writable.uncork()</code> to manage the buffering\nof writes to a stream, defer calls to <code>writable.uncork()</code> using\n<code>process.nextTick()</code>. Doing so allows batching of all\n<code>writable.write()</code> calls that occur within a given Node.js event loop phase.</p>\n<pre><code class=\"language-js\">stream.cork();\nstream.write('some ');\nstream.write('data ');\nprocess.nextTick(() => stream.uncork());\n</code></pre>\n<p>If the <a href=\"#writablecork\"><code>writable.cork()</code></a> method is called multiple times on a stream, the\nsame number of calls to <code>writable.uncork()</code> must be called to flush the buffered\ndata.</p>\n<pre><code class=\"language-js\">stream.cork();\nstream.write('some ');\nstream.cork();\nstream.write('data ');\nprocess.nextTick(() => {\n  stream.uncork();\n  // The data will not be flushed until uncork() is called a second time.\n  stream.uncork();\n});\n</code></pre>\n<p>See also: <a href=\"#writablecork\"><code>writable.cork()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`writable[Symbol.asyncDispose]()`",
                      "name": "[Symbol.asyncDispose]",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v22.4.0",
                          "v20.16.0"
                        ],
                        "changes": [
                          {
                            "version": "v24.2.0",
                            "pr-url": "https://github.com/nodejs/node/pull/58467",
                            "description": "No longer experimental."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": []
                        }
                      ],
                      "desc": "<p>Calls <a href=\"#writabledestroyerror\"><code>writable.destroy()</code></a> with an <code>AbortError</code> and returns\na promise that fulfills when the stream is finished.</p>"
                    },
                    {
                      "textRaw": "`writable.write(chunk[, encoding][, callback])`",
                      "name": "write",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v22.0.0",
                              "v20.13.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/51866",
                            "description": "The `chunk` argument can now be a `TypedArray` or `DataView` instance."
                          },
                          {
                            "version": "v8.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/11608",
                            "description": "The `chunk` argument can now be a `Uint8Array` instance."
                          },
                          {
                            "version": "v6.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/6170",
                            "description": "Passing `null` as the `chunk` parameter will always be considered invalid now, even in object mode."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`chunk` {string|Buffer|TypedArray|DataView|any} Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.",
                              "name": "chunk",
                              "type": "string|Buffer|TypedArray|DataView|any",
                              "desc": "Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`."
                            },
                            {
                              "textRaw": "`encoding` {string|null} The encoding, if `chunk` is a string. **Default:** `'utf8'`",
                              "name": "encoding",
                              "type": "string|null",
                              "default": "`'utf8'`",
                              "desc": "The encoding, if `chunk` is a string.",
                              "optional": true
                            },
                            {
                              "textRaw": "`callback` {Function} Callback for when this chunk of data is flushed.",
                              "name": "callback",
                              "type": "Function",
                              "desc": "Callback for when this chunk of data is flushed.",
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {boolean} `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                            "name": "return",
                            "type": "boolean",
                            "desc": "`false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                          }
                        }
                      ],
                      "desc": "<p>The <code>writable.write()</code> method writes some data to the stream, and calls the\nsupplied <code>callback</code> once the data has been fully handled. If an error\noccurs, the <code>callback</code> will be called with the error as its\nfirst argument. The <code>callback</code> is called asynchronously and before <code>'error'</code> is\nemitted.</p>\n<p>The return value is <code>true</code> if the internal buffer is less than the\n<code>highWaterMark</code> configured when the stream was created after admitting <code>chunk</code>.\nIf <code>false</code> is returned, further attempts to write data to the stream should\nstop until the <a href=\"#event-drain\"><code>'drain'</code></a> event is emitted.</p>\n<p>While a stream is not draining, calls to <code>write()</code> will buffer <code>chunk</code>, and\nreturn false. Once all currently buffered chunks are drained (accepted for\ndelivery by the operating system), the <code>'drain'</code> event will be emitted.\nOnce <code>write()</code> returns false, do not write more chunks\nuntil the <code>'drain'</code> event is emitted. While calling <code>write()</code> on a stream that\nis not draining is allowed, Node.js will buffer all written chunks until\nmaximum memory usage occurs, at which point it will abort unconditionally.\nEven before it aborts, high memory usage will cause poor garbage collector\nperformance and high RSS (which is not typically released back to the system,\neven after the memory is no longer required). Since TCP sockets may never\ndrain if the remote peer does not read the data, writing a socket that is\nnot draining may lead to a remotely exploitable vulnerability.</p>\n<p>Writing data while the stream is not draining is particularly\nproblematic for a <a href=\"#class-streamtransform\"><code>Transform</code></a>, because the <code>Transform</code> streams are paused\nby default until they are piped or a <code>'data'</code> or <code>'readable'</code> event handler\nis added.</p>\n<p>If the data to be written can be generated or fetched on demand, it is\nrecommended to encapsulate the logic into a <a href=\"#class-streamreadable\"><code>Readable</code></a> and use\n<a href=\"#readablepipedestination-options\"><code>stream.pipe()</code></a>. However, if calling <code>write()</code> is preferred, it is\npossible to respect backpressure and avoid memory issues using the\n<a href=\"#event-drain\"><code>'drain'</code></a> event:</p>\n<pre><code class=\"language-js\">function write(data, cb) {\n  if (!stream.write(data)) {\n    stream.once('drain', cb);\n  } else {\n    process.nextTick(cb);\n  }\n}\n\n// Wait for cb to be called before doing any other write.\nwrite('hello', () => {\n  console.log('Write completed, do more writes now.');\n});\n</code></pre>\n<p>A <code>Writable</code> stream in object mode will always ignore the <code>encoding</code> argument.</p>"
                    }
                  ],
                  "properties": [
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "closed",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v18.0.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> after <code>'close'</code> has been emitted.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "destroyed",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> after <a href=\"#writabledestroyerror\"><code>writable.destroy()</code></a> has been called.</p>\n<pre><code class=\"language-cjs\">const { Writable } = require('node:stream');\n\nconst myStream = new Writable();\n\nconsole.log(myStream.destroyed); // false\nmyStream.destroy();\nconsole.log(myStream.destroyed); // true\n</code></pre>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "writable",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v11.4.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> if it is safe to call <a href=\"#writablewritechunk-encoding-callback\"><code>writable.write()</code></a>, which means\nthe stream has not been destroyed, errored, or ended.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "writableAborted",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v18.0.0",
                          "v16.17.0"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v24.0.0",
                              "v22.17.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/57513",
                            "description": "Marking the API stable."
                          }
                        ]
                      },
                      "desc": "<p>Returns whether the stream was destroyed or errored before emitting <code>'finish'</code>.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "writableEnded",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v12.9.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> after <a href=\"#writableendchunk-encoding-callback\"><code>writable.end()</code></a> has been called. This property\ndoes not indicate whether the data has been flushed, for this use\n<a href=\"#writablewritablefinished\"><code>writable.writableFinished</code></a> instead.</p>"
                    },
                    {
                      "textRaw": "Type: {integer}",
                      "name": "writableCorked",
                      "type": "integer",
                      "meta": {
                        "added": [
                          "v13.2.0",
                          "v12.16.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Number of times <a href=\"#writableuncork\"><code>writable.uncork()</code></a> needs to be\ncalled in order to fully uncork the stream.</p>"
                    },
                    {
                      "textRaw": "Type: {Error}",
                      "name": "errored",
                      "type": "Error",
                      "meta": {
                        "added": [
                          "v18.0.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Returns error if the stream has been destroyed with an error.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "writableFinished",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v12.6.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is set to <code>true</code> immediately before the <a href=\"#event-finish\"><code>'finish'</code></a> event is emitted.</p>"
                    },
                    {
                      "textRaw": "Type: {number}",
                      "name": "writableHighWaterMark",
                      "type": "number",
                      "meta": {
                        "added": [
                          "v9.3.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Return the value of <code>highWaterMark</code> passed when creating this <code>Writable</code>.</p>"
                    },
                    {
                      "textRaw": "Type: {number}",
                      "name": "writableLength",
                      "type": "number",
                      "meta": {
                        "added": [
                          "v9.4.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>This property contains the number of bytes (or objects) in the queue\nready to be written. The value provides introspection data regarding\nthe status of the <code>highWaterMark</code>.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "writableNeedDrain",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v15.2.0",
                          "v14.17.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> if the stream's buffer has been full and stream will emit <code>'drain'</code>.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "writableObjectMode",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v12.3.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Getter for the property <code>objectMode</code> of a given <code>Writable</code> stream.</p>"
                    }
                  ]
                }
              ],
              "displayName": "Writable streams"
            },
            {
              "textRaw": "Readable streams",
              "name": "readable_streams",
              "type": "misc",
              "desc": "<p>Readable streams are an abstraction for a <em>source</em> from which data is\nconsumed.</p>\n<p>Examples of <code>Readable</code> streams include:</p>\n<ul>\n<li><a href=\"http.html#class-httpincomingmessage\">HTTP responses, on the client</a></li>\n<li><a href=\"http.html#class-httpincomingmessage\">HTTP requests, on the server</a></li>\n<li><a href=\"fs.html#class-fsreadstream\">fs read streams</a></li>\n<li><a href=\"zlib.html\">zlib streams</a></li>\n<li><a href=\"crypto.html\">crypto streams</a></li>\n<li><a href=\"net.html#class-netsocket\">TCP sockets</a></li>\n<li><a href=\"child_process.html#subprocessstdout\">child process stdout and stderr</a></li>\n<li><a href=\"process.html#processstdin\"><code>process.stdin</code></a></li>\n</ul>\n<p>All <a href=\"#class-streamreadable\"><code>Readable</code></a> streams implement the interface defined by the\n<code>stream.Readable</code> class.</p>",
              "modules": [
                {
                  "textRaw": "Two reading modes",
                  "name": "two_reading_modes",
                  "type": "module",
                  "desc": "<p><code>Readable</code> streams effectively operate in one of two modes: flowing and\npaused. These modes are separate from <a href=\"#object-mode\">object mode</a>.\nA <a href=\"#class-streamreadable\"><code>Readable</code></a> stream can be in object mode or not, regardless of whether\nit is in flowing mode or paused mode.</p>\n<ul>\n<li>\n<p>In flowing mode, data is read from the underlying system automatically\nand provided to an application as quickly as possible using events via the\n<a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a> interface.</p>\n</li>\n<li>\n<p>In paused mode, the <a href=\"#readablereadsize\"><code>stream.read()</code></a> method must be called\nexplicitly to read chunks of data from the stream.</p>\n</li>\n</ul>\n<p>All <a href=\"#class-streamreadable\"><code>Readable</code></a> streams begin in paused mode but can be switched to flowing\nmode in one of the following ways:</p>\n<ul>\n<li>Adding a <a href=\"#event-data\"><code>'data'</code></a> event handler.</li>\n<li>Calling the <a href=\"#readableresume\"><code>stream.resume()</code></a> method.</li>\n<li>Calling the <a href=\"#readablepipedestination-options\"><code>stream.pipe()</code></a> method to send the data to a <a href=\"#class-streamwritable\"><code>Writable</code></a>.</li>\n</ul>\n<p>The <code>Readable</code> can switch back to paused mode using one of the following:</p>\n<ul>\n<li>If there are no pipe destinations, by calling the\n<a href=\"#readablepause\"><code>stream.pause()</code></a> method.</li>\n<li>If there are pipe destinations, by removing all pipe destinations.\nMultiple pipe destinations may be removed by calling the\n<a href=\"#readableunpipedestination\"><code>stream.unpipe()</code></a> method.</li>\n</ul>\n<p>The important concept to remember is that a <code>Readable</code> will not generate data\nuntil a mechanism for either consuming or ignoring that data is provided. If\nthe consuming mechanism is disabled or taken away, the <code>Readable</code> will <em>attempt</em>\nto stop generating the data.</p>\n<p>For backward compatibility reasons, removing <a href=\"#event-data\"><code>'data'</code></a> event handlers will\n<strong>not</strong> automatically pause the stream. Also, if there are piped destinations,\nthen calling <a href=\"#readablepause\"><code>stream.pause()</code></a> will not guarantee that the\nstream will <em>remain</em> paused once those destinations drain and ask for more data.</p>\n<p>If a <a href=\"#class-streamreadable\"><code>Readable</code></a> is switched into flowing mode and there are no consumers\navailable to handle the data, that data will be lost. This can occur, for\ninstance, when the <code>readable.resume()</code> method is called without a listener\nattached to the <code>'data'</code> event, or when a <code>'data'</code> event handler is removed\nfrom the stream.</p>\n<p>Adding a <a href=\"#event-readable\"><code>'readable'</code></a> event handler automatically makes the stream\nstop flowing, and the data has to be consumed via\n<a href=\"#readablereadsize\"><code>readable.read()</code></a>. If the <a href=\"#event-readable\"><code>'readable'</code></a> event handler is\nremoved, then the stream will start flowing again if there is a\n<a href=\"#event-data\"><code>'data'</code></a> event handler.</p>",
                  "displayName": "Two reading modes"
                },
                {
                  "textRaw": "Three states",
                  "name": "three_states",
                  "type": "module",
                  "desc": "<p>The \"two modes\" of operation for a <code>Readable</code> stream are a simplified\nabstraction for the more complicated internal state management that is happening\nwithin the <code>Readable</code> stream implementation.</p>\n<p>Specifically, at any given point in time, every <code>Readable</code> is in one of three\npossible states:</p>\n<ul>\n<li><code>readable.readableFlowing === null</code></li>\n<li><code>readable.readableFlowing === false</code></li>\n<li><code>readable.readableFlowing === true</code></li>\n</ul>\n<p>When <code>readable.readableFlowing</code> is <code>null</code>, no mechanism for consuming the\nstream's data is provided. Therefore, the stream will not generate data.\nWhile in this state, attaching a listener for the <code>'data'</code> event, calling the\n<code>readable.pipe()</code> method, or calling the <code>readable.resume()</code> method will switch\n<code>readable.readableFlowing</code> to <code>true</code>, causing the <code>Readable</code> to begin actively\nemitting events as data is generated.</p>\n<p>Calling <code>readable.pause()</code>, <code>readable.unpipe()</code>, or receiving backpressure\nwill cause the <code>readable.readableFlowing</code> to be set as <code>false</code>,\ntemporarily halting the flowing of events but <em>not</em> halting the generation of\ndata. While in this state, attaching a listener for the <code>'data'</code> event\nwill not switch <code>readable.readableFlowing</code> to <code>true</code>.</p>\n<pre><code class=\"language-js\">const { PassThrough, Writable } = require('node:stream');\nconst pass = new PassThrough();\nconst writable = new Writable();\n\npass.pipe(writable);\npass.unpipe(writable);\n// readableFlowing is now false.\n\npass.on('data', (chunk) => { console.log(chunk.toString()); });\n// readableFlowing is still false.\npass.write('ok');  // Will not emit 'data'.\npass.resume();     // Must be called to make stream emit 'data'.\n// readableFlowing is now true.\n</code></pre>\n<p>While <code>readable.readableFlowing</code> is <code>false</code>, data may be accumulating\nwithin the stream's internal buffer.</p>",
                  "displayName": "Three states"
                },
                {
                  "textRaw": "Choose one API style",
                  "name": "choose_one_api_style",
                  "type": "module",
                  "desc": "<p>The <code>Readable</code> stream API evolved across multiple Node.js versions and provides\nmultiple methods of consuming stream data. In general, developers should choose\n<em>one</em> of the methods of consuming data and <em>should never</em> use multiple methods\nto consume data from a single stream. Specifically, using a combination\nof <code>on('data')</code>, <code>on('readable')</code>, <code>pipe()</code>, or async iterators could\nlead to unintuitive behavior.</p>",
                  "displayName": "Choose one API style"
                }
              ],
              "classes": [
                {
                  "textRaw": "Class: `stream.Readable`",
                  "name": "stream.Readable",
                  "type": "class",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "events": [
                    {
                      "textRaw": "Event: `'close'`",
                      "name": "close",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": [
                          {
                            "version": "v10.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/18438",
                            "description": "Add `emitClose` option to specify if `'close'` is emitted on destroy."
                          }
                        ]
                      },
                      "params": [],
                      "desc": "<p>The <code>'close'</code> event is emitted when the stream and any of its underlying\nresources (a file descriptor, for example) have been closed. The event indicates\nthat no more events will be emitted, and no further computation will occur.</p>\n<p>A <a href=\"#class-streamreadable\"><code>Readable</code></a> stream will always emit the <code>'close'</code> event if it is\ncreated with the <code>emitClose</code> option.</p>"
                    },
                    {
                      "textRaw": "Event: `'data'`",
                      "name": "data",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [
                        {
                          "textRaw": "`chunk` {Buffer|string|any} The chunk of data. For streams that are not operating in object mode, the chunk will be either a string or `Buffer`. For streams that are in object mode, the chunk can be any JavaScript value other than `null`.",
                          "name": "chunk",
                          "type": "Buffer|string|any",
                          "desc": "The chunk of data. For streams that are not operating in object mode, the chunk will be either a string or `Buffer`. For streams that are in object mode, the chunk can be any JavaScript value other than `null`."
                        }
                      ],
                      "desc": "<p>The <code>'data'</code> event is emitted whenever the stream is relinquishing ownership of\na chunk of data to a consumer. This may occur whenever the stream is switched\nin flowing mode by calling <code>readable.pipe()</code>, <code>readable.resume()</code>, or by\nattaching a listener callback to the <code>'data'</code> event. The <code>'data'</code> event will\nalso be emitted whenever the <code>readable.read()</code> method is called and a chunk of\ndata is available to be returned.</p>\n<p>Attaching a <code>'data'</code> event listener to a stream that has not been explicitly\npaused will switch the stream into flowing mode. Data will then be passed as\nsoon as it is available.</p>\n<p>The listener callback will be passed the chunk of data as a string if a default\nencoding has been specified for the stream using the\n<code>readable.setEncoding()</code> method; otherwise the data will be passed as a\n<code>Buffer</code>.</p>\n<pre><code class=\"language-js\">const readable = getReadableStreamSomehow();\nreadable.on('data', (chunk) => {\n  console.log(`Received ${chunk.length} bytes of data.`);\n});\n</code></pre>"
                    },
                    {
                      "textRaw": "Event: `'end'`",
                      "name": "end",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>The <code>'end'</code> event is emitted when there is no more data to be consumed from\nthe stream.</p>\n<p>The <code>'end'</code> event <strong>will not be emitted</strong> unless the data is completely\nconsumed. This can be accomplished by switching the stream into flowing mode,\nor by calling <a href=\"#readablereadsize\"><code>stream.read()</code></a> repeatedly until all data has been\nconsumed.</p>\n<pre><code class=\"language-js\">const readable = getReadableStreamSomehow();\nreadable.on('data', (chunk) => {\n  console.log(`Received ${chunk.length} bytes of data.`);\n});\nreadable.on('end', () => {\n  console.log('There will be no more data.');\n});\n</code></pre>"
                    },
                    {
                      "textRaw": "Event: `'error'`",
                      "name": "error",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [
                        {
                          "textRaw": "Type: {Error}",
                          "name": "type",
                          "type": "Error"
                        }
                      ],
                      "desc": "<p>The <code>'error'</code> event may be emitted by a <code>Readable</code> implementation at any time.\nTypically, this may occur if the underlying stream is unable to generate data\ndue to an underlying internal failure, or when a stream implementation attempts\nto push an invalid chunk of data.</p>\n<p>The listener callback will be passed a single <code>Error</code> object.</p>"
                    },
                    {
                      "textRaw": "Event: `'pause'`",
                      "name": "pause",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>The <code>'pause'</code> event is emitted when <a href=\"#readablepause\"><code>stream.pause()</code></a> is called\nand <code>readableFlowing</code> is not <code>false</code>.</p>"
                    },
                    {
                      "textRaw": "Event: `'readable'`",
                      "name": "readable",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": [
                          {
                            "version": "v10.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/17979",
                            "description": "The `'readable'` is always emitted in the next tick after `.push()` is called."
                          },
                          {
                            "version": "v10.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/18994",
                            "description": "Using `'readable'` requires calling `.read()`."
                          }
                        ]
                      },
                      "params": [],
                      "desc": "<p>The <code>'readable'</code> event is emitted when there is data available to be read from\nthe stream, up to the configured high water mark (<code>state.highWaterMark</code>). Effectively,\nit indicates that the stream has new information within the buffer. If data is available\nwithin this buffer, <a href=\"#readablereadsize\"><code>stream.read()</code></a> can be called to retrieve that data.\nAdditionally, the <code>'readable'</code> event may also be emitted when the end of the stream has been\nreached.</p>\n<pre><code class=\"language-js\">const readable = getReadableStreamSomehow();\nreadable.on('readable', function() {\n  // There is some data to read now.\n  let data;\n\n  while ((data = this.read()) !== null) {\n    console.log(data);\n  }\n});\n</code></pre>\n<p>If the end of the stream has been reached, calling\n<a href=\"#readablereadsize\"><code>stream.read()</code></a> will return <code>null</code> and trigger the <code>'end'</code>\nevent. This is also true if there never was any data to be read. For instance,\nin the following example, <code>foo.txt</code> is an empty file:</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nconst rr = fs.createReadStream('foo.txt');\nrr.on('readable', () => {\n  console.log(`readable: ${rr.read()}`);\n});\nrr.on('end', () => {\n  console.log('end');\n});\n</code></pre>\n<p>The output of running this script is:</p>\n<pre><code class=\"language-console\">$ node test.js\nreadable: null\nend\n</code></pre>\n<p>In some cases, attaching a listener for the <code>'readable'</code> event will cause some\namount of data to be read into an internal buffer.</p>\n<p>In general, the <code>readable.pipe()</code> and <code>'data'</code> event mechanisms are easier to\nunderstand than the <code>'readable'</code> event. However, handling <code>'readable'</code> might\nresult in increased throughput.</p>\n<p>If both <code>'readable'</code> and <a href=\"#event-data\"><code>'data'</code></a> are used at the same time, <code>'readable'</code>\ntakes precedence in controlling the flow, i.e. <code>'data'</code> will be emitted\nonly when <a href=\"#readablereadsize\"><code>stream.read()</code></a> is called. The\n<code>readableFlowing</code> property would become <code>false</code>.\nIf there are <code>'data'</code> listeners when <code>'readable'</code> is removed, the stream\nwill start flowing, i.e. <code>'data'</code> events will be emitted without calling\n<code>.resume()</code>.</p>"
                    },
                    {
                      "textRaw": "Event: `'resume'`",
                      "name": "resume",
                      "type": "event",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "params": [],
                      "desc": "<p>The <code>'resume'</code> event is emitted when <a href=\"#readableresume\"><code>stream.resume()</code></a> is\ncalled and <code>readableFlowing</code> is not <code>true</code>.</p>"
                    }
                  ],
                  "methods": [
                    {
                      "textRaw": "`readable.destroy([error])`",
                      "name": "destroy",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": [
                          {
                            "version": "v14.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/29197",
                            "description": "Work as a no-op on a stream that has already been destroyed."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`error` {Error} Error which will be passed as payload in `'error'` event",
                              "name": "error",
                              "type": "Error",
                              "desc": "Error which will be passed as payload in `'error'` event",
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>Destroy the stream. Optionally emit an <code>'error'</code> event, and emit a <code>'close'</code>\nevent (unless <code>emitClose</code> is set to <code>false</code>). After this call, the readable\nstream will release any internal resources and subsequent calls to <code>push()</code>\nwill be ignored.</p>\n<p>Once <code>destroy()</code> has been called any further calls will be a no-op and no\nfurther errors except from <code>_destroy()</code> may be emitted as <code>'error'</code>.</p>\n<p>Implementors should not override this method, but instead implement\n<a href=\"#readable_destroyerr-callback\"><code>readable._destroy()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`readable.isPaused()`",
                      "name": "isPaused",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.11.14"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": [],
                          "return": {
                            "textRaw": "Returns: {boolean}",
                            "name": "return",
                            "type": "boolean"
                          }
                        }
                      ],
                      "desc": "<p>The <code>readable.isPaused()</code> method returns the current operating state of the\n<code>Readable</code>. This is used primarily by the mechanism that underlies the\n<code>readable.pipe()</code> method. In most typical cases, there will be no reason to\nuse this method directly.</p>\n<pre><code class=\"language-js\">const readable = new stream.Readable();\n\nreadable.isPaused(); // === false\nreadable.pause();\nreadable.isPaused(); // === true\nreadable.resume();\nreadable.isPaused(); // === false\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.pause()`",
                      "name": "pause",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": [],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>The <code>readable.pause()</code> method will cause a stream in flowing mode to stop\nemitting <a href=\"#event-data\"><code>'data'</code></a> events, switching out of flowing mode. Any data that\nbecomes available will remain in the internal buffer.</p>\n<pre><code class=\"language-js\">const readable = getReadableStreamSomehow();\nreadable.on('data', (chunk) => {\n  console.log(`Received ${chunk.length} bytes of data.`);\n  readable.pause();\n  console.log('There will be no additional data for 1 second.');\n  setTimeout(() => {\n    console.log('Now data will start flowing again.');\n    readable.resume();\n  }, 1000);\n});\n</code></pre>\n<p>The <code>readable.pause()</code> method has no effect if there is a <code>'readable'</code>\nevent listener.</p>"
                    },
                    {
                      "textRaw": "`readable.pipe(destination[, options])`",
                      "name": "pipe",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`destination` {stream.Writable} The destination for writing data",
                              "name": "destination",
                              "type": "stream.Writable",
                              "desc": "The destination for writing data"
                            },
                            {
                              "textRaw": "`options` {Object} Pipe options",
                              "name": "options",
                              "type": "Object",
                              "desc": "Pipe options",
                              "options": [
                                {
                                  "textRaw": "`end` {boolean} End the writer when the reader ends. **Default:** `true`.",
                                  "name": "end",
                                  "type": "boolean",
                                  "default": "`true`",
                                  "desc": "End the writer when the reader ends."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {stream.Writable} The _destination_, allowing for a chain of pipes if it is a `Duplex` or a `Transform` stream",
                            "name": "return",
                            "type": "stream.Writable",
                            "desc": "The _destination_, allowing for a chain of pipes if it is a `Duplex` or a `Transform` stream"
                          }
                        }
                      ],
                      "desc": "<p>The <code>readable.pipe()</code> method attaches a <a href=\"#class-streamwritable\"><code>Writable</code></a> stream to the <code>readable</code>,\ncausing it to switch automatically into flowing mode and push all of its data\nto the attached <a href=\"#class-streamwritable\"><code>Writable</code></a>. The flow of data will be automatically managed\nso that the destination <code>Writable</code> stream is not overwhelmed by a faster\n<code>Readable</code> stream.</p>\n<p>The following example pipes all of the data from the <code>readable</code> into a file\nnamed <code>file.txt</code>:</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nconst readable = getReadableStreamSomehow();\nconst writable = fs.createWriteStream('file.txt');\n// All the data from readable goes into 'file.txt'.\nreadable.pipe(writable);\n</code></pre>\n<p>It is possible to attach multiple <code>Writable</code> streams to a single <code>Readable</code>\nstream.</p>\n<p>The <code>readable.pipe()</code> method returns a reference to the <em>destination</em> stream\nmaking it possible to set up chains of piped streams:</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nconst zlib = require('node:zlib');\nconst r = fs.createReadStream('file.txt');\nconst z = zlib.createGzip();\nconst w = fs.createWriteStream('file.txt.gz');\nr.pipe(z).pipe(w);\n</code></pre>\n<p>By default, <a href=\"#writableendchunk-encoding-callback\"><code>stream.end()</code></a> is called on the destination <code>Writable</code>\nstream when the source <code>Readable</code> stream emits <a href=\"#event-end\"><code>'end'</code></a>, so that the\ndestination is no longer writable. To disable this default behavior, the <code>end</code>\noption can be passed as <code>false</code>, causing the destination stream to remain open:</p>\n<pre><code class=\"language-js\">reader.pipe(writer, { end: false });\nreader.on('end', () => {\n  writer.end('Goodbye\\n');\n});\n</code></pre>\n<p>One important caveat is that if the <code>Readable</code> stream emits an error during\nprocessing, the <code>Writable</code> destination <em>is not closed</em> automatically. If an\nerror occurs, it will be necessary to <em>manually</em> close each stream in order\nto prevent memory leaks.</p>\n<p>The <a href=\"process.html#processstderr\"><code>process.stderr</code></a> and <a href=\"process.html#processstdout\"><code>process.stdout</code></a> <code>Writable</code> streams are never\nclosed until the Node.js process exits, regardless of the specified options.</p>"
                    },
                    {
                      "textRaw": "`readable.read([size])`",
                      "name": "read",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`size` {number} Optional argument to specify how much data to read.",
                              "name": "size",
                              "type": "number",
                              "desc": "Optional argument to specify how much data to read.",
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {string|Buffer|null|any}",
                            "name": "return",
                            "type": "string|Buffer|null|any"
                          }
                        }
                      ],
                      "desc": "<p>The <code>readable.read()</code> method reads data out of the internal buffer and\nreturns it. If no data is available to be read, <code>null</code> is returned. By default,\nthe data is returned as a <code>Buffer</code> object unless an encoding has been\nspecified using the <code>readable.setEncoding()</code> method or the stream is operating\nin object mode.</p>\n<p>The optional <code>size</code> argument specifies a specific number of bytes to read. If\n<code>size</code> bytes are not available to be read, <code>null</code> will be returned <em>unless</em>\nthe stream has ended, in which case all of the data remaining in the internal\nbuffer will be returned.</p>\n<p>If the <code>size</code> argument is not specified, all of the data contained in the\ninternal buffer will be returned.</p>\n<p>The <code>size</code> argument must be less than or equal to 1 GiB.</p>\n<p>The <code>readable.read()</code> method should only be called on <code>Readable</code> streams\noperating in paused mode. In flowing mode, <code>readable.read()</code> is called\nautomatically until the internal buffer is fully drained.</p>\n<pre><code class=\"language-js\">const readable = getReadableStreamSomehow();\n\n// 'readable' may be triggered multiple times as data is buffered in\nreadable.on('readable', () => {\n  let chunk;\n  console.log('Stream is readable (new data received in buffer)');\n  // Use a loop to make sure we read all currently available data\n  while (null !== (chunk = readable.read())) {\n    console.log(`Read ${chunk.length} bytes of data...`);\n  }\n});\n\n// 'end' will be triggered once when there is no more data available\nreadable.on('end', () => {\n  console.log('Reached end of stream.');\n});\n</code></pre>\n<p>Each call to <code>readable.read()</code> returns a chunk of data or <code>null</code>, signifying\nthat there's no more data to read at that moment. These chunks aren't automatically\nconcatenated. Because a single <code>read()</code> call does not return all the data, using\na while loop may be necessary to continuously read chunks until all data is retrieved.\nWhen reading a large file, <code>.read()</code> might return <code>null</code> temporarily, indicating\nthat it has consumed all buffered content but there may be more data yet to be\nbuffered. In such cases, a new <code>'readable'</code> event is emitted once there's more\ndata in the buffer, and the <code>'end'</code> event signifies the end of data transmission.</p>\n<p>Therefore to read a file's whole contents from a <code>readable</code>, it is necessary\nto collect chunks across multiple <code>'readable'</code> events:</p>\n<pre><code class=\"language-js\">const chunks = [];\n\nreadable.on('readable', () => {\n  let chunk;\n  while (null !== (chunk = readable.read())) {\n    chunks.push(chunk);\n  }\n});\n\nreadable.on('end', () => {\n  const content = chunks.join('');\n});\n</code></pre>\n<p>A <code>Readable</code> stream in object mode will always return a single item from\na call to <a href=\"#readablereadsize\"><code>readable.read(size)</code></a>, regardless of the value of the\n<code>size</code> argument.</p>\n<p>If the <code>readable.read()</code> method returns a chunk of data, a <code>'data'</code> event will\nalso be emitted.</p>\n<p>Calling <a href=\"#readablereadsize\"><code>stream.read([size])</code></a> after the <a href=\"#event-end\"><code>'end'</code></a> event has\nbeen emitted will return <code>null</code>. No runtime error will be raised.</p>"
                    },
                    {
                      "textRaw": "`readable.resume()`",
                      "name": "resume",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": [
                          {
                            "version": "v10.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/18994",
                            "description": "The `resume()` has no effect if there is a `'readable'` event listening."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>The <code>readable.resume()</code> method causes an explicitly paused <code>Readable</code> stream to\nresume emitting <a href=\"#event-data\"><code>'data'</code></a> events, switching the stream into flowing mode.</p>\n<p>The <code>readable.resume()</code> method can be used to fully consume the data from a\nstream without actually processing any of that data:</p>\n<pre><code class=\"language-js\">getReadableStreamSomehow()\n  .resume()\n  .on('end', () => {\n    console.log('Reached the end, but did not read anything.');\n  });\n</code></pre>\n<p>The <code>readable.resume()</code> method has no effect if there is a <code>'readable'</code>\nevent listener.</p>"
                    },
                    {
                      "textRaw": "`readable.setEncoding(encoding)`",
                      "name": "setEncoding",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`encoding` {string} The encoding to use.",
                              "name": "encoding",
                              "type": "string",
                              "desc": "The encoding to use."
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>The <code>readable.setEncoding()</code> method sets the character encoding for\ndata read from the <code>Readable</code> stream.</p>\n<p>By default, no encoding is assigned and stream data will be returned as\n<code>Buffer</code> objects. Setting an encoding causes the stream data\nto be returned as strings of the specified encoding rather than as <code>Buffer</code>\nobjects. For instance, calling <code>readable.setEncoding('utf8')</code> will cause the\noutput data to be interpreted as UTF-8 data, and passed as strings. Calling\n<code>readable.setEncoding('hex')</code> will cause the data to be encoded in hexadecimal\nstring format.</p>\n<p>The <code>Readable</code> stream will properly handle multi-byte characters delivered\nthrough the stream that would otherwise become improperly decoded if simply\npulled from the stream as <code>Buffer</code> objects.</p>\n<pre><code class=\"language-js\">const readable = getReadableStreamSomehow();\nreadable.setEncoding('utf8');\nreadable.on('data', (chunk) => {\n  assert.equal(typeof chunk, 'string');\n  console.log('Got %d characters of string data:', chunk.length);\n});\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.unpipe([destination])`",
                      "name": "unpipe",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`destination` {stream.Writable} Optional specific stream to unpipe",
                              "name": "destination",
                              "type": "stream.Writable",
                              "desc": "Optional specific stream to unpipe",
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>The <code>readable.unpipe()</code> method detaches a <code>Writable</code> stream previously attached\nusing the <a href=\"#readablepipedestination-options\"><code>stream.pipe()</code></a> method.</p>\n<p>If the <code>destination</code> is not specified, then <em>all</em> pipes are detached.</p>\n<p>If the <code>destination</code> is specified, but no pipe is set up for it, then\nthe method does nothing.</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nconst readable = getReadableStreamSomehow();\nconst writable = fs.createWriteStream('file.txt');\n// All the data from readable goes into 'file.txt',\n// but only for the first second.\nreadable.pipe(writable);\nsetTimeout(() => {\n  console.log('Stop writing to file.txt.');\n  readable.unpipe(writable);\n  console.log('Manually close the file stream.');\n  writable.end();\n}, 1000);\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.unshift(chunk[, encoding])`",
                      "name": "unshift",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.11"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v22.0.0",
                              "v20.13.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/51866",
                            "description": "The `chunk` argument can now be a `TypedArray` or `DataView` instance."
                          },
                          {
                            "version": "v8.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/11608",
                            "description": "The `chunk` argument can now be a `Uint8Array` instance."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`chunk` {Buffer|TypedArray|DataView|string|null|any} Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value.",
                              "name": "chunk",
                              "type": "Buffer|TypedArray|DataView|string|null|any",
                              "desc": "Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value."
                            },
                            {
                              "textRaw": "`encoding` {string} Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.",
                              "name": "encoding",
                              "type": "string",
                              "desc": "Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.",
                              "optional": true
                            }
                          ]
                        }
                      ],
                      "desc": "<p>Passing <code>chunk</code> as <code>null</code> signals the end of the stream (EOF) and behaves the\nsame as <code>readable.push(null)</code>, after which no more data can be written. The EOF\nsignal is put at the end of the buffer and any buffered data will still be\nflushed.</p>\n<p>The <code>readable.unshift()</code> method pushes a chunk of data back into the internal\nbuffer. This is useful in certain situations where a stream is being consumed by\ncode that needs to \"un-consume\" some amount of data that it has optimistically\npulled out of the source, so that the data can be passed on to some other party.</p>\n<p>The <code>stream.unshift(chunk)</code> method cannot be called after the <a href=\"#event-end\"><code>'end'</code></a> event\nhas been emitted or a runtime error will be thrown.</p>\n<p>Developers using <code>stream.unshift()</code> often should consider switching to\nuse of a <a href=\"#class-streamtransform\"><code>Transform</code></a> stream instead. See the <a href=\"#api-for-stream-implementers\">API for stream implementers</a>\nsection for more information.</p>\n<pre><code class=\"language-js\">// Pull off a header delimited by \\n\\n.\n// Use unshift() if we get too much.\n// Call the callback with (error, header, stream).\nconst { StringDecoder } = require('node:string_decoder');\nfunction parseHeader(stream, callback) {\n  stream.on('error', callback);\n  stream.on('readable', onReadable);\n  const decoder = new StringDecoder('utf8');\n  let header = '';\n  function onReadable() {\n    let chunk;\n    while (null !== (chunk = stream.read())) {\n      const str = decoder.write(chunk);\n      if (str.includes('\\n\\n')) {\n        // Found the header boundary.\n        const split = str.split(/\\n\\n/);\n        header += split.shift();\n        const remaining = split.join('\\n\\n');\n        const buf = Buffer.from(remaining, 'utf8');\n        stream.removeListener('error', callback);\n        // Remove the 'readable' listener before unshifting.\n        stream.removeListener('readable', onReadable);\n        if (buf.length)\n          stream.unshift(buf);\n        // Now the body of the message can be read from the stream.\n        callback(null, header, stream);\n        return;\n      }\n      // Still reading the header.\n      header += str;\n    }\n  }\n}\n</code></pre>\n<p>Unlike <a href=\"#readablepushchunk-encoding\"><code>stream.push(chunk)</code></a>, <code>stream.unshift(chunk)</code> will not\nend the reading process by resetting the internal reading state of the stream.\nThis can cause unexpected results if <code>readable.unshift()</code> is called during a\nread (i.e. from within a <a href=\"#readable_readsize\"><code>stream._read()</code></a> implementation on a\ncustom stream). Following the call to <code>readable.unshift()</code> with an immediate\n<a href=\"#readablepushchunk-encoding\"><code>stream.push('')</code></a> will reset the reading state appropriately,\nhowever it is best to simply avoid calling <code>readable.unshift()</code> while in the\nprocess of performing a read.</p>"
                    },
                    {
                      "textRaw": "`readable.wrap(stream)`",
                      "name": "wrap",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`stream` {Stream} An \"old style\" readable stream",
                              "name": "stream",
                              "type": "Stream",
                              "desc": "An \"old style\" readable stream"
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>Prior to Node.js 0.10, streams did not implement the entire <code>node:stream</code>\nmodule API as it is currently defined. (See <a href=\"#compatibility-with-older-nodejs-versions\">Compatibility</a> for more\ninformation.)</p>\n<p>When using an older Node.js library that emits <a href=\"#event-data\"><code>'data'</code></a> events and has a\n<a href=\"#readablepause\"><code>stream.pause()</code></a> method that is advisory only, the\n<code>readable.wrap()</code> method can be used to create a <a href=\"#class-streamreadable\"><code>Readable</code></a> stream that uses\nthe old stream as its data source.</p>\n<p>It will rarely be necessary to use <code>readable.wrap()</code> but the method has been\nprovided as a convenience for interacting with older Node.js applications and\nlibraries.</p>\n<pre><code class=\"language-js\">const { OldReader } = require('./old-api-module.js');\nconst { Readable } = require('node:stream');\nconst oreader = new OldReader();\nconst myReader = new Readable().wrap(oreader);\n\nmyReader.on('readable', () => {\n  myReader.read(); // etc.\n});\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable[Symbol.asyncIterator]()`",
                      "name": "[Symbol.asyncIterator]",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v10.0.0"
                        ],
                        "changes": [
                          {
                            "version": "v11.14.0",
                            "pr-url": "https://github.com/nodejs/node/pull/26989",
                            "description": "Symbol.asyncIterator support is no longer experimental."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [],
                          "return": {
                            "textRaw": "Returns: {AsyncIterator} to fully consume the stream.",
                            "name": "return",
                            "type": "AsyncIterator",
                            "desc": "to fully consume the stream."
                          }
                        }
                      ],
                      "desc": "<pre><code class=\"language-js\">const fs = require('node:fs');\n\nasync function print(readable) {\n  readable.setEncoding('utf8');\n  let data = '';\n  for await (const chunk of readable) {\n    data += chunk;\n  }\n  console.log(data);\n}\n\nprint(fs.createReadStream('file')).catch(console.error);\n</code></pre>\n<p>If the loop terminates with a <code>break</code>, <code>return</code>, or a <code>throw</code>, the stream will\nbe destroyed. In other terms, iterating over a stream will consume the stream\nfully. The stream will be read in chunks of size equal to the <code>highWaterMark</code>\noption. In the code example above, data will be in a single chunk if the file\nhas less then 64 KiB of data because no <code>highWaterMark</code> option is provided to\n<a href=\"fs.html#fscreatereadstreampath-options\"><code>fs.createReadStream()</code></a>.</p>"
                    },
                    {
                      "textRaw": "`readable[Symbol.for('Stream.toAsyncStreamable')]()`",
                      "name": "[Symbol.for('Stream.toAsyncStreamable')]",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v26.1.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [],
                          "return": {
                            "textRaw": "Returns: {AsyncIterable} An `AsyncIterable<Uint8Array[]>` that yields batched chunks from the stream.",
                            "name": "return",
                            "type": "AsyncIterable",
                            "desc": "An `AsyncIterable<Uint8Array[]>` that yields batched chunks from the stream."
                          }
                        }
                      ],
                      "desc": "<p>When the <code>--experimental-stream-iter</code> flag is enabled, <code>Readable</code> streams\nimplement the <a href=\"stream_iter.html#streamtoasyncstreamable\"><code>Stream.toAsyncStreamable</code></a> protocol, enabling efficient\nconsumption by the <a href=\"stream_iter.html\"><code>stream/iter</code></a> API.</p>\n<p>This provides a batched async iterator that drains the stream's internal\nbuffer into <code>Uint8Array[]</code> batches, amortizing the per-chunk Promise overhead\nof the standard <code>Symbol.asyncIterator</code> path. For byte-mode streams, chunks\nare yielded directly as <code>Buffer</code> instances (which are <code>Uint8Array</code> subclasses).\nFor object-mode or encoded streams, each chunk is normalized to <code>Uint8Array</code>\nbefore batching.</p>\n<p>The returned iterator is tagged as a validated source, so <a href=\"stream_iter.html#frominput\"><code>from()</code></a>\npasses it through without additional normalization.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { text, from } from 'node:stream/iter';\n\nconst readable = new Readable({\n  read() { this.push('hello'); this.push(null); },\n});\n\n// Readable is automatically consumed via toAsyncStreamable\nconsole.log(await text(from(readable))); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { Readable } = require('node:stream');\nconst { text, from } = require('node:stream/iter');\n\nasync function run() {\n  const readable = new Readable({\n    read() { this.push('hello'); this.push(null); },\n  });\n\n  console.log(await text(from(readable))); // 'hello'\n}\n\nrun().catch(console.error);\n</code></pre>\n<p>Without the <code>--experimental-stream-iter</code> flag, calling this method throws\n<a href=\"errors.html#err_stream_iter_missing_flag\"><code>ERR_STREAM_ITER_MISSING_FLAG</code></a>.</p>"
                    },
                    {
                      "textRaw": "`readable[Symbol.asyncDispose]()`",
                      "name": "[Symbol.asyncDispose]",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v20.4.0",
                          "v18.18.0"
                        ],
                        "changes": [
                          {
                            "version": "v24.2.0",
                            "pr-url": "https://github.com/nodejs/node/pull/58467",
                            "description": "No longer experimental."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": []
                        }
                      ],
                      "desc": "<p>Calls <a href=\"#readabledestroyerror\"><code>readable.destroy()</code></a> with an <code>AbortError</code> and returns\na promise that fulfills when the stream is finished.</p>"
                    },
                    {
                      "textRaw": "`readable.compose(stream[, options])`",
                      "name": "compose",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v19.1.0",
                          "v18.13.0"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v24.0.0",
                              "v22.17.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/57513",
                            "description": "Marking the API stable."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`stream` {Writable|Duplex|WritableStream|TransformStream|Function}",
                              "name": "stream",
                              "type": "Writable|Duplex|WritableStream|TransformStream|Function"
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Duplex} a stream composed with the stream `stream`.",
                            "name": "return",
                            "type": "Duplex",
                            "desc": "a stream composed with the stream `stream`."
                          }
                        }
                      ],
                      "desc": "<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\n\nasync function* splitToWords(source) {\n  for await (const chunk of source) {\n    const words = String(chunk).split(' ');\n\n    for (const word of words) {\n      yield word;\n    }\n  }\n}\n\nconst wordsStream = Readable.from(['text passed through', 'composed stream']).compose(splitToWords);\nconst words = await wordsStream.toArray();\n\nconsole.log(words); // prints ['text', 'passed', 'through', 'composed', 'stream']\n</code></pre>\n<p><code>readable.compose(s)</code> is equivalent to <code>stream.compose(readable, s)</code>.</p>\n<p>This method also allows for an <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> to be provided, which will destroy\nthe composed stream when aborted.</p>\n<p>See <a href=\"#streamcomposestreams\"><code>stream.compose(...streams)</code></a> for more information.</p>"
                    },
                    {
                      "textRaw": "`readable.iterator([options])`",
                      "name": "iterator",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v16.3.0"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v24.0.0",
                              "v22.17.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/57513",
                            "description": "Marking the API stable."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`destroyOnReturn` {boolean} When set to `false`, calling `return` on the async iterator, or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream. **Default:** `true`.",
                                  "name": "destroyOnReturn",
                                  "type": "boolean",
                                  "default": "`true`",
                                  "desc": "When set to `false`, calling `return` on the async iterator, or exiting a `for await...of` iteration using a `break`, `return`, or `throw` will not destroy the stream."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {AsyncIterator} to consume the stream.",
                            "name": "return",
                            "type": "AsyncIterator",
                            "desc": "to consume the stream."
                          }
                        }
                      ],
                      "desc": "<p>The iterator created by this method gives users the option to cancel the\ndestruction of the stream if the <code>for await...of</code> loop is exited by <code>return</code>,\n<code>break</code>, or <code>throw</code>, or if the iterator should destroy the stream if the stream\nemitted an error during iteration.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nasync function printIterator(readable) {\n  for await (const chunk of readable.iterator({ destroyOnReturn: false })) {\n    console.log(chunk); // 1\n    break;\n  }\n\n  console.log(readable.destroyed); // false\n\n  for await (const chunk of readable.iterator({ destroyOnReturn: false })) {\n    console.log(chunk); // Will print 2 and then 3\n  }\n\n  console.log(readable.destroyed); // True, stream was totally consumed\n}\n\nasync function printSymbolAsyncIterator(readable) {\n  for await (const chunk of readable) {\n    console.log(chunk); // 1\n    break;\n  }\n\n  console.log(readable.destroyed); // true\n}\n\nasync function showBoth() {\n  await printIterator(Readable.from([1, 2, 3]));\n  await printSymbolAsyncIterator(Readable.from([1, 2, 3]));\n}\n\nshowBoth();\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.map(fn[, options])`",
                      "name": "map",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.4.0",
                          "v16.14.0"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v20.7.0",
                              "v18.19.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/49249",
                            "description": "added `highWaterMark` in options."
                          }
                        ]
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`fn` {Function|AsyncFunction} a function to map over every chunk in the stream.",
                              "name": "fn",
                              "type": "Function|AsyncFunction",
                              "desc": "a function to map over every chunk in the stream.",
                              "options": [
                                {
                                  "textRaw": "`data` {any} a chunk of data from the stream.",
                                  "name": "data",
                                  "type": "any",
                                  "desc": "a chunk of data from the stream."
                                },
                                {
                                  "textRaw": "`options` {Object}",
                                  "name": "options",
                                  "type": "Object",
                                  "options": [
                                    {
                                      "textRaw": "`signal` {AbortSignal} aborted if the stream is destroyed allowing to abort the `fn` call early.",
                                      "name": "signal",
                                      "type": "AbortSignal",
                                      "desc": "aborted if the stream is destroyed allowing to abort the `fn` call early."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`concurrency` {number} the maximum concurrent invocation of `fn` to call on the stream at once. **Default:** `1`.",
                                  "name": "concurrency",
                                  "type": "number",
                                  "default": "`1`",
                                  "desc": "the maximum concurrent invocation of `fn` to call on the stream at once."
                                },
                                {
                                  "textRaw": "`highWaterMark` {number} how many items to buffer while waiting for user consumption of the mapped items. **Default:** `concurrency * 2 - 1`.",
                                  "name": "highWaterMark",
                                  "type": "number",
                                  "default": "`concurrency * 2 - 1`",
                                  "desc": "how many items to buffer while waiting for user consumption of the mapped items."
                                },
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Readable} a stream mapped with the function `fn`.",
                            "name": "return",
                            "type": "Readable",
                            "desc": "a stream mapped with the function `fn`."
                          }
                        }
                      ],
                      "desc": "<p>This method allows mapping over the stream. The <code>fn</code> function will be called\nfor every chunk in the stream. If the <code>fn</code> function returns a promise - that\npromise will be <code>await</code>ed before being passed to the result stream.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { Resolver } from 'node:dns/promises';\n\n// With a synchronous mapper.\nfor await (const chunk of Readable.from([1, 2, 3, 4]).map((x) => x * 2)) {\n  console.log(chunk); // 2, 4, 6, 8\n}\n// With an asynchronous mapper, making at most 2 queries at a time.\nconst resolver = new Resolver();\nconst dnsResults = Readable.from([\n  'nodejs.org',\n  'openjsf.org',\n  'www.linuxfoundation.org',\n]).map((domain) => resolver.resolve4(domain), { concurrency: 2 });\nfor await (const result of dnsResults) {\n  console.log(result); // Logs the DNS result of resolver.resolve4.\n}\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.filter(fn[, options])`",
                      "name": "filter",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.4.0",
                          "v16.14.0"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v20.7.0",
                              "v18.19.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/49249",
                            "description": "added `highWaterMark` in options."
                          }
                        ]
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`fn` {Function|AsyncFunction} a function to filter chunks from the stream.",
                              "name": "fn",
                              "type": "Function|AsyncFunction",
                              "desc": "a function to filter chunks from the stream.",
                              "options": [
                                {
                                  "textRaw": "`data` {any} a chunk of data from the stream.",
                                  "name": "data",
                                  "type": "any",
                                  "desc": "a chunk of data from the stream."
                                },
                                {
                                  "textRaw": "`options` {Object}",
                                  "name": "options",
                                  "type": "Object",
                                  "options": [
                                    {
                                      "textRaw": "`signal` {AbortSignal} aborted if the stream is destroyed allowing to abort the `fn` call early.",
                                      "name": "signal",
                                      "type": "AbortSignal",
                                      "desc": "aborted if the stream is destroyed allowing to abort the `fn` call early."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`concurrency` {number} the maximum concurrent invocation of `fn` to call on the stream at once. **Default:** `1`.",
                                  "name": "concurrency",
                                  "type": "number",
                                  "default": "`1`",
                                  "desc": "the maximum concurrent invocation of `fn` to call on the stream at once."
                                },
                                {
                                  "textRaw": "`highWaterMark` {number} how many items to buffer while waiting for user consumption of the filtered items. **Default:** `concurrency * 2 - 1`.",
                                  "name": "highWaterMark",
                                  "type": "number",
                                  "default": "`concurrency * 2 - 1`",
                                  "desc": "how many items to buffer while waiting for user consumption of the filtered items."
                                },
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Readable} a stream filtered with the predicate `fn`.",
                            "name": "return",
                            "type": "Readable",
                            "desc": "a stream filtered with the predicate `fn`."
                          }
                        }
                      ],
                      "desc": "<p>This method allows filtering the stream. For each chunk in the stream the <code>fn</code>\nfunction will be called and if it returns a truthy value, the chunk will be\npassed to the result stream. If the <code>fn</code> function returns a promise - that\npromise will be <code>await</code>ed.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { Resolver } from 'node:dns/promises';\n\n// With a synchronous predicate.\nfor await (const chunk of Readable.from([1, 2, 3, 4]).filter((x) => x > 2)) {\n  console.log(chunk); // 3, 4\n}\n// With an asynchronous predicate, making at most 2 queries at a time.\nconst resolver = new Resolver();\nconst dnsResults = Readable.from([\n  'nodejs.org',\n  'openjsf.org',\n  'www.linuxfoundation.org',\n]).filter(async (domain) => {\n  const { address } = await resolver.resolve4(domain, { ttl: true });\n  return address.ttl > 60;\n}, { concurrency: 2 });\nfor await (const result of dnsResults) {\n  // Logs domains with more than 60 seconds on the resolved dns record.\n  console.log(result);\n}\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.forEach(fn[, options])`",
                      "name": "forEach",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.15.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`fn` {Function|AsyncFunction} a function to call on each chunk of the stream.",
                              "name": "fn",
                              "type": "Function|AsyncFunction",
                              "desc": "a function to call on each chunk of the stream.",
                              "options": [
                                {
                                  "textRaw": "`data` {any} a chunk of data from the stream.",
                                  "name": "data",
                                  "type": "any",
                                  "desc": "a chunk of data from the stream."
                                },
                                {
                                  "textRaw": "`options` {Object}",
                                  "name": "options",
                                  "type": "Object",
                                  "options": [
                                    {
                                      "textRaw": "`signal` {AbortSignal} aborted if the stream is destroyed allowing to abort the `fn` call early.",
                                      "name": "signal",
                                      "type": "AbortSignal",
                                      "desc": "aborted if the stream is destroyed allowing to abort the `fn` call early."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`concurrency` {number} the maximum concurrent invocation of `fn` to call on the stream at once. **Default:** `1`.",
                                  "name": "concurrency",
                                  "type": "number",
                                  "default": "`1`",
                                  "desc": "the maximum concurrent invocation of `fn` to call on the stream at once."
                                },
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Promise} a promise for when the stream has finished.",
                            "name": "return",
                            "type": "Promise",
                            "desc": "a promise for when the stream has finished."
                          }
                        }
                      ],
                      "desc": "<p>This method allows iterating a stream. For each chunk in the stream the\n<code>fn</code> function will be called. If the <code>fn</code> function returns a promise - that\npromise will be <code>await</code>ed.</p>\n<p>This method is different from <code>for await...of</code> loops in that it can optionally\nprocess chunks concurrently. In addition, a <code>forEach</code> iteration can only be\nstopped by having passed a <code>signal</code> option and aborting the related\n<code>AbortController</code> while <code>for await...of</code> can be stopped with <code>break</code> or\n<code>return</code>. In either case the stream will be destroyed.</p>\n<p>This method is different from listening to the <a href=\"#event-data\"><code>'data'</code></a> event in that it\nuses the <a href=\"#class-streamreadable\"><code>readable</code></a> event in the underlying machinery and can limit the\nnumber of concurrent <code>fn</code> calls.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { Resolver } from 'node:dns/promises';\n\n// With a synchronous predicate.\nfor await (const chunk of Readable.from([1, 2, 3, 4]).filter((x) => x > 2)) {\n  console.log(chunk); // 3, 4\n}\n// With an asynchronous predicate, making at most 2 queries at a time.\nconst resolver = new Resolver();\nconst dnsResults = Readable.from([\n  'nodejs.org',\n  'openjsf.org',\n  'www.linuxfoundation.org',\n]).map(async (domain) => {\n  const { address } = await resolver.resolve4(domain, { ttl: true });\n  return address;\n}, { concurrency: 2 });\nawait dnsResults.forEach((result) => {\n  // Logs result, similar to `for await (const result of dnsResults)`\n  console.log(result);\n});\nconsole.log('done'); // Stream has finished\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.toArray([options])`",
                      "name": "toArray",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.15.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`signal` {AbortSignal} allows cancelling the toArray operation if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows cancelling the toArray operation if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Promise} a promise containing an array with the contents of the stream.",
                            "name": "return",
                            "type": "Promise",
                            "desc": "a promise containing an array with the contents of the stream."
                          }
                        }
                      ],
                      "desc": "<p>This method allows easily obtaining the contents of a stream.</p>\n<p>As this method reads the entire stream into memory, it negates the benefits of\nstreams. It's intended for interoperability and convenience, not as the primary\nway to consume streams.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { Resolver } from 'node:dns/promises';\n\nawait Readable.from([1, 2, 3, 4]).toArray(); // [1, 2, 3, 4]\n\nconst resolver = new Resolver();\n\n// Make dns queries concurrently using .map and collect\n// the results into an array using toArray\nconst dnsResults = await Readable.from([\n  'nodejs.org',\n  'openjsf.org',\n  'www.linuxfoundation.org',\n]).map(async (domain) => {\n  const { address } = await resolver.resolve4(domain, { ttl: true });\n  return address;\n}, { concurrency: 2 }).toArray();\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.some(fn[, options])`",
                      "name": "some",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.15.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`fn` {Function|AsyncFunction} a function to call on each chunk of the stream.",
                              "name": "fn",
                              "type": "Function|AsyncFunction",
                              "desc": "a function to call on each chunk of the stream.",
                              "options": [
                                {
                                  "textRaw": "`data` {any} a chunk of data from the stream.",
                                  "name": "data",
                                  "type": "any",
                                  "desc": "a chunk of data from the stream."
                                },
                                {
                                  "textRaw": "`options` {Object}",
                                  "name": "options",
                                  "type": "Object",
                                  "options": [
                                    {
                                      "textRaw": "`signal` {AbortSignal} aborted if the stream is destroyed allowing to abort the `fn` call early.",
                                      "name": "signal",
                                      "type": "AbortSignal",
                                      "desc": "aborted if the stream is destroyed allowing to abort the `fn` call early."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`concurrency` {number} the maximum concurrent invocation of `fn` to call on the stream at once. **Default:** `1`.",
                                  "name": "concurrency",
                                  "type": "number",
                                  "default": "`1`",
                                  "desc": "the maximum concurrent invocation of `fn` to call on the stream at once."
                                },
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Promise} a promise evaluating to `true` if `fn` returned a truthy value for at least one of the chunks.",
                            "name": "return",
                            "type": "Promise",
                            "desc": "a promise evaluating to `true` if `fn` returned a truthy value for at least one of the chunks."
                          }
                        }
                      ],
                      "desc": "<p>This method is similar to <code>Array.prototype.some</code> and calls <code>fn</code> on each chunk\nin the stream until the awaited return value is <code>true</code> (or any truthy value).\nOnce an <code>fn</code> call on a chunk awaited return value is truthy, the stream is\ndestroyed and the promise is fulfilled with <code>true</code>. If none of the <code>fn</code>\ncalls on the chunks return a truthy value, the promise is fulfilled with\n<code>false</code>.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { stat } from 'node:fs/promises';\n\n// With a synchronous predicate.\nawait Readable.from([1, 2, 3, 4]).some((x) => x > 2); // true\nawait Readable.from([1, 2, 3, 4]).some((x) => x &#x3C; 0); // false\n\n// With an asynchronous predicate, making at most 2 file checks at a time.\nconst anyBigFile = await Readable.from([\n  'file1',\n  'file2',\n  'file3',\n]).some(async (fileName) => {\n  const stats = await stat(fileName);\n  return stats.size > 1024 * 1024;\n}, { concurrency: 2 });\nconsole.log(anyBigFile); // `true` if any file in the list is bigger than 1MB\nconsole.log('done'); // Stream has finished\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.find(fn[, options])`",
                      "name": "find",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.17.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`fn` {Function|AsyncFunction} a function to call on each chunk of the stream.",
                              "name": "fn",
                              "type": "Function|AsyncFunction",
                              "desc": "a function to call on each chunk of the stream.",
                              "options": [
                                {
                                  "textRaw": "`data` {any} a chunk of data from the stream.",
                                  "name": "data",
                                  "type": "any",
                                  "desc": "a chunk of data from the stream."
                                },
                                {
                                  "textRaw": "`options` {Object}",
                                  "name": "options",
                                  "type": "Object",
                                  "options": [
                                    {
                                      "textRaw": "`signal` {AbortSignal} aborted if the stream is destroyed allowing to abort the `fn` call early.",
                                      "name": "signal",
                                      "type": "AbortSignal",
                                      "desc": "aborted if the stream is destroyed allowing to abort the `fn` call early."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`concurrency` {number} the maximum concurrent invocation of `fn` to call on the stream at once. **Default:** `1`.",
                                  "name": "concurrency",
                                  "type": "number",
                                  "default": "`1`",
                                  "desc": "the maximum concurrent invocation of `fn` to call on the stream at once."
                                },
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Promise} a promise evaluating to the first chunk for which `fn` evaluated with a truthy value, or `undefined` if no element was found.",
                            "name": "return",
                            "type": "Promise",
                            "desc": "a promise evaluating to the first chunk for which `fn` evaluated with a truthy value, or `undefined` if no element was found."
                          }
                        }
                      ],
                      "desc": "<p>This method is similar to <code>Array.prototype.find</code> and calls <code>fn</code> on each chunk\nin the stream to find a chunk with a truthy value for <code>fn</code>. Once an <code>fn</code> call's\nawaited return value is truthy, the stream is destroyed and the promise is\nfulfilled with value for which <code>fn</code> returned a truthy value. If all of the\n<code>fn</code> calls on the chunks return a falsy value, the promise is fulfilled with\n<code>undefined</code>.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { stat } from 'node:fs/promises';\n\n// With a synchronous predicate.\nawait Readable.from([1, 2, 3, 4]).find((x) => x > 2); // 3\nawait Readable.from([1, 2, 3, 4]).find((x) => x > 0); // 1\nawait Readable.from([1, 2, 3, 4]).find((x) => x > 10); // undefined\n\n// With an asynchronous predicate, making at most 2 file checks at a time.\nconst foundBigFile = await Readable.from([\n  'file1',\n  'file2',\n  'file3',\n]).find(async (fileName) => {\n  const stats = await stat(fileName);\n  return stats.size > 1024 * 1024;\n}, { concurrency: 2 });\nconsole.log(foundBigFile); // File name of large file, if any file in the list is bigger than 1MB\nconsole.log('done'); // Stream has finished\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.every(fn[, options])`",
                      "name": "every",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.15.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`fn` {Function|AsyncFunction} a function to call on each chunk of the stream.",
                              "name": "fn",
                              "type": "Function|AsyncFunction",
                              "desc": "a function to call on each chunk of the stream.",
                              "options": [
                                {
                                  "textRaw": "`data` {any} a chunk of data from the stream.",
                                  "name": "data",
                                  "type": "any",
                                  "desc": "a chunk of data from the stream."
                                },
                                {
                                  "textRaw": "`options` {Object}",
                                  "name": "options",
                                  "type": "Object",
                                  "options": [
                                    {
                                      "textRaw": "`signal` {AbortSignal} aborted if the stream is destroyed allowing to abort the `fn` call early.",
                                      "name": "signal",
                                      "type": "AbortSignal",
                                      "desc": "aborted if the stream is destroyed allowing to abort the `fn` call early."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`concurrency` {number} the maximum concurrent invocation of `fn` to call on the stream at once. **Default:** `1`.",
                                  "name": "concurrency",
                                  "type": "number",
                                  "default": "`1`",
                                  "desc": "the maximum concurrent invocation of `fn` to call on the stream at once."
                                },
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Promise} a promise evaluating to `true` if `fn` returned a truthy value for all of the chunks.",
                            "name": "return",
                            "type": "Promise",
                            "desc": "a promise evaluating to `true` if `fn` returned a truthy value for all of the chunks."
                          }
                        }
                      ],
                      "desc": "<p>This method is similar to <code>Array.prototype.every</code> and calls <code>fn</code> on each chunk\nin the stream to check if all awaited return values are truthy value for <code>fn</code>.\nOnce an <code>fn</code> call on a chunk awaited return value is falsy, the stream is\ndestroyed and the promise is fulfilled with <code>false</code>. If all of the <code>fn</code> calls\non the chunks return a truthy value, the promise is fulfilled with <code>true</code>.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { stat } from 'node:fs/promises';\n\n// With a synchronous predicate.\nawait Readable.from([1, 2, 3, 4]).every((x) => x > 2); // false\nawait Readable.from([1, 2, 3, 4]).every((x) => x > 0); // true\n\n// With an asynchronous predicate, making at most 2 file checks at a time.\nconst allBigFiles = await Readable.from([\n  'file1',\n  'file2',\n  'file3',\n]).every(async (fileName) => {\n  const stats = await stat(fileName);\n  return stats.size > 1024 * 1024;\n}, { concurrency: 2 });\n// `true` if all files in the list are bigger than 1MiB\nconsole.log(allBigFiles);\nconsole.log('done'); // Stream has finished\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.flatMap(fn[, options])`",
                      "name": "flatMap",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.15.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`fn` {Function|AsyncGeneratorFunction|AsyncFunction} a function to map over every chunk in the stream.",
                              "name": "fn",
                              "type": "Function|AsyncGeneratorFunction|AsyncFunction",
                              "desc": "a function to map over every chunk in the stream.",
                              "options": [
                                {
                                  "textRaw": "`data` {any} a chunk of data from the stream.",
                                  "name": "data",
                                  "type": "any",
                                  "desc": "a chunk of data from the stream."
                                },
                                {
                                  "textRaw": "`options` {Object}",
                                  "name": "options",
                                  "type": "Object",
                                  "options": [
                                    {
                                      "textRaw": "`signal` {AbortSignal} aborted if the stream is destroyed allowing to abort the `fn` call early.",
                                      "name": "signal",
                                      "type": "AbortSignal",
                                      "desc": "aborted if the stream is destroyed allowing to abort the `fn` call early."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`concurrency` {number} the maximum concurrent invocation of `fn` to call on the stream at once. **Default:** `1`.",
                                  "name": "concurrency",
                                  "type": "number",
                                  "default": "`1`",
                                  "desc": "the maximum concurrent invocation of `fn` to call on the stream at once."
                                },
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Readable} a stream flat-mapped with the function `fn`.",
                            "name": "return",
                            "type": "Readable",
                            "desc": "a stream flat-mapped with the function `fn`."
                          }
                        }
                      ],
                      "desc": "<p>This method returns a new stream by applying the given callback to each\nchunk of the stream and then flattening the result.</p>\n<p>It is possible to return a stream or another iterable or async iterable from\n<code>fn</code> and the result streams will be merged (flattened) into the returned\nstream.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { createReadStream } from 'node:fs';\n\n// With a synchronous mapper.\nfor await (const chunk of Readable.from([1, 2, 3, 4]).flatMap((x) => [x, x])) {\n  console.log(chunk); // 1, 1, 2, 2, 3, 3, 4, 4\n}\n// With an asynchronous mapper, combine the contents of 4 files\nconst concatResult = Readable.from([\n  './1.mjs',\n  './2.mjs',\n  './3.mjs',\n  './4.mjs',\n]).flatMap((fileName) => createReadStream(fileName));\nfor await (const result of concatResult) {\n  // This will contain the contents (all chunks) of all 4 files\n  console.log(result);\n}\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.drop(limit[, options])`",
                      "name": "drop",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.15.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`limit` {number} the number of chunks to drop from the readable.",
                              "name": "limit",
                              "type": "number",
                              "desc": "the number of chunks to drop from the readable."
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Readable} a stream with `limit` chunks dropped.",
                            "name": "return",
                            "type": "Readable",
                            "desc": "a stream with `limit` chunks dropped."
                          }
                        }
                      ],
                      "desc": "<p>This method returns a new stream with the first <code>limit</code> chunks dropped.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\n\nawait Readable.from([1, 2, 3, 4]).drop(2).toArray(); // [3, 4]\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.take(limit[, options])`",
                      "name": "take",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.15.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`limit` {number} the number of chunks to take from the readable.",
                              "name": "limit",
                              "type": "number",
                              "desc": "the number of chunks to take from the readable."
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Readable} a stream with `limit` chunks taken.",
                            "name": "return",
                            "type": "Readable",
                            "desc": "a stream with `limit` chunks taken."
                          }
                        }
                      ],
                      "desc": "<p>This method returns a new stream with the first <code>limit</code> chunks.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\n\nawait Readable.from([1, 2, 3, 4]).take(2).toArray(); // [1, 2]\n</code></pre>"
                    },
                    {
                      "textRaw": "`readable.reduce(fn[, initial[, options]])`",
                      "name": "reduce",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v17.5.0",
                          "v16.15.0"
                        ],
                        "changes": []
                      },
                      "stability": 1,
                      "stabilityText": "Experimental",
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`fn` {Function|AsyncFunction} a reducer function to call over every chunk in the stream.",
                              "name": "fn",
                              "type": "Function|AsyncFunction",
                              "desc": "a reducer function to call over every chunk in the stream.",
                              "options": [
                                {
                                  "textRaw": "`previous` {any} the value obtained from the last call to `fn` or the `initial` value if specified or the first chunk of the stream otherwise.",
                                  "name": "previous",
                                  "type": "any",
                                  "desc": "the value obtained from the last call to `fn` or the `initial` value if specified or the first chunk of the stream otherwise."
                                },
                                {
                                  "textRaw": "`data` {any} a chunk of data from the stream.",
                                  "name": "data",
                                  "type": "any",
                                  "desc": "a chunk of data from the stream."
                                },
                                {
                                  "textRaw": "`options` {Object}",
                                  "name": "options",
                                  "type": "Object",
                                  "options": [
                                    {
                                      "textRaw": "`signal` {AbortSignal} aborted if the stream is destroyed allowing to abort the `fn` call early.",
                                      "name": "signal",
                                      "type": "AbortSignal",
                                      "desc": "aborted if the stream is destroyed allowing to abort the `fn` call early."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "textRaw": "`initial` {any} the initial value to use in the reduction.",
                              "name": "initial",
                              "type": "any",
                              "desc": "the initial value to use in the reduction.",
                              "optional": true
                            },
                            {
                              "textRaw": "`options` {Object}",
                              "name": "options",
                              "type": "Object",
                              "options": [
                                {
                                  "textRaw": "`signal` {AbortSignal} allows destroying the stream if the signal is aborted.",
                                  "name": "signal",
                                  "type": "AbortSignal",
                                  "desc": "allows destroying the stream if the signal is aborted."
                                }
                              ],
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {Promise} a promise for the final value of the reduction.",
                            "name": "return",
                            "type": "Promise",
                            "desc": "a promise for the final value of the reduction."
                          }
                        }
                      ],
                      "desc": "<p>This method calls <code>fn</code> on each chunk of the stream in order, passing it the\nresult from the calculation on the previous element. It returns a promise for\nthe final value of the reduction.</p>\n<p>If no <code>initial</code> value is supplied the first chunk of the stream is used as the\ninitial value. If the stream is empty, the promise is rejected with a\n<code>TypeError</code> with the <code>ERR_INVALID_ARGS</code> code property.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { readdir, stat } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nconst directoryPath = './src';\nconst filesInDir = await readdir(directoryPath);\n\nconst folderSize = await Readable.from(filesInDir)\n  .reduce(async (totalSize, file) => {\n    const { size } = await stat(join(directoryPath, file));\n    return totalSize + size;\n  }, 0);\n\nconsole.log(folderSize);\n</code></pre>\n<p>The reducer function iterates the stream element-by-element which means that\nthere is no <code>concurrency</code> parameter or parallelism. To perform a <code>reduce</code>\nconcurrently, you can extract the async function to <a href=\"#readablemapfn-options\"><code>readable.map</code></a> method.</p>\n<pre><code class=\"language-mjs\">import { Readable } from 'node:stream';\nimport { readdir, stat } from 'node:fs/promises';\nimport { join } from 'node:path';\n\nconst directoryPath = './src';\nconst filesInDir = await readdir(directoryPath);\n\nconst folderSize = await Readable.from(filesInDir)\n  .map((file) => stat(join(directoryPath, file)), { concurrency: 2 })\n  .reduce((totalSize, { size }) => totalSize + size, 0);\n\nconsole.log(folderSize);\n</code></pre>"
                    }
                  ],
                  "properties": [
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "closed",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v18.0.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> after <code>'close'</code> has been emitted.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "destroyed",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> after <a href=\"#readabledestroyerror\"><code>readable.destroy()</code></a> has been called.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "readable",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v11.4.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Is <code>true</code> if it is safe to call <a href=\"#readablereadsize\"><code>readable.read()</code></a>, which means\nthe stream has not been destroyed or emitted <code>'error'</code> or <code>'end'</code>.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "readableAborted",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v16.8.0"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v24.0.0",
                              "v22.17.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/57513",
                            "description": "Marking the API stable."
                          }
                        ]
                      },
                      "desc": "<p>Returns whether the stream was destroyed or errored before emitting <code>'end'</code>.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "readableDidRead",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v16.7.0",
                          "v14.18.0"
                        ],
                        "changes": [
                          {
                            "version": [
                              "v24.0.0",
                              "v22.17.0"
                            ],
                            "pr-url": "https://github.com/nodejs/node/pull/57513",
                            "description": "Marking the API stable."
                          }
                        ]
                      },
                      "desc": "<p>Returns whether <code>'data'</code> has been emitted.</p>"
                    },
                    {
                      "textRaw": "Type: {null|string}",
                      "name": "readableEncoding",
                      "type": "null|string",
                      "meta": {
                        "added": [
                          "v12.7.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Getter for the property <code>encoding</code> of a given <code>Readable</code> stream. The <code>encoding</code>\nproperty can be set using the <a href=\"#readablesetencodingencoding\"><code>readable.setEncoding()</code></a> method.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "readableEnded",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v12.9.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Becomes <code>true</code> when <a href=\"#event-end\"><code>'end'</code></a> event is emitted.</p>"
                    },
                    {
                      "textRaw": "Type: {Error}",
                      "name": "errored",
                      "type": "Error",
                      "meta": {
                        "added": [
                          "v18.0.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Returns error if the stream has been destroyed with an error.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "readableFlowing",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v9.4.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>This property reflects the current state of a <code>Readable</code> stream as described\nin the <a href=\"#three-states\">Three states</a> section.</p>"
                    },
                    {
                      "textRaw": "Type: {number}",
                      "name": "readableHighWaterMark",
                      "type": "number",
                      "meta": {
                        "added": [
                          "v9.3.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Returns the value of <code>highWaterMark</code> passed when creating this <code>Readable</code>.</p>"
                    },
                    {
                      "textRaw": "Type: {number}",
                      "name": "readableLength",
                      "type": "number",
                      "meta": {
                        "added": [
                          "v9.4.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>This property contains the number of bytes (or objects) in the queue\nready to be read. The value provides introspection data regarding\nthe status of the <code>highWaterMark</code>.</p>"
                    },
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "readableObjectMode",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v12.3.0"
                        ],
                        "changes": []
                      },
                      "desc": "<p>Getter for the property <code>objectMode</code> of a given <code>Readable</code> stream.</p>"
                    }
                  ]
                }
              ],
              "displayName": "Readable streams"
            },
            {
              "textRaw": "Duplex and transform streams",
              "name": "duplex_and_transform_streams",
              "type": "misc",
              "classes": [
                {
                  "textRaw": "Class: `stream.Duplex`",
                  "name": "stream.Duplex",
                  "type": "class",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": [
                      {
                        "version": "v6.8.0",
                        "pr-url": "https://github.com/nodejs/node/pull/8834",
                        "description": "Instances of `Duplex` now return `true` when checking `instanceof stream.Writable`."
                      }
                    ]
                  },
                  "desc": "<p>Duplex streams are streams that implement both the <a href=\"#class-streamreadable\"><code>Readable</code></a> and\n<a href=\"#class-streamwritable\"><code>Writable</code></a> interfaces.</p>\n<p>Examples of <code>Duplex</code> streams include:</p>\n<ul>\n<li><a href=\"net.html#class-netsocket\">TCP sockets</a></li>\n<li><a href=\"zlib.html\">zlib streams</a></li>\n<li><a href=\"crypto.html\">crypto streams</a></li>\n</ul>",
                  "properties": [
                    {
                      "textRaw": "Type: {boolean}",
                      "name": "allowHalfOpen",
                      "type": "boolean",
                      "meta": {
                        "added": [
                          "v0.9.4"
                        ],
                        "changes": []
                      },
                      "desc": "<p>If <code>false</code> then the stream will automatically end the writable side when the\nreadable side ends. Set initially by the <code>allowHalfOpen</code> constructor option,\nwhich defaults to <code>true</code>.</p>\n<p>This can be changed manually to change the half-open behavior of an existing\n<code>Duplex</code> stream instance, but must be changed before the <code>'end'</code> event is\nemitted.</p>"
                    }
                  ]
                },
                {
                  "textRaw": "Class: `stream.Transform`",
                  "name": "stream.Transform",
                  "type": "class",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Transform streams are <a href=\"#class-streamduplex\"><code>Duplex</code></a> streams where the output is in some way\nrelated to the input. Like all <a href=\"#class-streamduplex\"><code>Duplex</code></a> streams, <code>Transform</code> streams\nimplement both the <a href=\"#class-streamreadable\"><code>Readable</code></a> and <a href=\"#class-streamwritable\"><code>Writable</code></a> interfaces.</p>\n<p>Examples of <code>Transform</code> streams include:</p>\n<ul>\n<li><a href=\"zlib.html\">zlib streams</a></li>\n<li><a href=\"crypto.html\">crypto streams</a></li>\n</ul>",
                  "methods": [
                    {
                      "textRaw": "`transform.destroy([error])`",
                      "name": "destroy",
                      "type": "method",
                      "meta": {
                        "added": [
                          "v8.0.0"
                        ],
                        "changes": [
                          {
                            "version": "v14.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/29197",
                            "description": "Work as a no-op on a stream that has already been destroyed."
                          }
                        ]
                      },
                      "signatures": [
                        {
                          "params": [
                            {
                              "textRaw": "`error` {Error}",
                              "name": "error",
                              "type": "Error",
                              "optional": true
                            }
                          ],
                          "return": {
                            "textRaw": "Returns: {this}",
                            "name": "return",
                            "type": "this"
                          }
                        }
                      ],
                      "desc": "<p>Destroy the stream, and optionally emit an <code>'error'</code> event. After this call, the\ntransform stream would release any internal resources.\nImplementors should not override this method, but instead implement\n<a href=\"#readable_destroyerr-callback\"><code>readable._destroy()</code></a>.\nThe default implementation of <code>_destroy()</code> for <code>Transform</code> also emit <code>'close'</code>\nunless <code>emitClose</code> is set in false.</p>\n<p>Once <code>destroy()</code> has been called, any further calls will be a no-op and no\nfurther errors except from <code>_destroy()</code> may be emitted as <code>'error'</code>.</p>"
                    }
                  ]
                }
              ],
              "methods": [
                {
                  "textRaw": "`stream.duplexPair([options])`",
                  "name": "duplexPair",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v22.6.0",
                      "v20.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object} A value to pass to both `Duplex` constructors, to set options such as buffering.",
                          "name": "options",
                          "type": "Object",
                          "desc": "A value to pass to both `Duplex` constructors, to set options such as buffering.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Array} of two `Duplex` instances.",
                        "name": "return",
                        "type": "Array",
                        "desc": "of two `Duplex` instances."
                      }
                    }
                  ],
                  "desc": "<p>The utility function <code>duplexPair</code> returns an Array with two items,\neach being a <code>Duplex</code> stream connected to the other side:</p>\n<pre><code class=\"language-js\">const [ sideA, sideB ] = duplexPair();\n</code></pre>\n<p>Whatever is written to one stream is made readable on the other. It provides\nbehavior analogous to a network connection, where the data written by the client\nbecomes readable by the server, and vice-versa.</p>\n<p>The Duplex streams are symmetrical; one or the other may be used without any\ndifference in behavior.</p>"
                }
              ],
              "displayName": "Duplex and transform streams"
            }
          ],
          "methods": [
            {
              "textRaw": "`stream.finished(stream[, options], callback)`",
              "name": "finished",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": "v19.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46205",
                    "description": "Added support for `ReadableStream` and `WritableStream`."
                  },
                  {
                    "version": "v15.11.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37354",
                    "description": "The `signal` option was added."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32158",
                    "description": "The `finished(stream, cb)` will wait for the `'close'` event before invoking the callback. The implementation tries to detect legacy streams and only apply this behavior to streams which are expected to emit `'close'`."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31545",
                    "description": "Emitting `'close'` before `'end'` on a `Readable` stream will cause an `ERR_STREAM_PREMATURE_CLOSE` error."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31509",
                    "description": "Callback will be invoked on streams which have already finished before the call to `finished(stream, cb)`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {Stream|ReadableStream|WritableStream} A readable and/or writable stream/webstream.",
                      "name": "stream",
                      "type": "Stream|ReadableStream|WritableStream",
                      "desc": "A readable and/or writable stream/webstream."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`error` {boolean} If set to `false`, then a call to `emit('error', err)` is not treated as finished. **Default:** `true`.",
                          "name": "error",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If set to `false`, then a call to `emit('error', err)` is not treated as finished."
                        },
                        {
                          "textRaw": "`readable` {boolean} When set to `false`, the callback will be called when the stream ends even though the stream might still be readable. **Default:** `true`.",
                          "name": "readable",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "When set to `false`, the callback will be called when the stream ends even though the stream might still be readable."
                        },
                        {
                          "textRaw": "`writable` {boolean} When set to `false`, the callback will be called when the stream ends even though the stream might still be writable. **Default:** `true`.",
                          "name": "writable",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "When set to `false`, the callback will be called when the stream ends even though the stream might still be writable."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} allows aborting the wait for the stream finish. The underlying stream will _not_ be aborted if the signal is aborted. The callback will get called with an `AbortError`. All registered listeners added by this function will also be removed.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "allows aborting the wait for the stream finish. The underlying stream will _not_ be aborted if the signal is aborted. The callback will get called with an `AbortError`. All registered listeners added by this function will also be removed."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} A callback function that takes an optional error argument.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "A callback function that takes an optional error argument."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} A cleanup function which removes all registered listeners.",
                    "name": "return",
                    "type": "Function",
                    "desc": "A cleanup function which removes all registered listeners."
                  }
                }
              ],
              "desc": "<p>A function to get notified when a stream is no longer readable, writable\nor has experienced an error or a premature close event.</p>\n<pre><code class=\"language-js\">const { finished } = require('node:stream');\nconst fs = require('node:fs');\n\nconst rs = fs.createReadStream('archive.tar');\n\nfinished(rs, (err) => {\n  if (err) {\n    console.error('Stream failed.', err);\n  } else {\n    console.log('Stream is done reading.');\n  }\n});\n\nrs.resume(); // Drain the stream.\n</code></pre>\n<p>Especially useful in error handling scenarios where a stream is destroyed\nprematurely (like an aborted HTTP request), and will not emit <code>'end'</code>\nor <code>'finish'</code>.</p>\n<p>The <code>finished</code> API provides <a href=\"#streamfinishedstream-options\">promise version</a>.</p>\n<p><code>stream.finished()</code> leaves dangling event listeners (in particular\n<code>'error'</code>, <code>'end'</code>, <code>'finish'</code> and <code>'close'</code>) after <code>callback</code> has been\ninvoked. The reason for this is so that unexpected <code>'error'</code> events (due to\nincorrect stream implementations) do not cause unexpected crashes.\nIf this is unwanted behavior then the returned cleanup function needs to be\ninvoked in the callback:</p>\n<pre><code class=\"language-js\">const cleanup = finished(rs, (err) => {\n  cleanup();\n  // ...\n});\n</code></pre>"
            },
            {
              "textRaw": "`stream.pipeline(source[, ...transforms], destination, callback)`",
              "name": "pipeline",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "source"
                    },
                    {
                      "name": "...transforms",
                      "optional": true
                    },
                    {
                      "name": "destination"
                    },
                    {
                      "name": "callback"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`stream.pipeline(streams, callback)`",
              "name": "pipeline",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.7.0",
                      "v18.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46307",
                    "description": "Added support for webstreams."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  },
                  {
                    "version": "v14.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/32158",
                    "description": "The `pipeline(..., cb)` will wait for the `'close'` event before invoking the callback. The implementation tries to detect legacy streams and only apply this behavior to streams which are expected to emit `'close'`."
                  },
                  {
                    "version": "v13.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/31223",
                    "description": "Add support for async generators."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`streams` {Stream[]|AsyncIterable[]|Function[]|ReadableStream[]|WritableStream[]|TransformStream[]}",
                      "name": "streams",
                      "type": "Stream[]|AsyncIterable[]|Function[]|ReadableStream[]|WritableStream[]|TransformStream[]"
                    },
                    {
                      "textRaw": "`callback` {Function} Called when the pipeline is fully done.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Called when the pipeline is fully done.",
                      "options": [
                        {
                          "textRaw": "`err` {Error}",
                          "name": "err",
                          "type": "Error"
                        },
                        {
                          "textRaw": "`val` Resolved value of `Promise` returned by `destination`.",
                          "name": "val",
                          "desc": "Resolved value of `Promise` returned by `destination`."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Stream}",
                    "name": "return",
                    "type": "Stream"
                  }
                }
              ],
              "desc": "<p>A module method to pipe between streams and generators forwarding errors and\nproperly cleaning up and provide a callback when the pipeline is complete.</p>\n<pre><code class=\"language-js\">const { pipeline } = require('node:stream');\nconst fs = require('node:fs');\nconst zlib = require('node:zlib');\n\n// Use the pipeline API to easily pipe a series of streams\n// together and get notified when the pipeline is fully done.\n\n// A pipeline to gzip a potentially huge tar file efficiently:\n\npipeline(\n  fs.createReadStream('archive.tar'),\n  zlib.createGzip(),\n  fs.createWriteStream('archive.tar.gz'),\n  (err) => {\n    if (err) {\n      console.error('Pipeline failed.', err);\n    } else {\n      console.log('Pipeline succeeded.');\n    }\n  },\n);\n</code></pre>\n<p>The <code>pipeline</code> API provides a <a href=\"#streampipelinesource-transforms-destination-options\">promise version</a>.</p>\n<p><code>stream.pipeline()</code> will call <code>stream.destroy(err)</code> on all streams except:</p>\n<ul>\n<li><code>Readable</code> streams which have emitted <code>'end'</code> or <code>'close'</code>.</li>\n<li><code>Writable</code> streams which have emitted <code>'finish'</code> or <code>'close'</code>.</li>\n</ul>\n<p><code>stream.pipeline()</code> leaves dangling event listeners on the streams\nafter the <code>callback</code> has been invoked. In the case of reuse of streams after\nfailure, this can cause event listener leaks and swallowed errors. If the last\nstream is readable, dangling event listeners will be removed so that the last\nstream can be consumed later.</p>\n<p><code>stream.pipeline()</code> closes all the streams when an error is raised.\nThe <code>IncomingRequest</code> usage with <code>pipeline</code> could lead to an unexpected behavior\nonce it would destroy the socket without sending the expected response.\nSee the example below:</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nconst http = require('node:http');\nconst { pipeline } = require('node:stream');\n\nconst server = http.createServer((req, res) => {\n  const fileStream = fs.createReadStream('./fileNotExist.txt');\n  pipeline(fileStream, res, (err) => {\n    if (err) {\n      console.log(err); // No such file\n      // this message can't be sent once `pipeline` already destroyed the socket\n      return res.end('error!!!');\n    }\n  });\n});\n</code></pre>"
            },
            {
              "textRaw": "`stream.compose(...streams)`",
              "name": "compose",
              "type": "method",
              "meta": {
                "added": [
                  "v16.9.0"
                ],
                "changes": [
                  {
                    "version": "v26.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62562",
                    "description": "Marking the API stable."
                  },
                  {
                    "version": [
                      "v21.1.0",
                      "v20.10.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50187",
                    "description": "Added support for stream class."
                  },
                  {
                    "version": [
                      "v19.8.0",
                      "v18.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46675",
                    "description": "Added support for webstreams."
                  }
                ]
              },
              "stability": 2,
              "stabilityText": "Stable",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "...streams"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {stream.Duplex}",
                    "name": "return",
                    "type": "stream.Duplex"
                  }
                }
              ],
              "desc": "<p>Combines two or more streams into a <code>Duplex</code> stream that writes to the\nfirst stream and reads from the last. Each provided stream is piped into\nthe next, using <code>stream.pipeline</code>. If any of the streams error then all\nare destroyed, including the outer <code>Duplex</code> stream.</p>\n<p>Because <code>stream.compose</code> returns a new stream that in turn can (and\nshould) be piped into other streams, it enables composition. In contrast,\nwhen passing streams to <code>stream.pipeline</code>, typically the first stream is\na readable stream and the last a writable stream, forming a closed\ncircuit.</p>\n<p>If passed a <code>Function</code> it must be a factory method taking a <code>source</code>\n<code>Iterable</code>.</p>\n<pre><code class=\"language-mjs\">import { compose, Transform } from 'node:stream';\n\nconst removeSpaces = new Transform({\n  transform(chunk, encoding, callback) {\n    callback(null, String(chunk).replace(' ', ''));\n  },\n});\n\nasync function* toUpper(source) {\n  for await (const chunk of source) {\n    yield String(chunk).toUpperCase();\n  }\n}\n\nlet res = '';\nfor await (const buf of compose(removeSpaces, toUpper).end('hello world')) {\n  res += buf;\n}\n\nconsole.log(res); // prints 'HELLOWORLD'\n</code></pre>\n<p><code>stream.compose</code> can be used to convert async iterables, generators and\nfunctions into streams.</p>\n<ul>\n<li><code>AsyncIterable</code> converts into a readable <code>Duplex</code>. Cannot yield\n<code>null</code>.</li>\n<li><code>AsyncGeneratorFunction</code> converts into a readable/writable transform <code>Duplex</code>.\nMust take a source <code>AsyncIterable</code> as first parameter. Cannot yield\n<code>null</code>.</li>\n<li><code>AsyncFunction</code> converts into a writable <code>Duplex</code>. Must return\neither <code>null</code> or <code>undefined</code>.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { compose } from 'node:stream';\nimport { finished } from 'node:stream/promises';\n\n// Convert AsyncIterable into readable Duplex.\nconst s1 = compose(async function*() {\n  yield 'Hello';\n  yield 'World';\n}());\n\n// Convert AsyncGenerator into transform Duplex.\nconst s2 = compose(async function*(source) {\n  for await (const chunk of source) {\n    yield String(chunk).toUpperCase();\n  }\n});\n\nlet res = '';\n\n// Convert AsyncFunction into writable Duplex.\nconst s3 = compose(async function(source) {\n  for await (const chunk of source) {\n    res += chunk;\n  }\n});\n\nawait finished(compose(s1, s2, s3));\n\nconsole.log(res); // prints 'HELLOWORLD'\n</code></pre>\n<p>For convenience, the <a href=\"#readablecomposestream-options\"><code>readable.compose(stream)</code></a> method is available on\n<a href=\"stream.html#class-streamreadable\"><code>&#x3C;Readable></code></a> and <a href=\"stream.html#class-streamduplex\"><code>&#x3C;Duplex></code></a> streams as a wrapper for this function.</p>"
            },
            {
              "textRaw": "`stream.isErrored(stream)`",
              "name": "isErrored",
              "type": "method",
              "meta": {
                "added": [
                  "v17.3.0",
                  "v16.14.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {Readable|Writable|Duplex|WritableStream|ReadableStream}",
                      "name": "stream",
                      "type": "Readable|Writable|Duplex|WritableStream|ReadableStream"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns whether the stream has encountered an error.</p>"
            },
            {
              "textRaw": "`stream.isReadable(stream)`",
              "name": "isReadable",
              "type": "method",
              "meta": {
                "added": [
                  "v17.4.0",
                  "v16.14.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {Readable|Duplex|ReadableStream}",
                      "name": "stream",
                      "type": "Readable|Duplex|ReadableStream"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean|null} - Only returns `null` if `stream` is not a valid `Readable`, `Duplex` or `ReadableStream`.",
                    "name": "return",
                    "type": "boolean|null",
                    "desc": "Only returns `null` if `stream` is not a valid `Readable`, `Duplex` or `ReadableStream`."
                  }
                }
              ],
              "desc": "<p>Returns whether the stream is readable.</p>"
            },
            {
              "textRaw": "`stream.isWritable(stream)`",
              "name": "isWritable",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {Writable|Duplex|WritableStream}",
                      "name": "stream",
                      "type": "Writable|Duplex|WritableStream"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean|null} - Only returns `null` if `stream` is not a valid `Writable`, `Duplex` or `WritableStream`.",
                    "name": "return",
                    "type": "boolean|null",
                    "desc": "Only returns `null` if `stream` is not a valid `Writable`, `Duplex` or `WritableStream`."
                  }
                }
              ],
              "desc": "<p>Returns whether the stream is writable.</p>"
            },
            {
              "textRaw": "`stream.Readable.from(iterable[, options])`",
              "name": "from",
              "type": "method",
              "meta": {
                "added": [
                  "v12.3.0",
                  "v10.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "iterable"
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>iterable</code> {Iterable} Object implementing the <code>Symbol.asyncIterator</code> or\n<code>Symbol.iterator</code> iterable protocol. Emits an 'error' event if a null\nvalue is passed.</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Options provided to <code>new stream.Readable([options])</code>.\nBy default, <code>Readable.from()</code> will set <code>options.objectMode</code> to <code>true</code>, unless\nthis is explicitly opted out by setting <code>options.objectMode</code> to <code>false</code>.</li>\n<li>Returns: <a href=\"stream.html#class-streamreadable\"><code>&#x3C;stream.Readable></code></a></li>\n</ul>\n<p>A utility method for creating readable streams out of iterators.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nasync function * generate() {\n  yield 'hello';\n  yield 'streams';\n}\n\nconst readable = Readable.from(generate());\n\nreadable.on('data', (chunk) => {\n  console.log(chunk);\n});\n</code></pre>\n<p>Calling <code>Readable.from(string)</code> or <code>Readable.from(buffer)</code> will not have\nthe strings or buffers be iterated to match the other streams semantics\nfor performance reasons.</p>\n<p>If an <code>Iterable</code> object containing promises is passed as an argument,\nit might result in unhandled rejection.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nReadable.from([\n  new Promise((resolve) => setTimeout(resolve('1'), 1500)),\n  new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Unhandled rejection\n]);\n</code></pre>"
            },
            {
              "textRaw": "`stream.Readable.fromWeb(readableStream[, options])`",
              "name": "fromWeb",
              "type": "method",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`readableStream` {ReadableStream}",
                      "name": "readableStream",
                      "type": "ReadableStream"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`encoding` {string}",
                          "name": "encoding",
                          "type": "string"
                        },
                        {
                          "textRaw": "`highWaterMark` {number}",
                          "name": "highWaterMark",
                          "type": "number"
                        },
                        {
                          "textRaw": "`objectMode` {boolean}",
                          "name": "objectMode",
                          "type": "boolean"
                        },
                        {
                          "textRaw": "`signal` {AbortSignal}",
                          "name": "signal",
                          "type": "AbortSignal"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {stream.Readable}",
                    "name": "return",
                    "type": "stream.Readable"
                  }
                }
              ]
            },
            {
              "textRaw": "`stream.Readable.isDisturbed(stream)`",
              "name": "isDisturbed",
              "type": "method",
              "meta": {
                "added": [
                  "v16.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`stream` {stream.Readable|ReadableStream}",
                      "name": "stream",
                      "type": "stream.Readable|ReadableStream"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: `boolean`",
                    "name": "return",
                    "desc": "`boolean`"
                  }
                }
              ],
              "desc": "<p>Returns whether the stream has been read from or cancelled.</p>"
            },
            {
              "textRaw": "`stream.Readable.toWeb(streamReadable[, options])`",
              "name": "toWeb",
              "type": "method",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v25.4.0",
                      "v24.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58664",
                    "description": "Add 'type' option to specify 'bytes'."
                  },
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  },
                  {
                    "version": [
                      "v18.7.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/43515",
                    "description": "include strategy options on Readable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`streamReadable` {stream.Readable}",
                      "name": "streamReadable",
                      "type": "stream.Readable"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`strategy` {Object}",
                          "name": "strategy",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`highWaterMark` {number} The maximum internal queue size (of the created `ReadableStream`) before backpressure is applied in reading from the given `stream.Readable`. If no value is provided, it will be taken from the given `stream.Readable`.",
                              "name": "highWaterMark",
                              "type": "number",
                              "desc": "The maximum internal queue size (of the created `ReadableStream`) before backpressure is applied in reading from the given `stream.Readable`. If no value is provided, it will be taken from the given `stream.Readable`."
                            },
                            {
                              "textRaw": "`size` {Function} A function that size of the given chunk of data. If no value is provided, the size will be `1` for all the chunks.",
                              "name": "size",
                              "type": "Function",
                              "desc": "A function that size of the given chunk of data. If no value is provided, the size will be `1` for all the chunks.",
                              "options": [
                                {
                                  "textRaw": "`chunk` {any}",
                                  "name": "chunk",
                                  "type": "any"
                                },
                                {
                                  "textRaw": "Returns: {number}",
                                  "name": "return",
                                  "type": "number"
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "textRaw": "`type` {string} Specifies the type of the created `ReadableStream`. Must be `'bytes'` or undefined.",
                          "name": "type",
                          "type": "string",
                          "desc": "Specifies the type of the created `ReadableStream`. Must be `'bytes'` or undefined."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {ReadableStream}",
                    "name": "return",
                    "type": "ReadableStream"
                  }
                }
              ]
            },
            {
              "textRaw": "`stream.Writable.fromWeb(writableStream[, options])`",
              "name": "fromWeb",
              "type": "method",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`writableStream` {WritableStream}",
                      "name": "writableStream",
                      "type": "WritableStream"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`decodeStrings` {boolean}",
                          "name": "decodeStrings",
                          "type": "boolean"
                        },
                        {
                          "textRaw": "`highWaterMark` {number}",
                          "name": "highWaterMark",
                          "type": "number"
                        },
                        {
                          "textRaw": "`objectMode` {boolean}",
                          "name": "objectMode",
                          "type": "boolean"
                        },
                        {
                          "textRaw": "`signal` {AbortSignal}",
                          "name": "signal",
                          "type": "AbortSignal"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {stream.Writable}",
                    "name": "return",
                    "type": "stream.Writable"
                  }
                }
              ]
            },
            {
              "textRaw": "`stream.Writable.toWeb(streamWritable)`",
              "name": "toWeb",
              "type": "method",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`streamWritable` {stream.Writable}",
                      "name": "streamWritable",
                      "type": "stream.Writable"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {WritableStream}",
                    "name": "return",
                    "type": "WritableStream"
                  }
                }
              ]
            },
            {
              "textRaw": "`stream.Duplex.from(src)`",
              "name": "from",
              "type": "method",
              "meta": {
                "added": [
                  "v16.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.5.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46190",
                    "description": "The `src` argument can now be a `ReadableStream` or `WritableStream`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {Stream|Blob|ArrayBuffer|string|AsyncIterable|AsyncGeneratorFunction|AsyncFunction|Promise|Object|ReadableStream|WritableStream}",
                      "name": "src",
                      "type": "Stream|Blob|ArrayBuffer|string|AsyncIterable|AsyncGeneratorFunction|AsyncFunction|Promise|Object|ReadableStream|WritableStream"
                    }
                  ]
                }
              ],
              "desc": "<p>A utility method for creating duplex streams.</p>\n<ul>\n<li><code>Stream</code> converts writable stream into writable <code>Duplex</code> and readable stream\nto <code>Duplex</code>.</li>\n<li><code>Blob</code> converts into readable <code>Duplex</code>.</li>\n<li><code>string</code> converts into readable <code>Duplex</code>.</li>\n<li><code>ArrayBuffer</code> converts into readable <code>Duplex</code>.</li>\n<li><code>AsyncIterable</code> converts into a readable <code>Duplex</code>. Cannot yield\n<code>null</code>.</li>\n<li><code>AsyncGeneratorFunction</code> converts into a readable/writable transform\n<code>Duplex</code>. Must take a source <code>AsyncIterable</code> as first parameter. Cannot yield\n<code>null</code>.</li>\n<li><code>AsyncFunction</code> converts into a writable <code>Duplex</code>. Must return\neither <code>null</code> or <code>undefined</code></li>\n<li><code>Object ({ writable, readable })</code> converts <code>readable</code> and\n<code>writable</code> into <code>Stream</code> and then combines them into <code>Duplex</code> where the\n<code>Duplex</code> will write to the <code>writable</code> and read from the <code>readable</code>.</li>\n<li><code>Promise</code> converts into readable <code>Duplex</code>. Value <code>null</code> is ignored.</li>\n<li><code>ReadableStream</code> converts into readable <code>Duplex</code>.</li>\n<li><code>WritableStream</code> converts into writable <code>Duplex</code>.</li>\n<li>Returns: <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a></li>\n</ul>\n<p>If an <code>Iterable</code> object containing promises is passed as an argument,\nit might result in unhandled rejection.</p>\n<pre><code class=\"language-js\">const { Duplex } = require('node:stream');\n\nDuplex.from([\n  new Promise((resolve) => setTimeout(resolve('1'), 1500)),\n  new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Unhandled rejection\n]);\n</code></pre>"
            },
            {
              "textRaw": "`stream.Duplex.fromWeb(pair[, options])`",
              "name": "fromWeb",
              "type": "method",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`pair` {Object}",
                      "name": "pair",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`readable` {ReadableStream}",
                          "name": "readable",
                          "type": "ReadableStream"
                        },
                        {
                          "textRaw": "`writable` {WritableStream}",
                          "name": "writable",
                          "type": "WritableStream"
                        }
                      ]
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`allowHalfOpen` {boolean}",
                          "name": "allowHalfOpen",
                          "type": "boolean"
                        },
                        {
                          "textRaw": "`decodeStrings` {boolean}",
                          "name": "decodeStrings",
                          "type": "boolean"
                        },
                        {
                          "textRaw": "`encoding` {string}",
                          "name": "encoding",
                          "type": "string"
                        },
                        {
                          "textRaw": "`highWaterMark` {number}",
                          "name": "highWaterMark",
                          "type": "number"
                        },
                        {
                          "textRaw": "`objectMode` {boolean}",
                          "name": "objectMode",
                          "type": "boolean"
                        },
                        {
                          "textRaw": "`signal` {AbortSignal}",
                          "name": "signal",
                          "type": "AbortSignal"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {stream.Duplex}",
                    "name": "return",
                    "type": "stream.Duplex"
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { Duplex } from 'node:stream';\nimport {\n  ReadableStream,\n  WritableStream,\n} from 'node:stream/web';\n\nconst readable = new ReadableStream({\n  start(controller) {\n    controller.enqueue('world');\n  },\n});\n\nconst writable = new WritableStream({\n  write(chunk) {\n    console.log('writable', chunk);\n  },\n});\n\nconst pair = {\n  readable,\n  writable,\n};\nconst duplex = Duplex.fromWeb(pair, { encoding: 'utf8', objectMode: true });\n\nduplex.write('hello');\n\nfor await (const chunk of duplex) {\n  console.log('readable', chunk);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { Duplex } = require('node:stream');\nconst {\n  ReadableStream,\n  WritableStream,\n} = require('node:stream/web');\n\nconst readable = new ReadableStream({\n  start(controller) {\n    controller.enqueue('world');\n  },\n});\n\nconst writable = new WritableStream({\n  write(chunk) {\n    console.log('writable', chunk);\n  },\n});\n\nconst pair = {\n  readable,\n  writable,\n};\nconst duplex = Duplex.fromWeb(pair, { encoding: 'utf8', objectMode: true });\n\nduplex.write('hello');\nduplex.once('readable', () => console.log('readable', duplex.read()));\n</code></pre>"
            },
            {
              "textRaw": "`stream.Duplex.toWeb(streamDuplex[, options])`",
              "name": "toWeb",
              "type": "method",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": [
                  {
                    "version": "v25.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61632",
                    "description": "Added the 'readableType' option to specify the ReadableStream type. The 'type' option is deprecated."
                  },
                  {
                    "version": [
                      "v25.4.0",
                      "v24.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58664",
                    "description": "Added the 'type' option to specify the ReadableStream type."
                  },
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`streamDuplex` {stream.Duplex}",
                      "name": "streamDuplex",
                      "type": "stream.Duplex"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`readableType` {string} Specifies the type of the `ReadableStream` half of the created readable-writable pair. Must be `'bytes'` or undefined. (`options.type` is a deprecated alias for this option.)",
                          "name": "readableType",
                          "type": "string",
                          "desc": "Specifies the type of the `ReadableStream` half of the created readable-writable pair. Must be `'bytes'` or undefined. (`options.type` is a deprecated alias for this option.)"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`readable` {ReadableStream}",
                        "name": "readable",
                        "type": "ReadableStream"
                      },
                      {
                        "textRaw": "`writable` {WritableStream}",
                        "name": "writable",
                        "type": "WritableStream"
                      }
                    ]
                  }
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import { Duplex } from 'node:stream';\n\nconst duplex = Duplex({\n  objectMode: true,\n  read() {\n    this.push('world');\n    this.push(null);\n  },\n  write(chunk, encoding, callback) {\n    console.log('writable', chunk);\n    callback();\n  },\n});\n\nconst { readable, writable } = Duplex.toWeb(duplex);\nwritable.getWriter().write('hello');\n\nconst { value } = await readable.getReader().read();\nconsole.log('readable', value);\n</code></pre>\n<pre><code class=\"language-cjs\">const { Duplex } = require('node:stream');\n\nconst duplex = Duplex({\n  objectMode: true,\n  read() {\n    this.push('world');\n    this.push(null);\n  },\n  write(chunk, encoding, callback) {\n    console.log('writable', chunk);\n    callback();\n  },\n});\n\nconst { readable, writable } = Duplex.toWeb(duplex);\nwritable.getWriter().write('hello');\n\nreadable.getReader().read().then((result) => {\n  console.log('readable', result.value);\n});\n</code></pre>"
            },
            {
              "textRaw": "`stream.addAbortSignal(signal, stream)`",
              "name": "addAbortSignal",
              "type": "method",
              "meta": {
                "added": [
                  "v15.4.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.7.0",
                      "v18.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46273",
                    "description": "Added support for `ReadableStream` and `WritableStream`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`signal` {AbortSignal} A signal representing possible cancellation",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "A signal representing possible cancellation"
                    },
                    {
                      "textRaw": "`stream` {Stream|ReadableStream|WritableStream} A stream to attach a signal to.",
                      "name": "stream",
                      "type": "Stream|ReadableStream|WritableStream",
                      "desc": "A stream to attach a signal to."
                    }
                  ]
                }
              ],
              "desc": "<p>Attaches an AbortSignal to a readable or writeable stream. This lets code\ncontrol stream destruction using an <code>AbortController</code>.</p>\n<p>Calling <code>abort</code> on the <code>AbortController</code> corresponding to the passed\n<code>AbortSignal</code> will behave the same way as calling <code>.destroy(new AbortError())</code>\non the stream, and <code>controller.error(new AbortError())</code> for webstreams.</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\n\nconst controller = new AbortController();\nconst read = addAbortSignal(\n  controller.signal,\n  fs.createReadStream(('object.json')),\n);\n// Later, abort the operation closing the stream\ncontroller.abort();\n</code></pre>\n<p>Or using an <code>AbortSignal</code> with a readable stream as an async iterable:</p>\n<pre><code class=\"language-js\">const controller = new AbortController();\nsetTimeout(() => controller.abort(), 10_000); // set a timeout\nconst stream = addAbortSignal(\n  controller.signal,\n  fs.createReadStream(('object.json')),\n);\n(async () => {\n  try {\n    for await (const chunk of stream) {\n      await process(chunk);\n    }\n  } catch (e) {\n    if (e.name === 'AbortError') {\n      // The operation was cancelled\n    } else {\n      throw e;\n    }\n  }\n})();\n</code></pre>\n<p>Or using an <code>AbortSignal</code> with a ReadableStream:</p>\n<pre><code class=\"language-js\">const controller = new AbortController();\nconst rs = new ReadableStream({\n  start(controller) {\n    controller.enqueue('hello');\n    controller.enqueue('world');\n    controller.close();\n  },\n});\n\naddAbortSignal(controller.signal, rs);\n\nfinished(rs, (err) => {\n  if (err) {\n    if (err.name === 'AbortError') {\n      // The operation was cancelled\n    }\n  }\n});\n\nconst reader = rs.getReader();\n\nreader.read().then(({ value, done }) => {\n  console.log(value); // hello\n  console.log(done); // false\n  controller.abort();\n});\n</code></pre>"
            },
            {
              "textRaw": "`stream.getDefaultHighWaterMark(objectMode)`",
              "name": "getDefaultHighWaterMark",
              "type": "method",
              "meta": {
                "added": [
                  "v19.9.0",
                  "v18.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`objectMode` {boolean}",
                      "name": "objectMode",
                      "type": "boolean"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {integer}",
                    "name": "return",
                    "type": "integer"
                  }
                }
              ],
              "desc": "<p>Returns the default highWaterMark used by streams.\nDefaults to <code>65536</code> (64 KiB), or <code>16</code> for <code>objectMode</code>.</p>"
            },
            {
              "textRaw": "`stream.setDefaultHighWaterMark(objectMode, value)`",
              "name": "setDefaultHighWaterMark",
              "type": "method",
              "meta": {
                "added": [
                  "v19.9.0",
                  "v18.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`objectMode` {boolean}",
                      "name": "objectMode",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`value` {integer} highWaterMark value",
                      "name": "value",
                      "type": "integer",
                      "desc": "highWaterMark value"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the default highWaterMark used by streams.</p>"
            }
          ]
        },
        {
          "textRaw": "API for stream implementers",
          "name": "API for stream implementers",
          "type": "misc",
          "desc": "<p>The <code>node:stream</code> module API has been designed to make it possible to easily\nimplement streams using JavaScript's prototypal inheritance model.</p>\n<p>First, a stream developer would declare a new JavaScript class that extends one\nof the four basic stream classes (<code>stream.Writable</code>, <code>stream.Readable</code>,\n<code>stream.Duplex</code>, or <code>stream.Transform</code>), making sure they call the appropriate\nparent class constructor:</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\n\nclass MyWritable extends Writable {\n  constructor({ highWaterMark, ...options }) {\n    super({ highWaterMark });\n    // ...\n  }\n}\n</code></pre>\n<p>When extending streams, keep in mind what options the user\ncan and should provide before forwarding these to the base constructor. For\nexample, if the implementation makes assumptions in regard to the\n<code>autoDestroy</code> and <code>emitClose</code> options, do not allow the\nuser to override these. Be explicit about what\noptions are forwarded instead of implicitly forwarding all options.</p>\n<p>The new stream class must then implement one or more specific methods, depending\non the type of stream being created, as detailed in the chart below:</p>\n<table>\n<thead>\n<tr>\n<th>Use-case</th>\n<th>Class</th>\n<th>Method(s) to implement</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Reading only</td>\n<td><a href=\"#class-streamreadable\"><code>Readable</code></a></td>\n<td><a href=\"#readable_readsize\"><code>_read()</code></a></td>\n</tr>\n<tr>\n<td>Writing only</td>\n<td><a href=\"#class-streamwritable\"><code>Writable</code></a></td>\n<td><a href=\"#writable_writechunk-encoding-callback\"><code>_write()</code></a>, <a href=\"#writable_writevchunks-callback\"><code>_writev()</code></a>, <a href=\"#writable_finalcallback\"><code>_final()</code></a></td>\n</tr>\n<tr>\n<td>Reading and writing</td>\n<td><a href=\"#class-streamduplex\"><code>Duplex</code></a></td>\n<td><a href=\"#readable_readsize\"><code>_read()</code></a>, <a href=\"#writable_writechunk-encoding-callback\"><code>_write()</code></a>, <a href=\"#writable_writevchunks-callback\"><code>_writev()</code></a>, <a href=\"#writable_finalcallback\"><code>_final()</code></a></td>\n</tr>\n<tr>\n<td>Operate on written data, then read the result</td>\n<td><a href=\"#class-streamtransform\"><code>Transform</code></a></td>\n<td><a href=\"#transform_transformchunk-encoding-callback\"><code>_transform()</code></a>, <a href=\"#transform_flushcallback\"><code>_flush()</code></a>, <a href=\"#writable_finalcallback\"><code>_final()</code></a></td>\n</tr>\n</tbody>\n</table>\n<p>The implementation code for a stream should <em>never</em> call the \"public\" methods\nof a stream that are intended for use by consumers (as described in the\n<a href=\"#api-for-stream-consumers\">API for stream consumers</a> section). Doing so may lead to adverse side effects\nin application code consuming the stream.</p>\n<p>Avoid overriding public methods such as <code>write()</code>, <code>end()</code>, <code>cork()</code>,\n<code>uncork()</code>, <code>read()</code> and <code>destroy()</code>, or emitting internal events such\nas <code>'error'</code>, <code>'data'</code>, <code>'end'</code>, <code>'finish'</code> and <code>'close'</code> through <code>.emit()</code>.\nDoing so can break current and future stream invariants leading to behavior\nand/or compatibility issues with other streams, stream utilities, and user\nexpectations.</p>",
          "miscs": [
            {
              "textRaw": "Simplified construction",
              "name": "simplified_construction",
              "type": "misc",
              "meta": {
                "added": [
                  "v1.2.0"
                ],
                "changes": []
              },
              "desc": "<p>For many simple cases, it is possible to create a stream without relying on\ninheritance. This can be accomplished by directly creating instances of the\n<code>stream.Writable</code>, <code>stream.Readable</code>, <code>stream.Duplex</code>, or <code>stream.Transform</code>\nobjects and passing appropriate methods as constructor options.</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\n\nconst myWritable = new Writable({\n  construct(callback) {\n    // Initialize state and load resources...\n  },\n  write(chunk, encoding, callback) {\n    // ...\n  },\n  destroy() {\n    // Free resources...\n  },\n});\n</code></pre>",
              "displayName": "Simplified construction"
            },
            {
              "textRaw": "Implementing a writable stream",
              "name": "implementing_a_writable_stream",
              "type": "misc",
              "desc": "<p>The <code>stream.Writable</code> class is extended to implement a <a href=\"#class-streamwritable\"><code>Writable</code></a> stream.</p>\n<p>Custom <code>Writable</code> streams <em>must</em> call the <code>new stream.Writable([options])</code>\nconstructor and implement the <code>writable._write()</code> and/or <code>writable._writev()</code>\nmethod.</p>",
              "signatures": [
                {
                  "textRaw": "`new stream.Writable([options])`",
                  "name": "stream.Writable",
                  "type": "ctor",
                  "meta": {
                    "changes": [
                      {
                        "version": "v22.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/52037",
                        "description": "bump default highWaterMark."
                      },
                      {
                        "version": "v15.5.0",
                        "pr-url": "https://github.com/nodejs/node/pull/36431",
                        "description": "support passing in an AbortSignal."
                      },
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/30623",
                        "description": "Change `autoDestroy` option default to `true`."
                      },
                      {
                        "version": [
                          "v11.2.0",
                          "v10.16.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/22795",
                        "description": "Add `autoDestroy` option to automatically `destroy()` the stream when it emits `'finish'` or errors."
                      },
                      {
                        "version": "v10.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/18438",
                        "description": "Add `emitClose` option to specify if `'close'` is emitted on destroy."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} Buffer level when `stream.write()` starts returning `false`. **Default:** `65536` (64 KiB), or `16` for `objectMode` streams.",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`65536` (64 KiB), or `16` for `objectMode` streams",
                          "desc": "Buffer level when `stream.write()` starts returning `false`."
                        },
                        {
                          "textRaw": "`decodeStrings` {boolean} Whether to encode `string`s passed to `stream.write()` to `Buffer`s (with the encoding specified in the `stream.write()` call) before passing them to `stream._write()`. Other types of data are not converted (i.e. `Buffer`s are not decoded into `string`s). Setting to false will prevent `string`s from being converted. **Default:** `true`.",
                          "name": "decodeStrings",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether to encode `string`s passed to `stream.write()` to `Buffer`s (with the encoding specified in the `stream.write()` call) before passing them to `stream._write()`. Other types of data are not converted (i.e. `Buffer`s are not decoded into `string`s). Setting to false will prevent `string`s from being converted."
                        },
                        {
                          "textRaw": "`defaultEncoding` {string} The default encoding that is used when no encoding is specified as an argument to `stream.write()`. **Default:** `'utf8'`.",
                          "name": "defaultEncoding",
                          "type": "string",
                          "default": "`'utf8'`",
                          "desc": "The default encoding that is used when no encoding is specified as an argument to `stream.write()`."
                        },
                        {
                          "textRaw": "`objectMode` {boolean} Whether or not the `stream.write(anyObj)` is a valid operation. When set, it becomes possible to write JavaScript values other than string, {Buffer}, {TypedArray} or {DataView} if supported by the stream implementation. **Default:** `false`.",
                          "name": "objectMode",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether or not the `stream.write(anyObj)` is a valid operation. When set, it becomes possible to write JavaScript values other than string, {Buffer}, {TypedArray} or {DataView} if supported by the stream implementation."
                        },
                        {
                          "textRaw": "`emitClose` {boolean} Whether or not the stream should emit `'close'` after it has been destroyed. **Default:** `true`.",
                          "name": "emitClose",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether or not the stream should emit `'close'` after it has been destroyed."
                        },
                        {
                          "textRaw": "`write` {Function} Implementation for the `stream._write()` method.",
                          "name": "write",
                          "type": "Function",
                          "desc": "Implementation for the `stream._write()` method."
                        },
                        {
                          "textRaw": "`writev` {Function} Implementation for the `stream._writev()` method.",
                          "name": "writev",
                          "type": "Function",
                          "desc": "Implementation for the `stream._writev()` method."
                        },
                        {
                          "textRaw": "`destroy` {Function} Implementation for the `stream._destroy()` method.",
                          "name": "destroy",
                          "type": "Function",
                          "desc": "Implementation for the `stream._destroy()` method."
                        },
                        {
                          "textRaw": "`final` {Function} Implementation for the `stream._final()` method.",
                          "name": "final",
                          "type": "Function",
                          "desc": "Implementation for the `stream._final()` method."
                        },
                        {
                          "textRaw": "`construct` {Function} Implementation for the `stream._construct()` method.",
                          "name": "construct",
                          "type": "Function",
                          "desc": "Implementation for the `stream._construct()` method."
                        },
                        {
                          "textRaw": "`autoDestroy` {boolean} Whether this stream should automatically call `.destroy()` on itself after ending. **Default:** `true`.",
                          "name": "autoDestroy",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether this stream should automatically call `.destroy()` on itself after ending."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} A signal representing possible cancellation.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "A signal representing possible cancellation."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const { Writable } = require('node:stream');\n\nclass MyWritable extends Writable {\n  constructor(options) {\n    // Calls the stream.Writable() constructor.\n    super(options);\n    // ...\n  }\n}\n</code></pre>\n<p>Or, when using pre-ES6 style constructors:</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\nconst util = require('node:util');\n\nfunction MyWritable(options) {\n  if (!(this instanceof MyWritable))\n    return new MyWritable(options);\n  Writable.call(this, options);\n}\nutil.inherits(MyWritable, Writable);\n</code></pre>\n<p>Or, using the simplified constructor approach:</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\n\nconst myWritable = new Writable({\n  write(chunk, encoding, callback) {\n    // ...\n  },\n  writev(chunks, callback) {\n    // ...\n  },\n});\n</code></pre>\n<p>Calling <code>abort</code> on the <code>AbortController</code> corresponding to the passed\n<code>AbortSignal</code> will behave the same way as calling <code>.destroy(new AbortError())</code>\non the writeable stream.</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\n\nconst controller = new AbortController();\nconst myWritable = new Writable({\n  write(chunk, encoding, callback) {\n    // ...\n  },\n  writev(chunks, callback) {\n    // ...\n  },\n  signal: controller.signal,\n});\n// Later, abort the operation closing the stream\ncontroller.abort();\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`writable._construct(callback)`",
                  "name": "_construct",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function} Call this function (optionally with an error argument) when the stream has finished initializing.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "Call this function (optionally with an error argument) when the stream has finished initializing."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>The <code>_construct()</code> method MUST NOT be called directly. It may be implemented\nby child classes, and if so, will be called by the internal <code>Writable</code>\nclass methods only.</p>\n<p>This optional function will be called in a tick after the stream constructor\nhas returned, delaying any <code>_write()</code>, <code>_final()</code> and <code>_destroy()</code> calls until\n<code>callback</code> is called. This is useful to initialize state or asynchronously\ninitialize resources before the stream can be used.</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\nconst fs = require('node:fs');\n\nclass WriteStream extends Writable {\n  constructor(filename) {\n    super();\n    this.filename = filename;\n    this.fd = null;\n  }\n  _construct(callback) {\n    fs.open(this.filename, 'w', (err, fd) => {\n      if (err) {\n        callback(err);\n      } else {\n        this.fd = fd;\n        callback();\n      }\n    });\n  }\n  _write(chunk, encoding, callback) {\n    fs.write(this.fd, chunk, callback);\n  }\n  _destroy(err, callback) {\n    if (this.fd) {\n      fs.close(this.fd, (er) => callback(er || err));\n    } else {\n      callback(err);\n    }\n  }\n}\n</code></pre>"
                },
                {
                  "textRaw": "`writable._write(chunk, encoding, callback)`",
                  "name": "_write",
                  "type": "method",
                  "meta": {
                    "changes": [
                      {
                        "version": "v12.11.0",
                        "pr-url": "https://github.com/nodejs/node/pull/29639",
                        "description": "_write() is optional when providing _writev()."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {Buffer|string|any} The `Buffer` to be written, converted from the `string` passed to `stream.write()`. If the stream's `decodeStrings` option is `false` or the stream is operating in object mode, the chunk will not be converted & will be whatever was passed to `stream.write()`.",
                          "name": "chunk",
                          "type": "Buffer|string|any",
                          "desc": "The `Buffer` to be written, converted from the `string` passed to `stream.write()`. If the stream's `decodeStrings` option is `false` or the stream is operating in object mode, the chunk will not be converted & will be whatever was passed to `stream.write()`."
                        },
                        {
                          "textRaw": "`encoding` {string} If the chunk is a string, then `encoding` is the character encoding of that string. If chunk is a `Buffer`, or if the stream is operating in object mode, `encoding` may be ignored.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "If the chunk is a string, then `encoding` is the character encoding of that string. If chunk is a `Buffer`, or if the stream is operating in object mode, `encoding` may be ignored."
                        },
                        {
                          "textRaw": "`callback` {Function} Call this function (optionally with an error argument) when processing is complete for the supplied chunk.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "Call this function (optionally with an error argument) when processing is complete for the supplied chunk."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>All <code>Writable</code> stream implementations must provide a\n<a href=\"#writable_writechunk-encoding-callback\"><code>writable._write()</code></a> and/or\n<a href=\"#writable_writevchunks-callback\"><code>writable._writev()</code></a> method to send data to the underlying\nresource.</p>\n<p><a href=\"#class-streamtransform\"><code>Transform</code></a> streams provide their own implementation of the\n<a href=\"#writable_writechunk-encoding-callback\"><code>writable._write()</code></a>.</p>\n<p>This function MUST NOT be called by application code directly. It should be\nimplemented by child classes, and called by the internal <code>Writable</code> class\nmethods only.</p>\n<p>The <code>callback</code> function must be called synchronously inside of\n<code>writable._write()</code> or asynchronously (i.e. different tick) to signal either\nthat the write completed successfully or failed with an error.\nThe first argument passed to the <code>callback</code> must be the <code>Error</code> object if the\ncall failed or <code>null</code> if the write succeeded.</p>\n<p>All calls to <code>writable.write()</code> that occur between the time <code>writable._write()</code>\nis called and the <code>callback</code> is called will cause the written data to be\nbuffered. When the <code>callback</code> is invoked, the stream might emit a <a href=\"#event-drain\"><code>'drain'</code></a>\nevent. If a stream implementation is capable of processing multiple chunks of\ndata at once, the <code>writable._writev()</code> method should be implemented.</p>\n<p>If the <code>decodeStrings</code> property is explicitly set to <code>false</code> in the constructor\noptions, then <code>chunk</code> will remain the same object that is passed to <code>.write()</code>,\nand may be a string rather than a <code>Buffer</code>. This is to support implementations\nthat have an optimized handling for certain string data encodings. In that case,\nthe <code>encoding</code> argument will indicate the character encoding of the string.\nOtherwise, the <code>encoding</code> argument can be safely ignored.</p>\n<p>The <code>writable._write()</code> method is prefixed with an underscore because it is\ninternal to the class that defines it, and should never be called directly by\nuser programs.</p>"
                },
                {
                  "textRaw": "`writable._writev(chunks, callback)`",
                  "name": "_writev",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunks` {Object[]} The data to be written. The value is an array of {Object} that each represent a discrete chunk of data to write. The properties of these objects are:",
                          "name": "chunks",
                          "type": "Object[]",
                          "desc": "The data to be written. The value is an array of {Object} that each represent a discrete chunk of data to write. The properties of these objects are:",
                          "options": [
                            {
                              "textRaw": "`chunk` {Buffer|string} A buffer instance or string containing the data to be written. The `chunk` will be a string if the `Writable` was created with the `decodeStrings` option set to `false` and a string was passed to `write()`.",
                              "name": "chunk",
                              "type": "Buffer|string",
                              "desc": "A buffer instance or string containing the data to be written. The `chunk` will be a string if the `Writable` was created with the `decodeStrings` option set to `false` and a string was passed to `write()`."
                            },
                            {
                              "textRaw": "`encoding` {string} The character encoding of the `chunk`. If `chunk` is a `Buffer`, the `encoding` will be `'buffer'`.",
                              "name": "encoding",
                              "type": "string",
                              "desc": "The character encoding of the `chunk`. If `chunk` is a `Buffer`, the `encoding` will be `'buffer'`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`callback` {Function} A callback function (optionally with an error argument) to be invoked when processing is complete for the supplied chunks.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "A callback function (optionally with an error argument) to be invoked when processing is complete for the supplied chunks."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This function MUST NOT be called by application code directly. It should be\nimplemented by child classes, and called by the internal <code>Writable</code> class\nmethods only.</p>\n<p>The <code>writable._writev()</code> method may be implemented in addition or alternatively\nto <code>writable._write()</code> in stream implementations that are capable of processing\nmultiple chunks of data at once. If implemented and if there is buffered data\nfrom previous writes, <code>_writev()</code> will be called instead of <code>_write()</code>.</p>\n<p>The <code>writable._writev()</code> method is prefixed with an underscore because it is\ninternal to the class that defines it, and should never be called directly by\nuser programs.</p>"
                },
                {
                  "textRaw": "`writable._destroy(err, callback)`",
                  "name": "_destroy",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`err` {Error} A possible error.",
                          "name": "err",
                          "type": "Error",
                          "desc": "A possible error."
                        },
                        {
                          "textRaw": "`callback` {Function} A callback function that takes an optional error argument.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "A callback function that takes an optional error argument."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>The <code>_destroy()</code> method is called by <a href=\"#writabledestroyerror\"><code>writable.destroy()</code></a>.\nIt can be overridden by child classes but it <strong>must not</strong> be called directly.</p>"
                },
                {
                  "textRaw": "`writable._final(callback)`",
                  "name": "_final",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function} Call this function (optionally with an error argument) when finished writing any remaining data.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "Call this function (optionally with an error argument) when finished writing any remaining data."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>The <code>_final()</code> method <strong>must not</strong> be called directly. It may be implemented\nby child classes, and if so, will be called by the internal <code>Writable</code>\nclass methods only.</p>\n<p>This optional function will be called before the stream closes, delaying the\n<code>'finish'</code> event until <code>callback</code> is called. This is useful to close resources\nor write buffered data before a stream ends.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Errors while writing",
                  "name": "errors_while_writing",
                  "type": "module",
                  "desc": "<p>Errors occurring during the processing of the <a href=\"#writable_writechunk-encoding-callback\"><code>writable._write()</code></a>,\n<a href=\"#writable_writevchunks-callback\"><code>writable._writev()</code></a> and <a href=\"#writable_finalcallback\"><code>writable._final()</code></a> methods must be propagated\nby invoking the callback and passing the error as the first argument.\nThrowing an <code>Error</code> from within these methods or manually emitting an <code>'error'</code>\nevent results in undefined behavior.</p>\n<p>If a <code>Readable</code> stream pipes into a <code>Writable</code> stream when <code>Writable</code> emits an\nerror, the <code>Readable</code> stream will be unpiped.</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\n\nconst myWritable = new Writable({\n  write(chunk, encoding, callback) {\n    if (chunk.toString().indexOf('a') >= 0) {\n      callback(new Error('chunk is invalid'));\n    } else {\n      callback();\n    }\n  },\n});\n</code></pre>",
                  "displayName": "Errors while writing"
                },
                {
                  "textRaw": "An example writable stream",
                  "name": "an_example_writable_stream",
                  "type": "module",
                  "desc": "<p>The following illustrates a rather simplistic (and somewhat pointless) custom\n<code>Writable</code> stream implementation. While this specific <code>Writable</code> stream instance\nis not of any real particular usefulness, the example illustrates each of the\nrequired elements of a custom <a href=\"#class-streamwritable\"><code>Writable</code></a> stream instance:</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\n\nclass MyWritable extends Writable {\n  _write(chunk, encoding, callback) {\n    if (chunk.toString().indexOf('a') >= 0) {\n      callback(new Error('chunk is invalid'));\n    } else {\n      callback();\n    }\n  }\n}\n</code></pre>",
                  "displayName": "An example writable stream"
                },
                {
                  "textRaw": "Decoding buffers in a writable stream",
                  "name": "decoding_buffers_in_a_writable_stream",
                  "type": "module",
                  "desc": "<p>Decoding buffers is a common task, for instance, when using transformers whose\ninput is a string. This is not a trivial process when using multi-byte\ncharacters encoding, such as UTF-8. The following example shows how to decode\nmulti-byte strings using <code>StringDecoder</code> and <a href=\"#class-streamwritable\"><code>Writable</code></a>.</p>\n<pre><code class=\"language-js\">const { Writable } = require('node:stream');\nconst { StringDecoder } = require('node:string_decoder');\n\nclass StringWritable extends Writable {\n  constructor(options) {\n    super(options);\n    this._decoder = new StringDecoder(options?.defaultEncoding);\n    this.data = '';\n  }\n  _write(chunk, encoding, callback) {\n    if (encoding === 'buffer') {\n      chunk = this._decoder.write(chunk);\n    }\n    this.data += chunk;\n    callback();\n  }\n  _final(callback) {\n    this.data += this._decoder.end();\n    callback();\n  }\n}\n\nconst euro = [[0xE2, 0x82], [0xAC]].map(Buffer.from);\nconst w = new StringWritable();\n\nw.write('currency: ');\nw.write(euro[0]);\nw.end(euro[1]);\n\nconsole.log(w.data); // currency: €\n</code></pre>",
                  "displayName": "Decoding buffers in a writable stream"
                }
              ],
              "displayName": "Implementing a writable stream"
            },
            {
              "textRaw": "Implementing a readable stream",
              "name": "implementing_a_readable_stream",
              "type": "misc",
              "desc": "<p>The <code>stream.Readable</code> class is extended to implement a <a href=\"#class-streamreadable\"><code>Readable</code></a> stream.</p>\n<p>Custom <code>Readable</code> streams <em>must</em> call the <code>new stream.Readable([options])</code>\nconstructor and implement the <a href=\"#readable_readsize\"><code>readable._read()</code></a> method.</p>",
              "signatures": [
                {
                  "textRaw": "`new stream.Readable([options])`",
                  "name": "stream.Readable",
                  "type": "ctor",
                  "meta": {
                    "changes": [
                      {
                        "version": "v22.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/52037",
                        "description": "bump default highWaterMark."
                      },
                      {
                        "version": "v15.5.0",
                        "pr-url": "https://github.com/nodejs/node/pull/36431",
                        "description": "support passing in an AbortSignal."
                      },
                      {
                        "version": "v14.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/30623",
                        "description": "Change `autoDestroy` option default to `true`."
                      },
                      {
                        "version": [
                          "v11.2.0",
                          "v10.16.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/22795",
                        "description": "Add `autoDestroy` option to automatically `destroy()` the stream when it emits `'end'` or errors."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} The maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource. **Default:** `65536` (64 KiB), or `16` for `objectMode` streams.",
                          "name": "highWaterMark",
                          "type": "number",
                          "default": "`65536` (64 KiB), or `16` for `objectMode` streams",
                          "desc": "The maximum number of bytes to store in the internal buffer before ceasing to read from the underlying resource."
                        },
                        {
                          "textRaw": "`encoding` {string} If specified, then buffers will be decoded to strings using the specified encoding. **Default:** `null`.",
                          "name": "encoding",
                          "type": "string",
                          "default": "`null`",
                          "desc": "If specified, then buffers will be decoded to strings using the specified encoding."
                        },
                        {
                          "textRaw": "`objectMode` {boolean} Whether this stream should behave as a stream of objects. Meaning that `stream.read(n)` returns a single value instead of a `Buffer` of size `n`. **Default:** `false`.",
                          "name": "objectMode",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether this stream should behave as a stream of objects. Meaning that `stream.read(n)` returns a single value instead of a `Buffer` of size `n`."
                        },
                        {
                          "textRaw": "`emitClose` {boolean} Whether or not the stream should emit `'close'` after it has been destroyed. **Default:** `true`.",
                          "name": "emitClose",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether or not the stream should emit `'close'` after it has been destroyed."
                        },
                        {
                          "textRaw": "`read` {Function} Implementation for the `stream._read()` method.",
                          "name": "read",
                          "type": "Function",
                          "desc": "Implementation for the `stream._read()` method."
                        },
                        {
                          "textRaw": "`destroy` {Function} Implementation for the `stream._destroy()` method.",
                          "name": "destroy",
                          "type": "Function",
                          "desc": "Implementation for the `stream._destroy()` method."
                        },
                        {
                          "textRaw": "`construct` {Function} Implementation for the `stream._construct()` method.",
                          "name": "construct",
                          "type": "Function",
                          "desc": "Implementation for the `stream._construct()` method."
                        },
                        {
                          "textRaw": "`autoDestroy` {boolean} Whether this stream should automatically call `.destroy()` on itself after ending. **Default:** `true`.",
                          "name": "autoDestroy",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Whether this stream should automatically call `.destroy()` on itself after ending."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} A signal representing possible cancellation.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "A signal representing possible cancellation."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nclass MyReadable extends Readable {\n  constructor(options) {\n    // Calls the stream.Readable(options) constructor.\n    super(options);\n    // ...\n  }\n}\n</code></pre>\n<p>Or, when using pre-ES6 style constructors:</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\nconst util = require('node:util');\n\nfunction MyReadable(options) {\n  if (!(this instanceof MyReadable))\n    return new MyReadable(options);\n  Readable.call(this, options);\n}\nutil.inherits(MyReadable, Readable);\n</code></pre>\n<p>Or, using the simplified constructor approach:</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nconst myReadable = new Readable({\n  read(size) {\n    // ...\n  },\n});\n</code></pre>\n<p>Calling <code>abort</code> on the <code>AbortController</code> corresponding to the passed\n<code>AbortSignal</code> will behave the same way as calling <code>.destroy(new AbortError())</code>\non the readable created.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\nconst controller = new AbortController();\nconst read = new Readable({\n  read(size) {\n    // ...\n  },\n  signal: controller.signal,\n});\n// Later, abort the operation closing the stream\ncontroller.abort();\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`readable._construct(callback)`",
                  "name": "_construct",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function} Call this function (optionally with an error argument) when the stream has finished initializing.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "Call this function (optionally with an error argument) when the stream has finished initializing."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>The <code>_construct()</code> method MUST NOT be called directly. It may be implemented\nby child classes, and if so, will be called by the internal <code>Readable</code>\nclass methods only.</p>\n<p>This optional function will be scheduled in the next tick by the stream\nconstructor, delaying any <code>_read()</code> and <code>_destroy()</code> calls until <code>callback</code> is\ncalled. This is useful to initialize state or asynchronously initialize\nresources before the stream can be used.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\nconst fs = require('node:fs');\n\nclass ReadStream extends Readable {\n  constructor(filename) {\n    super();\n    this.filename = filename;\n    this.fd = null;\n  }\n  _construct(callback) {\n    fs.open(this.filename, (err, fd) => {\n      if (err) {\n        callback(err);\n      } else {\n        this.fd = fd;\n        callback();\n      }\n    });\n  }\n  _read(n) {\n    const buf = Buffer.alloc(n);\n    fs.read(this.fd, buf, 0, n, null, (err, bytesRead) => {\n      if (err) {\n        this.destroy(err);\n      } else {\n        this.push(bytesRead > 0 ? buf.slice(0, bytesRead) : null);\n      }\n    });\n  }\n  _destroy(err, callback) {\n    if (this.fd) {\n      fs.close(this.fd, (er) => callback(er || err));\n    } else {\n      callback(err);\n    }\n  }\n}\n</code></pre>"
                },
                {
                  "textRaw": "`readable._read(size)`",
                  "name": "_read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v0.9.4"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`size` {number} Number of bytes to read asynchronously",
                          "name": "size",
                          "type": "number",
                          "desc": "Number of bytes to read asynchronously"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This function MUST NOT be called by application code directly. It should be\nimplemented by child classes, and called by the internal <code>Readable</code> class\nmethods only.</p>\n<p>All <code>Readable</code> stream implementations must provide an implementation of the\n<a href=\"#readable_readsize\"><code>readable._read()</code></a> method to fetch data from the underlying resource.</p>\n<p>When <a href=\"#readable_readsize\"><code>readable._read()</code></a> is called, if data is available from the resource,\nthe implementation should begin pushing that data into the read queue using the\n<a href=\"#readablepushchunk-encoding\"><code>this.push(dataChunk)</code></a> method. <code>_read()</code> will be called again\nafter each call to <a href=\"#readablepushchunk-encoding\"><code>this.push(dataChunk)</code></a> once the stream is\nready to accept more data. <code>_read()</code> may continue reading from the resource and\npushing data until <code>readable.push()</code> returns <code>false</code>. Only when <code>_read()</code> is\ncalled again after it has stopped should it resume pushing additional data into\nthe queue.</p>\n<p>Once the <a href=\"#readable_readsize\"><code>readable._read()</code></a> method has been called, it will not be called\nagain until more data is pushed through the <a href=\"#readablepushchunk-encoding\"><code>readable.push()</code></a>\nmethod. Empty data such as empty buffers and strings will not cause\n<a href=\"#readable_readsize\"><code>readable._read()</code></a> to be called.</p>\n<p>The <code>size</code> argument is advisory. For implementations where a \"read\" is a\nsingle operation that returns data can use the <code>size</code> argument to determine how\nmuch data to fetch. Other implementations may ignore this argument and simply\nprovide data whenever it becomes available. There is no need to \"wait\" until\n<code>size</code> bytes are available before calling <a href=\"#readablepushchunk-encoding\"><code>stream.push(chunk)</code></a>.</p>\n<p>The <a href=\"#readable_readsize\"><code>readable._read()</code></a> method is prefixed with an underscore because it is\ninternal to the class that defines it, and should never be called directly by\nuser programs.</p>"
                },
                {
                  "textRaw": "`readable._destroy(err, callback)`",
                  "name": "_destroy",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v8.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`err` {Error} A possible error.",
                          "name": "err",
                          "type": "Error",
                          "desc": "A possible error."
                        },
                        {
                          "textRaw": "`callback` {Function} A callback function that takes an optional error argument.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "A callback function that takes an optional error argument."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>The <code>_destroy()</code> method is called by <a href=\"#readabledestroyerror\"><code>readable.destroy()</code></a>.\nIt can be overridden by child classes but it <strong>must not</strong> be called directly.</p>"
                },
                {
                  "textRaw": "`readable.push(chunk[, encoding])`",
                  "name": "push",
                  "type": "method",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v22.0.0",
                          "v20.13.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/51866",
                        "description": "The `chunk` argument can now be a `TypedArray` or `DataView` instance."
                      },
                      {
                        "version": "v8.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/11608",
                        "description": "The `chunk` argument can now be a `Uint8Array` instance."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {Buffer|TypedArray|DataView|string|null|any} Chunk of data to push into the read queue. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value.",
                          "name": "chunk",
                          "type": "Buffer|TypedArray|DataView|string|null|any",
                          "desc": "Chunk of data to push into the read queue. For streams not operating in object mode, `chunk` must be a {string}, {Buffer}, {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value."
                        },
                        {
                          "textRaw": "`encoding` {string} Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean} `true` if additional chunks of data may continue to be pushed; `false` otherwise.",
                        "name": "return",
                        "type": "boolean",
                        "desc": "`true` if additional chunks of data may continue to be pushed; `false` otherwise."
                      }
                    }
                  ],
                  "desc": "<p>When <code>chunk</code> is a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, the <code>chunk</code>\nof data will be added to the internal queue for users of the stream to consume.\nPassing <code>chunk</code> as <code>null</code> signals the end of the stream (EOF), after which no\nmore data can be written.</p>\n<p>When the <code>Readable</code> is operating in paused mode, the data added with\n<code>readable.push()</code> can be read out by calling the\n<a href=\"#readablereadsize\"><code>readable.read()</code></a> method when the <a href=\"#event-readable\"><code>'readable'</code></a> event is\nemitted.</p>\n<p>When the <code>Readable</code> is operating in flowing mode, the data added with\n<code>readable.push()</code> will be delivered by emitting a <code>'data'</code> event.</p>\n<p>The <code>readable.push()</code> method is designed to be as flexible as possible. For\nexample, when wrapping a lower-level source that provides some form of\npause/resume mechanism, and a data callback, the low-level source can be wrapped\nby the custom <code>Readable</code> instance:</p>\n<pre><code class=\"language-js\">// `_source` is an object with readStop() and readStart() methods,\n// and an `ondata` member that gets called when it has data, and\n// an `onend` member that gets called when the data is over.\n\nclass SourceWrapper extends Readable {\n  constructor(options) {\n    super(options);\n\n    this._source = getLowLevelSourceObject();\n\n    // Every time there's data, push it into the internal buffer.\n    this._source.ondata = (chunk) => {\n      // If push() returns false, then stop reading from source.\n      if (!this.push(chunk))\n        this._source.readStop();\n    };\n\n    // When the source ends, push the EOF-signaling `null` chunk.\n    this._source.onend = () => {\n      this.push(null);\n    };\n  }\n  // _read() will be called when the stream wants to pull more data in.\n  // The advisory size argument is ignored in this case.\n  _read(size) {\n    this._source.readStart();\n  }\n}\n</code></pre>\n<p>The <code>readable.push()</code> method is used to push the content\ninto the internal buffer. It can be driven by the <a href=\"#readable_readsize\"><code>readable._read()</code></a> method.</p>\n<p>For streams not operating in object mode, if the <code>chunk</code> parameter of\n<code>readable.push()</code> is <code>undefined</code>, it will be treated as empty string or\nbuffer. See <a href=\"#readablepush\"><code>readable.push('')</code></a> for more information.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Errors while reading",
                  "name": "errors_while_reading",
                  "type": "module",
                  "desc": "<p>Errors occurring during processing of the <a href=\"#readable_readsize\"><code>readable._read()</code></a> must be\npropagated through the <a href=\"#readable_destroyerr-callback\"><code>readable.destroy(err)</code></a> method.\nThrowing an <code>Error</code> from within <a href=\"#readable_readsize\"><code>readable._read()</code></a> or manually emitting an\n<code>'error'</code> event results in undefined behavior.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nconst myReadable = new Readable({\n  read(size) {\n    const err = checkSomeErrorCondition();\n    if (err) {\n      this.destroy(err);\n    } else {\n      // Do some work.\n    }\n  },\n});\n</code></pre>",
                  "displayName": "Errors while reading"
                }
              ],
              "examples": [
                {
                  "textRaw": "An example counting stream",
                  "name": "An example counting stream",
                  "type": "example",
                  "desc": "<p>The following is a basic example of a <code>Readable</code> stream that emits the numerals\nfrom 1 to 1,000,000 in ascending order, and then ends.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nclass Counter extends Readable {\n  constructor(opt) {\n    super(opt);\n    this._max = 1000000;\n    this._index = 1;\n  }\n\n  _read() {\n    const i = this._index++;\n    if (i > this._max)\n      this.push(null);\n    else {\n      const str = String(i);\n      const buf = Buffer.from(str, 'ascii');\n      this.push(buf);\n    }\n  }\n}\n</code></pre>"
                }
              ],
              "displayName": "Implementing a readable stream"
            },
            {
              "textRaw": "Implementing a duplex stream",
              "name": "implementing_a_duplex_stream",
              "type": "misc",
              "desc": "<p>A <a href=\"#class-streamduplex\"><code>Duplex</code></a> stream is one that implements both <a href=\"#class-streamreadable\"><code>Readable</code></a> and\n<a href=\"#class-streamwritable\"><code>Writable</code></a>, such as a TCP socket connection.</p>\n<p>Because JavaScript does not have support for multiple inheritance, the\n<code>stream.Duplex</code> class is extended to implement a <a href=\"#class-streamduplex\"><code>Duplex</code></a> stream (as opposed\nto extending the <code>stream.Readable</code> <em>and</em> <code>stream.Writable</code> classes).</p>\n<p>The <code>stream.Duplex</code> class prototypically inherits from <code>stream.Readable</code> and\nparasitically from <code>stream.Writable</code>, but <code>instanceof</code> will work properly for\nboth base classes due to overriding <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance\"><code>Symbol.hasInstance</code></a> on\n<code>stream.Writable</code>.</p>\n<p>Custom <code>Duplex</code> streams <em>must</em> call the <code>new stream.Duplex([options])</code>\nconstructor and implement <em>both</em> the <a href=\"#readable_readsize\"><code>readable._read()</code></a> and\n<code>writable._write()</code> methods.</p>",
              "signatures": [
                {
                  "textRaw": "`new stream.Duplex(options)`",
                  "name": "stream.Duplex",
                  "type": "ctor",
                  "meta": {
                    "changes": [
                      {
                        "version": "v8.4.0",
                        "pr-url": "https://github.com/nodejs/node/pull/14636",
                        "description": "The `readableHighWaterMark` and `writableHighWaterMark` options are supported now."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`options` {Object} Passed to both `Writable` and `Readable` constructors. Also has the following fields:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Passed to both `Writable` and `Readable` constructors. Also has the following fields:",
                      "options": [
                        {
                          "textRaw": "`allowHalfOpen` {boolean} If set to `false`, then the stream will automatically end the writable side when the readable side ends. **Default:** `true`.",
                          "name": "allowHalfOpen",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If set to `false`, then the stream will automatically end the writable side when the readable side ends."
                        },
                        {
                          "textRaw": "`readable` {boolean} Sets whether the `Duplex` should be readable. **Default:** `true`.",
                          "name": "readable",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Sets whether the `Duplex` should be readable."
                        },
                        {
                          "textRaw": "`writable` {boolean} Sets whether the `Duplex` should be writable. **Default:** `true`.",
                          "name": "writable",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Sets whether the `Duplex` should be writable."
                        },
                        {
                          "textRaw": "`readableObjectMode` {boolean} Sets `objectMode` for readable side of the stream. Has no effect if `objectMode` is `true`. **Default:** `false`.",
                          "name": "readableObjectMode",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Sets `objectMode` for readable side of the stream. Has no effect if `objectMode` is `true`."
                        },
                        {
                          "textRaw": "`writableObjectMode` {boolean} Sets `objectMode` for writable side of the stream. Has no effect if `objectMode` is `true`. **Default:** `false`.",
                          "name": "writableObjectMode",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Sets `objectMode` for writable side of the stream. Has no effect if `objectMode` is `true`."
                        },
                        {
                          "textRaw": "`readableHighWaterMark` {number} Sets `highWaterMark` for the readable side of the stream. Has no effect if `highWaterMark` is provided.",
                          "name": "readableHighWaterMark",
                          "type": "number",
                          "desc": "Sets `highWaterMark` for the readable side of the stream. Has no effect if `highWaterMark` is provided."
                        },
                        {
                          "textRaw": "`writableHighWaterMark` {number} Sets `highWaterMark` for the writable side of the stream. Has no effect if `highWaterMark` is provided.",
                          "name": "writableHighWaterMark",
                          "type": "number",
                          "desc": "Sets `highWaterMark` for the writable side of the stream. Has no effect if `highWaterMark` is provided."
                        }
                      ]
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const { Duplex } = require('node:stream');\n\nclass MyDuplex extends Duplex {\n  constructor(options) {\n    super(options);\n    // ...\n  }\n}\n</code></pre>\n<p>Or, when using pre-ES6 style constructors:</p>\n<pre><code class=\"language-js\">const { Duplex } = require('node:stream');\nconst util = require('node:util');\n\nfunction MyDuplex(options) {\n  if (!(this instanceof MyDuplex))\n    return new MyDuplex(options);\n  Duplex.call(this, options);\n}\nutil.inherits(MyDuplex, Duplex);\n</code></pre>\n<p>Or, using the simplified constructor approach:</p>\n<pre><code class=\"language-js\">const { Duplex } = require('node:stream');\n\nconst myDuplex = new Duplex({\n  read(size) {\n    // ...\n  },\n  write(chunk, encoding, callback) {\n    // ...\n  },\n});\n</code></pre>\n<p>When using pipeline:</p>\n<pre><code class=\"language-js\">const { Transform, pipeline } = require('node:stream');\nconst fs = require('node:fs');\n\npipeline(\n  fs.createReadStream('object.json')\n    .setEncoding('utf8'),\n  new Transform({\n    decodeStrings: false, // Accept string input rather than Buffers\n    construct(callback) {\n      this.data = '';\n      callback();\n    },\n    transform(chunk, encoding, callback) {\n      this.data += chunk;\n      callback();\n    },\n    flush(callback) {\n      try {\n        // Make sure is valid json.\n        JSON.parse(this.data);\n        this.push(this.data);\n        callback();\n      } catch (err) {\n        callback(err);\n      }\n    },\n  }),\n  fs.createWriteStream('valid-object.json'),\n  (err) => {\n    if (err) {\n      console.error('failed', err);\n    } else {\n      console.log('completed');\n    }\n  },\n);\n</code></pre>"
                }
              ],
              "modules": [
                {
                  "textRaw": "An example duplex stream",
                  "name": "an_example_duplex_stream",
                  "type": "module",
                  "desc": "<p>The following illustrates a simple example of a <code>Duplex</code> stream that wraps a\nhypothetical lower-level source object to which data can be written, and\nfrom which data can be read, albeit using an API that is not compatible with\nNode.js streams.\nThe following illustrates a simple example of a <code>Duplex</code> stream that buffers\nincoming written data via the <a href=\"#class-streamwritable\"><code>Writable</code></a> interface that is read back out\nvia the <a href=\"#class-streamreadable\"><code>Readable</code></a> interface.</p>\n<pre><code class=\"language-js\">const { Duplex } = require('node:stream');\nconst kSource = Symbol('source');\n\nclass MyDuplex extends Duplex {\n  constructor(source, options) {\n    super(options);\n    this[kSource] = source;\n  }\n\n  _write(chunk, encoding, callback) {\n    // The underlying source only deals with strings.\n    if (Buffer.isBuffer(chunk))\n      chunk = chunk.toString();\n    this[kSource].writeSomeData(chunk);\n    callback();\n  }\n\n  _read(size) {\n    this[kSource].fetchSomeData(size, (data, encoding) => {\n      this.push(Buffer.from(data, encoding));\n    });\n  }\n}\n</code></pre>\n<p>The most important aspect of a <code>Duplex</code> stream is that the <code>Readable</code> and\n<code>Writable</code> sides operate independently of one another despite co-existing within\na single object instance.</p>",
                  "displayName": "An example duplex stream"
                },
                {
                  "textRaw": "Object mode duplex streams",
                  "name": "object_mode_duplex_streams",
                  "type": "module",
                  "desc": "<p>For <code>Duplex</code> streams, <code>objectMode</code> can be set exclusively for either the\n<code>Readable</code> or <code>Writable</code> side using the <code>readableObjectMode</code> and\n<code>writableObjectMode</code> options respectively.</p>\n<p>In the following example, for instance, a new <code>Transform</code> stream (which is a\ntype of <a href=\"#class-streamduplex\"><code>Duplex</code></a> stream) is created that has an object mode <code>Writable</code> side\nthat accepts JavaScript numbers that are converted to hexadecimal strings on\nthe <code>Readable</code> side.</p>\n<pre><code class=\"language-js\">const { Transform } = require('node:stream');\n\n// All Transform streams are also Duplex Streams.\nconst myTransform = new Transform({\n  writableObjectMode: true,\n\n  transform(chunk, encoding, callback) {\n    // Coerce the chunk to a number if necessary.\n    chunk |= 0;\n\n    // Transform the chunk into something else.\n    const data = chunk.toString(16);\n\n    // Push the data onto the readable queue.\n    callback(null, '0'.repeat(data.length % 2) + data);\n  },\n});\n\nmyTransform.setEncoding('ascii');\nmyTransform.on('data', (chunk) => console.log(chunk));\n\nmyTransform.write(1);\n// Prints: 01\nmyTransform.write(10);\n// Prints: 0a\nmyTransform.write(100);\n// Prints: 64\n</code></pre>",
                  "displayName": "Object mode duplex streams"
                }
              ],
              "displayName": "Implementing a duplex stream"
            },
            {
              "textRaw": "Implementing a transform stream",
              "name": "implementing_a_transform_stream",
              "type": "misc",
              "desc": "<p>A <a href=\"#class-streamtransform\"><code>Transform</code></a> stream is a <a href=\"#class-streamduplex\"><code>Duplex</code></a> stream where the output is computed\nin some way from the input. Examples include <a href=\"zlib.html\">zlib</a> streams or <a href=\"crypto.html\">crypto</a>\nstreams that compress, encrypt, or decrypt data.</p>\n<p>There is no requirement that the output be the same size as the input, the same\nnumber of chunks, or arrive at the same time. For example, a <code>Hash</code> stream will\nonly ever have a single chunk of output which is provided when the input is\nended. A <code>zlib</code> stream will produce output that is either much smaller or much\nlarger than its input.</p>\n<p>The <code>stream.Transform</code> class is extended to implement a <a href=\"#class-streamtransform\"><code>Transform</code></a> stream.</p>\n<p>The <code>stream.Transform</code> class prototypically inherits from <code>stream.Duplex</code> and\nimplements its own versions of the <code>writable._write()</code> and\n<a href=\"#readable_readsize\"><code>readable._read()</code></a> methods. Custom <code>Transform</code> implementations <em>must</em>\nimplement the <a href=\"#transform_transformchunk-encoding-callback\"><code>transform._transform()</code></a> method and <em>may</em>\nalso implement the <a href=\"#transform_flushcallback\"><code>transform._flush()</code></a> method.</p>\n<p>Care must be taken when using <code>Transform</code> streams in that data written to the\nstream can cause the <code>Writable</code> side of the stream to become paused if the\noutput on the <code>Readable</code> side is not consumed.</p>",
              "signatures": [
                {
                  "textRaw": "`new stream.Transform([options])`",
                  "name": "stream.Transform",
                  "type": "ctor",
                  "params": [
                    {
                      "textRaw": "`options` {Object} Passed to both `Writable` and `Readable` constructors. Also has the following fields:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Passed to both `Writable` and `Readable` constructors. Also has the following fields:",
                      "options": [
                        {
                          "textRaw": "`transform` {Function} Implementation for the `stream._transform()` method.",
                          "name": "transform",
                          "type": "Function",
                          "desc": "Implementation for the `stream._transform()` method."
                        },
                        {
                          "textRaw": "`flush` {Function} Implementation for the `stream._flush()` method.",
                          "name": "flush",
                          "type": "Function",
                          "desc": "Implementation for the `stream._flush()` method."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "desc": "<pre><code class=\"language-js\">const { Transform } = require('node:stream');\n\nclass MyTransform extends Transform {\n  constructor(options) {\n    super(options);\n    // ...\n  }\n}\n</code></pre>\n<p>Or, when using pre-ES6 style constructors:</p>\n<pre><code class=\"language-js\">const { Transform } = require('node:stream');\nconst util = require('node:util');\n\nfunction MyTransform(options) {\n  if (!(this instanceof MyTransform))\n    return new MyTransform(options);\n  Transform.call(this, options);\n}\nutil.inherits(MyTransform, Transform);\n</code></pre>\n<p>Or, using the simplified constructor approach:</p>\n<pre><code class=\"language-js\">const { Transform } = require('node:stream');\n\nconst myTransform = new Transform({\n  transform(chunk, encoding, callback) {\n    // ...\n  },\n});\n</code></pre>"
                }
              ],
              "events": [
                {
                  "textRaw": "Event: `'end'`",
                  "name": "end",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <a href=\"#event-end\"><code>'end'</code></a> event is from the <code>stream.Readable</code> class. The <code>'end'</code> event is\nemitted after all data has been output, which occurs after the callback in\n<a href=\"#transform_flushcallback\"><code>transform._flush()</code></a> has been called. In the case of an error,\n<code>'end'</code> should not be emitted.</p>"
                },
                {
                  "textRaw": "Event: `'finish'`",
                  "name": "finish",
                  "type": "event",
                  "params": [],
                  "desc": "<p>The <a href=\"#event-finish\"><code>'finish'</code></a> event is from the <code>stream.Writable</code> class. The <code>'finish'</code>\nevent is emitted after <a href=\"#writableendchunk-encoding-callback\"><code>stream.end()</code></a> is called and all chunks\nhave been processed by <a href=\"#transform_transformchunk-encoding-callback\"><code>stream._transform()</code></a>. In the case\nof an error, <code>'finish'</code> should not be emitted.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`transform._flush(callback)`",
                  "name": "_flush",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`callback` {Function} A callback function (optionally with an error argument and data) to be called when remaining data has been flushed.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "A callback function (optionally with an error argument and data) to be called when remaining data has been flushed."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This function MUST NOT be called by application code directly. It should be\nimplemented by child classes, and called by the internal <code>Readable</code> class\nmethods only.</p>\n<p>In some cases, a transform operation may need to emit an additional bit of\ndata at the end of the stream. For example, a <code>zlib</code> compression stream will\nstore an amount of internal state used to optimally compress the output. When\nthe stream ends, however, that additional data needs to be flushed so that the\ncompressed data will be complete.</p>\n<p>Custom <a href=\"#class-streamtransform\"><code>Transform</code></a> implementations <em>may</em> implement the <code>transform._flush()</code>\nmethod. This will be called when there is no more written data to be consumed,\nbut before the <a href=\"#event-end\"><code>'end'</code></a> event is emitted signaling the end of the\n<a href=\"#class-streamreadable\"><code>Readable</code></a> stream.</p>\n<p>Within the <code>transform._flush()</code> implementation, the <code>transform.push()</code> method\nmay be called zero or more times, as appropriate. The <code>callback</code> function must\nbe called when the flush operation is complete.</p>\n<p>The <code>transform._flush()</code> method is prefixed with an underscore because it is\ninternal to the class that defines it, and should never be called directly by\nuser programs.</p>"
                },
                {
                  "textRaw": "`transform._transform(chunk, encoding, callback)`",
                  "name": "_transform",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {Buffer|string|any} The `Buffer` to be transformed, converted from the `string` passed to `stream.write()`. If the stream's `decodeStrings` option is `false` or the stream is operating in object mode, the chunk will not be converted & will be whatever was passed to `stream.write()`.",
                          "name": "chunk",
                          "type": "Buffer|string|any",
                          "desc": "The `Buffer` to be transformed, converted from the `string` passed to `stream.write()`. If the stream's `decodeStrings` option is `false` or the stream is operating in object mode, the chunk will not be converted & will be whatever was passed to `stream.write()`."
                        },
                        {
                          "textRaw": "`encoding` {string} If the chunk is a string, then this is the encoding type. If chunk is a buffer, then this is the special value `'buffer'`. Ignore it in that case.",
                          "name": "encoding",
                          "type": "string",
                          "desc": "If the chunk is a string, then this is the encoding type. If chunk is a buffer, then this is the special value `'buffer'`. Ignore it in that case."
                        },
                        {
                          "textRaw": "`callback` {Function} A callback function (optionally with an error argument and data) to be called after the supplied `chunk` has been processed.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "A callback function (optionally with an error argument and data) to be called after the supplied `chunk` has been processed."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This function MUST NOT be called by application code directly. It should be\nimplemented by child classes, and called by the internal <code>Readable</code> class\nmethods only.</p>\n<p>All <code>Transform</code> stream implementations must provide a <code>_transform()</code>\nmethod to accept input and produce output. The <code>transform._transform()</code>\nimplementation handles the bytes being written, computes an output, then passes\nthat output off to the readable portion using the <code>transform.push()</code> method.</p>\n<p>The <code>transform.push()</code> method may be called zero or more times to generate\noutput from a single input chunk, depending on how much is to be output\nas a result of the chunk.</p>\n<p>It is possible that no output is generated from any given chunk of input data.</p>\n<p>The <code>callback</code> function must be called only when the current chunk is completely\nconsumed. The first argument passed to the <code>callback</code> must be an <code>Error</code> object\nif an error occurred while processing the input or <code>null</code> otherwise. If a second\nargument is passed to the <code>callback</code>, it will be forwarded on to the\n<code>transform.push()</code> method, but only if the first argument is falsy. In other\nwords, the following are equivalent:</p>\n<pre><code class=\"language-js\">transform.prototype._transform = function(data, encoding, callback) {\n  this.push(data);\n  callback();\n};\n\ntransform.prototype._transform = function(data, encoding, callback) {\n  callback(null, data);\n};\n</code></pre>\n<p>The <code>transform._transform()</code> method is prefixed with an underscore because it\nis internal to the class that defines it, and should never be called directly by\nuser programs.</p>\n<p><code>transform._transform()</code> is never called in parallel; streams implement a\nqueue mechanism, and to receive the next chunk, <code>callback</code> must be\ncalled, either synchronously or asynchronously.</p>"
                }
              ],
              "classes": [
                {
                  "textRaw": "Class: `stream.PassThrough`",
                  "name": "stream.PassThrough",
                  "type": "class",
                  "desc": "<p>The <code>stream.PassThrough</code> class is a trivial implementation of a <a href=\"#class-streamtransform\"><code>Transform</code></a>\nstream that simply passes the input bytes across to the output. Its purpose is\nprimarily for examples and testing, but there are some use cases where\n<code>stream.PassThrough</code> is useful as a building block for novel sorts of streams.</p>"
                }
              ],
              "displayName": "Implementing a transform stream"
            }
          ]
        },
        {
          "textRaw": "Additional notes",
          "name": "Additional notes",
          "type": "misc",
          "miscs": [
            {
              "textRaw": "Streams compatibility with async generators and async iterators",
              "name": "streams_compatibility_with_async_generators_and_async_iterators",
              "type": "misc",
              "desc": "<p>With the support of async generators and iterators in JavaScript, async\ngenerators are effectively a first-class language-level stream construct at\nthis point.</p>\n<p>Some common interop cases of using Node.js streams with async generators\nand async iterators are provided below.</p>",
              "modules": [
                {
                  "textRaw": "Consuming readable streams with async iterators",
                  "name": "consuming_readable_streams_with_async_iterators",
                  "type": "module",
                  "desc": "<pre><code class=\"language-js\">(async function() {\n  for await (const chunk of readable) {\n    console.log(chunk);\n  }\n})();\n</code></pre>\n<p>Async iterators register a permanent error handler on the stream to prevent any\nunhandled post-destroy errors.</p>",
                  "displayName": "Consuming readable streams with async iterators"
                },
                {
                  "textRaw": "Creating readable streams with async generators",
                  "name": "creating_readable_streams_with_async_generators",
                  "type": "module",
                  "desc": "<p>A Node.js readable stream can be created from an asynchronous generator using\nthe <code>Readable.from()</code> utility method:</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nconst ac = new AbortController();\nconst signal = ac.signal;\n\nasync function * generate() {\n  yield 'a';\n  await someLongRunningFn({ signal });\n  yield 'b';\n  yield 'c';\n}\n\nconst readable = Readable.from(generate());\nreadable.on('close', () => {\n  ac.abort();\n});\n\nreadable.on('data', (chunk) => {\n  console.log(chunk);\n});\n</code></pre>",
                  "displayName": "Creating readable streams with async generators"
                }
              ],
              "miscs": [
                {
                  "textRaw": "Piping to writable streams from async iterators",
                  "name": "Piping to writable streams from async iterators",
                  "type": "misc",
                  "desc": "<p>When writing to a writable stream from an async iterator, ensure correct\nhandling of backpressure and errors. <a href=\"#streampipelinesource-transforms-destination-callback\"><code>stream.pipeline()</code></a> abstracts away\nthe handling of backpressure and backpressure-related errors:</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nconst { pipeline } = require('node:stream');\nconst { pipeline: pipelinePromise } = require('node:stream/promises');\n\nconst writable = fs.createWriteStream('./file');\n\nconst ac = new AbortController();\nconst signal = ac.signal;\n\nconst iterator = createIterator({ signal });\n\n// Callback Pattern\npipeline(iterator, writable, (err, value) => {\n  if (err) {\n    console.error(err);\n  } else {\n    console.log(value, 'value returned');\n  }\n}).on('close', () => {\n  ac.abort();\n});\n\n// Promise Pattern\npipelinePromise(iterator, writable)\n  .then((value) => {\n    console.log(value, 'value returned');\n  })\n  .catch((err) => {\n    console.error(err);\n    ac.abort();\n  });\n</code></pre>"
                }
              ],
              "displayName": "Streams compatibility with async generators and async iterators"
            },
            {
              "textRaw": "Compatibility with older Node.js versions",
              "name": "Compatibility with older Node.js versions",
              "type": "misc",
              "desc": "<p>Prior to Node.js 0.10, the <code>Readable</code> stream interface was simpler, but also\nless powerful and less useful.</p>\n<ul>\n<li>Rather than waiting for calls to the <a href=\"#readablereadsize\"><code>stream.read()</code></a> method,\n<a href=\"#event-data\"><code>'data'</code></a> events would begin emitting immediately. Applications that\nwould need to perform some amount of work to decide how to handle data\nwere required to store read data into buffers so the data would not be lost.</li>\n<li>The <a href=\"#readablepause\"><code>stream.pause()</code></a> method was advisory, rather than\nguaranteed. This meant that it was still necessary to be prepared to receive\n<a href=\"#event-data\"><code>'data'</code></a> events <em>even when the stream was in a paused state</em>.</li>\n</ul>\n<p>In Node.js 0.10, the <a href=\"#class-streamreadable\"><code>Readable</code></a> class was added. For backward\ncompatibility with older Node.js programs, <code>Readable</code> streams switch into\n\"flowing mode\" when a <a href=\"#event-data\"><code>'data'</code></a> event handler is added, or when the\n<a href=\"#readableresume\"><code>stream.resume()</code></a> method is called. The effect is that, even\nwhen not using the new <a href=\"#readablereadsize\"><code>stream.read()</code></a> method and\n<a href=\"#event-readable\"><code>'readable'</code></a> event, it is no longer necessary to worry about losing\n<a href=\"#event-data\"><code>'data'</code></a> chunks.</p>\n<p>While most applications will continue to function normally, this introduces an\nedge case in the following conditions:</p>\n<ul>\n<li>No <a href=\"#event-data\"><code>'data'</code></a> event listener is added.</li>\n<li>The <a href=\"#readableresume\"><code>stream.resume()</code></a> method is never called.</li>\n<li>The stream is not piped to any writable destination.</li>\n</ul>\n<p>For example, consider the following code:</p>\n<pre><code class=\"language-js\">// WARNING!  BROKEN!\nnet.createServer((socket) => {\n\n  // We add an 'end' listener, but never consume the data.\n  socket.on('end', () => {\n    // It will never get here.\n    socket.end('The message was received but was not processed.\\n');\n  });\n\n}).listen(1337);\n</code></pre>\n<p>Prior to Node.js 0.10, the incoming message data would be simply discarded.\nHowever, in Node.js 0.10 and beyond, the socket remains paused forever.</p>\n<p>The workaround in this situation is to call the\n<a href=\"#readableresume\"><code>stream.resume()</code></a> method to begin the flow of data:</p>\n<pre><code class=\"language-js\">// Workaround.\nnet.createServer((socket) => {\n  socket.on('end', () => {\n    socket.end('The message was received but was not processed.\\n');\n  });\n\n  // Start the flow of data, discarding it.\n  socket.resume();\n}).listen(1337);\n</code></pre>\n<p>In addition to new <code>Readable</code> streams switching into flowing mode,\npre-0.10 style streams can be wrapped in a <code>Readable</code> class using the\n<a href=\"#readablewrapstream\"><code>readable.wrap()</code></a> method.</p>"
            },
            {
              "textRaw": "`highWaterMark` discrepancy after calling `readable.setEncoding()`",
              "name": "`highwatermark`_discrepancy_after_calling_`readable.setencoding()`",
              "type": "misc",
              "desc": "<p>The use of <code>readable.setEncoding()</code> will change the behavior of how the\n<code>highWaterMark</code> operates in non-object mode.</p>\n<p>Typically, the size of the current buffer is measured against the\n<code>highWaterMark</code> in <em>bytes</em>. However, after <code>setEncoding()</code> is called, the\ncomparison function will begin to measure the buffer's size in <em>characters</em>.</p>\n<p>This is not a problem in common cases with <code>latin1</code> or <code>ascii</code>. But it is\nadvised to be mindful about this behavior when working with strings that could\ncontain multi-byte characters.</p>",
              "displayName": "`highWaterMark` discrepancy after calling `readable.setEncoding()`"
            }
          ],
          "methods": [
            {
              "textRaw": "`readable.read(0)`",
              "name": "read",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "0"
                    }
                  ]
                }
              ],
              "desc": "<p>There are some cases where it is necessary to trigger a refresh of the\nunderlying readable stream mechanisms, without actually consuming any\ndata. In such cases, it is possible to call <code>readable.read(0)</code>, which will\nalways return <code>null</code>.</p>\n<p>If the internal read buffer is below the <code>highWaterMark</code>, and the\nstream is not currently reading, then calling <code>stream.read(0)</code> will trigger\na low-level <a href=\"#readable_readsize\"><code>stream._read()</code></a> call.</p>\n<p>While most applications will almost never need to do this, there are\nsituations within Node.js where this is done, particularly in the\n<code>Readable</code> stream class internals.</p>"
            },
            {
              "textRaw": "`readable.push('')`",
              "name": "push",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "''"
                    }
                  ]
                }
              ],
              "desc": "<p>Use of <code>readable.push('')</code> is not recommended.</p>\n<p>Pushing a zero-byte <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> to a stream\nthat is not in object mode has an interesting side effect.\nBecause it <em>is</em> a call to\n<a href=\"#readablepushchunk-encoding\"><code>readable.push()</code></a>, the call will end the reading process.\nHowever, because the argument is an empty string, no data is added to the\nreadable buffer so there is nothing for a user to consume.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`stream.finished(stream[, options], callback)`",
          "name": "finished",
          "type": "method",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": [
              {
                "version": "v19.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/46205",
                "description": "Added support for `ReadableStream` and `WritableStream`."
              },
              {
                "version": "v15.11.0",
                "pr-url": "https://github.com/nodejs/node/pull/37354",
                "description": "The `signal` option was added."
              },
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/32158",
                "description": "The `finished(stream, cb)` will wait for the `'close'` event before invoking the callback. The implementation tries to detect legacy streams and only apply this behavior to streams which are expected to emit `'close'`."
              },
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/31545",
                "description": "Emitting `'close'` before `'end'` on a `Readable` stream will cause an `ERR_STREAM_PREMATURE_CLOSE` error."
              },
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/31509",
                "description": "Callback will be invoked on streams which have already finished before the call to `finished(stream, cb)`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`stream` {Stream|ReadableStream|WritableStream} A readable and/or writable stream/webstream.",
                  "name": "stream",
                  "type": "Stream|ReadableStream|WritableStream",
                  "desc": "A readable and/or writable stream/webstream."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`error` {boolean} If set to `false`, then a call to `emit('error', err)` is not treated as finished. **Default:** `true`.",
                      "name": "error",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If set to `false`, then a call to `emit('error', err)` is not treated as finished."
                    },
                    {
                      "textRaw": "`readable` {boolean} When set to `false`, the callback will be called when the stream ends even though the stream might still be readable. **Default:** `true`.",
                      "name": "readable",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "When set to `false`, the callback will be called when the stream ends even though the stream might still be readable."
                    },
                    {
                      "textRaw": "`writable` {boolean} When set to `false`, the callback will be called when the stream ends even though the stream might still be writable. **Default:** `true`.",
                      "name": "writable",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "When set to `false`, the callback will be called when the stream ends even though the stream might still be writable."
                    },
                    {
                      "textRaw": "`signal` {AbortSignal} allows aborting the wait for the stream finish. The underlying stream will _not_ be aborted if the signal is aborted. The callback will get called with an `AbortError`. All registered listeners added by this function will also be removed.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "allows aborting the wait for the stream finish. The underlying stream will _not_ be aborted if the signal is aborted. The callback will get called with an `AbortError`. All registered listeners added by this function will also be removed."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function} A callback function that takes an optional error argument.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "A callback function that takes an optional error argument."
                }
              ],
              "return": {
                "textRaw": "Returns: {Function} A cleanup function which removes all registered listeners.",
                "name": "return",
                "type": "Function",
                "desc": "A cleanup function which removes all registered listeners."
              }
            }
          ],
          "desc": "<p>A function to get notified when a stream is no longer readable, writable\nor has experienced an error or a premature close event.</p>\n<pre><code class=\"language-js\">const { finished } = require('node:stream');\nconst fs = require('node:fs');\n\nconst rs = fs.createReadStream('archive.tar');\n\nfinished(rs, (err) => {\n  if (err) {\n    console.error('Stream failed.', err);\n  } else {\n    console.log('Stream is done reading.');\n  }\n});\n\nrs.resume(); // Drain the stream.\n</code></pre>\n<p>Especially useful in error handling scenarios where a stream is destroyed\nprematurely (like an aborted HTTP request), and will not emit <code>'end'</code>\nor <code>'finish'</code>.</p>\n<p>The <code>finished</code> API provides <a href=\"#streamfinishedstream-options\">promise version</a>.</p>\n<p><code>stream.finished()</code> leaves dangling event listeners (in particular\n<code>'error'</code>, <code>'end'</code>, <code>'finish'</code> and <code>'close'</code>) after <code>callback</code> has been\ninvoked. The reason for this is so that unexpected <code>'error'</code> events (due to\nincorrect stream implementations) do not cause unexpected crashes.\nIf this is unwanted behavior then the returned cleanup function needs to be\ninvoked in the callback:</p>\n<pre><code class=\"language-js\">const cleanup = finished(rs, (err) => {\n  cleanup();\n  // ...\n});\n</code></pre>"
        },
        {
          "textRaw": "`stream.pipeline(source[, ...transforms], destination, callback)`",
          "name": "pipeline",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "source"
                },
                {
                  "name": "...transforms",
                  "optional": true
                },
                {
                  "name": "destination"
                },
                {
                  "name": "callback"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`stream.pipeline(streams, callback)`",
          "name": "pipeline",
          "type": "method",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v19.7.0",
                  "v18.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46307",
                "description": "Added support for webstreams."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              },
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/32158",
                "description": "The `pipeline(..., cb)` will wait for the `'close'` event before invoking the callback. The implementation tries to detect legacy streams and only apply this behavior to streams which are expected to emit `'close'`."
              },
              {
                "version": "v13.10.0",
                "pr-url": "https://github.com/nodejs/node/pull/31223",
                "description": "Add support for async generators."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`streams` {Stream[]|AsyncIterable[]|Function[]|ReadableStream[]|WritableStream[]|TransformStream[]}",
                  "name": "streams",
                  "type": "Stream[]|AsyncIterable[]|Function[]|ReadableStream[]|WritableStream[]|TransformStream[]"
                },
                {
                  "textRaw": "`callback` {Function} Called when the pipeline is fully done.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "Called when the pipeline is fully done.",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`val` Resolved value of `Promise` returned by `destination`.",
                      "name": "val",
                      "desc": "Resolved value of `Promise` returned by `destination`."
                    }
                  ]
                }
              ],
              "return": {
                "textRaw": "Returns: {Stream}",
                "name": "return",
                "type": "Stream"
              }
            }
          ],
          "desc": "<p>A module method to pipe between streams and generators forwarding errors and\nproperly cleaning up and provide a callback when the pipeline is complete.</p>\n<pre><code class=\"language-js\">const { pipeline } = require('node:stream');\nconst fs = require('node:fs');\nconst zlib = require('node:zlib');\n\n// Use the pipeline API to easily pipe a series of streams\n// together and get notified when the pipeline is fully done.\n\n// A pipeline to gzip a potentially huge tar file efficiently:\n\npipeline(\n  fs.createReadStream('archive.tar'),\n  zlib.createGzip(),\n  fs.createWriteStream('archive.tar.gz'),\n  (err) => {\n    if (err) {\n      console.error('Pipeline failed.', err);\n    } else {\n      console.log('Pipeline succeeded.');\n    }\n  },\n);\n</code></pre>\n<p>The <code>pipeline</code> API provides a <a href=\"#streampipelinesource-transforms-destination-options\">promise version</a>.</p>\n<p><code>stream.pipeline()</code> will call <code>stream.destroy(err)</code> on all streams except:</p>\n<ul>\n<li><code>Readable</code> streams which have emitted <code>'end'</code> or <code>'close'</code>.</li>\n<li><code>Writable</code> streams which have emitted <code>'finish'</code> or <code>'close'</code>.</li>\n</ul>\n<p><code>stream.pipeline()</code> leaves dangling event listeners on the streams\nafter the <code>callback</code> has been invoked. In the case of reuse of streams after\nfailure, this can cause event listener leaks and swallowed errors. If the last\nstream is readable, dangling event listeners will be removed so that the last\nstream can be consumed later.</p>\n<p><code>stream.pipeline()</code> closes all the streams when an error is raised.\nThe <code>IncomingRequest</code> usage with <code>pipeline</code> could lead to an unexpected behavior\nonce it would destroy the socket without sending the expected response.\nSee the example below:</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\nconst http = require('node:http');\nconst { pipeline } = require('node:stream');\n\nconst server = http.createServer((req, res) => {\n  const fileStream = fs.createReadStream('./fileNotExist.txt');\n  pipeline(fileStream, res, (err) => {\n    if (err) {\n      console.log(err); // No such file\n      // this message can't be sent once `pipeline` already destroyed the socket\n      return res.end('error!!!');\n    }\n  });\n});\n</code></pre>"
        },
        {
          "textRaw": "`stream.compose(...streams)`",
          "name": "compose",
          "type": "method",
          "meta": {
            "added": [
              "v16.9.0"
            ],
            "changes": [
              {
                "version": "v26.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/62562",
                "description": "Marking the API stable."
              },
              {
                "version": [
                  "v21.1.0",
                  "v20.10.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/50187",
                "description": "Added support for stream class."
              },
              {
                "version": [
                  "v19.8.0",
                  "v18.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46675",
                "description": "Added support for webstreams."
              }
            ]
          },
          "stability": 2,
          "stabilityText": "Stable",
          "signatures": [
            {
              "params": [
                {
                  "name": "...streams"
                }
              ],
              "return": {
                "textRaw": "Returns: {stream.Duplex}",
                "name": "return",
                "type": "stream.Duplex"
              }
            }
          ],
          "desc": "<p>Combines two or more streams into a <code>Duplex</code> stream that writes to the\nfirst stream and reads from the last. Each provided stream is piped into\nthe next, using <code>stream.pipeline</code>. If any of the streams error then all\nare destroyed, including the outer <code>Duplex</code> stream.</p>\n<p>Because <code>stream.compose</code> returns a new stream that in turn can (and\nshould) be piped into other streams, it enables composition. In contrast,\nwhen passing streams to <code>stream.pipeline</code>, typically the first stream is\na readable stream and the last a writable stream, forming a closed\ncircuit.</p>\n<p>If passed a <code>Function</code> it must be a factory method taking a <code>source</code>\n<code>Iterable</code>.</p>\n<pre><code class=\"language-mjs\">import { compose, Transform } from 'node:stream';\n\nconst removeSpaces = new Transform({\n  transform(chunk, encoding, callback) {\n    callback(null, String(chunk).replace(' ', ''));\n  },\n});\n\nasync function* toUpper(source) {\n  for await (const chunk of source) {\n    yield String(chunk).toUpperCase();\n  }\n}\n\nlet res = '';\nfor await (const buf of compose(removeSpaces, toUpper).end('hello world')) {\n  res += buf;\n}\n\nconsole.log(res); // prints 'HELLOWORLD'\n</code></pre>\n<p><code>stream.compose</code> can be used to convert async iterables, generators and\nfunctions into streams.</p>\n<ul>\n<li><code>AsyncIterable</code> converts into a readable <code>Duplex</code>. Cannot yield\n<code>null</code>.</li>\n<li><code>AsyncGeneratorFunction</code> converts into a readable/writable transform <code>Duplex</code>.\nMust take a source <code>AsyncIterable</code> as first parameter. Cannot yield\n<code>null</code>.</li>\n<li><code>AsyncFunction</code> converts into a writable <code>Duplex</code>. Must return\neither <code>null</code> or <code>undefined</code>.</li>\n</ul>\n<pre><code class=\"language-mjs\">import { compose } from 'node:stream';\nimport { finished } from 'node:stream/promises';\n\n// Convert AsyncIterable into readable Duplex.\nconst s1 = compose(async function*() {\n  yield 'Hello';\n  yield 'World';\n}());\n\n// Convert AsyncGenerator into transform Duplex.\nconst s2 = compose(async function*(source) {\n  for await (const chunk of source) {\n    yield String(chunk).toUpperCase();\n  }\n});\n\nlet res = '';\n\n// Convert AsyncFunction into writable Duplex.\nconst s3 = compose(async function(source) {\n  for await (const chunk of source) {\n    res += chunk;\n  }\n});\n\nawait finished(compose(s1, s2, s3));\n\nconsole.log(res); // prints 'HELLOWORLD'\n</code></pre>\n<p>For convenience, the <a href=\"#readablecomposestream-options\"><code>readable.compose(stream)</code></a> method is available on\n<a href=\"stream.html#class-streamreadable\"><code>&#x3C;Readable></code></a> and <a href=\"stream.html#class-streamduplex\"><code>&#x3C;Duplex></code></a> streams as a wrapper for this function.</p>"
        },
        {
          "textRaw": "`stream.isErrored(stream)`",
          "name": "isErrored",
          "type": "method",
          "meta": {
            "added": [
              "v17.3.0",
              "v16.14.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`stream` {Readable|Writable|Duplex|WritableStream|ReadableStream}",
                  "name": "stream",
                  "type": "Readable|Writable|Duplex|WritableStream|ReadableStream"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>Returns whether the stream has encountered an error.</p>"
        },
        {
          "textRaw": "`stream.isReadable(stream)`",
          "name": "isReadable",
          "type": "method",
          "meta": {
            "added": [
              "v17.4.0",
              "v16.14.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`stream` {Readable|Duplex|ReadableStream}",
                  "name": "stream",
                  "type": "Readable|Duplex|ReadableStream"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean|null} - Only returns `null` if `stream` is not a valid `Readable`, `Duplex` or `ReadableStream`.",
                "name": "return",
                "type": "boolean|null",
                "desc": "Only returns `null` if `stream` is not a valid `Readable`, `Duplex` or `ReadableStream`."
              }
            }
          ],
          "desc": "<p>Returns whether the stream is readable.</p>"
        },
        {
          "textRaw": "`stream.isWritable(stream)`",
          "name": "isWritable",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`stream` {Writable|Duplex|WritableStream}",
                  "name": "stream",
                  "type": "Writable|Duplex|WritableStream"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean|null} - Only returns `null` if `stream` is not a valid `Writable`, `Duplex` or `WritableStream`.",
                "name": "return",
                "type": "boolean|null",
                "desc": "Only returns `null` if `stream` is not a valid `Writable`, `Duplex` or `WritableStream`."
              }
            }
          ],
          "desc": "<p>Returns whether the stream is writable.</p>"
        },
        {
          "textRaw": "`stream.Readable.from(iterable[, options])`",
          "name": "from",
          "type": "method",
          "meta": {
            "added": [
              "v12.3.0",
              "v10.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "iterable"
                },
                {
                  "name": "options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<ul>\n<li><code>iterable</code> {Iterable} Object implementing the <code>Symbol.asyncIterator</code> or\n<code>Symbol.iterator</code> iterable protocol. Emits an 'error' event if a null\nvalue is passed.</li>\n<li><code>options</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Options provided to <code>new stream.Readable([options])</code>.\nBy default, <code>Readable.from()</code> will set <code>options.objectMode</code> to <code>true</code>, unless\nthis is explicitly opted out by setting <code>options.objectMode</code> to <code>false</code>.</li>\n<li>Returns: <a href=\"stream.html#class-streamreadable\"><code>&#x3C;stream.Readable></code></a></li>\n</ul>\n<p>A utility method for creating readable streams out of iterators.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nasync function * generate() {\n  yield 'hello';\n  yield 'streams';\n}\n\nconst readable = Readable.from(generate());\n\nreadable.on('data', (chunk) => {\n  console.log(chunk);\n});\n</code></pre>\n<p>Calling <code>Readable.from(string)</code> or <code>Readable.from(buffer)</code> will not have\nthe strings or buffers be iterated to match the other streams semantics\nfor performance reasons.</p>\n<p>If an <code>Iterable</code> object containing promises is passed as an argument,\nit might result in unhandled rejection.</p>\n<pre><code class=\"language-js\">const { Readable } = require('node:stream');\n\nReadable.from([\n  new Promise((resolve) => setTimeout(resolve('1'), 1500)),\n  new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Unhandled rejection\n]);\n</code></pre>"
        },
        {
          "textRaw": "`stream.Readable.fromWeb(readableStream[, options])`",
          "name": "fromWeb",
          "type": "method",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`readableStream` {ReadableStream}",
                  "name": "readableStream",
                  "type": "ReadableStream"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string"
                    },
                    {
                      "textRaw": "`highWaterMark` {number}",
                      "name": "highWaterMark",
                      "type": "number"
                    },
                    {
                      "textRaw": "`objectMode` {boolean}",
                      "name": "objectMode",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`signal` {AbortSignal}",
                      "name": "signal",
                      "type": "AbortSignal"
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {stream.Readable}",
                "name": "return",
                "type": "stream.Readable"
              }
            }
          ]
        },
        {
          "textRaw": "`stream.Readable.isDisturbed(stream)`",
          "name": "isDisturbed",
          "type": "method",
          "meta": {
            "added": [
              "v16.8.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`stream` {stream.Readable|ReadableStream}",
                  "name": "stream",
                  "type": "stream.Readable|ReadableStream"
                }
              ],
              "return": {
                "textRaw": "Returns: `boolean`",
                "name": "return",
                "desc": "`boolean`"
              }
            }
          ],
          "desc": "<p>Returns whether the stream has been read from or cancelled.</p>"
        },
        {
          "textRaw": "`stream.Readable.toWeb(streamReadable[, options])`",
          "name": "toWeb",
          "type": "method",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v25.4.0",
                  "v24.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/58664",
                "description": "Add 'type' option to specify 'bytes'."
              },
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              },
              {
                "version": [
                  "v18.7.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/43515",
                "description": "include strategy options on Readable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`streamReadable` {stream.Readable}",
                  "name": "streamReadable",
                  "type": "stream.Readable"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`strategy` {Object}",
                      "name": "strategy",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} The maximum internal queue size (of the created `ReadableStream`) before backpressure is applied in reading from the given `stream.Readable`. If no value is provided, it will be taken from the given `stream.Readable`.",
                          "name": "highWaterMark",
                          "type": "number",
                          "desc": "The maximum internal queue size (of the created `ReadableStream`) before backpressure is applied in reading from the given `stream.Readable`. If no value is provided, it will be taken from the given `stream.Readable`."
                        },
                        {
                          "textRaw": "`size` {Function} A function that size of the given chunk of data. If no value is provided, the size will be `1` for all the chunks.",
                          "name": "size",
                          "type": "Function",
                          "desc": "A function that size of the given chunk of data. If no value is provided, the size will be `1` for all the chunks.",
                          "options": [
                            {
                              "textRaw": "`chunk` {any}",
                              "name": "chunk",
                              "type": "any"
                            },
                            {
                              "textRaw": "Returns: {number}",
                              "name": "return",
                              "type": "number"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "textRaw": "`type` {string} Specifies the type of the created `ReadableStream`. Must be `'bytes'` or undefined.",
                      "name": "type",
                      "type": "string",
                      "desc": "Specifies the type of the created `ReadableStream`. Must be `'bytes'` or undefined."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {ReadableStream}",
                "name": "return",
                "type": "ReadableStream"
              }
            }
          ]
        },
        {
          "textRaw": "`stream.Writable.fromWeb(writableStream[, options])`",
          "name": "fromWeb",
          "type": "method",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`writableStream` {WritableStream}",
                  "name": "writableStream",
                  "type": "WritableStream"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`decodeStrings` {boolean}",
                      "name": "decodeStrings",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`highWaterMark` {number}",
                      "name": "highWaterMark",
                      "type": "number"
                    },
                    {
                      "textRaw": "`objectMode` {boolean}",
                      "name": "objectMode",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`signal` {AbortSignal}",
                      "name": "signal",
                      "type": "AbortSignal"
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {stream.Writable}",
                "name": "return",
                "type": "stream.Writable"
              }
            }
          ]
        },
        {
          "textRaw": "`stream.Writable.toWeb(streamWritable)`",
          "name": "toWeb",
          "type": "method",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`streamWritable` {stream.Writable}",
                  "name": "streamWritable",
                  "type": "stream.Writable"
                }
              ],
              "return": {
                "textRaw": "Returns: {WritableStream}",
                "name": "return",
                "type": "WritableStream"
              }
            }
          ]
        },
        {
          "textRaw": "`stream.Duplex.from(src)`",
          "name": "from",
          "type": "method",
          "meta": {
            "added": [
              "v16.8.0"
            ],
            "changes": [
              {
                "version": [
                  "v19.5.0",
                  "v18.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46190",
                "description": "The `src` argument can now be a `ReadableStream` or `WritableStream`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`src` {Stream|Blob|ArrayBuffer|string|AsyncIterable|AsyncGeneratorFunction|AsyncFunction|Promise|Object|ReadableStream|WritableStream}",
                  "name": "src",
                  "type": "Stream|Blob|ArrayBuffer|string|AsyncIterable|AsyncGeneratorFunction|AsyncFunction|Promise|Object|ReadableStream|WritableStream"
                }
              ]
            }
          ],
          "desc": "<p>A utility method for creating duplex streams.</p>\n<ul>\n<li><code>Stream</code> converts writable stream into writable <code>Duplex</code> and readable stream\nto <code>Duplex</code>.</li>\n<li><code>Blob</code> converts into readable <code>Duplex</code>.</li>\n<li><code>string</code> converts into readable <code>Duplex</code>.</li>\n<li><code>ArrayBuffer</code> converts into readable <code>Duplex</code>.</li>\n<li><code>AsyncIterable</code> converts into a readable <code>Duplex</code>. Cannot yield\n<code>null</code>.</li>\n<li><code>AsyncGeneratorFunction</code> converts into a readable/writable transform\n<code>Duplex</code>. Must take a source <code>AsyncIterable</code> as first parameter. Cannot yield\n<code>null</code>.</li>\n<li><code>AsyncFunction</code> converts into a writable <code>Duplex</code>. Must return\neither <code>null</code> or <code>undefined</code></li>\n<li><code>Object ({ writable, readable })</code> converts <code>readable</code> and\n<code>writable</code> into <code>Stream</code> and then combines them into <code>Duplex</code> where the\n<code>Duplex</code> will write to the <code>writable</code> and read from the <code>readable</code>.</li>\n<li><code>Promise</code> converts into readable <code>Duplex</code>. Value <code>null</code> is ignored.</li>\n<li><code>ReadableStream</code> converts into readable <code>Duplex</code>.</li>\n<li><code>WritableStream</code> converts into writable <code>Duplex</code>.</li>\n<li>Returns: <a href=\"stream.html#class-streamduplex\"><code>&#x3C;stream.Duplex></code></a></li>\n</ul>\n<p>If an <code>Iterable</code> object containing promises is passed as an argument,\nit might result in unhandled rejection.</p>\n<pre><code class=\"language-js\">const { Duplex } = require('node:stream');\n\nDuplex.from([\n  new Promise((resolve) => setTimeout(resolve('1'), 1500)),\n  new Promise((_, reject) => setTimeout(reject(new Error('2')), 1000)), // Unhandled rejection\n]);\n</code></pre>"
        },
        {
          "textRaw": "`stream.Duplex.fromWeb(pair[, options])`",
          "name": "fromWeb",
          "type": "method",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pair` {Object}",
                  "name": "pair",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`readable` {ReadableStream}",
                      "name": "readable",
                      "type": "ReadableStream"
                    },
                    {
                      "textRaw": "`writable` {WritableStream}",
                      "name": "writable",
                      "type": "WritableStream"
                    }
                  ]
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`allowHalfOpen` {boolean}",
                      "name": "allowHalfOpen",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`decodeStrings` {boolean}",
                      "name": "decodeStrings",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`encoding` {string}",
                      "name": "encoding",
                      "type": "string"
                    },
                    {
                      "textRaw": "`highWaterMark` {number}",
                      "name": "highWaterMark",
                      "type": "number"
                    },
                    {
                      "textRaw": "`objectMode` {boolean}",
                      "name": "objectMode",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`signal` {AbortSignal}",
                      "name": "signal",
                      "type": "AbortSignal"
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {stream.Duplex}",
                "name": "return",
                "type": "stream.Duplex"
              }
            }
          ],
          "desc": "<pre><code class=\"language-mjs\">import { Duplex } from 'node:stream';\nimport {\n  ReadableStream,\n  WritableStream,\n} from 'node:stream/web';\n\nconst readable = new ReadableStream({\n  start(controller) {\n    controller.enqueue('world');\n  },\n});\n\nconst writable = new WritableStream({\n  write(chunk) {\n    console.log('writable', chunk);\n  },\n});\n\nconst pair = {\n  readable,\n  writable,\n};\nconst duplex = Duplex.fromWeb(pair, { encoding: 'utf8', objectMode: true });\n\nduplex.write('hello');\n\nfor await (const chunk of duplex) {\n  console.log('readable', chunk);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { Duplex } = require('node:stream');\nconst {\n  ReadableStream,\n  WritableStream,\n} = require('node:stream/web');\n\nconst readable = new ReadableStream({\n  start(controller) {\n    controller.enqueue('world');\n  },\n});\n\nconst writable = new WritableStream({\n  write(chunk) {\n    console.log('writable', chunk);\n  },\n});\n\nconst pair = {\n  readable,\n  writable,\n};\nconst duplex = Duplex.fromWeb(pair, { encoding: 'utf8', objectMode: true });\n\nduplex.write('hello');\nduplex.once('readable', () => console.log('readable', duplex.read()));\n</code></pre>"
        },
        {
          "textRaw": "`stream.Duplex.toWeb(streamDuplex[, options])`",
          "name": "toWeb",
          "type": "method",
          "meta": {
            "added": [
              "v17.0.0"
            ],
            "changes": [
              {
                "version": "v25.7.0",
                "pr-url": "https://github.com/nodejs/node/pull/61632",
                "description": "Added the 'readableType' option to specify the ReadableStream type. The 'type' option is deprecated."
              },
              {
                "version": [
                  "v25.4.0",
                  "v24.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/58664",
                "description": "Added the 'type' option to specify the ReadableStream type."
              },
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`streamDuplex` {stream.Duplex}",
                  "name": "streamDuplex",
                  "type": "stream.Duplex"
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`readableType` {string} Specifies the type of the `ReadableStream` half of the created readable-writable pair. Must be `'bytes'` or undefined. (`options.type` is a deprecated alias for this option.)",
                      "name": "readableType",
                      "type": "string",
                      "desc": "Specifies the type of the `ReadableStream` half of the created readable-writable pair. Must be `'bytes'` or undefined. (`options.type` is a deprecated alias for this option.)"
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object",
                "options": [
                  {
                    "textRaw": "`readable` {ReadableStream}",
                    "name": "readable",
                    "type": "ReadableStream"
                  },
                  {
                    "textRaw": "`writable` {WritableStream}",
                    "name": "writable",
                    "type": "WritableStream"
                  }
                ]
              }
            }
          ],
          "desc": "<pre><code class=\"language-mjs\">import { Duplex } from 'node:stream';\n\nconst duplex = Duplex({\n  objectMode: true,\n  read() {\n    this.push('world');\n    this.push(null);\n  },\n  write(chunk, encoding, callback) {\n    console.log('writable', chunk);\n    callback();\n  },\n});\n\nconst { readable, writable } = Duplex.toWeb(duplex);\nwritable.getWriter().write('hello');\n\nconst { value } = await readable.getReader().read();\nconsole.log('readable', value);\n</code></pre>\n<pre><code class=\"language-cjs\">const { Duplex } = require('node:stream');\n\nconst duplex = Duplex({\n  objectMode: true,\n  read() {\n    this.push('world');\n    this.push(null);\n  },\n  write(chunk, encoding, callback) {\n    console.log('writable', chunk);\n    callback();\n  },\n});\n\nconst { readable, writable } = Duplex.toWeb(duplex);\nwritable.getWriter().write('hello');\n\nreadable.getReader().read().then((result) => {\n  console.log('readable', result.value);\n});\n</code></pre>"
        },
        {
          "textRaw": "`stream.addAbortSignal(signal, stream)`",
          "name": "addAbortSignal",
          "type": "method",
          "meta": {
            "added": [
              "v15.4.0"
            ],
            "changes": [
              {
                "version": [
                  "v19.7.0",
                  "v18.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46273",
                "description": "Added support for `ReadableStream` and `WritableStream`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`signal` {AbortSignal} A signal representing possible cancellation",
                  "name": "signal",
                  "type": "AbortSignal",
                  "desc": "A signal representing possible cancellation"
                },
                {
                  "textRaw": "`stream` {Stream|ReadableStream|WritableStream} A stream to attach a signal to.",
                  "name": "stream",
                  "type": "Stream|ReadableStream|WritableStream",
                  "desc": "A stream to attach a signal to."
                }
              ]
            }
          ],
          "desc": "<p>Attaches an AbortSignal to a readable or writeable stream. This lets code\ncontrol stream destruction using an <code>AbortController</code>.</p>\n<p>Calling <code>abort</code> on the <code>AbortController</code> corresponding to the passed\n<code>AbortSignal</code> will behave the same way as calling <code>.destroy(new AbortError())</code>\non the stream, and <code>controller.error(new AbortError())</code> for webstreams.</p>\n<pre><code class=\"language-js\">const fs = require('node:fs');\n\nconst controller = new AbortController();\nconst read = addAbortSignal(\n  controller.signal,\n  fs.createReadStream(('object.json')),\n);\n// Later, abort the operation closing the stream\ncontroller.abort();\n</code></pre>\n<p>Or using an <code>AbortSignal</code> with a readable stream as an async iterable:</p>\n<pre><code class=\"language-js\">const controller = new AbortController();\nsetTimeout(() => controller.abort(), 10_000); // set a timeout\nconst stream = addAbortSignal(\n  controller.signal,\n  fs.createReadStream(('object.json')),\n);\n(async () => {\n  try {\n    for await (const chunk of stream) {\n      await process(chunk);\n    }\n  } catch (e) {\n    if (e.name === 'AbortError') {\n      // The operation was cancelled\n    } else {\n      throw e;\n    }\n  }\n})();\n</code></pre>\n<p>Or using an <code>AbortSignal</code> with a ReadableStream:</p>\n<pre><code class=\"language-js\">const controller = new AbortController();\nconst rs = new ReadableStream({\n  start(controller) {\n    controller.enqueue('hello');\n    controller.enqueue('world');\n    controller.close();\n  },\n});\n\naddAbortSignal(controller.signal, rs);\n\nfinished(rs, (err) => {\n  if (err) {\n    if (err.name === 'AbortError') {\n      // The operation was cancelled\n    }\n  }\n});\n\nconst reader = rs.getReader();\n\nreader.read().then(({ value, done }) => {\n  console.log(value); // hello\n  console.log(done); // false\n  controller.abort();\n});\n</code></pre>"
        },
        {
          "textRaw": "`stream.getDefaultHighWaterMark(objectMode)`",
          "name": "getDefaultHighWaterMark",
          "type": "method",
          "meta": {
            "added": [
              "v19.9.0",
              "v18.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`objectMode` {boolean}",
                  "name": "objectMode",
                  "type": "boolean"
                }
              ],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns the default highWaterMark used by streams.\nDefaults to <code>65536</code> (64 KiB), or <code>16</code> for <code>objectMode</code>.</p>"
        },
        {
          "textRaw": "`stream.setDefaultHighWaterMark(objectMode, value)`",
          "name": "setDefaultHighWaterMark",
          "type": "method",
          "meta": {
            "added": [
              "v19.9.0",
              "v18.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`objectMode` {boolean}",
                  "name": "objectMode",
                  "type": "boolean"
                },
                {
                  "textRaw": "`value` {integer} highWaterMark value",
                  "name": "value",
                  "type": "integer",
                  "desc": "highWaterMark value"
                }
              ]
            }
          ],
          "desc": "<p>Sets the default highWaterMark used by streams.</p>"
        },
        {
          "textRaw": "`readable.read(0)`",
          "name": "read",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "0"
                }
              ]
            }
          ],
          "desc": "<p>There are some cases where it is necessary to trigger a refresh of the\nunderlying readable stream mechanisms, without actually consuming any\ndata. In such cases, it is possible to call <code>readable.read(0)</code>, which will\nalways return <code>null</code>.</p>\n<p>If the internal read buffer is below the <code>highWaterMark</code>, and the\nstream is not currently reading, then calling <code>stream.read(0)</code> will trigger\na low-level <a href=\"#readable_readsize\"><code>stream._read()</code></a> call.</p>\n<p>While most applications will almost never need to do this, there are\nsituations within Node.js where this is done, particularly in the\n<code>Readable</code> stream class internals.</p>"
        },
        {
          "textRaw": "`readable.push('')`",
          "name": "push",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "''"
                }
              ]
            }
          ],
          "desc": "<p>Use of <code>readable.push('')</code> is not recommended.</p>\n<p>Pushing a zero-byte <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> to a stream\nthat is not in object mode has an interesting side effect.\nBecause it <em>is</em> a call to\n<a href=\"#readablepushchunk-encoding\"><code>readable.push()</code></a>, the call will end the reading process.\nHowever, because the argument is an empty string, no data is added to the\nreadable buffer so there is nothing for a user to consume.</p>"
        }
      ],
      "displayName": "Stream",
      "source": "doc/api/stream.md"
    },
    {
      "textRaw": "String decoder",
      "name": "string_decoder",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:string_decoder</code> module provides an API for decoding <code>Buffer</code> objects\ninto strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16\ncharacters. It can be accessed using:</p>\n<pre><code class=\"language-mjs\">import { StringDecoder } from 'node:string_decoder';\n</code></pre>\n<pre><code class=\"language-cjs\">const { StringDecoder } = require('node:string_decoder');\n</code></pre>\n<p>The following example shows the basic use of the <code>StringDecoder</code> class.</p>\n<pre><code class=\"language-mjs\">import { StringDecoder } from 'node:string_decoder';\nimport { Buffer } from 'node:buffer';\nconst decoder = new StringDecoder('utf8');\n\nconst cent = Buffer.from([0xC2, 0xA2]);\nconsole.log(decoder.write(cent)); // Prints: ¢\n\nconst euro = Buffer.from([0xE2, 0x82, 0xAC]);\nconsole.log(decoder.write(euro)); // Prints: €\n</code></pre>\n<pre><code class=\"language-cjs\">const { StringDecoder } = require('node:string_decoder');\nconst decoder = new StringDecoder('utf8');\n\nconst cent = Buffer.from([0xC2, 0xA2]);\nconsole.log(decoder.write(cent)); // Prints: ¢\n\nconst euro = Buffer.from([0xE2, 0x82, 0xAC]);\nconsole.log(decoder.write(euro)); // Prints: €\n</code></pre>\n<p>When a <code>Buffer</code> instance is written to the <code>StringDecoder</code> instance, an\ninternal buffer is used to ensure that the decoded string does not contain\nany incomplete multibyte characters. These are held in the buffer until the\nnext call to <code>stringDecoder.write()</code> or until <code>stringDecoder.end()</code> is called.</p>\n<p>In the following example, the three UTF-8 encoded bytes of the European Euro\nsymbol (<code>€</code>) are written over three separate operations:</p>\n<pre><code class=\"language-mjs\">import { StringDecoder } from 'node:string_decoder';\nimport { Buffer } from 'node:buffer';\nconst decoder = new StringDecoder('utf8');\n\ndecoder.write(Buffer.from([0xE2]));\ndecoder.write(Buffer.from([0x82]));\nconsole.log(decoder.end(Buffer.from([0xAC]))); // Prints: €\n</code></pre>\n<pre><code class=\"language-cjs\">const { StringDecoder } = require('node:string_decoder');\nconst decoder = new StringDecoder('utf8');\n\ndecoder.write(Buffer.from([0xE2]));\ndecoder.write(Buffer.from([0x82]));\nconsole.log(decoder.end(Buffer.from([0xAC]))); // Prints: €\n</code></pre>",
      "classes": [
        {
          "textRaw": "Class: `StringDecoder`",
          "name": "StringDecoder",
          "type": "class",
          "signatures": [
            {
              "textRaw": "`new StringDecoder([encoding])`",
              "name": "StringDecoder",
              "type": "ctor",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`encoding` {string} The character encoding the `StringDecoder` will use. **Default:** `'utf8'`.",
                  "name": "encoding",
                  "type": "string",
                  "default": "`'utf8'`",
                  "desc": "The character encoding the `StringDecoder` will use.",
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new <code>StringDecoder</code> instance.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`stringDecoder.end([buffer])`",
              "name": "end",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {string|Buffer|TypedArray|DataView} The bytes to decode.",
                      "name": "buffer",
                      "type": "string|Buffer|TypedArray|DataView",
                      "desc": "The bytes to decode.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Returns any remaining input stored in the internal buffer as a string. Bytes\nrepresenting incomplete UTF-8 and UTF-16 characters will be replaced with\nsubstitution characters appropriate for the character encoding.</p>\n<p>If the <code>buffer</code> argument is provided, one final call to <code>stringDecoder.write()</code>\nis performed before returning the remaining input.\nAfter <code>end()</code> is called, the <code>stringDecoder</code> object can be reused for new input.</p>"
            },
            {
              "textRaw": "`stringDecoder.write(buffer)`",
              "name": "write",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/9618",
                    "description": "Each invalid character is now replaced by a single replacement character instead of one for each individual byte."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {string|Buffer|TypedArray|DataView} The bytes to decode.",
                      "name": "buffer",
                      "type": "string|Buffer|TypedArray|DataView",
                      "desc": "The bytes to decode."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Returns a decoded string, ensuring that any incomplete multibyte characters at\nthe end of the <code>Buffer</code>, or <code>TypedArray</code>, or <code>DataView</code> are omitted from the\nreturned string and stored in an internal buffer for the next call to\n<code>stringDecoder.write()</code> or <code>stringDecoder.end()</code>.</p>"
            }
          ]
        }
      ],
      "displayName": "String decoder",
      "source": "doc/api/string_decoder.md"
    },
    {
      "textRaw": "Test runner",
      "name": "test_runner",
      "introduced_in": "v18.0.0",
      "type": "module",
      "meta": {
        "added": [
          "v18.0.0",
          "v16.17.0"
        ],
        "changes": [
          {
            "version": "v20.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/46983",
            "description": "The test runner is now stable."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:test</code> module facilitates the creation of JavaScript tests.\nTo access it:</p>\n<pre><code class=\"language-mjs\">import test from 'node:test';\n</code></pre>\n<pre><code class=\"language-cjs\">const test = require('node:test');\n</code></pre>\n<p>This module is only available under the <code>node:</code> scheme.</p>\n<p>Tests created via the <code>test</code> module consist of a single function that is\nprocessed in one of three ways:</p>\n<ol>\n<li>A synchronous function that is considered failing if it throws an exception,\nand is considered passing otherwise.</li>\n<li>A function that returns a <code>Promise</code> that is considered failing if the\n<code>Promise</code> rejects, and is considered passing if the <code>Promise</code> fulfills.</li>\n<li>A function that receives a callback function. If the callback receives any\ntruthy value as its first argument, the test is considered failing. If a\nfalsy value is passed as the first argument to the callback, the test is\nconsidered passing. If the test function receives a callback function and\nalso returns a <code>Promise</code>, the test will fail.</li>\n</ol>\n<p>The following example illustrates how tests are written using the\n<code>test</code> module.</p>\n<pre><code class=\"language-js\">test('synchronous passing test', (t) => {\n  // This test passes because it does not throw an exception.\n  assert.strictEqual(1, 1);\n});\n\ntest('synchronous failing test', (t) => {\n  // This test fails because it throws an exception.\n  assert.strictEqual(1, 2);\n});\n\ntest('asynchronous passing test', async (t) => {\n  // This test passes because the Promise returned by the async\n  // function is settled and not rejected.\n  assert.strictEqual(1, 1);\n});\n\ntest('asynchronous failing test', async (t) => {\n  // This test fails because the Promise returned by the async\n  // function is rejected.\n  assert.strictEqual(1, 2);\n});\n\ntest('failing test using Promises', (t) => {\n  // Promises can be used directly as well.\n  return new Promise((resolve, reject) => {\n    setImmediate(() => {\n      reject(new Error('this will cause the test to fail'));\n    });\n  });\n});\n\ntest('callback passing test', (t, done) => {\n  // done() is the callback function. When the setImmediate() runs, it invokes\n  // done() with no arguments.\n  setImmediate(done);\n});\n\ntest('callback failing test', (t, done) => {\n  // When the setImmediate() runs, done() is invoked with an Error object and\n  // the test fails.\n  setImmediate(() => {\n    done(new Error('callback failure'));\n  });\n});\n</code></pre>\n<p>If any tests fail, the process exit code is set to <code>1</code>.</p>",
      "modules": [
        {
          "textRaw": "Subtests",
          "name": "subtests",
          "type": "module",
          "desc": "<p>The test context's <code>test()</code> method allows subtests to be created.\nIt allows you to structure your tests in a hierarchical manner,\nwhere you can create nested tests within a larger test.\nThis method behaves identically to the top level <code>test()</code> function.\nThe following example demonstrates the creation of a\ntop level test with two subtests.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  await t.test('subtest 1', (t) => {\n    assert.strictEqual(1, 1);\n  });\n\n  await t.test('subtest 2', (t) => {\n    assert.strictEqual(2, 2);\n  });\n});\n</code></pre>\n<blockquote>\n<p><strong>Note:</strong> <code>beforeEach</code> and <code>afterEach</code> hooks are triggered\nbetween each subtest execution.</p>\n</blockquote>\n<p>In this example, <code>await</code> is used to ensure that both subtests have completed.\nThis is necessary because tests do not wait for their subtests to\ncomplete, unlike tests created within suites.\nAny subtests that are still outstanding when their parent finishes\nare cancelled and treated as failures. Any subtest failures cause the parent\ntest to fail.</p>",
          "displayName": "Subtests"
        },
        {
          "textRaw": "Rerunning failed tests",
          "name": "rerunning_failed_tests",
          "type": "module",
          "desc": "<p>The test runner supports persisting the state of the run to a file, allowing\nthe test runner to rerun failed tests without having to re-run the entire test suite.\nUse the <a href=\"cli.html#--test-rerun-failures\"><code>--test-rerun-failures</code></a> command-line option to specify a file path where the\nstate of the run is stored. if the state file does not exist, the test runner will\ncreate it.\nthe state file is a JSON file that contains an array of run attempts.\nEach run attempt is an object mapping successful tests to the attempt they have passed in.\nThe key identifying a test in this map is the test file path, with the line and column where the test is defined.\nin a case where a test defined in a specific location is run multiple times,\nfor example within a function or a loop,\na counter will be appended to the key, to disambiguate the test runs.\nnote changing the order of test execution or the location of a test can lead the test runner\nto consider tests as passed on a previous attempt,\nmeaning <code>--test-rerun-failures</code> should be used when tests run in a deterministic order.</p>\n<p>example of a state file:</p>\n<pre><code class=\"language-json\">[\n  {\n    \"test.js:10:5\": { \"passed_on_attempt\": 0, \"name\": \"test 1\" }\n  },\n  {\n    \"test.js:10:5\": { \"passed_on_attempt\": 0, \"name\": \"test 1\" },\n    \"test.js:20:5\": { \"passed_on_attempt\": 1, \"name\": \"test 2\" }\n  }\n]\n</code></pre>\n<p>in this example, there are two run attempts, with two tests defined in <code>test.js</code>,\nthe first test succeeded on the first attempt, and the second test succeeded on the second attempt.</p>\n<p>When the <code>--test-rerun-failures</code> option is used, the test runner will only run tests that have not yet passed.</p>\n<pre><code class=\"language-bash\">node --test-rerun-failures /path/to/state/file\n</code></pre>",
          "displayName": "Rerunning failed tests"
        },
        {
          "textRaw": "`describe()` and `it()` aliases",
          "name": "`describe()`_and_`it()`_aliases",
          "type": "module",
          "desc": "<p>Suites and tests can also be written using the <code>describe()</code> and <code>it()</code>\nfunctions. <a href=\"#describename-options-fn\"><code>describe()</code></a> is an alias for <a href=\"#suitename-options-fn\"><code>suite()</code></a>, and <a href=\"#itname-options-fn\"><code>it()</code></a> is an\nalias for <a href=\"#testname-options-fn\"><code>test()</code></a>.</p>\n<pre><code class=\"language-js\">describe('A thing', () => {\n  it('should work', () => {\n    assert.strictEqual(1, 1);\n  });\n\n  it('should be ok', () => {\n    assert.strictEqual(2, 2);\n  });\n\n  describe('a nested thing', () => {\n    it('should work', () => {\n      assert.strictEqual(3, 3);\n    });\n  });\n});\n</code></pre>\n<p><code>describe()</code> and <code>it()</code> are imported from the <code>node:test</code> module.</p>\n<pre><code class=\"language-mjs\">import { describe, it } from 'node:test';\n</code></pre>\n<pre><code class=\"language-cjs\">const { describe, it } = require('node:test');\n</code></pre>",
          "displayName": "`describe()` and `it()` aliases"
        },
        {
          "textRaw": "Skipping tests",
          "name": "skipping_tests",
          "type": "module",
          "desc": "<p>Individual tests can be skipped by passing the <code>skip</code> option to the test, or by\ncalling the test context's <code>skip()</code> method as shown in the\nfollowing example.</p>\n<pre><code class=\"language-js\">// The skip option is used, but no message is provided.\ntest('skip option', { skip: true }, (t) => {\n  // This code is never executed.\n});\n\n// The skip option is used, and a message is provided.\ntest('skip option with message', { skip: 'this is skipped' }, (t) => {\n  // This code is never executed.\n});\n\ntest('skip() method', (t) => {\n  // Make sure to return here as well if the test contains additional logic.\n  t.skip();\n});\n\ntest('skip() method with message', (t) => {\n  // Make sure to return here as well if the test contains additional logic.\n  t.skip('this is skipped');\n});\n</code></pre>",
          "displayName": "Skipping tests"
        },
        {
          "textRaw": "TODO tests",
          "name": "todo_tests",
          "type": "module",
          "desc": "<p>Individual tests can be marked as flaky or incomplete by passing the <code>todo</code>\noption to the test, or by calling the test context's <code>todo()</code> method, as shown\nin the following example. These tests represent a pending implementation or bug\nthat needs to be fixed. TODO tests are executed, but are not treated as test\nfailures, and therefore do not affect the process exit code. If a test is marked\nas both TODO and skipped, the TODO option is ignored.</p>\n<pre><code class=\"language-js\">// The todo option is used, but no message is provided.\ntest('todo option', { todo: true }, (t) => {\n  // This code is executed, but not treated as a failure.\n  throw new Error('this does not fail the test');\n});\n\n// The todo option is used, and a message is provided.\ntest('todo option with message', { todo: 'this is a todo test' }, (t) => {\n  // This code is executed.\n});\n\ntest('todo() method', (t) => {\n  t.todo();\n});\n\ntest('todo() method with message', (t) => {\n  t.todo('this is a todo test and is not treated as a failure');\n  throw new Error('this does not fail the test');\n});\n</code></pre>",
          "displayName": "TODO tests"
        },
        {
          "textRaw": "Expecting tests to fail",
          "name": "expecting_tests_to_fail",
          "type": "module",
          "meta": {
            "added": [
              "v25.5.0",
              "v24.14.0"
            ],
            "changes": []
          },
          "desc": "<p>This flips the pass/fail reporting for a specific test or suite: a flagged test\ncase must throw in order to pass, and a flagged test case that does not throw\nfails.</p>\n<p>In each of the following, <code>doTheThing()</code> fails to return <code>true</code>, but since the\ntests are flagged <code>expectFailure</code>, they pass.</p>\n<pre><code class=\"language-js\">it.expectFailure('should do the thing', () => {\n  assert.strictEqual(doTheThing(), true);\n});\n\nit('should do the thing', { expectFailure: true }, () => {\n  assert.strictEqual(doTheThing(), true);\n});\n\nit('should do the thing', { expectFailure: 'feature not implemented' }, () => {\n  assert.strictEqual(doTheThing(), true);\n});\n</code></pre>\n<p>If the value of <code>expectFailure</code> is a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp\"><code>&#x3C;RegExp></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a>\nthe tests will pass only if they throw a matching value.\nSee <a href=\"assert.html#assertthrowsfn-error-message\"><code>assert.throws</code></a> for how each value type is handled.</p>\n<p>Each of the following tests fails <em>despite</em> being flagged <code>expectFailure</code>\nbecause the failure does not match the specific <strong>expected</strong> failure.</p>\n<pre><code class=\"language-js\">it('fails because regex does not match', {\n  expectFailure: /expected message/,\n}, () => {\n  throw new Error('different message');\n});\n\nit('fails because object matcher does not match', {\n  expectFailure: { code: 'ERR_EXPECTED' },\n}, () => {\n  const err = new Error('boom');\n  err.code = 'ERR_ACTUAL';\n  throw err;\n});\n</code></pre>\n<p>To supply both a reason and specific error for <code>expectFailure</code>, use <code>{ label, match }</code>.</p>\n<pre><code class=\"language-js\">it('should fail with specific error and reason', {\n  expectFailure: {\n    label: 'reason for failure',\n    match: /error message/,\n  },\n}, () => {\n  assert.strictEqual(doTheThing(), true);\n});\n</code></pre>\n<p><code>skip</code> and/or <code>todo</code> are mutually exclusive to <code>expectFailure</code>, and <code>skip</code> or <code>todo</code>\nwill \"win\" when both are applied (<code>skip</code> wins against both, and <code>todo</code> wins\nagainst <code>expectFailure</code>).</p>\n<p>These tests will be skipped (and not run):</p>\n<pre><code class=\"language-js\">it.expectFailure('should do the thing', { skip: true }, () => {\n  assert.strictEqual(doTheThing(), true);\n});\n\nit.skip('should do the thing', { expectFailure: true }, () => {\n  assert.strictEqual(doTheThing(), true);\n});\n</code></pre>\n<p>These tests will be marked \"todo\" (silencing errors):</p>\n<pre><code class=\"language-js\">it.expectFailure('should do the thing', { todo: true }, () => {\n  assert.strictEqual(doTheThing(), true);\n});\n\nit.todo('should do the thing', { expectFailure: true }, () => {\n  assert.strictEqual(doTheThing(), true);\n});\n</code></pre>",
          "displayName": "Expecting tests to fail"
        },
        {
          "textRaw": "`only` tests",
          "name": "`only`_tests",
          "type": "module",
          "desc": "<p>If Node.js is started with the <a href=\"cli.html#--test-only\"><code>--test-only</code></a> command-line option, or test\nisolation is disabled, it is possible to skip all tests except for a selected\nsubset by passing the <code>only</code> option to the tests that should run. When a test\nwith the <code>only</code> option is set, all subtests are also run.\nIf a suite has the <code>only</code> option set, all tests within the suite are run,\nunless it has descendants with the <code>only</code> option set, in which case only those\ntests are run.</p>\n<p>When using <a href=\"#subtests\">subtests</a> within a <code>test()</code>/<code>it()</code>, it is required to mark\nall ancestor tests with the <code>only</code> option to run only a\nselected subset of tests.</p>\n<p>The test context's <code>runOnly()</code>\nmethod can be used to implement the same behavior at the subtest level. Tests\nthat are not executed are omitted from the test runner output.</p>\n<pre><code class=\"language-js\">// Assume Node.js is run with the --test-only command-line option.\n// The suite's 'only' option is set, so these tests are run.\ntest('this test is run', { only: true }, async (t) => {\n  // Within this test, all subtests are run by default.\n  await t.test('running subtest');\n\n  // The test context can be updated to run subtests with the 'only' option.\n  t.runOnly(true);\n  await t.test('this subtest is now skipped');\n  await t.test('this subtest is run', { only: true });\n\n  // Switch the context back to execute all tests.\n  t.runOnly(false);\n  await t.test('this subtest is now run');\n\n  // Explicitly do not run these tests.\n  await t.test('skipped subtest 3', { only: false });\n  await t.test('skipped subtest 4', { skip: true });\n});\n\n// The 'only' option is not set, so this test is skipped.\ntest('this test is not run', () => {\n  // This code is not run.\n  throw new Error('fail');\n});\n\ndescribe('a suite', () => {\n  // The 'only' option is set, so this test is run.\n  it('this test is run', { only: true }, () => {\n    // This code is run.\n  });\n\n  it('this test is not run', () => {\n    // This code is not run.\n    throw new Error('fail');\n  });\n});\n\ndescribe.only('a suite', () => {\n  // The 'only' option is set, so this test is run.\n  it('this test is run', () => {\n    // This code is run.\n  });\n\n  it('this test is run', () => {\n    // This code is run.\n  });\n});\n</code></pre>",
          "displayName": "`only` tests"
        },
        {
          "textRaw": "Filtering tests by name",
          "name": "filtering_tests_by_name",
          "type": "module",
          "desc": "<p>The <a href=\"cli.html#--test-name-pattern\"><code>--test-name-pattern</code></a> command-line option can be used to only run\ntests whose name matches the provided pattern, and the\n<a href=\"cli.html#--test-skip-pattern\"><code>--test-skip-pattern</code></a> option can be used to skip tests whose name\nmatches the provided pattern. Test name patterns are interpreted as\nJavaScript regular expressions. The <code>--test-name-pattern</code> and\n<code>--test-skip-pattern</code> options can be specified multiple times in order to run\nnested tests. For each test that is executed, any corresponding test hooks,\nsuch as <code>beforeEach()</code>, are also run. Tests that are not executed are omitted\nfrom the test runner output.</p>\n<p>Given the following test file, starting Node.js with the\n<code>--test-name-pattern=\"test [1-3]\"</code> option would cause the test runner to execute\n<code>test 1</code>, <code>test 2</code>, and <code>test 3</code>. If <code>test 1</code> did not match the test name\npattern, then its subtests would not execute, despite matching the pattern. The\nsame set of tests could also be executed by passing <code>--test-name-pattern</code>\nmultiple times (e.g. <code>--test-name-pattern=\"test 1\"</code>,\n<code>--test-name-pattern=\"test 2\"</code>, etc.).</p>\n<pre><code class=\"language-js\">test('test 1', async (t) => {\n  await t.test('test 2');\n  await t.test('test 3');\n});\n\ntest('Test 4', async (t) => {\n  await t.test('Test 5');\n  await t.test('test 6');\n});\n</code></pre>\n<p>Test name patterns can also be specified using regular expression literals. This\nallows regular expression flags to be used. In the previous example, starting\nNode.js with <code>--test-name-pattern=\"/test [4-5]/i\"</code> (or <code>--test-skip-pattern=\"/test [4-5]/i\"</code>)\nwould match <code>Test 4</code> and <code>Test 5</code> because the pattern is case-insensitive.</p>\n<p>To match a single test with a pattern, you can prefix it with all its ancestor\ntest names separated by space, to ensure it is unique.\nFor example, given the following test file:</p>\n<pre><code class=\"language-js\">describe('test 1', (t) => {\n  it('some test');\n});\n\ndescribe('test 2', (t) => {\n  it('some test');\n});\n</code></pre>\n<p>Starting Node.js with <code>--test-name-pattern=\"test 1 some test\"</code> would match\nonly <code>some test</code> in <code>test 1</code>.</p>\n<p>Test name patterns do not change the set of files that the test runner executes.</p>\n<p>If both <code>--test-name-pattern</code> and <code>--test-skip-pattern</code> are supplied,\ntests must satisfy <strong>both</strong> requirements in order to be executed.</p>",
          "displayName": "Filtering tests by name"
        },
        {
          "textRaw": "Test tags",
          "name": "test_tags",
          "type": "module",
          "meta": {
            "added": [
              "v26.2.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Early development",
          "desc": "<p>Tags annotate tests and suites with arbitrary string labels. The\n<a href=\"cli.html#--experimental-test-tag-filterexpr\"><code>--experimental-test-tag-filter</code></a> CLI flag (or the <code>testTagFilters</code>\noption on <a href=\"#runoptions\"><code>run()</code></a>) selects tests whose tag set contains every\nprovided filter value.</p>\n<p>Tags are an alternative to encoding metadata into test names. They are\nuseful for cross-cutting axes such as subsystem, speed bucket, flakiness,\nor environment, where a name pattern would be brittle.</p>",
          "modules": [
            {
              "textRaw": "Authoring tagged tests",
              "name": "authoring_tagged_tests",
              "type": "module",
              "desc": "<p>Pass a <code>tags</code> array on any of <code>test()</code>, <code>it()</code>, <code>suite()</code>, or <code>describe()</code>.\nTags inherit from a suite to its child tests by union—a test inside a\nsuite tagged <code>['db']</code> that declares its own <code>tags: ['integration']</code>\neffectively has both tags.</p>\n<pre><code class=\"language-mjs\">import { describe, it } from 'node:test';\n\ndescribe('database', { tags: ['db'] }, () => {\n  it('reads a row');                                            // tags: ['db']\n  it('writes a row', { tags: ['integration'] });                // tags: ['db', 'integration']\n  it('reconnects after disconnect', { tags: ['flaky'] });       // tags: ['db', 'flaky']\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { describe, it } = require('node:test');\n\ndescribe('database', { tags: ['db'] }, () => {\n  it('reads a row');                                            // tags: ['db']\n  it('writes a row', { tags: ['integration'] });                // tags: ['db', 'integration']\n  it('reconnects after disconnect', { tags: ['flaky'] });       // tags: ['db', 'flaky']\n});\n</code></pre>\n<p>Tag values must be non-empty strings. Tags are matched case-insensitively;\nthe canonical form is lowercase. Duplicates within a single <code>tags</code> array\nare collapsed on the lowercased form, preserving the first-seen\ndeclaration order.</p>\n<p>Hooks (<code>before</code>, <code>after</code>, <code>beforeEach</code>, <code>afterEach</code>) do not declare their\nown tags. They run as part of their owning suite, which carries the\nsuite's tags.</p>",
              "displayName": "Authoring tagged tests"
            },
            {
              "textRaw": "Filtering by tag",
              "name": "filtering_by_tag",
              "type": "module",
              "desc": "<p>Each <a href=\"cli.html#--experimental-test-tag-filterexpr\"><code>--experimental-test-tag-filter</code></a> value is a literal tag name. A\ntest runs only when its tag set contains that name. The flag may be\nspecified more than once; tests must match <strong>every</strong> filter to run. The\nsame applies to the <code>testTagFilters</code> array on <a href=\"#runoptions\"><code>run()</code></a>. Filters are\ncase-insensitive and AND'd with <a href=\"cli.html#--test-name-pattern\"><code>--test-name-pattern</code></a>,\n<a href=\"cli.html#--test-skip-pattern\"><code>--test-skip-pattern</code></a>, and <code>.only</code> filtering.</p>\n<p>Untagged tests are excluded under any non-empty filter, since the filter\nrequires the tag to be present.</p>",
              "displayName": "Filtering by tag"
            },
            {
              "textRaw": "Reading tags from inside a test",
              "name": "reading_tags_from_inside_a_test",
              "type": "module",
              "desc": "<p>The <a href=\"#class-testcontext\"><code>TestContext</code></a> object exposes the test's tags as a frozen array\nthrough <a href=\"#contexttags\"><code>context.tags</code></a>, so tests can branch on their own metadata.</p>",
              "displayName": "Reading tags from inside a test"
            },
            {
              "textRaw": "Errors",
              "name": "errors",
              "type": "module",
              "desc": "<p>A tag value that violates the validation rules above throws\n<code>ERR_INVALID_ARG_VALUE</code> at the registration site, before any test runs.\nA non-array <code>tags</code> value throws <code>ERR_INVALID_ARG_TYPE</code>.</p>",
              "displayName": "Errors"
            }
          ],
          "displayName": "Test tags"
        },
        {
          "textRaw": "Extraneous asynchronous activity",
          "name": "extraneous_asynchronous_activity",
          "type": "module",
          "desc": "<p>Once a test function finishes executing, the results are reported as quickly\nas possible while maintaining the order of the tests. However, it is possible\nfor the test function to generate asynchronous activity that outlives the test\nitself. The test runner handles this type of activity, but does not delay the\nreporting of test results in order to accommodate it.</p>\n<p>In the following example, a test completes with two <code>setImmediate()</code>\noperations still outstanding. The first <code>setImmediate()</code> attempts to create a\nnew subtest. Because the parent test has already finished and output its\nresults, the new subtest is immediately marked as failed, and reported later\nto the <a href=\"test.html#class-testsstream\"><code>&#x3C;TestsStream></code></a>.</p>\n<p>The second <code>setImmediate()</code> creates an <code>uncaughtException</code> event.\n<code>uncaughtException</code> and <code>unhandledRejection</code> events originating from a completed\ntest are marked as failed by the <code>test</code> module and reported as diagnostic\nwarnings at the top level by the <a href=\"test.html#class-testsstream\"><code>&#x3C;TestsStream></code></a>.</p>\n<pre><code class=\"language-js\">test('a test that creates asynchronous activity', (t) => {\n  setImmediate(() => {\n    t.test('subtest that is created too late', (t) => {\n      throw new Error('error1');\n    });\n  });\n\n  setImmediate(() => {\n    throw new Error('error2');\n  });\n\n  // The test finishes after this line.\n});\n</code></pre>",
          "displayName": "Extraneous asynchronous activity"
        },
        {
          "textRaw": "Watch mode",
          "name": "watch_mode",
          "type": "module",
          "meta": {
            "added": [
              "v19.2.0",
              "v18.13.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>The Node.js test runner supports running in watch mode by passing the <code>--watch</code> flag:</p>\n<pre><code class=\"language-bash\">node --test --watch\n</code></pre>\n<p>In watch mode, the test runner will watch for changes to test files and\ntheir dependencies. When a change is detected, the test runner will\nrerun the tests affected by the change.\nThe test runner will continue to run until the process is terminated.</p>",
          "displayName": "Watch mode"
        },
        {
          "textRaw": "Global setup and teardown",
          "name": "global_setup_and_teardown",
          "type": "module",
          "meta": {
            "added": [
              "v24.0.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Early development",
          "desc": "<p>The test runner supports specifying a module that will be evaluated before all tests are executed and\ncan be used to setup global state or fixtures for tests. This is useful for preparing resources or setting up\nshared state that is required by multiple tests.</p>\n<p>This module can export any of the following:</p>\n<ul>\n<li>A <code>globalSetup</code> function which runs once before all tests start</li>\n<li>A <code>globalTeardown</code> function which runs once after all tests complete</li>\n</ul>\n<p>The module is specified using the <code>--test-global-setup</code> flag when running tests from the command line.</p>\n<pre><code class=\"language-cjs\">// setup-module.js\nasync function globalSetup() {\n  // Setup shared resources, state, or environment\n  console.log('Global setup executed');\n  // Run servers, create files, prepare databases, etc.\n}\n\nasync function globalTeardown() {\n  // Clean up resources, state, or environment\n  console.log('Global teardown executed');\n  // Close servers, remove files, disconnect from databases, etc.\n}\n\nmodule.exports = { globalSetup, globalTeardown };\n</code></pre>\n<pre><code class=\"language-mjs\">// setup-module.mjs\nexport async function globalSetup() {\n  // Setup shared resources, state, or environment\n  console.log('Global setup executed');\n  // Run servers, create files, prepare databases, etc.\n}\n\nexport async function globalTeardown() {\n  // Clean up resources, state, or environment\n  console.log('Global teardown executed');\n  // Close servers, remove files, disconnect from databases, etc.\n}\n</code></pre>\n<p>If the global setup function throws an error, no tests will be run and the process will exit with a non-zero exit code.\nThe global teardown function will not be called in this case.</p>",
          "displayName": "Global setup and teardown"
        },
        {
          "textRaw": "Running tests from the command line",
          "name": "running_tests_from_the_command_line",
          "type": "module",
          "desc": "<p>The Node.js test runner can be invoked from the command line by passing the\n<a href=\"cli.html#--test\"><code>--test</code></a> flag:</p>\n<pre><code class=\"language-bash\">node --test\n</code></pre>\n<p>By default, Node.js will run all files matching these patterns:</p>\n<ul>\n<li><code>**/*.test.{cjs,mjs,js}</code></li>\n<li><code>**/*-test.{cjs,mjs,js}</code></li>\n<li><code>**/*_test.{cjs,mjs,js}</code></li>\n<li><code>**/test-*.{cjs,mjs,js}</code></li>\n<li><code>**/test.{cjs,mjs,js}</code></li>\n<li><code>**/test/**/*.{cjs,mjs,js}</code></li>\n</ul>\n<p>Unless <a href=\"cli.html#--no-strip-types\"><code>--no-strip-types</code></a> is supplied, the following\nadditional patterns are also matched:</p>\n<ul>\n<li><code>**/*.test.{cts,mts,ts}</code></li>\n<li><code>**/*-test.{cts,mts,ts}</code></li>\n<li><code>**/*_test.{cts,mts,ts}</code></li>\n<li><code>**/test-*.{cts,mts,ts}</code></li>\n<li><code>**/test.{cts,mts,ts}</code></li>\n<li><code>**/test/**/*.{cts,mts,ts}</code></li>\n</ul>\n<p>Alternatively, one or more glob patterns can be provided as the\nfinal argument(s) to the Node.js command, as shown below.\nGlob patterns follow the behavior of <a href=\"https://man7.org/linux/man-pages/man7/glob.7.html\"><code>glob(7)</code></a>.\nThe glob patterns should be enclosed in double quotes on the command line to\nprevent shell expansion, which can reduce portability across systems.</p>\n<pre><code class=\"language-bash\">node --test \"**/*.test.js\" \"**/*.spec.js\"\n</code></pre>",
          "modules": [
            {
              "textRaw": "Randomizing tests execution order",
              "name": "randomizing_tests_execution_order",
              "type": "module",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>The test runner can randomize execution order to help detect\norder-dependent tests. When enabled, the runner randomizes both discovered\ntest files and queued tests within each file. Use <code>--test-randomize</code> to\nenable this mode.</p>\n<pre><code class=\"language-bash\">node --test --test-randomize\n</code></pre>\n<p>When randomization is enabled, the test runner prints the seed used for the run\nas a diagnostic message:</p>\n<pre><code class=\"language-text\">Randomized test order seed: 12345\n</code></pre>\n<p>Use <code>--test-random-seed=&#x3C;number></code> to replay the same randomized order\ndeterministically. Supplying <code>--test-random-seed</code> also enables randomization,\nso <code>--test-randomize</code> is optional when a seed is provided:</p>\n<pre><code class=\"language-bash\">node --test --test-random-seed=12345\n</code></pre>\n<p>In most test files, randomization works automatically. One important exception\nis when subtests are awaited one by one. In that pattern, each subtest starts\nonly after the previous one finishes, so the runner keeps declaration order\ninstead of randomizing it.</p>\n<p>Example: this runs sequentially and is <strong>not</strong> randomized.</p>\n<pre><code class=\"language-mjs\">import test from 'node:test';\n\ntest('math', async (t) => {\n  for (const name of ['adds', 'subtracts', 'multiplies']) {\n    // Sequentially awaiting each subtest preserves declaration order.\n    await t.test(name, async () => {});\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const test = require('node:test');\n\ntest('math', async (t) => {\n  for (const name of ['adds', 'subtracts', 'multiplies']) {\n    // Sequentially awaiting each subtest preserves declaration order.\n    await t.test(name, async () => {});\n  }\n});\n</code></pre>\n<p>Using suite-style APIs such as <code>describe()</code>/<code>it()</code> or <code>suite()</code>/<code>test()</code>\nstill allows randomization, because sibling tests are enqueued together.</p>\n<p>Example: this remains eligible for randomization.</p>\n<pre><code class=\"language-mjs\">import { describe, it } from 'node:test';\n\ndescribe('math', () => {\n  it('adds', () => {});\n  it('subtracts', () => {});\n  it('multiplies', () => {});\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { describe, it } = require('node:test');\n\ndescribe('math', () => {\n  it('adds', () => {});\n  it('subtracts', () => {});\n  it('multiplies', () => {});\n});\n</code></pre>\n<p><code>--test-randomize</code> and <code>--test-random-seed</code> are not supported with <code>--watch</code> mode.</p>\n<p>Matching files are executed as test files.\nMore information on the test file execution can be found\nin the <a href=\"#test-runner-execution-model\">test runner execution model</a> section.</p>",
              "displayName": "Randomizing tests execution order"
            },
            {
              "textRaw": "Test runner execution model",
              "name": "test_runner_execution_model",
              "type": "module",
              "desc": "<p>When process-level test isolation is enabled, each matching test file is\nexecuted in a separate child process. The maximum number of child processes\nrunning at any time is controlled by the <a href=\"cli.html#--test-concurrency\"><code>--test-concurrency</code></a> flag. If the\nchild process finishes with an exit code of 0, the test is considered passing.\nOtherwise, the test is considered to be a failure. Test files must be executable\nby Node.js, but are not required to use the <code>node:test</code> module internally.</p>\n<p>Each test file is executed as if it was a regular script. That is, if the test\nfile itself uses <code>node:test</code> to define tests, all of those tests will be\nexecuted within a single application thread, regardless of the value of the\n<code>concurrency</code> option of <a href=\"#testname-options-fn\"><code>test()</code></a>.</p>\n<p>When process-level test isolation is disabled, each matching test file is\nimported into the test runner process. Once all test files have been loaded, the\ntop level tests are executed with a concurrency of one. Because the test files\nare all run within the same context, it is possible for tests to interact with\neach other in ways that are not possible when isolation is enabled. For example,\nif a test relies on global state, it is possible for that state to be modified\nby a test originating from another file.</p>",
              "modules": [
                {
                  "textRaw": "Child process option inheritance",
                  "name": "child_process_option_inheritance",
                  "type": "module",
                  "desc": "<p>When running tests in process isolation mode (the default), spawned child processes\ninherit Node.js options from the parent process, including those specified in\n<a href=\"cli.html#--experimental-config-filepath---experimental-config-file\">configuration files</a>. However, certain flags are filtered out to enable proper\ntest runner functionality:</p>\n<ul>\n<li><code>--test</code> - Prevented to avoid recursive test execution</li>\n<li><code>--experimental-test-coverage</code> - Managed by the test runner</li>\n<li><code>--experimental-test-tag-filter</code> - Filter values are validated by the parent\nprocess and re-emitted to child processes</li>\n<li><code>--watch</code> - Watch mode is handled at the parent level</li>\n<li><code>--experimental-default-config-file</code> - Config file loading is handled by the parent</li>\n<li><code>--test-reporter</code> - Reporting is managed by the parent process</li>\n<li><code>--test-reporter-destination</code> - Output destinations are controlled by the parent</li>\n<li><code>--experimental-config-file</code> - Config file paths are managed by the parent</li>\n<li><code>--test-randomize</code> - Randomization is managed by the parent process and\npropagated to child processes</li>\n<li><code>--test-random-seed</code> - Randomization seed is managed by the parent process and\npropagated to child processes</li>\n</ul>\n<p>All other Node.js options from command line arguments, environment variables,\nand configuration files are inherited by the child processes.</p>",
                  "displayName": "Child process option inheritance"
                }
              ],
              "displayName": "Test runner execution model"
            }
          ],
          "displayName": "Running tests from the command line"
        },
        {
          "textRaw": "Collecting code coverage",
          "name": "collecting_code_coverage",
          "type": "module",
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>When Node.js is started with the <a href=\"cli.html#--experimental-test-coverage\"><code>--experimental-test-coverage</code></a>\ncommand-line flag, code coverage is collected and statistics are reported once\nall tests have completed. If the <a href=\"cli.html#node_v8_coveragedir\"><code>NODE_V8_COVERAGE</code></a> environment variable is\nused to specify a code coverage directory, the generated V8 coverage files are\nwritten to that directory. Node.js core modules and files within\n<code>node_modules/</code> directories are, by default, not included in the coverage report.\nHowever, they can be explicitly included via the <a href=\"cli.html#--test-coverage-include\"><code>--test-coverage-include</code></a> flag.\nBy default all the matching test files are excluded from the coverage report.\nExclusions can be overridden by using the <a href=\"cli.html#--test-coverage-exclude\"><code>--test-coverage-exclude</code></a> flag.\nIf coverage is enabled, the coverage report is sent to any <a href=\"#test-reporters\">test reporters</a> via\nthe <code>'test:coverage'</code> event.</p>\n<p>Coverage can be disabled on a series of lines using the following\ncomment syntax:</p>\n<pre><code class=\"language-js\">/* node:coverage disable */\nif (anAlwaysFalseCondition) {\n  // Code in this branch will never be executed, but the lines are ignored for\n  // coverage purposes. All lines following the 'disable' comment are ignored\n  // until a corresponding 'enable' comment is encountered.\n  console.log('this is never executed');\n}\n/* node:coverage enable */\n</code></pre>\n<p>Coverage can also be disabled for a specified number of lines. After the\nspecified number of lines, coverage will be automatically reenabled. If the\nnumber of lines is not explicitly provided, a single line is ignored.</p>\n<pre><code class=\"language-js\">/* node:coverage ignore next */\nif (anAlwaysFalseCondition) { console.log('this is never executed'); }\n\n/* node:coverage ignore next 3 */\nif (anAlwaysFalseCondition) {\n  console.log('this is never executed');\n}\n</code></pre>",
          "modules": [
            {
              "textRaw": "Coverage reporters",
              "name": "coverage_reporters",
              "type": "module",
              "desc": "<p>The tap and spec reporters will print a summary of the coverage statistics.\nThere is also an lcov reporter that will generate an lcov file which can be\nused as an in depth coverage report.</p>\n<pre><code class=\"language-bash\">node --test --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info\n</code></pre>\n<ul>\n<li>No test results are reported by this reporter.</li>\n<li>This reporter should ideally be used alongside another reporter.</li>\n</ul>",
              "displayName": "Coverage reporters"
            }
          ],
          "displayName": "Collecting code coverage"
        },
        {
          "textRaw": "Mocking",
          "name": "mocking",
          "type": "module",
          "desc": "<p>The <code>node:test</code> module supports mocking during testing via a top-level <code>mock</code>\nobject. The following example creates a spy on a function that adds two numbers\ntogether. The spy is then used to assert that the function was called as\nexpected.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { mock, test } from 'node:test';\n\ntest('spies on a function', () => {\n  const sum = mock.fn((a, b) => {\n    return a + b;\n  });\n\n  assert.strictEqual(sum.mock.callCount(), 0);\n  assert.strictEqual(sum(3, 4), 7);\n  assert.strictEqual(sum.mock.callCount(), 1);\n\n  const call = sum.mock.calls[0];\n  assert.deepStrictEqual(call.arguments, [3, 4]);\n  assert.strictEqual(call.result, 7);\n  assert.strictEqual(call.error, undefined);\n\n  // Reset the globally tracked mocks.\n  mock.reset();\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { mock, test } = require('node:test');\n\ntest('spies on a function', () => {\n  const sum = mock.fn((a, b) => {\n    return a + b;\n  });\n\n  assert.strictEqual(sum.mock.callCount(), 0);\n  assert.strictEqual(sum(3, 4), 7);\n  assert.strictEqual(sum.mock.callCount(), 1);\n\n  const call = sum.mock.calls[0];\n  assert.deepStrictEqual(call.arguments, [3, 4]);\n  assert.strictEqual(call.result, 7);\n  assert.strictEqual(call.error, undefined);\n\n  // Reset the globally tracked mocks.\n  mock.reset();\n});\n</code></pre>\n<p>The same mocking functionality is also exposed on the <a href=\"#class-testcontext\"><code>TestContext</code></a> object\nof each test. The following example creates a spy on an object method using the\nAPI exposed on the <code>TestContext</code>. The benefit of mocking via the test context is\nthat the test runner will automatically restore all mocked functionality once\nthe test finishes.</p>\n<pre><code class=\"language-js\">test('spies on an object method', (t) => {\n  const number = {\n    value: 5,\n    add(a) {\n      return this.value + a;\n    },\n  };\n\n  t.mock.method(number, 'add');\n  assert.strictEqual(number.add.mock.callCount(), 0);\n  assert.strictEqual(number.add(3), 8);\n  assert.strictEqual(number.add.mock.callCount(), 1);\n\n  const call = number.add.mock.calls[0];\n\n  assert.deepStrictEqual(call.arguments, [3]);\n  assert.strictEqual(call.result, 8);\n  assert.strictEqual(call.target, undefined);\n  assert.strictEqual(call.this, number);\n});\n</code></pre>",
          "modules": [
            {
              "textRaw": "Timers",
              "name": "timers",
              "type": "module",
              "desc": "<p>Mocking timers is a technique commonly used in software testing to simulate and\ncontrol the behavior of timers, such as <code>setInterval</code> and <code>setTimeout</code>,\nwithout actually waiting for the specified time intervals.</p>\n<p>Refer to the <a href=\"#class-mocktimers\"><code>MockTimers</code></a> class for a full list of methods and features.</p>\n<p>This allows developers to write more reliable and\npredictable tests for time-dependent functionality.</p>\n<p>The example below shows how to mock <code>setTimeout</code>.\nUsing <code>.enable({ apis: ['setTimeout'] });</code>\nit will mock the <code>setTimeout</code> functions in the <a href=\"./timers.html\">node:timers</a> and\n<a href=\"./timers.html#timers-promises-api\">node:timers/promises</a> modules,\nas well as from the Node.js global context.</p>\n<p><strong>Note:</strong> Destructuring functions such as\n<code>import { setTimeout } from 'node:timers'</code>\nis currently not supported by this API.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { mock, test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', () => {\n  const fn = mock.fn();\n\n  // Optionally choose what to mock\n  mock.timers.enable({ apis: ['setTimeout'] });\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n\n  // Reset the globally tracked mocks.\n  mock.timers.reset();\n\n  // If you call reset mock instance, it will also reset timers instance\n  mock.reset();\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { mock, test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', () => {\n  const fn = mock.fn();\n\n  // Optionally choose what to mock\n  mock.timers.enable({ apis: ['setTimeout'] });\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n\n  // Reset the globally tracked mocks.\n  mock.timers.reset();\n\n  // If you call reset mock instance, it will also reset timers instance\n  mock.reset();\n});\n</code></pre>\n<p>The same mocking functionality is also exposed in the mock property on the <a href=\"#class-testcontext\"><code>TestContext</code></a> object\nof each test. The benefit of mocking via the test context is\nthat the test runner will automatically restore all mocked timers\nfunctionality once the test finishes.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>",
              "displayName": "Timers"
            },
            {
              "textRaw": "Dates",
              "name": "dates",
              "type": "module",
              "desc": "<p>The mock timers API also allows the mocking of the <code>Date</code> object. This is a\nuseful feature for testing time-dependent functionality, or to simulate\ninternal calendar functions such as <code>Date.now()</code>.</p>\n<p>The dates implementation is also part of the <a href=\"#class-mocktimers\"><code>MockTimers</code></a> class. Refer to it\nfor a full list of methods and features.</p>\n<p><strong>Note:</strong> Dates and timers are dependent when mocked together. This means that\nif you have both the <code>Date</code> and <code>setTimeout</code> mocked, advancing the time will\nalso advance the mocked date as they simulate a single internal clock.</p>\n<p>The example below show how to mock the <code>Date</code> object and obtain the current\n<code>Date.now()</code> value.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks the Date object', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['Date'] });\n  // If not specified, the initial date will be based on 0 in the UNIX epoch\n  assert.strictEqual(Date.now(), 0);\n\n  // Advance in time will also advance the date\n  context.mock.timers.tick(9999);\n  assert.strictEqual(Date.now(), 9999);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks the Date object', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['Date'] });\n  // If not specified, the initial date will be based on 0 in the UNIX epoch\n  assert.strictEqual(Date.now(), 0);\n\n  // Advance in time will also advance the date\n  context.mock.timers.tick(9999);\n  assert.strictEqual(Date.now(), 9999);\n});\n</code></pre>\n<p>If there is no initial epoch set, the initial date will be based on 0 in the\nUnix epoch. This is January 1st, 1970, 00:00:00 UTC. You can set an initial date\nby passing a <code>now</code> property to the <code>.enable()</code> method. This value will be used\nas the initial date for the mocked <code>Date</code> object. It can either be a positive\ninteger, or another Date object.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks the Date object with initial time', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['Date'], now: 100 });\n  assert.strictEqual(Date.now(), 100);\n\n  // Advance in time will also advance the date\n  context.mock.timers.tick(200);\n  assert.strictEqual(Date.now(), 300);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks the Date object with initial time', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['Date'], now: 100 });\n  assert.strictEqual(Date.now(), 100);\n\n  // Advance in time will also advance the date\n  context.mock.timers.tick(200);\n  assert.strictEqual(Date.now(), 300);\n});\n</code></pre>\n<p>You can use the <code>.setTime()</code> method to manually move the mocked date to another\ntime. This method only accepts a positive integer.</p>\n<p><strong>Note:</strong> This method will <strong>not</strong> execute any mocked timers that are in the past\nfrom the new time.</p>\n<p>In the below example we are setting a new time for the mocked date.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('sets the time of a date object', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['Date'], now: 100 });\n  assert.strictEqual(Date.now(), 100);\n\n  // Advance in time will also advance the date\n  context.mock.timers.setTime(1000);\n  context.mock.timers.tick(200);\n  assert.strictEqual(Date.now(), 1200);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('sets the time of a date object', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['Date'], now: 100 });\n  assert.strictEqual(Date.now(), 100);\n\n  // Advance in time will also advance the date\n  context.mock.timers.setTime(1000);\n  context.mock.timers.tick(200);\n  assert.strictEqual(Date.now(), 1200);\n});\n</code></pre>\n<p>Timers scheduled in the past will <strong>not</strong> run when you call <code>setTime()</code>. To execute those timers, you can use\nthe <code>.tick()</code> method to move forward from the new time.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('setTime does not execute timers', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  const fn = context.mock.fn();\n  setTimeout(fn, 1000);\n\n  context.mock.timers.setTime(800);\n  // Timer is not executed as the time is not yet reached\n  assert.strictEqual(fn.mock.callCount(), 0);\n  assert.strictEqual(Date.now(), 800);\n\n  context.mock.timers.setTime(1200);\n  // Timer is still not executed\n  assert.strictEqual(fn.mock.callCount(), 0);\n  // Advance in time to execute the timer\n  context.mock.timers.tick(0);\n  assert.strictEqual(fn.mock.callCount(), 1);\n  assert.strictEqual(Date.now(), 1200);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('runs timers as setTime passes ticks', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  const fn = context.mock.fn();\n  setTimeout(fn, 1000);\n\n  context.mock.timers.setTime(800);\n  // Timer is not executed as the time is not yet reached\n  assert.strictEqual(fn.mock.callCount(), 0);\n  assert.strictEqual(Date.now(), 800);\n\n  context.mock.timers.setTime(1200);\n  // Timer is executed as the time is now reached\n  assert.strictEqual(fn.mock.callCount(), 1);\n  assert.strictEqual(Date.now(), 1200);\n});\n</code></pre>\n<p>Using <code>.runAll()</code> will execute all timers that are currently in the queue. This\nwill also advance the mocked date to the time of the last timer that was\nexecuted as if the time has passed.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('runs timers as setTime passes ticks', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  const fn = context.mock.fn();\n  setTimeout(fn, 1000);\n  setTimeout(fn, 2000);\n  setTimeout(fn, 3000);\n\n  context.mock.timers.runAll();\n  // All timers are executed as the time is now reached\n  assert.strictEqual(fn.mock.callCount(), 3);\n  assert.strictEqual(Date.now(), 3000);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('runs timers as setTime passes ticks', (context) => {\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  const fn = context.mock.fn();\n  setTimeout(fn, 1000);\n  setTimeout(fn, 2000);\n  setTimeout(fn, 3000);\n\n  context.mock.timers.runAll();\n  // All timers are executed as the time is now reached\n  assert.strictEqual(fn.mock.callCount(), 3);\n  assert.strictEqual(Date.now(), 3000);\n});\n</code></pre>",
              "displayName": "Dates"
            }
          ],
          "displayName": "Mocking"
        },
        {
          "textRaw": "Snapshot testing",
          "name": "snapshot_testing",
          "type": "module",
          "meta": {
            "added": [
              "v22.3.0"
            ],
            "changes": [
              {
                "version": "v23.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/55897",
                "description": "Snapshot testing is no longer experimental."
              }
            ]
          },
          "desc": "<p>Snapshot tests allow arbitrary values to be serialized into string values and\ncompared against a set of known good values. The known good values are known as\nsnapshots, and are stored in a snapshot file. Snapshot files are managed by the\ntest runner, but are designed to be human readable to aid in debugging. Best\npractice is for snapshot files to be checked into source control along with your\ntest files.</p>\n<p>Snapshot files are generated by starting Node.js with the\n<a href=\"cli.html#--test-update-snapshots\"><code>--test-update-snapshots</code></a> command-line flag. A separate snapshot file is\ngenerated for each test file. By default, the snapshot file has the same name\nas the test file with a <code>.snapshot</code> file extension. This behavior can be\nconfigured using the <code>snapshot.setResolveSnapshotPath()</code> function. Each\nsnapshot assertion corresponds to an export in the snapshot file.</p>\n<p>An example snapshot test is shown below. The first time this test is executed,\nit will fail because the corresponding snapshot file does not exist.</p>\n<pre><code class=\"language-js\">// test.js\nsuite('suite of snapshot tests', () => {\n  test('snapshot test', (t) => {\n    t.assert.snapshot({ value1: 1, value2: 2 });\n    t.assert.snapshot(5);\n  });\n});\n</code></pre>\n<p>Generate the snapshot file by running the test file with\n<code>--test-update-snapshots</code>. The test should pass, and a file named\n<code>test.js.snapshot</code> is created in the same directory as the test file. The\ncontents of the snapshot file are shown below. Each snapshot is identified by\nthe full name of test and a counter to differentiate between snapshots in the\nsame test.</p>\n<pre><code class=\"language-js\">exports[`suite of snapshot tests > snapshot test 1`] = `\n{\n  \"value1\": 1,\n  \"value2\": 2\n}\n`;\n\nexports[`suite of snapshot tests > snapshot test 2`] = `\n5\n`;\n</code></pre>\n<p>Once the snapshot file is created, run the tests again without the\n<code>--test-update-snapshots</code> flag. The tests should pass now.</p>",
          "displayName": "Snapshot testing"
        },
        {
          "textRaw": "Test reporters",
          "name": "test_reporters",
          "type": "module",
          "meta": {
            "added": [
              "v19.6.0",
              "v18.15.0"
            ],
            "changes": [
              {
                "version": "v23.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/54548",
                "description": "The default reporter on non-TTY stdout is changed from `tap` to `spec`, aligning with TTY stdout."
              },
              {
                "version": [
                  "v19.9.0",
                  "v18.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/47238",
                "description": "Reporters are now exposed at `node:test/reporters`."
              }
            ]
          },
          "desc": "<p>The <code>node:test</code> module supports passing <a href=\"cli.html#--test-reporter\"><code>--test-reporter</code></a>\nflags for the test runner to use a specific reporter.</p>\n<p>The following built-reporters are supported:</p>\n<ul>\n<li>\n<p><code>spec</code>\nThe <code>spec</code> reporter outputs the test results in a human-readable format. This\nis the default reporter.</p>\n</li>\n<li>\n<p><code>tap</code>\nThe <code>tap</code> reporter outputs the test results in the <a href=\"https://testanything.org/\">TAP</a> format.</p>\n</li>\n<li>\n<p><code>dot</code>\nThe <code>dot</code> reporter outputs the test results in a compact format,\nwhere each passing test is represented by a <code>.</code>,\nand each failing test is represented by a <code>X</code>.</p>\n</li>\n<li>\n<p><code>junit</code>\nThe junit reporter outputs test results in a jUnit XML format</p>\n</li>\n<li>\n<p><code>lcov</code>\nThe <code>lcov</code> reporter outputs test coverage when used with the\n<a href=\"cli.html#--experimental-test-coverage\"><code>--experimental-test-coverage</code></a> flag.</p>\n</li>\n</ul>\n<p>The exact output of these reporters is subject to change between versions of\nNode.js, and should not be relied on programmatically. If programmatic access\nto the test runner's output is required, use the events emitted by the\n<a href=\"test.html#class-testsstream\"><code>&#x3C;TestsStream></code></a>.</p>\n<p>The reporters are available via the <code>node:test/reporters</code> module:</p>\n<pre><code class=\"language-mjs\">import { tap, spec, dot, junit, lcov } from 'node:test/reporters';\n</code></pre>\n<pre><code class=\"language-cjs\">const { tap, spec, dot, junit, lcov } = require('node:test/reporters');\n</code></pre>",
          "modules": [
            {
              "textRaw": "Custom reporters",
              "name": "custom_reporters",
              "type": "module",
              "desc": "<p><a href=\"cli.html#--test-reporter\"><code>--test-reporter</code></a> can be used to specify a path to custom reporter.\nA custom reporter is a module that exports a value\naccepted by <a href=\"stream.html#streamcomposestreams\">stream.compose</a>.\nReporters should transform events emitted by a <a href=\"test.html#class-testsstream\"><code>&#x3C;TestsStream></code></a></p>\n<p>Example of a custom reporter using <a href=\"stream.html#class-streamtransform\"><code>&#x3C;stream.Transform></code></a>:</p>\n<pre><code class=\"language-mjs\">import { Transform } from 'node:stream';\n\nconst customReporter = new Transform({\n  writableObjectMode: true,\n  transform(event, encoding, callback) {\n    switch (event.type) {\n      case 'test:dequeue':\n        callback(null, `test ${event.data.name} dequeued`);\n        break;\n      case 'test:enqueue':\n        callback(null, `test ${event.data.name} enqueued`);\n        break;\n      case 'test:watch:drained':\n        callback(null, 'test watch queue drained');\n        break;\n      case 'test:watch:restarted':\n        callback(null, 'test watch restarted due to file change');\n        break;\n      case 'test:start':\n        callback(null, `test ${event.data.name} started`);\n        break;\n      case 'test:pass':\n        callback(null, `test ${event.data.name} passed`);\n        break;\n      case 'test:fail':\n        callback(null, `test ${event.data.name} failed`);\n        break;\n      case 'test:plan':\n        callback(null, 'test plan');\n        break;\n      case 'test:diagnostic':\n      case 'test:stderr':\n      case 'test:stdout':\n        callback(null, event.data.message);\n        break;\n      case 'test:coverage': {\n        const { totalLineCount } = event.data.summary.totals;\n        callback(null, `total line count: ${totalLineCount}\\n`);\n        break;\n      }\n    }\n  },\n});\n\nexport default customReporter;\n</code></pre>\n<pre><code class=\"language-cjs\">const { Transform } = require('node:stream');\n\nconst customReporter = new Transform({\n  writableObjectMode: true,\n  transform(event, encoding, callback) {\n    switch (event.type) {\n      case 'test:dequeue':\n        callback(null, `test ${event.data.name} dequeued`);\n        break;\n      case 'test:enqueue':\n        callback(null, `test ${event.data.name} enqueued`);\n        break;\n      case 'test:watch:drained':\n        callback(null, 'test watch queue drained');\n        break;\n      case 'test:watch:restarted':\n        callback(null, 'test watch restarted due to file change');\n        break;\n      case 'test:start':\n        callback(null, `test ${event.data.name} started`);\n        break;\n      case 'test:pass':\n        callback(null, `test ${event.data.name} passed`);\n        break;\n      case 'test:fail':\n        callback(null, `test ${event.data.name} failed`);\n        break;\n      case 'test:plan':\n        callback(null, 'test plan');\n        break;\n      case 'test:diagnostic':\n      case 'test:stderr':\n      case 'test:stdout':\n        callback(null, event.data.message);\n        break;\n      case 'test:coverage': {\n        const { totalLineCount } = event.data.summary.totals;\n        callback(null, `total line count: ${totalLineCount}\\n`);\n        break;\n      }\n    }\n  },\n});\n\nmodule.exports = customReporter;\n</code></pre>\n<p>Example of a custom reporter using a generator function:</p>\n<pre><code class=\"language-mjs\">export default async function * customReporter(source) {\n  for await (const event of source) {\n    switch (event.type) {\n      case 'test:dequeue':\n        yield `test ${event.data.name} dequeued\\n`;\n        break;\n      case 'test:enqueue':\n        yield `test ${event.data.name} enqueued\\n`;\n        break;\n      case 'test:watch:drained':\n        yield 'test watch queue drained\\n';\n        break;\n      case 'test:watch:restarted':\n        yield 'test watch restarted due to file change\\n';\n        break;\n      case 'test:start':\n        yield `test ${event.data.name} started\\n`;\n        break;\n      case 'test:pass':\n        yield `test ${event.data.name} passed\\n`;\n        break;\n      case 'test:fail':\n        yield `test ${event.data.name} failed\\n`;\n        break;\n      case 'test:plan':\n        yield 'test plan\\n';\n        break;\n      case 'test:diagnostic':\n      case 'test:stderr':\n      case 'test:stdout':\n        yield `${event.data.message}\\n`;\n        break;\n      case 'test:coverage': {\n        const { totalLineCount } = event.data.summary.totals;\n        yield `total line count: ${totalLineCount}\\n`;\n        break;\n      }\n    }\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">module.exports = async function * customReporter(source) {\n  for await (const event of source) {\n    switch (event.type) {\n      case 'test:dequeue':\n        yield `test ${event.data.name} dequeued\\n`;\n        break;\n      case 'test:enqueue':\n        yield `test ${event.data.name} enqueued\\n`;\n        break;\n      case 'test:watch:drained':\n        yield 'test watch queue drained\\n';\n        break;\n      case 'test:watch:restarted':\n        yield 'test watch restarted due to file change\\n';\n        break;\n      case 'test:start':\n        yield `test ${event.data.name} started\\n`;\n        break;\n      case 'test:pass':\n        yield `test ${event.data.name} passed\\n`;\n        break;\n      case 'test:fail':\n        yield `test ${event.data.name} failed\\n`;\n        break;\n      case 'test:plan':\n        yield 'test plan\\n';\n        break;\n      case 'test:diagnostic':\n      case 'test:stderr':\n      case 'test:stdout':\n        yield `${event.data.message}\\n`;\n        break;\n      case 'test:coverage': {\n        const { totalLineCount } = event.data.summary.totals;\n        yield `total line count: ${totalLineCount}\\n`;\n        break;\n      }\n    }\n  }\n};\n</code></pre>\n<p>The value provided to <code>--test-reporter</code> should be a string like one used in an\n<code>import()</code> in JavaScript code, or a value provided for <a href=\"cli.html#--importmodule\"><code>--import</code></a>.</p>",
              "displayName": "Custom reporters"
            },
            {
              "textRaw": "Multiple reporters",
              "name": "multiple_reporters",
              "type": "module",
              "desc": "<p>The <a href=\"cli.html#--test-reporter\"><code>--test-reporter</code></a> flag can be specified multiple times to report test\nresults in several formats. In this situation\nit is required to specify a destination for each reporter\nusing <a href=\"cli.html#--test-reporter-destination\"><code>--test-reporter-destination</code></a>.\nDestination can be <code>stdout</code>, <code>stderr</code>, or a file path.\nReporters and destinations are paired according\nto the order they were specified.</p>\n<p>In the following example, the <code>spec</code> reporter will output to <code>stdout</code>,\nand the <code>dot</code> reporter will output to <code>file.txt</code>:</p>\n<pre><code class=\"language-bash\">node --test-reporter=spec --test-reporter=dot --test-reporter-destination=stdout --test-reporter-destination=file.txt\n</code></pre>\n<p>When a single reporter is specified, the destination will default to <code>stdout</code>,\nunless a destination is explicitly provided.</p>",
              "displayName": "Multiple reporters"
            }
          ],
          "displayName": "Test reporters"
        },
        {
          "textRaw": "`assert`",
          "name": "`assert`",
          "type": "module",
          "meta": {
            "added": [
              "v23.7.0",
              "v22.14.0"
            ],
            "changes": []
          },
          "desc": "<p>An object whose methods are used to configure available assertions on the\n<code>TestContext</code> objects in the current process. The methods from <code>node:assert</code>\nand snapshot testing functions are available by default.</p>\n<p>It is possible to apply the same configuration to all files by placing common\nconfiguration code in a module\npreloaded with <code>--require</code> or <code>--import</code>.</p>",
          "methods": [
            {
              "textRaw": "`assert.register(name, fn)`",
              "name": "register",
              "type": "method",
              "meta": {
                "added": [
                  "v23.7.0",
                  "v22.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "name"
                    },
                    {
                      "name": "fn"
                    }
                  ]
                }
              ],
              "desc": "<p>Defines a new assertion function with the provided name and function. If an\nassertion already exists with the same name, it is overwritten.</p>"
            }
          ],
          "displayName": "`assert`"
        },
        {
          "textRaw": "`snapshot`",
          "name": "`snapshot`",
          "type": "module",
          "meta": {
            "added": [
              "v22.3.0"
            ],
            "changes": []
          },
          "desc": "<p>An object whose methods are used to configure default snapshot settings in the\ncurrent process. It is possible to apply the same configuration to all files by\nplacing common configuration code in a module preloaded with <code>--require</code> or\n<code>--import</code>.</p>",
          "methods": [
            {
              "textRaw": "`snapshot.setDefaultSnapshotSerializers(serializers)`",
              "name": "setDefaultSnapshotSerializers",
              "type": "method",
              "meta": {
                "added": [
                  "v22.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`serializers` {Array} An array of synchronous functions used as the default serializers for snapshot tests.",
                      "name": "serializers",
                      "type": "Array",
                      "desc": "An array of synchronous functions used as the default serializers for snapshot tests."
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to customize the default serialization mechanism used by\nthe test runner. By default, the test runner performs serialization by calling\n<code>JSON.stringify(value, null, 2)</code> on the provided value. <code>JSON.stringify()</code> does\nhave limitations regarding circular structures and supported data types. If a\nmore robust serialization mechanism is required, this function should be used.</p>"
            },
            {
              "textRaw": "`snapshot.setResolveSnapshotPath(fn)`",
              "name": "setResolveSnapshotPath",
              "type": "method",
              "meta": {
                "added": [
                  "v22.3.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function} A function used to compute the location of the snapshot file. The function receives the path of the test file as its only argument. If the test is not associated with a file (for example in the REPL), the input is undefined. `fn()` must return a string specifying the location of the snapshot snapshot file.",
                      "name": "fn",
                      "type": "Function",
                      "desc": "A function used to compute the location of the snapshot file. The function receives the path of the test file as its only argument. If the test is not associated with a file (for example in the REPL), the input is undefined. `fn()` must return a string specifying the location of the snapshot snapshot file."
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to customize the location of the snapshot file used for\nsnapshot testing. By default, the snapshot filename is the same as the entry\npoint filename with a <code>.snapshot</code> file extension.</p>"
            }
          ],
          "displayName": "`snapshot`"
        },
        {
          "textRaw": "Test instrumentation and OpenTelemetry",
          "name": "test_instrumentation_and_opentelemetry",
          "type": "module",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "desc": "<p>The test runner publishes test execution events through the Node.js\n<a href=\"diagnostics_channel.html\"><code>diagnostics_channel</code></a> module, enabling integration with observability tools\nlike OpenTelemetry without requiring changes to the test runner itself.</p>",
          "modules": [
            {
              "textRaw": "Tracing events",
              "name": "tracing_events",
              "type": "module",
              "desc": "<p>The test runner publishes events to the <code>'node.test'</code> tracing channel. Subscribers\ncan use the <a href=\"diagnostics_channel.html#class-tracingchannel\"><code>TracingChannel</code></a> API to bind context or perform custom\ninstrumentation.</p>",
              "modules": [
                {
                  "textRaw": "Channel: `'tracing:node.test:start'`",
                  "name": "channel:_`'tracing:node.test:start'`",
                  "type": "module",
                  "desc": "<ul>\n<li><code>data</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The name of the test.</li>\n<li><code>nesting</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The nesting level of the test.</li>\n<li><code>file</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The path to the test file, or <code>undefined</code> when\nrunning in the REPL.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The type of test. Either <code>'test'</code> or <code>'suite'</code>.</li>\n</ul>\n</li>\n</ul>\n<p>Emitted when a test or suite starts execution. The test's span encompasses all\nof its before, beforeEach, and afterEach hooks, as well as the test body.</p>",
                  "displayName": "Channel: `'tracing:node.test:start'`"
                },
                {
                  "textRaw": "Channel: `'tracing:node.test:end'`",
                  "name": "channel:_`'tracing:node.test:end'`",
                  "type": "module",
                  "desc": "<ul>\n<li><code>data</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The name of the test.</li>\n<li><code>nesting</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The nesting level of the test.</li>\n<li><code>file</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The path to the test file, or <code>undefined</code> when\nrunning in the REPL.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The type of test. Either <code>'test'</code> or <code>'suite'</code>.</li>\n</ul>\n</li>\n</ul>\n<p>Emitted when a test or suite finishes execution.</p>",
                  "displayName": "Channel: `'tracing:node.test:end'`"
                },
                {
                  "textRaw": "Channel: `'tracing:node.test:error'`",
                  "name": "channel:_`'tracing:node.test:error'`",
                  "type": "module",
                  "desc": "<ul>\n<li><code>data</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The name of the test.</li>\n<li><code>nesting</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The nesting level of the test.</li>\n<li><code>file</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> The path to the test file, or <code>undefined</code> when\nrunning in the REPL.</li>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The type of test. Either <code>'test'</code> or <code>'suite'</code>.</li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> The error that was thrown.</li>\n</ul>\n</li>\n</ul>\n<p>Emitted when a test or suite throws an error.</p>",
                  "displayName": "Channel: `'tracing:node.test:error'`"
                }
              ],
              "displayName": "Tracing events"
            },
            {
              "textRaw": "Context propagation with `bindStore()`",
              "name": "context_propagation_with_`bindstore()`",
              "type": "module",
              "desc": "<p>The tracing channel can be used to propagate context through test execution by\nbinding an <code>AsyncLocalStorage</code> instance. This allows context to be automatically\navailable in the test function and all async operations within the test.</p>\n<pre><code class=\"language-mjs\">import dc from 'node:diagnostics_channel';\nimport { AsyncLocalStorage } from 'node:async_hooks';\n\nconst testStorage = new AsyncLocalStorage();\nconst testChannel = dc.tracingChannel('node.test');\n\n// Bind context to test execution — the returned value becomes the store\ntestChannel.start.bindStore(testStorage, (data) => {\n  return { testName: data.name, startTime: Date.now() };\n});\n\n// Optionally handle errors and cleanup\ntestChannel.error.subscribe((data) => {\n  const store = testStorage.getStore();\n  console.log(`Test \"${data.name}\" failed after ${Date.now() - store.startTime}ms`);\n});\n\ntestChannel.end.subscribe((data) => {\n  const store = testStorage.getStore();\n  console.log(`Test \"${data.name}\" completed in ${Date.now() - store.startTime}ms`);\n});\n</code></pre>\n<p>When using <code>bindStore()</code>, the context provided will be automatically propagated\nto the test function and all async operations within the test, without requiring\nany additional instrumentation in the test code.</p>",
              "displayName": "Context propagation with `bindStore()`"
            }
          ],
          "displayName": "Test instrumentation and OpenTelemetry"
        }
      ],
      "methods": [
        {
          "textRaw": "`run([options])`",
          "name": "run",
          "type": "method",
          "meta": {
            "added": [
              "v18.9.0",
              "v16.19.0"
            ],
            "changes": [
              {
                "version": "v26.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/63221",
                "description": "Added the `testTagFilters` option."
              },
              {
                "version": [
                  "v25.6.0",
                  "v24.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/61367",
                "description": "Add the `env` option."
              },
              {
                "version": "v24.7.0",
                "pr-url": "https://github.com/nodejs/node/pull/59443",
                "description": "Added a rerunFailuresFilePath option."
              },
              {
                "version": "v23.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/54705",
                "description": "Added the `cwd` option."
              },
              {
                "version": [
                  "v23.0.0",
                  "v22.10.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/53937",
                "description": "Added coverage options."
              },
              {
                "version": "v22.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/53927",
                "description": "Added the `isolation` option."
              },
              {
                "version": "v22.6.0",
                "pr-url": "https://github.com/nodejs/node/pull/53866",
                "description": "Added the `globPatterns` option."
              },
              {
                "version": [
                  "v22.0.0",
                  "v20.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52038",
                "description": "Added the `forceExit` option."
              },
              {
                "version": [
                  "v20.1.0",
                  "v18.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/47628",
                "description": "Add a testNamePatterns option."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object} Configuration options for running tests. The following properties are supported:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Configuration options for running tests. The following properties are supported:",
                  "options": [
                    {
                      "textRaw": "`concurrency` {number|boolean} If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file. If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time. **Default:** `false`.",
                      "name": "concurrency",
                      "type": "number|boolean",
                      "default": "`false`",
                      "desc": "If a number is provided, then that many test processes would run in parallel, where each process corresponds to one test file. If `true`, it would run `os.availableParallelism() - 1` test files in parallel. If `false`, it would only run one test file at a time."
                    },
                    {
                      "textRaw": "`cwd` {string} Specifies the current working directory to be used by the test runner. Serves as the base path for resolving files as if running tests from the command line from that directory. **Default:** `process.cwd()`.",
                      "name": "cwd",
                      "type": "string",
                      "default": "`process.cwd()`",
                      "desc": "Specifies the current working directory to be used by the test runner. Serves as the base path for resolving files as if running tests from the command line from that directory."
                    },
                    {
                      "textRaw": "`files` {Array} An array containing the list of files to run. **Default:** Same as running tests from the command line.",
                      "name": "files",
                      "type": "Array",
                      "default": "Same as running tests from the command line",
                      "desc": "An array containing the list of files to run."
                    },
                    {
                      "textRaw": "`forceExit` {boolean} Configures the test runner to exit the process once all known tests have finished executing even if the event loop would otherwise remain active. **Default:** `false`.",
                      "name": "forceExit",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Configures the test runner to exit the process once all known tests have finished executing even if the event loop would otherwise remain active."
                    },
                    {
                      "textRaw": "`globPatterns` {Array} An array containing the list of glob patterns to match test files. This option cannot be used together with `files`. **Default:** Same as running tests from the command line.",
                      "name": "globPatterns",
                      "type": "Array",
                      "default": "Same as running tests from the command line",
                      "desc": "An array containing the list of glob patterns to match test files. This option cannot be used together with `files`."
                    },
                    {
                      "textRaw": "`inspectPort` {number|Function} Sets inspector port of test child process. This can be a number, or a function that takes no arguments and returns a number. If a nullish value is provided, each process gets its own port, incremented from the primary's `process.debugPort`. This option is ignored if the `isolation` option is set to `'none'` as no child processes are spawned. **Default:** `undefined`.",
                      "name": "inspectPort",
                      "type": "number|Function",
                      "default": "`undefined`",
                      "desc": "Sets inspector port of test child process. This can be a number, or a function that takes no arguments and returns a number. If a nullish value is provided, each process gets its own port, incremented from the primary's `process.debugPort`. This option is ignored if the `isolation` option is set to `'none'` as no child processes are spawned."
                    },
                    {
                      "textRaw": "`isolation` {string} Configures the type of test isolation. If set to `'process'`, each test file is run in a separate child process. If set to `'none'`, all test files run in the current process. **Default:** `'process'`.",
                      "name": "isolation",
                      "type": "string",
                      "default": "`'process'`",
                      "desc": "Configures the type of test isolation. If set to `'process'`, each test file is run in a separate child process. If set to `'none'`, all test files run in the current process."
                    },
                    {
                      "textRaw": "`only` {boolean} If truthy, the test context will only run tests that have the `only` option set",
                      "name": "only",
                      "type": "boolean",
                      "desc": "If truthy, the test context will only run tests that have the `only` option set"
                    },
                    {
                      "textRaw": "`setup` {Function} A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run. **Default:** `undefined`.",
                      "name": "setup",
                      "type": "Function",
                      "default": "`undefined`",
                      "desc": "A function that accepts the `TestsStream` instance and can be used to setup listeners before any tests are run."
                    },
                    {
                      "textRaw": "`execArgv` {Array} An array of CLI flags to pass to the `node` executable when spawning the subprocesses. This option has no effect when `isolation` is `'none`'. **Default:** `[]`",
                      "name": "execArgv",
                      "type": "Array",
                      "default": "`[]`",
                      "desc": "An array of CLI flags to pass to the `node` executable when spawning the subprocesses. This option has no effect when `isolation` is `'none`'."
                    },
                    {
                      "textRaw": "`argv` {Array} An array of CLI flags to pass to each test file when spawning the subprocesses. This option has no effect when `isolation` is `'none'`. **Default:** `[]`.",
                      "name": "argv",
                      "type": "Array",
                      "default": "`[]`",
                      "desc": "An array of CLI flags to pass to each test file when spawning the subprocesses. This option has no effect when `isolation` is `'none'`."
                    },
                    {
                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress test execution.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "Allows aborting an in-progress test execution."
                    },
                    {
                      "textRaw": "`testNamePatterns` {string|RegExp|Array} A String, RegExp or a RegExp Array, that can be used to only run tests whose name matches the provided pattern. Test name patterns are interpreted as JavaScript regular expressions. For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. **Default:** `undefined`.",
                      "name": "testNamePatterns",
                      "type": "string|RegExp|Array",
                      "default": "`undefined`",
                      "desc": "A String, RegExp or a RegExp Array, that can be used to only run tests whose name matches the provided pattern. Test name patterns are interpreted as JavaScript regular expressions. For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run."
                    },
                    {
                      "textRaw": "`testSkipPatterns` {string|RegExp|Array} A String, RegExp or a RegExp Array, that can be used to exclude running tests whose name matches the provided pattern. Test name patterns are interpreted as JavaScript regular expressions. For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run. **Default:** `undefined`.",
                      "name": "testSkipPatterns",
                      "type": "string|RegExp|Array",
                      "default": "`undefined`",
                      "desc": "A String, RegExp or a RegExp Array, that can be used to exclude running tests whose name matches the provided pattern. Test name patterns are interpreted as JavaScript regular expressions. For each test that is executed, any corresponding test hooks, such as `beforeEach()`, are also run."
                    },
                    {
                      "textRaw": "`testTagFilters` {string|string[]} A tag name, or an array of tag names, used to filter tests by their declared tags. Tests must contain every listed tag to run. Equivalent to passing `--experimental-test-tag-filter` on the command line. See Test tags. **Default:** `undefined`.",
                      "name": "testTagFilters",
                      "type": "string|string[]",
                      "default": "`undefined`",
                      "desc": "A tag name, or an array of tag names, used to filter tests by their declared tags. Tests must contain every listed tag to run. Equivalent to passing `--experimental-test-tag-filter` on the command line. See Test tags."
                    },
                    {
                      "textRaw": "`timeout` {number} A number of milliseconds the test execution will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                      "name": "timeout",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "A number of milliseconds the test execution will fail after. If unspecified, subtests inherit this value from their parent."
                    },
                    {
                      "textRaw": "`watch` {boolean} Whether to run in watch mode or not. **Default:** `false`.",
                      "name": "watch",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Whether to run in watch mode or not."
                    },
                    {
                      "textRaw": "`shard` {Object} Running tests in a specific shard. **Default:** `undefined`.",
                      "name": "shard",
                      "type": "Object",
                      "default": "`undefined`",
                      "desc": "Running tests in a specific shard.",
                      "options": [
                        {
                          "textRaw": "`index` {number} is a positive integer between 1 and {total} that specifies the index of the shard to run. This option is _required_.",
                          "name": "index",
                          "type": "number",
                          "desc": "is a positive integer between 1 and {total} that specifies the index of the shard to run. This option is _required_."
                        },
                        {
                          "textRaw": "`total` {number} is a positive integer that specifies the total number of shards to split the test files to. This option is _required_.",
                          "name": "total",
                          "type": "number",
                          "desc": "is a positive integer that specifies the total number of shards to split the test files to. This option is _required_."
                        }
                      ]
                    },
                    {
                      "textRaw": "`randomize` {boolean} Randomize execution order for test files and queued tests. This option is not supported with `watch: true`. **Default:** `false`.",
                      "name": "randomize",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Randomize execution order for test files and queued tests. This option is not supported with `watch: true`."
                    },
                    {
                      "textRaw": "`randomSeed` {number} Seed used when randomizing execution order. If this option is set, runs can replay the same randomized order deterministically, and setting this option also enables randomization. The value must be an integer between `0` and `4294967295`. **Default:** `undefined`.",
                      "name": "randomSeed",
                      "type": "number",
                      "default": "`undefined`",
                      "desc": "Seed used when randomizing execution order. If this option is set, runs can replay the same randomized order deterministically, and setting this option also enables randomization. The value must be an integer between `0` and `4294967295`."
                    },
                    {
                      "textRaw": "`rerunFailuresFilePath` {string} A file path where the test runner will store the state of the tests to allow rerunning only the failed tests on a next run. see [Rerunning failed tests][] for more information. **Default:** `undefined`.",
                      "name": "rerunFailuresFilePath",
                      "type": "string",
                      "default": "`undefined`",
                      "desc": "A file path where the test runner will store the state of the tests to allow rerunning only the failed tests on a next run. see [Rerunning failed tests][] for more information."
                    },
                    {
                      "textRaw": "`coverage` {boolean} enable code coverage collection. **Default:** `false`.",
                      "name": "coverage",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "enable code coverage collection."
                    },
                    {
                      "textRaw": "`coverageExcludeGlobs` {string|Array} Excludes specific files from code coverage using a glob pattern, which can match both absolute and relative file paths. This property is only applicable when `coverage` was set to `true`. If both `coverageExcludeGlobs` and `coverageIncludeGlobs` are provided, files must meet **both** criteria to be included in the coverage report. **Default:** `undefined`.",
                      "name": "coverageExcludeGlobs",
                      "type": "string|Array",
                      "default": "`undefined`",
                      "desc": "Excludes specific files from code coverage using a glob pattern, which can match both absolute and relative file paths. This property is only applicable when `coverage` was set to `true`. If both `coverageExcludeGlobs` and `coverageIncludeGlobs` are provided, files must meet **both** criteria to be included in the coverage report."
                    },
                    {
                      "textRaw": "`coverageIncludeGlobs` {string|Array} Includes specific files in code coverage using a glob pattern, which can match both absolute and relative file paths. This property is only applicable when `coverage` was set to `true`. If both `coverageExcludeGlobs` and `coverageIncludeGlobs` are provided, files must meet **both** criteria to be included in the coverage report. **Default:** `undefined`.",
                      "name": "coverageIncludeGlobs",
                      "type": "string|Array",
                      "default": "`undefined`",
                      "desc": "Includes specific files in code coverage using a glob pattern, which can match both absolute and relative file paths. This property is only applicable when `coverage` was set to `true`. If both `coverageExcludeGlobs` and `coverageIncludeGlobs` are provided, files must meet **both** criteria to be included in the coverage report."
                    },
                    {
                      "textRaw": "`lineCoverage` {number} Require a minimum percent of covered lines. If code coverage does not reach the threshold specified, the process will exit with code `1`. **Default:** `0`.",
                      "name": "lineCoverage",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Require a minimum percent of covered lines. If code coverage does not reach the threshold specified, the process will exit with code `1`."
                    },
                    {
                      "textRaw": "`branchCoverage` {number} Require a minimum percent of covered branches. If code coverage does not reach the threshold specified, the process will exit with code `1`. **Default:** `0`.",
                      "name": "branchCoverage",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Require a minimum percent of covered branches. If code coverage does not reach the threshold specified, the process will exit with code `1`."
                    },
                    {
                      "textRaw": "`functionCoverage` {number} Require a minimum percent of covered functions. If code coverage does not reach the threshold specified, the process will exit with code `1`. **Default:** `0`.",
                      "name": "functionCoverage",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Require a minimum percent of covered functions. If code coverage does not reach the threshold specified, the process will exit with code `1`."
                    },
                    {
                      "textRaw": "`env` {Object} Specify environment variables to be passed along to the test process. This option is not compatible with `isolation='none'`. These variables will override those from the main process, and are not merged with `process.env`. **Default:** `process.env`.",
                      "name": "env",
                      "type": "Object",
                      "default": "`process.env`",
                      "desc": "Specify environment variables to be passed along to the test process. This option is not compatible with `isolation='none'`. These variables will override those from the main process, and are not merged with `process.env`."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {TestsStream}",
                "name": "return",
                "type": "TestsStream"
              }
            }
          ],
          "desc": "<p><strong>Note:</strong> <code>shard</code> is used to horizontally parallelize test running across\nmachines or processes, ideal for large-scale executions across varied\nenvironments. It's incompatible with <code>watch</code> mode, tailored for rapid\ncode iteration by automatically rerunning tests on file changes.</p>\n<pre><code class=\"language-mjs\">import { tap } from 'node:test/reporters';\nimport { run } from 'node:test';\nimport process from 'node:process';\nimport path from 'node:path';\n\nrun({ files: [path.resolve('./tests/test.js')] })\n .on('test:fail', () => {\n   process.exitCode = 1;\n })\n .compose(tap)\n .pipe(process.stdout);\n</code></pre>\n<pre><code class=\"language-cjs\">const { tap } = require('node:test/reporters');\nconst { run } = require('node:test');\nconst path = require('node:path');\n\nrun({ files: [path.resolve('./tests/test.js')] })\n .on('test:fail', () => {\n   process.exitCode = 1;\n })\n .compose(tap)\n .pipe(process.stdout);\n</code></pre>"
        },
        {
          "textRaw": "`suite([name][, options][, fn])`",
          "name": "suite",
          "type": "method",
          "meta": {
            "added": [
              "v22.0.0",
              "v20.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`name` {string} The name of the suite, which is displayed when reporting test results. **Default:** The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.",
                  "name": "name",
                  "type": "string",
                  "default": "The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name",
                  "desc": "The name of the suite, which is displayed when reporting test results.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} Optional configuration options for the suite. This supports the same options as `test([name][, options][, fn])`.",
                  "name": "options",
                  "type": "Object",
                  "desc": "Optional configuration options for the suite. This supports the same options as `test([name][, options][, fn])`.",
                  "optional": true
                },
                {
                  "textRaw": "`fn` {Function|AsyncFunction} The suite function declaring nested tests and suites. The first argument to this function is a `SuiteContext` object. **Default:** A no-op function.",
                  "name": "fn",
                  "type": "Function|AsyncFunction",
                  "default": "A no-op function",
                  "desc": "The suite function declaring nested tests and suites. The first argument to this function is a `SuiteContext` object.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise} Immediately fulfilled with `undefined`.",
                "name": "return",
                "type": "Promise",
                "desc": "Immediately fulfilled with `undefined`."
              }
            }
          ],
          "desc": "<p>The <code>suite()</code> function is imported from the <code>node:test</code> module.</p>"
        },
        {
          "textRaw": "`suite.skip([name][, options][, fn])`",
          "name": "skip",
          "type": "method",
          "meta": {
            "added": [
              "v22.0.0",
              "v20.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for skipping a suite. This is the same as\n<a href=\"#suitename-options-fn\"><code>suite([name], { skip: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`suite.todo([name][, options][, fn])`",
          "name": "todo",
          "type": "method",
          "meta": {
            "added": [
              "v22.0.0",
              "v20.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for marking a suite as <code>TODO</code>. This is the same as\n<a href=\"#suitename-options-fn\"><code>suite([name], { todo: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`suite.only([name][, options][, fn])`",
          "name": "only",
          "type": "method",
          "meta": {
            "added": [
              "v22.0.0",
              "v20.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for marking a suite as <code>only</code>. This is the same as\n<a href=\"#suitename-options-fn\"><code>suite([name], { only: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`test([name][, options][, fn])`",
          "name": "test",
          "type": "method",
          "meta": {
            "added": [
              "v18.0.0",
              "v16.17.0"
            ],
            "changes": [
              {
                "version": "v26.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/63221",
                "description": "Added the `tags` option."
              },
              {
                "version": [
                  "v20.2.0",
                  "v18.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/47909",
                "description": "Added the `skip`, `todo`, and `only` shorthands."
              },
              {
                "version": [
                  "v18.8.0",
                  "v16.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/43554",
                "description": "Add a `signal` option."
              },
              {
                "version": [
                  "v18.7.0",
                  "v16.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/43505",
                "description": "Add a `timeout` option."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`name` {string} The name of the test, which is displayed when reporting test results. **Default:** The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.",
                  "name": "name",
                  "type": "string",
                  "default": "The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name",
                  "desc": "The name of the test, which is displayed when reporting test results.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} Configuration options for the test. The following properties are supported:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Configuration options for the test. The following properties are supported:",
                  "options": [
                    {
                      "textRaw": "`concurrency` {number|boolean} If a number is provided, then that many tests would run asynchronously (they are still managed by the single-threaded event loop). If `true`, all scheduled asynchronous tests run concurrently within the thread. If `false`, only one test runs at a time. If unspecified, subtests inherit this value from their parent. **Default:** `false`.",
                      "name": "concurrency",
                      "type": "number|boolean",
                      "default": "`false`",
                      "desc": "If a number is provided, then that many tests would run asynchronously (they are still managed by the single-threaded event loop). If `true`, all scheduled asynchronous tests run concurrently within the thread. If `false`, only one test runs at a time. If unspecified, subtests inherit this value from their parent."
                    },
                    {
                      "textRaw": "`expectFailure` {boolean|string|RegExp|Function|Object|Error} If truthy, the test is expected to fail. If a non-empty string is provided, that string is displayed in the test results as the reason why the test is expected to fail. If a {RegExp|Function|Object|Error} is provided directly (without wrapping in `{ match: … }`), the test passes only if the thrown error matches, following the behavior of `assert.throws`. To provide both a reason and validation, pass an object with `label` (string) and `match` (RegExp, Function, Object, or Error). **Default:** `false`.",
                      "name": "expectFailure",
                      "type": "boolean|string|RegExp|Function|Object|Error",
                      "default": "`false`",
                      "desc": "If truthy, the test is expected to fail. If a non-empty string is provided, that string is displayed in the test results as the reason why the test is expected to fail. If a {RegExp|Function|Object|Error} is provided directly (without wrapping in `{ match: … }`), the test passes only if the thrown error matches, following the behavior of `assert.throws`. To provide both a reason and validation, pass an object with `label` (string) and `match` (RegExp, Function, Object, or Error)."
                    },
                    {
                      "textRaw": "`only` {boolean} If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped. **Default:** `false`.",
                      "name": "only",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped."
                    },
                    {
                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress test.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "Allows aborting an in-progress test."
                    },
                    {
                      "textRaw": "`skip` {boolean|string} If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test. **Default:** `false`.",
                      "name": "skip",
                      "type": "boolean|string",
                      "default": "`false`",
                      "desc": "If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test."
                    },
                    {
                      "textRaw": "`tags` {string[]} An array of string labels associated with the test. Used together with `--experimental-test-tag-filter` to filter which tests run. Tags inherit from suites to nested tests by union. See Test tags. **Default:** `[]`.",
                      "name": "tags",
                      "type": "string[]",
                      "default": "`[]`",
                      "desc": "An array of string labels associated with the test. Used together with `--experimental-test-tag-filter` to filter which tests run. Tags inherit from suites to nested tests by union. See Test tags."
                    },
                    {
                      "textRaw": "`todo` {boolean|string} If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in the test results as the reason why the test is `TODO`. **Default:** `false`.",
                      "name": "todo",
                      "type": "boolean|string",
                      "default": "`false`",
                      "desc": "If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in the test results as the reason why the test is `TODO`."
                    },
                    {
                      "textRaw": "`timeout` {number} A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                      "name": "timeout",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent."
                    },
                    {
                      "textRaw": "`plan` {number} The number of assertions and subtests expected to be run in the test. If the number of assertions run in the test does not match the number specified in the plan, the test will fail. **Default:** `undefined`.",
                      "name": "plan",
                      "type": "number",
                      "default": "`undefined`",
                      "desc": "The number of assertions and subtests expected to be run in the test. If the number of assertions run in the test does not match the number specified in the plan, the test will fail."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`fn` {Function|AsyncFunction} The function under test. The first argument to this function is a `TestContext` object. If the test uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                  "name": "fn",
                  "type": "Function|AsyncFunction",
                  "default": "A no-op function",
                  "desc": "The function under test. The first argument to this function is a `TestContext` object. If the test uses callbacks, the callback function is passed as the second argument.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise} Fulfilled with `undefined` once the test completes, or immediately if the test runs within a suite.",
                "name": "return",
                "type": "Promise",
                "desc": "Fulfilled with `undefined` once the test completes, or immediately if the test runs within a suite."
              }
            }
          ],
          "desc": "<p>The <code>test()</code> function is the value imported from the <code>test</code> module. Each\ninvocation of this function results in reporting the test to the <a href=\"test.html#class-testsstream\"><code>&#x3C;TestsStream></code></a>.</p>\n<p>The <code>TestContext</code> object passed to the <code>fn</code> argument can be used to perform\nactions related to the current test. Examples include skipping the test, adding\nadditional diagnostic information, or creating subtests.</p>\n<p><code>test()</code> returns a <code>Promise</code> that fulfills once the test completes.\nif <code>test()</code> is called within a suite, it fulfills immediately.\nThe return value can usually be discarded for top level tests.\nHowever, the return value from subtests should be used to prevent the parent\ntest from finishing first and cancelling the subtest\nas shown in the following example.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  // The setTimeout() in the following subtest would cause it to outlive its\n  // parent test if 'await' is removed on the next line. Once the parent test\n  // completes, it will cancel any outstanding subtests.\n  await t.test('longer running subtest', async (t) => {\n    return new Promise((resolve, reject) => {\n      setTimeout(resolve, 1000);\n    });\n  });\n});\n</code></pre>\n<p>The <code>timeout</code> option can be used to fail the test if it takes longer than\n<code>timeout</code> milliseconds to complete. However, it is not a reliable mechanism for\ncanceling tests because a running test might block the application thread and\nthus prevent the scheduled cancellation.</p>"
        },
        {
          "textRaw": "`test.skip([name][, options][, fn])`",
          "name": "skip",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for skipping a test,\nsame as <a href=\"#testname-options-fn\"><code>test([name], { skip: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`test.todo([name][, options][, fn])`",
          "name": "todo",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for marking a test as <code>TODO</code>,\nsame as <a href=\"#testname-options-fn\"><code>test([name], { todo: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`test.only([name][, options][, fn])`",
          "name": "only",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for marking a test as <code>only</code>,\nsame as <a href=\"#testname-options-fn\"><code>test([name], { only: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`describe([name][, options][, fn])`",
          "name": "describe",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Alias for <a href=\"#suitename-options-fn\"><code>suite()</code></a>.</p>\n<p>The <code>describe()</code> function is imported from the <code>node:test</code> module.</p>"
        },
        {
          "textRaw": "`describe.skip([name][, options][, fn])`",
          "name": "skip",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for skipping a suite. This is the same as\n<a href=\"#describename-options-fn\"><code>describe([name], { skip: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`describe.todo([name][, options][, fn])`",
          "name": "todo",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for marking a suite as <code>TODO</code>. This is the same as\n<a href=\"#describename-options-fn\"><code>describe([name], { todo: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`describe.only([name][, options][, fn])`",
          "name": "only",
          "type": "method",
          "meta": {
            "added": [
              "v19.8.0",
              "v18.15.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for marking a suite as <code>only</code>. This is the same as\n<a href=\"#describename-options-fn\"><code>describe([name], { only: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`it([name][, options][, fn])`",
          "name": "it",
          "type": "method",
          "meta": {
            "added": [
              "v18.6.0",
              "v16.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v19.8.0",
                  "v18.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46889",
                "description": "Calling `it()` is now equivalent to calling `test()`."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Alias for <a href=\"#testname-options-fn\"><code>test()</code></a>.</p>\n<p>The <code>it()</code> function is imported from the <code>node:test</code> module.</p>"
        },
        {
          "textRaw": "`it.skip([name][, options][, fn])`",
          "name": "skip",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for skipping a test,\nsame as <a href=\"#testname-options-fn\"><code>it([name], { skip: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`it.todo([name][, options][, fn])`",
          "name": "todo",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for marking a test as <code>TODO</code>,\nsame as <a href=\"#testname-options-fn\"><code>it([name], { todo: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`it.only([name][, options][, fn])`",
          "name": "only",
          "type": "method",
          "meta": {
            "added": [
              "v19.8.0",
              "v18.15.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "name",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "fn",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Shorthand for marking a test as <code>only</code>,\nsame as <a href=\"#testname-options-fn\"><code>it([name], { only: true }[, fn])</code></a>.</p>"
        },
        {
          "textRaw": "`before([fn][, options])`",
          "name": "before",
          "type": "method",
          "meta": {
            "added": [
              "v18.8.0",
              "v16.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function|AsyncFunction} The hook function. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                  "name": "fn",
                  "type": "Function|AsyncFunction",
                  "default": "A no-op function",
                  "desc": "The hook function. If the hook uses callbacks, the callback function is passed as the second argument.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Configuration options for the hook. The following properties are supported:",
                  "options": [
                    {
                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "Allows aborting an in-progress hook."
                    },
                    {
                      "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                      "name": "timeout",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>This function creates a hook that runs before executing a suite.</p>\n<pre><code class=\"language-js\">describe('tests', async () => {\n  before(() => console.log('about to run some test'));\n  it('is a subtest', () => {\n    // Some relevant assertions here\n  });\n});\n</code></pre>"
        },
        {
          "textRaw": "`after([fn][, options])`",
          "name": "after",
          "type": "method",
          "meta": {
            "added": [
              "v18.8.0",
              "v16.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function|AsyncFunction} The hook function. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                  "name": "fn",
                  "type": "Function|AsyncFunction",
                  "default": "A no-op function",
                  "desc": "The hook function. If the hook uses callbacks, the callback function is passed as the second argument.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Configuration options for the hook. The following properties are supported:",
                  "options": [
                    {
                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "Allows aborting an in-progress hook."
                    },
                    {
                      "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                      "name": "timeout",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>This function creates a hook that runs after executing a suite.</p>\n<pre><code class=\"language-js\">describe('tests', async () => {\n  after(() => console.log('finished running tests'));\n  it('is a subtest', () => {\n    // Some relevant assertion here\n  });\n});\n</code></pre>\n<p><strong>Note:</strong> The <code>after</code> hook is guaranteed to run,\neven if tests within the suite fail.</p>"
        },
        {
          "textRaw": "`beforeEach([fn][, options])`",
          "name": "beforeEach",
          "type": "method",
          "meta": {
            "added": [
              "v18.8.0",
              "v16.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function|AsyncFunction} The hook function. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                  "name": "fn",
                  "type": "Function|AsyncFunction",
                  "default": "A no-op function",
                  "desc": "The hook function. If the hook uses callbacks, the callback function is passed as the second argument.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Configuration options for the hook. The following properties are supported:",
                  "options": [
                    {
                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "Allows aborting an in-progress hook."
                    },
                    {
                      "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                      "name": "timeout",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>This function creates a hook that runs before each test in the current suite.</p>\n<pre><code class=\"language-js\">describe('tests', async () => {\n  beforeEach(() => console.log('about to run a test'));\n  it('is a subtest', () => {\n    // Some relevant assertion here\n  });\n});\n</code></pre>"
        },
        {
          "textRaw": "`afterEach([fn][, options])`",
          "name": "afterEach",
          "type": "method",
          "meta": {
            "added": [
              "v18.8.0",
              "v16.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function|AsyncFunction} The hook function. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                  "name": "fn",
                  "type": "Function|AsyncFunction",
                  "default": "A no-op function",
                  "desc": "The hook function. If the hook uses callbacks, the callback function is passed as the second argument.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
                  "name": "options",
                  "type": "Object",
                  "desc": "Configuration options for the hook. The following properties are supported:",
                  "options": [
                    {
                      "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
                      "name": "signal",
                      "type": "AbortSignal",
                      "desc": "Allows aborting an in-progress hook."
                    },
                    {
                      "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                      "name": "timeout",
                      "type": "number",
                      "default": "`Infinity`",
                      "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>This function creates a hook that runs after each test in the current suite.\nThe <code>afterEach()</code> hook is run even if the test fails.</p>\n<pre><code class=\"language-js\">describe('tests', async () => {\n  afterEach(() => console.log('finished running a test'));\n  it('is a subtest', () => {\n    // Some relevant assertion here\n  });\n});\n</code></pre>"
        },
        {
          "textRaw": "`getTestContext()`",
          "name": "getTestContext",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {undefined}",
                "name": "return",
                "type": "undefined"
              }
            }
          ],
          "desc": "<p>Returns the <a href=\"#class-testcontext\"><code>TestContext</code></a> or <a href=\"#class-suitecontext\"><code>SuiteContext</code></a> object associated with the\ncurrently executing test or suite, or <code>undefined</code> if called outside of a test or\nsuite. This function can be used to access context information from within the\ntest or suite function or any async operations within them.</p>\n<pre><code class=\"language-mjs\">import { getTestContext } from 'node:test';\n\ntest('example test', async () => {\n  const ctx = getTestContext();\n  console.log(`Running test: ${ctx.name}`);\n});\n\ndescribe('example suite', () => {\n  const ctx = getTestContext();\n  console.log(`Running suite: ${ctx.name}`);\n});\n</code></pre>\n<p>When called from a test, returns a <a href=\"#class-testcontext\"><code>TestContext</code></a>.\nWhen called from a suite, returns a <a href=\"#class-suitecontext\"><code>SuiteContext</code></a>.</p>\n<p>If called from outside a test or suite (e.g., at the top level of a module or in\na setTimeout callback after execution has completed), this function returns\n<code>undefined</code>.</p>\n<p>When called from within a hook (before, beforeEach, after, afterEach), this\nfunction returns the context of the test or suite that the hook is associated\nwith.</p>"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `MockFunctionContext`",
          "name": "MockFunctionContext",
          "type": "class",
          "meta": {
            "added": [
              "v19.1.0",
              "v18.13.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>MockFunctionContext</code> class is used to inspect or manipulate the behavior of\nmocks created via the <a href=\"#class-mocktracker\"><code>MockTracker</code></a> APIs.</p>",
          "properties": [
            {
              "textRaw": "Type: {Array}",
              "name": "calls",
              "type": "Array",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "desc": "<p>A getter that returns a copy of the internal array used to track calls to the\nmock. Each entry in the array is an object with the following properties.</p>\n<ul>\n<li><code>arguments</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\"><code>&#x3C;Array></code></a> An array of the arguments passed to the mock function.</li>\n<li><code>error</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> If the mocked function threw then this property contains the\nthrown value. <strong>Default:</strong> <code>undefined</code>.</li>\n<li><code>result</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> The value returned by the mocked function.</li>\n<li><code>stack</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> An <code>Error</code> object whose stack can be used to determine the\ncallsite of the mocked function invocation.</li>\n<li><code>target</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> If the mocked function is a constructor, this\nfield contains the class being constructed. Otherwise this will be <code>undefined</code>.</li>\n<li><code>this</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> The mocked function's <code>this</code> value.</li>\n</ul>"
            }
          ],
          "methods": [
            {
              "textRaw": "`ctx.callCount()`",
              "name": "callCount",
              "type": "method",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {integer} The number of times that this mock has been invoked.",
                    "name": "return",
                    "type": "integer",
                    "desc": "The number of times that this mock has been invoked."
                  }
                }
              ],
              "desc": "<p>This function returns the number of times that this mock has been invoked. This\nfunction is more efficient than checking <code>ctx.calls.length</code> because <code>ctx.calls</code>\nis a getter that creates a copy of the internal call tracking array.</p>"
            },
            {
              "textRaw": "`ctx.mockImplementation(implementation)`",
              "name": "mockImplementation",
              "type": "method",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`implementation` {Function|AsyncFunction} The function to be used as the mock's new implementation.",
                      "name": "implementation",
                      "type": "Function|AsyncFunction",
                      "desc": "The function to be used as the mock's new implementation."
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to change the behavior of an existing mock.</p>\n<p>The following example creates a mock function using <code>t.mock.fn()</code>, calls the\nmock function, and then changes the mock implementation to a different function.</p>\n<pre><code class=\"language-js\">test('changes a mock behavior', (t) => {\n  let cnt = 0;\n\n  function addOne() {\n    cnt++;\n    return cnt;\n  }\n\n  function addTwo() {\n    cnt += 2;\n    return cnt;\n  }\n\n  const fn = t.mock.fn(addOne);\n\n  assert.strictEqual(fn(), 1);\n  fn.mock.mockImplementation(addTwo);\n  assert.strictEqual(fn(), 3);\n  assert.strictEqual(fn(), 5);\n});\n</code></pre>"
            },
            {
              "textRaw": "`ctx.mockImplementationOnce(implementation[, onCall])`",
              "name": "mockImplementationOnce",
              "type": "method",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`implementation` {Function|AsyncFunction} The function to be used as the mock's implementation for the invocation number specified by `onCall`.",
                      "name": "implementation",
                      "type": "Function|AsyncFunction",
                      "desc": "The function to be used as the mock's implementation for the invocation number specified by `onCall`."
                    },
                    {
                      "textRaw": "`onCall` {integer} The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown. **Default:** The number of the next invocation.",
                      "name": "onCall",
                      "type": "integer",
                      "default": "The number of the next invocation",
                      "desc": "The invocation number that will use `implementation`. If the specified invocation has already occurred then an exception is thrown.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to change the behavior of an existing mock for a single\ninvocation. Once invocation <code>onCall</code> has occurred, the mock will revert to\nwhatever behavior it would have used had <code>mockImplementationOnce()</code> not been\ncalled.</p>\n<p>The following example creates a mock function using <code>t.mock.fn()</code>, calls the\nmock function, changes the mock implementation to a different function for the\nnext invocation, and then resumes its previous behavior.</p>\n<pre><code class=\"language-js\">test('changes a mock behavior once', (t) => {\n  let cnt = 0;\n\n  function addOne() {\n    cnt++;\n    return cnt;\n  }\n\n  function addTwo() {\n    cnt += 2;\n    return cnt;\n  }\n\n  const fn = t.mock.fn(addOne);\n\n  assert.strictEqual(fn(), 1);\n  fn.mock.mockImplementationOnce(addTwo);\n  assert.strictEqual(fn(), 3);\n  assert.strictEqual(fn(), 4);\n});\n</code></pre>"
            },
            {
              "textRaw": "`ctx.resetCalls()`",
              "name": "resetCalls",
              "type": "method",
              "meta": {
                "added": [
                  "v19.3.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Resets the call history of the mock function.</p>"
            },
            {
              "textRaw": "`ctx.restore()`",
              "name": "restore",
              "type": "method",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Resets the implementation of the mock function to its original behavior. The\nmock can still be used after calling this function.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `MockModuleContext`",
          "name": "MockModuleContext",
          "type": "class",
          "meta": {
            "added": [
              "v22.3.0",
              "v20.18.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Early development",
          "desc": "<p>The <code>MockModuleContext</code> class is used to manipulate the behavior of module mocks\ncreated via the <a href=\"#class-mocktracker\"><code>MockTracker</code></a> APIs.</p>",
          "methods": [
            {
              "textRaw": "`ctx.restore()`",
              "name": "restore",
              "type": "method",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Resets the implementation of the mock module.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `MockPropertyContext`",
          "name": "MockPropertyContext",
          "type": "class",
          "meta": {
            "added": [
              "v24.3.0",
              "v22.20.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>MockPropertyContext</code> class is used to inspect or manipulate the behavior\nof property mocks created via the <a href=\"#class-mocktracker\"><code>MockTracker</code></a> APIs.</p>",
          "properties": [
            {
              "textRaw": "Type: {Array}",
              "name": "accesses",
              "type": "Array",
              "desc": "<p>A getter that returns a copy of the internal array used to track accesses (get/set) to\nthe mocked property. Each entry in the array is an object with the following properties:</p>\n<ul>\n<li><code>type</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Either <code>'get'</code> or <code>'set'</code>, indicating the type of access.</li>\n<li><code>value</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#Data_types\"><code>&#x3C;any></code></a> The value that was read (for <code>'get'</code>) or written (for <code>'set'</code>).</li>\n<li><code>stack</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> An <code>Error</code> object whose stack can be used to determine the\ncallsite of the mocked function invocation.</li>\n</ul>"
            }
          ],
          "methods": [
            {
              "textRaw": "`ctx.accessCount()`",
              "name": "accessCount",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {integer} The number of times that the property was accessed (read or written).",
                    "name": "return",
                    "type": "integer",
                    "desc": "The number of times that the property was accessed (read or written)."
                  }
                }
              ],
              "desc": "<p>This function returns the number of times that the property was accessed.\nThis function is more efficient than checking <code>ctx.accesses.length</code> because\n<code>ctx.accesses</code> is a getter that creates a copy of the internal access tracking array.</p>"
            },
            {
              "textRaw": "`ctx.mockImplementation(value)`",
              "name": "mockImplementation",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any} The new value to be set as the mocked property value.",
                      "name": "value",
                      "type": "any",
                      "desc": "The new value to be set as the mocked property value."
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to change the value returned by the mocked property getter.</p>"
            },
            {
              "textRaw": "`ctx.mockImplementationOnce(value[, onAccess])`",
              "name": "mockImplementationOnce",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any} The value to be used as the mock's implementation for the invocation number specified by `onAccess`.",
                      "name": "value",
                      "type": "any",
                      "desc": "The value to be used as the mock's implementation for the invocation number specified by `onAccess`."
                    },
                    {
                      "textRaw": "`onAccess` {integer} The invocation number that will use `value`. If the specified invocation has already occurred then an exception is thrown. **Default:** The number of the next invocation.",
                      "name": "onAccess",
                      "type": "integer",
                      "default": "The number of the next invocation",
                      "desc": "The invocation number that will use `value`. If the specified invocation has already occurred then an exception is thrown.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to change the behavior of an existing mock for a single\ninvocation. Once invocation <code>onAccess</code> has occurred, the mock will revert to\nwhatever behavior it would have used had <code>mockImplementationOnce()</code> not been\ncalled.</p>\n<p>The following example creates a mock function using <code>t.mock.property()</code>, calls the\nmock property, changes the mock implementation to a different value for the\nnext invocation, and then resumes its previous behavior.</p>\n<pre><code class=\"language-js\">test('changes a mock behavior once', (t) => {\n  const obj = { foo: 1 };\n\n  const prop = t.mock.property(obj, 'foo', 5);\n\n  assert.strictEqual(obj.foo, 5);\n  prop.mock.mockImplementationOnce(25);\n  assert.strictEqual(obj.foo, 25);\n  assert.strictEqual(obj.foo, 5);\n});\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Caveat",
                  "name": "caveat",
                  "type": "module",
                  "desc": "<p>For consistency with the rest of the mocking API, this function treats both property gets and sets\nas accesses. If a property set occurs at the same access index, the \"once\" value will be consumed\nby the set operation, and the mocked property value will be changed to the \"once\" value. This may\nlead to unexpected behavior if you intend the \"once\" value to only be used for a get operation.</p>",
                  "displayName": "Caveat"
                }
              ]
            },
            {
              "textRaw": "`ctx.resetAccesses()`",
              "name": "resetAccesses",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Resets the access history of the mocked property.</p>"
            },
            {
              "textRaw": "`ctx.restore()`",
              "name": "restore",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Resets the implementation of the mock property to its original behavior. The\nmock can still be used after calling this function.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `MockTracker`",
          "name": "MockTracker",
          "type": "class",
          "meta": {
            "added": [
              "v19.1.0",
              "v18.13.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>MockTracker</code> class is used to manage mocking functionality. The test runner\nmodule provides a top level <code>mock</code> export which is a <code>MockTracker</code> instance.\nEach test also provides its own <code>MockTracker</code> instance via the test context's\n<code>mock</code> property.</p>",
          "methods": [
            {
              "textRaw": "`mock.fn([original[, implementation]][, options])`",
              "name": "fn",
              "type": "method",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`original` {Function|AsyncFunction} An optional function to create a mock on. **Default:** A no-op function.",
                      "name": "original",
                      "type": "Function|AsyncFunction",
                      "default": "A no-op function",
                      "desc": "An optional function to create a mock on.",
                      "optional": true
                    },
                    {
                      "textRaw": "`implementation` {Function|AsyncFunction} An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`. **Default:** The function specified by `original`.",
                      "name": "implementation",
                      "type": "Function|AsyncFunction",
                      "default": "The function specified by `original`",
                      "desc": "An optional function used as the mock implementation for `original`. This is useful for creating mocks that exhibit one behavior for a specified number of calls and then restore the behavior of `original`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Optional configuration options for the mock function. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Optional configuration options for the mock function. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`times` {integer} The number of times that the mock will use the behavior of `implementation`. Once the mock function has been called `times` times, it will automatically restore the behavior of `original`. This value must be an integer greater than zero. **Default:** `Infinity`.",
                          "name": "times",
                          "type": "integer",
                          "default": "`Infinity`",
                          "desc": "The number of times that the mock will use the behavior of `implementation`. Once the mock function has been called `times` times, it will automatically restore the behavior of `original`. This value must be an integer greater than zero."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Proxy} The mocked function. The mocked function contains a special `mock` property, which is an instance of `MockFunctionContext`, and can be used for inspecting and changing the behavior of the mocked function.",
                    "name": "return",
                    "type": "Proxy",
                    "desc": "The mocked function. The mocked function contains a special `mock` property, which is an instance of `MockFunctionContext`, and can be used for inspecting and changing the behavior of the mocked function."
                  }
                }
              ],
              "desc": "<p>This function is used to create a mock function.</p>\n<p>The following example creates a mock function that increments a counter by one\non each invocation. The <code>times</code> option is used to modify the mock behavior such\nthat the first two invocations add two to the counter instead of one.</p>\n<pre><code class=\"language-js\">test('mocks a counting function', (t) => {\n  let cnt = 0;\n\n  function addOne() {\n    cnt++;\n    return cnt;\n  }\n\n  function addTwo() {\n    cnt += 2;\n    return cnt;\n  }\n\n  const fn = t.mock.fn(addOne, addTwo, { times: 2 });\n\n  assert.strictEqual(fn(), 2);\n  assert.strictEqual(fn(), 4);\n  assert.strictEqual(fn(), 5);\n  assert.strictEqual(fn(), 6);\n});\n</code></pre>"
            },
            {
              "textRaw": "`mock.getter(object, methodName[, implementation][, options])`",
              "name": "getter",
              "type": "method",
              "meta": {
                "added": [
                  "v19.3.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "object"
                    },
                    {
                      "name": "methodName"
                    },
                    {
                      "name": "implementation",
                      "optional": true
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is syntax sugar for <a href=\"#mockmethodobject-methodname-implementation-options\"><code>MockTracker.method</code></a> with <code>options.getter</code>\nset to <code>true</code>.</p>"
            },
            {
              "textRaw": "`mock.method(object, methodName[, implementation][, options])`",
              "name": "method",
              "type": "method",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`object` {Object} The object whose method is being mocked.",
                      "name": "object",
                      "type": "Object",
                      "desc": "The object whose method is being mocked."
                    },
                    {
                      "textRaw": "`methodName` {string|symbol} The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown.",
                      "name": "methodName",
                      "type": "string|symbol",
                      "desc": "The identifier of the method on `object` to mock. If `object[methodName]` is not a function, an error is thrown."
                    },
                    {
                      "textRaw": "`implementation` {Function|AsyncFunction} An optional function used as the mock implementation for `object[methodName]`. **Default:** The original method specified by `object[methodName]`.",
                      "name": "implementation",
                      "type": "Function|AsyncFunction",
                      "default": "The original method specified by `object[methodName]`",
                      "desc": "An optional function used as the mock implementation for `object[methodName]`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Optional configuration options for the mock method. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Optional configuration options for the mock method. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`getter` {boolean} If `true`, `object[methodName]` is treated as a getter. This option cannot be used with the `setter` option. **Default:** false.",
                          "name": "getter",
                          "type": "boolean",
                          "default": "false",
                          "desc": "If `true`, `object[methodName]` is treated as a getter. This option cannot be used with the `setter` option."
                        },
                        {
                          "textRaw": "`setter` {boolean} If `true`, `object[methodName]` is treated as a setter. This option cannot be used with the `getter` option. **Default:** false.",
                          "name": "setter",
                          "type": "boolean",
                          "default": "false",
                          "desc": "If `true`, `object[methodName]` is treated as a setter. This option cannot be used with the `getter` option."
                        },
                        {
                          "textRaw": "`times` {integer} The number of times that the mock will use the behavior of `implementation`. Once the mocked method has been called `times` times, it will automatically restore the original behavior. This value must be an integer greater than zero. **Default:** `Infinity`.",
                          "name": "times",
                          "type": "integer",
                          "default": "`Infinity`",
                          "desc": "The number of times that the mock will use the behavior of `implementation`. Once the mocked method has been called `times` times, it will automatically restore the original behavior. This value must be an integer greater than zero."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Proxy} The mocked method. The mocked method contains a special `mock` property, which is an instance of `MockFunctionContext`, and can be used for inspecting and changing the behavior of the mocked method.",
                    "name": "return",
                    "type": "Proxy",
                    "desc": "The mocked method. The mocked method contains a special `mock` property, which is an instance of `MockFunctionContext`, and can be used for inspecting and changing the behavior of the mocked method."
                  }
                }
              ],
              "desc": "<p>This function is used to create a mock on an existing object method. The\nfollowing example demonstrates how a mock is created on an existing object\nmethod.</p>\n<pre><code class=\"language-js\">test('spies on an object method', (t) => {\n  const number = {\n    value: 5,\n    subtract(a) {\n      return this.value - a;\n    },\n  };\n\n  t.mock.method(number, 'subtract');\n  assert.strictEqual(number.subtract.mock.callCount(), 0);\n  assert.strictEqual(number.subtract(3), 2);\n  assert.strictEqual(number.subtract.mock.callCount(), 1);\n\n  const call = number.subtract.mock.calls[0];\n\n  assert.deepStrictEqual(call.arguments, [3]);\n  assert.strictEqual(call.result, 2);\n  assert.strictEqual(call.error, undefined);\n  assert.strictEqual(call.target, undefined);\n  assert.strictEqual(call.this, number);\n});\n</code></pre>"
            },
            {
              "textRaw": "`mock.module(specifier[, options])`",
              "name": "module",
              "type": "method",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.18.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/58007",
                    "description": "Support JSON modules."
                  }
                ]
              },
              "stability": 1,
              "stabilityText": "Early development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`specifier` {string|URL} A string identifying the module to mock.",
                      "name": "specifier",
                      "type": "string|URL",
                      "desc": "A string identifying the module to mock."
                    },
                    {
                      "textRaw": "`options` {Object} Optional configuration options for the mock module. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Optional configuration options for the mock module. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`cache` {boolean} If `false`, each call to `require()` or `import()` generates a new mock module. If `true`, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache. **Default:** false.",
                          "name": "cache",
                          "type": "boolean",
                          "default": "false",
                          "desc": "If `false`, each call to `require()` or `import()` generates a new mock module. If `true`, subsequent calls will return the same module mock, and the mock module is inserted into the CommonJS cache."
                        },
                        {
                          "textRaw": "`exports` {Object} Optional mocked exports. The `default` property, if provided, is used as the mocked module's default export. All other own enumerable properties are used as named exports. **This option cannot be used with `defaultExport` or `namedExports`.**If the mock is a CommonJS or builtin module, `exports.default` is used as the value of `module.exports`.If `exports.default` is not provided for a CommonJS or builtin mock, `module.exports` defaults to an empty object.If named exports are provided with a non-object default export, the mock throws an exception when used as a CommonJS or builtin module.",
                          "name": "exports",
                          "type": "Object",
                          "desc": "Optional mocked exports. The `default` property, if provided, is used as the mocked module's default export. All other own enumerable properties are used as named exports. **This option cannot be used with `defaultExport` or `namedExports`.**If the mock is a CommonJS or builtin module, `exports.default` is used as the value of `module.exports`.If `exports.default` is not provided for a CommonJS or builtin mock, `module.exports` defaults to an empty object.If named exports are provided with a non-object default export, the mock throws an exception when used as a CommonJS or builtin module."
                        },
                        {
                          "textRaw": "`defaultExport` {any} An optional value used as the mocked module's default export. If this value is not provided, ESM mocks do not include a default export. If the mock is a CommonJS or builtin module, this setting is used as the value of `module.exports`. If this value is not provided, CJS and builtin mocks use an empty object as the value of `module.exports`. **This option cannot be used with `options.exports`.** This option is deprecated and will be removed in a later version. Prefer `options.exports.default`.",
                          "name": "defaultExport",
                          "type": "any",
                          "desc": "An optional value used as the mocked module's default export. If this value is not provided, ESM mocks do not include a default export. If the mock is a CommonJS or builtin module, this setting is used as the value of `module.exports`. If this value is not provided, CJS and builtin mocks use an empty object as the value of `module.exports`. **This option cannot be used with `options.exports`.** This option is deprecated and will be removed in a later version. Prefer `options.exports.default`."
                        },
                        {
                          "textRaw": "`namedExports` {Object} An optional object whose keys and values are used to create the named exports of the mock module. If the mock is a CommonJS or builtin module, these values are copied onto `module.exports`. Therefore, if a mock is created with both named exports and a non-object default export, the mock will throw an exception when used as a CJS or builtin module. **This option cannot be used with `options.exports`.** This option is deprecated and will be removed in a later version. Prefer `options.exports`.",
                          "name": "namedExports",
                          "type": "Object",
                          "desc": "An optional object whose keys and values are used to create the named exports of the mock module. If the mock is a CommonJS or builtin module, these values are copied onto `module.exports`. Therefore, if a mock is created with both named exports and a non-object default export, the mock will throw an exception when used as a CJS or builtin module. **This option cannot be used with `options.exports`.** This option is deprecated and will be removed in a later version. Prefer `options.exports`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {MockModuleContext} An object that can be used to manipulate the mock.",
                    "name": "return",
                    "type": "MockModuleContext",
                    "desc": "An object that can be used to manipulate the mock."
                  }
                }
              ],
              "desc": "<p>This function is used to mock the exports of ECMAScript modules, CommonJS modules, JSON modules, and\nNode.js builtin modules. Any references to the original module prior to mocking are not impacted. In\norder to enable module mocking, Node.js must be started with the\n<a href=\"cli.html#--experimental-test-module-mocks\"><code>--experimental-test-module-mocks</code></a> command-line flag.</p>\n<p><strong>Note</strong>: <a href=\"module.html#customization-hooks\">module customization hooks</a> registered via the <strong>synchronous</strong> API effect resolution of\nthe <code>specifier</code> provided to <code>mock.module</code>. Customization hooks registered via the <strong>asynchronous</strong>\nAPI are currently ignored (because the test runner's loader is synchronous, and node does not\nsupport multi-chain / cross-chain loading).</p>\n<p>The following example demonstrates how a mock is created for a module.</p>\n<pre><code class=\"language-js\">test('mocks a builtin module in both module systems', async (t) => {\n  // Create a mock of 'node:readline' with a named export named 'foo', which\n  // does not exist in the original 'node:readline' module.\n  const mock = t.mock.module('node:readline', {\n    exports: { foo: () => 42 },\n  });\n\n  let esmImpl = await import('node:readline');\n  let cjsImpl = require('node:readline');\n\n  // cursorTo() is an export of the original 'node:readline' module.\n  assert.strictEqual(esmImpl.cursorTo, undefined);\n  assert.strictEqual(cjsImpl.cursorTo, undefined);\n  assert.strictEqual(esmImpl.fn(), 42);\n  assert.strictEqual(cjsImpl.fn(), 42);\n\n  mock.restore();\n\n  // The mock is restored, so the original builtin module is returned.\n  esmImpl = await import('node:readline');\n  cjsImpl = require('node:readline');\n\n  assert.strictEqual(typeof esmImpl.cursorTo, 'function');\n  assert.strictEqual(typeof cjsImpl.cursorTo, 'function');\n  assert.strictEqual(esmImpl.fn, undefined);\n  assert.strictEqual(cjsImpl.fn, undefined);\n});\n</code></pre>"
            },
            {
              "textRaw": "`mock.property(object, propertyName[, value])`",
              "name": "property",
              "type": "method",
              "meta": {
                "added": [
                  "v24.3.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`object` {Object} The object whose value is being mocked.",
                      "name": "object",
                      "type": "Object",
                      "desc": "The object whose value is being mocked."
                    },
                    {
                      "textRaw": "`propertyName` {string|symbol} The identifier of the property on `object` to mock.",
                      "name": "propertyName",
                      "type": "string|symbol",
                      "desc": "The identifier of the property on `object` to mock."
                    },
                    {
                      "textRaw": "`value` {any} An optional value used as the mock value for `object[propertyName]`. **Default:** The original property value.",
                      "name": "value",
                      "type": "any",
                      "default": "The original property value",
                      "desc": "An optional value used as the mock value for `object[propertyName]`.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Proxy} A proxy to the mocked object. The mocked object contains a special `mock` property, which is an instance of `MockPropertyContext`, and can be used for inspecting and changing the behavior of the mocked property.",
                    "name": "return",
                    "type": "Proxy",
                    "desc": "A proxy to the mocked object. The mocked object contains a special `mock` property, which is an instance of `MockPropertyContext`, and can be used for inspecting and changing the behavior of the mocked property."
                  }
                }
              ],
              "desc": "<p>Creates a mock for a property value on an object. This allows you to track and control access to a specific property,\nincluding how many times it is read (getter) or written (setter), and to restore the original value after mocking.</p>\n<pre><code class=\"language-js\">test('mocks a property value', (t) => {\n  const obj = { foo: 42 };\n  const prop = t.mock.property(obj, 'foo', 100);\n\n  assert.strictEqual(obj.foo, 100);\n  assert.strictEqual(prop.mock.accessCount(), 1);\n  assert.strictEqual(prop.mock.accesses[0].type, 'get');\n  assert.strictEqual(prop.mock.accesses[0].value, 100);\n\n  obj.foo = 200;\n  assert.strictEqual(prop.mock.accessCount(), 2);\n  assert.strictEqual(prop.mock.accesses[1].type, 'set');\n  assert.strictEqual(prop.mock.accesses[1].value, 200);\n\n  prop.mock.restore();\n  assert.strictEqual(obj.foo, 42);\n});\n</code></pre>"
            },
            {
              "textRaw": "`mock.reset()`",
              "name": "reset",
              "type": "method",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This function restores the default behavior of all mocks that were previously\ncreated by this <code>MockTracker</code> and disassociates the mocks from the\n<code>MockTracker</code> instance. Once disassociated, the mocks can still be used, but the\n<code>MockTracker</code> instance can no longer be used to reset their behavior or\notherwise interact with them.</p>\n<p>After each test completes, this function is called on the test context's\n<code>MockTracker</code>. If the global <code>MockTracker</code> is used extensively, calling this\nfunction manually is recommended.</p>"
            },
            {
              "textRaw": "`mock.restoreAll()`",
              "name": "restoreAll",
              "type": "method",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This function restores the default behavior of all mocks that were previously\ncreated by this <code>MockTracker</code>. Unlike <code>mock.reset()</code>, <code>mock.restoreAll()</code> does\nnot disassociate the mocks from the <code>MockTracker</code> instance.</p>"
            },
            {
              "textRaw": "`mock.setter(object, methodName[, implementation][, options])`",
              "name": "setter",
              "type": "method",
              "meta": {
                "added": [
                  "v19.3.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "object"
                    },
                    {
                      "name": "methodName"
                    },
                    {
                      "name": "implementation",
                      "optional": true
                    },
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is syntax sugar for <a href=\"#mockmethodobject-methodname-implementation-options\"><code>MockTracker.method</code></a> with <code>options.setter</code>\nset to <code>true</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `MockTimers`",
          "name": "MockTimers",
          "type": "class",
          "meta": {
            "added": [
              "v20.4.0",
              "v18.19.0"
            ],
            "changes": [
              {
                "version": "v23.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/55398",
                "description": "The Mock Timers is now stable."
              }
            ]
          },
          "desc": "<p>Mocking timers is a technique commonly used in software testing to simulate and\ncontrol the behavior of timers, such as <code>setInterval</code> and <code>setTimeout</code>,\nwithout actually waiting for the specified time intervals.</p>\n<p>MockTimers is also able to mock the <code>Date</code> object.</p>\n<p>The <a href=\"#class-mocktracker\"><code>MockTracker</code></a> provides a top-level <code>timers</code> export\nwhich is a <code>MockTimers</code> instance.</p>",
          "methods": [
            {
              "textRaw": "`timers.enable([enableOptions])`",
              "name": "enable",
              "type": "method",
              "meta": {
                "added": [
                  "v20.4.0",
                  "v18.19.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.2.0",
                      "v20.11.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/48638",
                    "description": "Updated parameters to be an option object with available APIs and the default initial epoch."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`enableOptions` {Object} Optional configuration options for enabling timer mocking. The following properties are supported:",
                      "name": "enableOptions",
                      "type": "Object",
                      "desc": "Optional configuration options for enabling timer mocking. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`apis` {Array} An optional array containing the timers to mock. The currently supported timer values are `'setInterval'`, `'setTimeout'`, `'setImmediate'`, and `'Date'`. **Default:** `['setInterval', 'setTimeout', 'setImmediate', 'Date']`. If no array is provided, all time related APIs (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, `'clearTimeout'`, `'setImmediate'`, `'clearImmediate'`, and `'Date'`) will be mocked by default.",
                          "name": "apis",
                          "type": "Array",
                          "default": "`['setInterval', 'setTimeout', 'setImmediate', 'Date']`. If no array is provided, all time related APIs (`'setInterval'`, `'clearInterval'`, `'setTimeout'`, `'clearTimeout'`, `'setImmediate'`, `'clearImmediate'`, and `'Date'`) will be mocked by default",
                          "desc": "An optional array containing the timers to mock. The currently supported timer values are `'setInterval'`, `'setTimeout'`, `'setImmediate'`, and `'Date'`."
                        },
                        {
                          "textRaw": "`now` {number|Date} An optional number or Date object representing the initial time (in milliseconds) to use as the value for `Date.now()`. **Default:** `0`.",
                          "name": "now",
                          "type": "number|Date",
                          "default": "`0`",
                          "desc": "An optional number or Date object representing the initial time (in milliseconds) to use as the value for `Date.now()`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Enables timer mocking for the specified timers.</p>\n<p><strong>Note:</strong> When you enable mocking for a specific timer, its associated\nclear function will also be implicitly mocked.</p>\n<p><strong>Note:</strong> Mocking <code>Date</code> will affect the behavior of the mocked timers\nas they use the same internal clock.</p>\n<p>Example usage without setting initial time:</p>\n<pre><code class=\"language-mjs\">import { mock } from 'node:test';\nmock.timers.enable({ apis: ['setInterval'] });\n</code></pre>\n<pre><code class=\"language-cjs\">const { mock } = require('node:test');\nmock.timers.enable({ apis: ['setInterval'] });\n</code></pre>\n<p>The above example enables mocking for the <code>setInterval</code> timer and\nimplicitly mocks the <code>clearInterval</code> function. Only the <code>setInterval</code>\nand <code>clearInterval</code> functions from <a href=\"./timers.html\">node:timers</a>,\n<a href=\"./timers.html#timers-promises-api\">node:timers/promises</a>, and\n<code>globalThis</code> will be mocked.</p>\n<p>Example usage with initial time set</p>\n<pre><code class=\"language-mjs\">import { mock } from 'node:test';\nmock.timers.enable({ apis: ['Date'], now: 1000 });\n</code></pre>\n<pre><code class=\"language-cjs\">const { mock } = require('node:test');\nmock.timers.enable({ apis: ['Date'], now: 1000 });\n</code></pre>\n<p>Example usage with initial Date object as time set</p>\n<pre><code class=\"language-mjs\">import { mock } from 'node:test';\nmock.timers.enable({ apis: ['Date'], now: new Date() });\n</code></pre>\n<pre><code class=\"language-cjs\">const { mock } = require('node:test');\nmock.timers.enable({ apis: ['Date'], now: new Date() });\n</code></pre>\n<p>Alternatively, if you call <code>mock.timers.enable()</code> without any parameters:</p>\n<p>All timers (<code>'setInterval'</code>, <code>'clearInterval'</code>, <code>'setTimeout'</code>, <code>'clearTimeout'</code>,\n<code>'setImmediate'</code>, and <code>'clearImmediate'</code>) will be mocked. The <code>setInterval</code>,\n<code>clearInterval</code>, <code>setTimeout</code>, <code>clearTimeout</code>, <code>setImmediate</code>, and\n<code>clearImmediate</code> functions from <code>node:timers</code>, <code>node:timers/promises</code>, and\n<code>globalThis</code> will be mocked. As well as the global <code>Date</code> object.</p>"
            },
            {
              "textRaw": "`timers.reset()`",
              "name": "reset",
              "type": "method",
              "meta": {
                "added": [
                  "v20.4.0",
                  "v18.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This function restores the default behavior of all mocks that were previously\ncreated by this  <code>MockTimers</code> instance and disassociates the mocks\nfrom the  <code>MockTracker</code> instance.</p>\n<p><strong>Note:</strong> After each test completes, this function is called on\nthe test context's  <code>MockTracker</code>.</p>\n<pre><code class=\"language-mjs\">import { mock } from 'node:test';\nmock.timers.reset();\n</code></pre>\n<pre><code class=\"language-cjs\">const { mock } = require('node:test');\nmock.timers.reset();\n</code></pre>"
            },
            {
              "textRaw": "`timers[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <code>timers.reset()</code>.</p>"
            },
            {
              "textRaw": "`timers.tick([milliseconds])`",
              "name": "tick",
              "type": "method",
              "meta": {
                "added": [
                  "v20.4.0",
                  "v18.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`milliseconds` {number} The amount of time, in milliseconds, to advance the timers. **Default:** `1`.",
                      "name": "milliseconds",
                      "type": "number",
                      "default": "`1`",
                      "desc": "The amount of time, in milliseconds, to advance the timers.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Advances time for all mocked timers.</p>\n<p><strong>Note:</strong> This diverges from how <code>setTimeout</code> in Node.js behaves and accepts\nonly positive numbers. In Node.js, <code>setTimeout</code> with negative numbers is\nonly supported for web compatibility reasons.</p>\n<p>The following example mocks a <code>setTimeout</code> function and\nby using <code>.tick</code> advances in\ntime triggering all pending timers.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n\n  setTimeout(fn, 9999);\n\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<p>Alternatively, the <code>.tick</code> function can be called many times</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n  const nineSecs = 9000;\n  setTimeout(fn, nineSecs);\n\n  const threeSeconds = 3000;\n  context.mock.timers.tick(threeSeconds);\n  context.mock.timers.tick(threeSeconds);\n  context.mock.timers.tick(threeSeconds);\n\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n  const nineSecs = 9000;\n  setTimeout(fn, nineSecs);\n\n  const threeSeconds = 3000;\n  context.mock.timers.tick(threeSeconds);\n  context.mock.timers.tick(threeSeconds);\n  context.mock.timers.tick(threeSeconds);\n\n  assert.strictEqual(fn.mock.callCount(), 1);\n});\n</code></pre>\n<p>Advancing time using <code>.tick</code> will also advance the time for any <code>Date</code> object\ncreated after the mock was enabled (if <code>Date</code> was also set to be mocked).</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  setTimeout(fn, 9999);\n\n  assert.strictEqual(fn.mock.callCount(), 0);\n  assert.strictEqual(Date.now(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n  assert.strictEqual(Date.now(), 9999);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n\n  setTimeout(fn, 9999);\n  assert.strictEqual(fn.mock.callCount(), 0);\n  assert.strictEqual(Date.now(), 0);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(fn.mock.callCount(), 1);\n  assert.strictEqual(Date.now(), 9999);\n});\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Using clear functions",
                  "name": "using_clear_functions",
                  "type": "module",
                  "desc": "<p>As mentioned, all clear functions from timers (<code>clearTimeout</code>, <code>clearInterval</code>,and\n<code>clearImmediate</code>) are implicitly mocked. Take a look at this example using <code>setTimeout</code>:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n  const id = setTimeout(fn, 9999);\n\n  // Implicitly mocked as well\n  clearTimeout(id);\n  context.mock.timers.tick(9999);\n\n  // As that setTimeout was cleared the mock function will never be called\n  assert.strictEqual(fn.mock.callCount(), 0);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', (context) => {\n  const fn = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n  const id = setTimeout(fn, 9999);\n\n  // Implicitly mocked as well\n  clearTimeout(id);\n  context.mock.timers.tick(9999);\n\n  // As that setTimeout was cleared the mock function will never be called\n  assert.strictEqual(fn.mock.callCount(), 0);\n});\n</code></pre>",
                  "displayName": "Using clear functions"
                },
                {
                  "textRaw": "Working with Node.js timers modules",
                  "name": "working_with_node.js_timers_modules",
                  "type": "module",
                  "desc": "<p>Once you enable mocking timers, <a href=\"./timers.html\">node:timers</a>,\n<a href=\"./timers.html#timers-promises-api\">node:timers/promises</a> modules,\nand timers from the Node.js global context are enabled:</p>\n<p><strong>Note:</strong> Destructuring functions such as\n<code>import { setTimeout } from 'node:timers'</code> is currently\nnot supported by this API.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\nimport nodeTimers from 'node:timers';\nimport nodeTimersPromises from 'node:timers/promises';\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', async (context) => {\n  const globalTimeoutObjectSpy = context.mock.fn();\n  const nodeTimerSpy = context.mock.fn();\n  const nodeTimerPromiseSpy = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n  setTimeout(globalTimeoutObjectSpy, 9999);\n  nodeTimers.setTimeout(nodeTimerSpy, 9999);\n\n  const promise = nodeTimersPromises.setTimeout(9999).then(nodeTimerPromiseSpy);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(globalTimeoutObjectSpy.mock.callCount(), 1);\n  assert.strictEqual(nodeTimerSpy.mock.callCount(), 1);\n  await promise;\n  assert.strictEqual(nodeTimerPromiseSpy.mock.callCount(), 1);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\nconst nodeTimers = require('node:timers');\nconst nodeTimersPromises = require('node:timers/promises');\n\ntest('mocks setTimeout to be executed synchronously without having to actually wait for it', async (context) => {\n  const globalTimeoutObjectSpy = context.mock.fn();\n  const nodeTimerSpy = context.mock.fn();\n  const nodeTimerPromiseSpy = context.mock.fn();\n\n  // Optionally choose what to mock\n  context.mock.timers.enable({ apis: ['setTimeout'] });\n  setTimeout(globalTimeoutObjectSpy, 9999);\n  nodeTimers.setTimeout(nodeTimerSpy, 9999);\n\n  const promise = nodeTimersPromises.setTimeout(9999).then(nodeTimerPromiseSpy);\n\n  // Advance in time\n  context.mock.timers.tick(9999);\n  assert.strictEqual(globalTimeoutObjectSpy.mock.callCount(), 1);\n  assert.strictEqual(nodeTimerSpy.mock.callCount(), 1);\n  await promise;\n  assert.strictEqual(nodeTimerPromiseSpy.mock.callCount(), 1);\n});\n</code></pre>\n<p>In Node.js, <code>setInterval</code> from <a href=\"./timers.html#timers-promises-api\">node:timers/promises</a>\nis an <code>AsyncGenerator</code> and is also supported by this API:</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\nimport nodeTimersPromises from 'node:timers/promises';\ntest('should tick five times testing a real use case', async (context) => {\n  context.mock.timers.enable({ apis: ['setInterval'] });\n\n  const expectedIterations = 3;\n  const interval = 1000;\n  const startedAt = Date.now();\n  async function run() {\n    const times = [];\n    for await (const time of nodeTimersPromises.setInterval(interval, startedAt)) {\n      times.push(time);\n      if (times.length === expectedIterations) break;\n    }\n    return times;\n  }\n\n  const r = run();\n  context.mock.timers.tick(interval);\n  context.mock.timers.tick(interval);\n  context.mock.timers.tick(interval);\n\n  const timeResults = await r;\n  assert.strictEqual(timeResults.length, expectedIterations);\n  for (let it = 1; it &#x3C; expectedIterations; it++) {\n    assert.strictEqual(timeResults[it - 1], startedAt + (interval * it));\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\nconst nodeTimersPromises = require('node:timers/promises');\ntest('should tick five times testing a real use case', async (context) => {\n  context.mock.timers.enable({ apis: ['setInterval'] });\n\n  const expectedIterations = 3;\n  const interval = 1000;\n  const startedAt = Date.now();\n  async function run() {\n    const times = [];\n    for await (const time of nodeTimersPromises.setInterval(interval, startedAt)) {\n      times.push(time);\n      if (times.length === expectedIterations) break;\n    }\n    return times;\n  }\n\n  const r = run();\n  context.mock.timers.tick(interval);\n  context.mock.timers.tick(interval);\n  context.mock.timers.tick(interval);\n\n  const timeResults = await r;\n  assert.strictEqual(timeResults.length, expectedIterations);\n  for (let it = 1; it &#x3C; expectedIterations; it++) {\n    assert.strictEqual(timeResults[it - 1], startedAt + (interval * it));\n  }\n});\n</code></pre>",
                  "displayName": "Working with Node.js timers modules"
                }
              ]
            },
            {
              "textRaw": "`timers.runAll()`",
              "name": "runAll",
              "type": "method",
              "meta": {
                "added": [
                  "v20.4.0",
                  "v18.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Triggers all pending mocked timers immediately. If the <code>Date</code> object is also\nmocked, it will also advance the <code>Date</code> object to the furthest timer's time.</p>\n<p>The example below triggers all pending timers immediately,\ncausing them to execute without any delay.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('runAll functions following the given order', (context) => {\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  const results = [];\n  setTimeout(() => results.push(1), 9999);\n\n  // Notice that if both timers have the same timeout,\n  // the order of execution is guaranteed\n  setTimeout(() => results.push(3), 8888);\n  setTimeout(() => results.push(2), 8888);\n\n  assert.deepStrictEqual(results, []);\n\n  context.mock.timers.runAll();\n  assert.deepStrictEqual(results, [3, 2, 1]);\n  // The Date object is also advanced to the furthest timer's time\n  assert.strictEqual(Date.now(), 9999);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('runAll functions following the given order', (context) => {\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  const results = [];\n  setTimeout(() => results.push(1), 9999);\n\n  // Notice that if both timers have the same timeout,\n  // the order of execution is guaranteed\n  setTimeout(() => results.push(3), 8888);\n  setTimeout(() => results.push(2), 8888);\n\n  assert.deepStrictEqual(results, []);\n\n  context.mock.timers.runAll();\n  assert.deepStrictEqual(results, [3, 2, 1]);\n  // The Date object is also advanced to the furthest timer's time\n  assert.strictEqual(Date.now(), 9999);\n});\n</code></pre>\n<p><strong>Note:</strong> The <code>runAll()</code> function is specifically designed for\ntriggering timers in the context of timer mocking.\nIt does not have any effect on real-time system\nclocks or actual timers outside of the mocking environment.</p>"
            },
            {
              "textRaw": "`timers.setTime(milliseconds)`",
              "name": "setTime",
              "type": "method",
              "meta": {
                "added": [
                  "v21.2.0",
                  "v20.11.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "milliseconds"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the current Unix timestamp that will be used as reference for any mocked\n<code>Date</code> objects.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('runAll functions following the given order', (context) => {\n  const now = Date.now();\n  const setTime = 1000;\n  // Date.now is not mocked\n  assert.deepStrictEqual(Date.now(), now);\n\n  context.mock.timers.enable({ apis: ['Date'] });\n  context.mock.timers.setTime(setTime);\n  // Date.now is now 1000\n  assert.strictEqual(Date.now(), setTime);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('setTime replaces current time', (context) => {\n  const now = Date.now();\n  const setTime = 1000;\n  // Date.now is not mocked\n  assert.deepStrictEqual(Date.now(), now);\n\n  context.mock.timers.enable({ apis: ['Date'] });\n  context.mock.timers.setTime(setTime);\n  // Date.now is now 1000\n  assert.strictEqual(Date.now(), setTime);\n});\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Dates and Timers working together",
                  "name": "dates_and_timers_working_together",
                  "type": "module",
                  "desc": "<p>Dates and timer objects are dependent on each other. If you use <code>setTime()</code> to\npass the current time to the mocked <code>Date</code> object, the set timers with\n<code>setTimeout</code> and <code>setInterval</code> will <strong>not</strong> be affected.</p>\n<p>However, the <code>tick</code> method <strong>will</strong> advance the mocked <code>Date</code> object.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('runAll functions following the given order', (context) => {\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  const results = [];\n  setTimeout(() => results.push(1), 9999);\n\n  assert.deepStrictEqual(results, []);\n  context.mock.timers.setTime(12000);\n  assert.deepStrictEqual(results, []);\n  // The date is advanced but the timers don't tick\n  assert.strictEqual(Date.now(), 12000);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst { test } = require('node:test');\n\ntest('runAll functions following the given order', (context) => {\n  context.mock.timers.enable({ apis: ['setTimeout', 'Date'] });\n  const results = [];\n  setTimeout(() => results.push(1), 9999);\n\n  assert.deepStrictEqual(results, []);\n  context.mock.timers.setTime(12000);\n  assert.deepStrictEqual(results, []);\n  // The date is advanced but the timers don't tick\n  assert.strictEqual(Date.now(), 12000);\n});\n</code></pre>",
                  "displayName": "Dates and Timers working together"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "Class: `TestsStream`",
          "name": "TestsStream",
          "type": "class",
          "meta": {
            "added": [
              "v18.9.0",
              "v16.19.0"
            ],
            "changes": [
              {
                "version": "v26.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/63435",
                "description": "Added `parentId` to test events that carry a `testId`."
              },
              {
                "version": [
                  "v20.0.0",
                  "v19.9.0",
                  "v18.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/47094",
                "description": "added type to test:pass and test:fail events for when the test is a suite."
              }
            ]
          },
          "desc": "<ul>\n<li>Extends <a href=\"stream.html#class-streamreadable\"><code>&#x3C;Readable></code></a></li>\n</ul>\n<p>A successful call to <a href=\"#runoptions\"><code>run()</code></a> method will return a new <a href=\"test.html#class-testsstream\"><code>&#x3C;TestsStream></code></a>\nobject, streaming a series of events representing the execution of the tests. <code>TestsStream</code> will emit events, in the order of the tests definition</p>\n<p>Some of the events are guaranteed to be emitted in the same order as the tests\nare defined, while others are emitted in the order that the tests execute.</p>",
          "events": [
            {
              "textRaw": "Event: `'test:coverage'`",
              "name": "test:coverage",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`summary` {Object} An object containing the coverage report.",
                      "name": "summary",
                      "type": "Object",
                      "desc": "An object containing the coverage report.",
                      "options": [
                        {
                          "textRaw": "`files` {Array} An array of coverage reports for individual files. Each report is an object with the following schema:",
                          "name": "files",
                          "type": "Array",
                          "desc": "An array of coverage reports for individual files. Each report is an object with the following schema:",
                          "options": [
                            {
                              "textRaw": "`path` {string} The absolute path of the file.",
                              "name": "path",
                              "type": "string",
                              "desc": "The absolute path of the file."
                            },
                            {
                              "textRaw": "`totalLineCount` {number} The total number of lines.",
                              "name": "totalLineCount",
                              "type": "number",
                              "desc": "The total number of lines."
                            },
                            {
                              "textRaw": "`totalBranchCount` {number} The total number of branches.",
                              "name": "totalBranchCount",
                              "type": "number",
                              "desc": "The total number of branches."
                            },
                            {
                              "textRaw": "`totalFunctionCount` {number} The total number of functions.",
                              "name": "totalFunctionCount",
                              "type": "number",
                              "desc": "The total number of functions."
                            },
                            {
                              "textRaw": "`coveredLineCount` {number} The number of covered lines.",
                              "name": "coveredLineCount",
                              "type": "number",
                              "desc": "The number of covered lines."
                            },
                            {
                              "textRaw": "`coveredBranchCount` {number} The number of covered branches.",
                              "name": "coveredBranchCount",
                              "type": "number",
                              "desc": "The number of covered branches."
                            },
                            {
                              "textRaw": "`coveredFunctionCount` {number} The number of covered functions.",
                              "name": "coveredFunctionCount",
                              "type": "number",
                              "desc": "The number of covered functions."
                            },
                            {
                              "textRaw": "`coveredLinePercent` {number} The percentage of lines covered.",
                              "name": "coveredLinePercent",
                              "type": "number",
                              "desc": "The percentage of lines covered."
                            },
                            {
                              "textRaw": "`coveredBranchPercent` {number} The percentage of branches covered.",
                              "name": "coveredBranchPercent",
                              "type": "number",
                              "desc": "The percentage of branches covered."
                            },
                            {
                              "textRaw": "`coveredFunctionPercent` {number} The percentage of functions covered.",
                              "name": "coveredFunctionPercent",
                              "type": "number",
                              "desc": "The percentage of functions covered."
                            },
                            {
                              "textRaw": "`functions` {Array} An array of functions representing function coverage.",
                              "name": "functions",
                              "type": "Array",
                              "desc": "An array of functions representing function coverage.",
                              "options": [
                                {
                                  "textRaw": "`name` {string} The name of the function.",
                                  "name": "name",
                                  "type": "string",
                                  "desc": "The name of the function."
                                },
                                {
                                  "textRaw": "`line` {number} The line number where the function is defined.",
                                  "name": "line",
                                  "type": "number",
                                  "desc": "The line number where the function is defined."
                                },
                                {
                                  "textRaw": "`count` {number} The number of times the function was called.",
                                  "name": "count",
                                  "type": "number",
                                  "desc": "The number of times the function was called."
                                }
                              ]
                            },
                            {
                              "textRaw": "`branches` {Array} An array of branches representing branch coverage.",
                              "name": "branches",
                              "type": "Array",
                              "desc": "An array of branches representing branch coverage.",
                              "options": [
                                {
                                  "textRaw": "`line` {number} The line number where the branch is defined.",
                                  "name": "line",
                                  "type": "number",
                                  "desc": "The line number where the branch is defined."
                                },
                                {
                                  "textRaw": "`count` {number} The number of times the branch was taken.",
                                  "name": "count",
                                  "type": "number",
                                  "desc": "The number of times the branch was taken."
                                }
                              ]
                            },
                            {
                              "textRaw": "`lines` {Array} An array of lines representing line numbers and the number of times they were covered.",
                              "name": "lines",
                              "type": "Array",
                              "desc": "An array of lines representing line numbers and the number of times they were covered.",
                              "options": [
                                {
                                  "textRaw": "`line` {number} The line number.",
                                  "name": "line",
                                  "type": "number",
                                  "desc": "The line number."
                                },
                                {
                                  "textRaw": "`count` {number} The number of times the line was covered.",
                                  "name": "count",
                                  "type": "number",
                                  "desc": "The number of times the line was covered."
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "textRaw": "`thresholds` {Object} An object containing whether or not the coverage for each coverage type.",
                          "name": "thresholds",
                          "type": "Object",
                          "desc": "An object containing whether or not the coverage for each coverage type.",
                          "options": [
                            {
                              "textRaw": "`function` {number} The function coverage threshold.",
                              "name": "function",
                              "type": "number",
                              "desc": "The function coverage threshold."
                            },
                            {
                              "textRaw": "`branch` {number} The branch coverage threshold.",
                              "name": "branch",
                              "type": "number",
                              "desc": "The branch coverage threshold."
                            },
                            {
                              "textRaw": "`line` {number} The line coverage threshold.",
                              "name": "line",
                              "type": "number",
                              "desc": "The line coverage threshold."
                            }
                          ]
                        },
                        {
                          "textRaw": "`totals` {Object} An object containing a summary of coverage for all files.",
                          "name": "totals",
                          "type": "Object",
                          "desc": "An object containing a summary of coverage for all files.",
                          "options": [
                            {
                              "textRaw": "`totalLineCount` {number} The total number of lines.",
                              "name": "totalLineCount",
                              "type": "number",
                              "desc": "The total number of lines."
                            },
                            {
                              "textRaw": "`totalBranchCount` {number} The total number of branches.",
                              "name": "totalBranchCount",
                              "type": "number",
                              "desc": "The total number of branches."
                            },
                            {
                              "textRaw": "`totalFunctionCount` {number} The total number of functions.",
                              "name": "totalFunctionCount",
                              "type": "number",
                              "desc": "The total number of functions."
                            },
                            {
                              "textRaw": "`coveredLineCount` {number} The number of covered lines.",
                              "name": "coveredLineCount",
                              "type": "number",
                              "desc": "The number of covered lines."
                            },
                            {
                              "textRaw": "`coveredBranchCount` {number} The number of covered branches.",
                              "name": "coveredBranchCount",
                              "type": "number",
                              "desc": "The number of covered branches."
                            },
                            {
                              "textRaw": "`coveredFunctionCount` {number} The number of covered functions.",
                              "name": "coveredFunctionCount",
                              "type": "number",
                              "desc": "The number of covered functions."
                            },
                            {
                              "textRaw": "`coveredLinePercent` {number} The percentage of lines covered.",
                              "name": "coveredLinePercent",
                              "type": "number",
                              "desc": "The percentage of lines covered."
                            },
                            {
                              "textRaw": "`coveredBranchPercent` {number} The percentage of branches covered.",
                              "name": "coveredBranchPercent",
                              "type": "number",
                              "desc": "The percentage of branches covered."
                            },
                            {
                              "textRaw": "`coveredFunctionPercent` {number} The percentage of functions covered.",
                              "name": "coveredFunctionPercent",
                              "type": "number",
                              "desc": "The percentage of functions covered."
                            }
                          ]
                        },
                        {
                          "textRaw": "`workingDirectory` {string} The working directory when code coverage began. This is useful for displaying relative path names in case the tests changed the working directory of the Node.js process.",
                          "name": "workingDirectory",
                          "type": "string",
                          "desc": "The working directory when code coverage began. This is useful for displaying relative path names in case the tests changed the working directory of the Node.js process."
                        }
                      ]
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when code coverage is enabled and all tests have completed.</p>"
            },
            {
              "textRaw": "Event: `'test:complete'`",
              "name": "test:complete",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "column",
                      "type": "number|undefined",
                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`details` {Object} Additional execution metadata.",
                      "name": "details",
                      "type": "Object",
                      "desc": "Additional execution metadata.",
                      "options": [
                        {
                          "textRaw": "`passed` {boolean} Whether the test passed or not.",
                          "name": "passed",
                          "type": "boolean",
                          "desc": "Whether the test passed or not."
                        },
                        {
                          "textRaw": "`duration_ms` {number} The duration of the test in milliseconds.",
                          "name": "duration_ms",
                          "type": "number",
                          "desc": "The duration of the test in milliseconds."
                        },
                        {
                          "textRaw": "`error` {Error|undefined} An error wrapping the error thrown by the test if it did not pass.",
                          "name": "error",
                          "type": "Error|undefined",
                          "desc": "An error wrapping the error thrown by the test if it did not pass.",
                          "options": [
                            {
                              "textRaw": "`cause` {Error} The actual error thrown by the test.",
                              "name": "cause",
                              "type": "Error",
                              "desc": "The actual error thrown by the test."
                            }
                          ]
                        },
                        {
                          "textRaw": "`type` {string|undefined} The type of the test, used to denote whether this is a suite.",
                          "name": "type",
                          "type": "string|undefined",
                          "desc": "The type of the test, used to denote whether this is a suite."
                        }
                      ]
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
                    },
                    {
                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "line",
                      "type": "number|undefined",
                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`name` {string} The test name.",
                      "name": "name",
                      "type": "string",
                      "desc": "The test name."
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    },
                    {
                      "textRaw": "`parentId` {number|undefined} The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.",
                      "name": "parentId",
                      "type": "number|undefined",
                      "desc": "The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave."
                    },
                    {
                      "textRaw": "`tags` {string[]} The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.",
                      "name": "tags",
                      "type": "string[]",
                      "desc": "The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags."
                    },
                    {
                      "textRaw": "`testId` {number} A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.",
                      "name": "testId",
                      "type": "number",
                      "desc": "A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters."
                    },
                    {
                      "textRaw": "`testNumber` {number} The ordinal number of the test.",
                      "name": "testNumber",
                      "type": "number",
                      "desc": "The ordinal number of the test."
                    },
                    {
                      "textRaw": "`todo` {string|boolean|undefined} Present if `context.todo` is called",
                      "name": "todo",
                      "type": "string|boolean|undefined",
                      "desc": "Present if `context.todo` is called"
                    },
                    {
                      "textRaw": "`skip` {string|boolean|undefined} Present if `context.skip` is called",
                      "name": "skip",
                      "type": "string|boolean|undefined",
                      "desc": "Present if `context.skip` is called"
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a test completes its execution.\nThis event is not emitted in the same order as the tests are\ndefined.\nThe corresponding declaration ordered events are <code>'test:pass'</code> and <code>'test:fail'</code>.</p>"
            },
            {
              "textRaw": "Event: `'test:dequeue'`",
              "name": "test:dequeue",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "column",
                      "type": "number|undefined",
                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
                    },
                    {
                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "line",
                      "type": "number|undefined",
                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`name` {string} The test name.",
                      "name": "name",
                      "type": "string",
                      "desc": "The test name."
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    },
                    {
                      "textRaw": "`parentId` {number|undefined} The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.",
                      "name": "parentId",
                      "type": "number|undefined",
                      "desc": "The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave."
                    },
                    {
                      "textRaw": "`tags` {string[]} The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.",
                      "name": "tags",
                      "type": "string[]",
                      "desc": "The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags."
                    },
                    {
                      "textRaw": "`testId` {number} A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.",
                      "name": "testId",
                      "type": "number",
                      "desc": "A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters."
                    },
                    {
                      "textRaw": "`type` {string} The test type. Either `'suite'` or `'test'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "The test type. Either `'suite'` or `'test'`."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a test is dequeued, right before it is executed.\nThis event is not guaranteed to be emitted in the same order as the tests are\ndefined. The corresponding declaration ordered event is <code>'test:start'</code>.</p>"
            },
            {
              "textRaw": "Event: `'test:diagnostic'`",
              "name": "test:diagnostic",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "column",
                      "type": "number|undefined",
                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
                    },
                    {
                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "line",
                      "type": "number|undefined",
                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`message` {string} The diagnostic message.",
                      "name": "message",
                      "type": "string",
                      "desc": "The diagnostic message."
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    },
                    {
                      "textRaw": "`level` {string} The severity level of the diagnostic message. Possible values are:",
                      "name": "level",
                      "type": "string",
                      "desc": "The severity level of the diagnostic message. Possible values are:",
                      "options": [
                        {
                          "textRaw": "`'info'`: Informational messages.",
                          "desc": "`'info'`: Informational messages."
                        },
                        {
                          "textRaw": "`'warn'`: Warnings.",
                          "desc": "`'warn'`: Warnings."
                        },
                        {
                          "textRaw": "`'error'`: Errors.",
                          "desc": "`'error'`: Errors."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when <a href=\"#contextdiagnosticmessage\"><code>context.diagnostic</code></a> is called.\nThis event is guaranteed to be emitted in the same order as the tests are\ndefined.</p>"
            },
            {
              "textRaw": "Event: `'test:enqueue'`",
              "name": "test:enqueue",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "column",
                      "type": "number|undefined",
                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
                    },
                    {
                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "line",
                      "type": "number|undefined",
                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`name` {string} The test name.",
                      "name": "name",
                      "type": "string",
                      "desc": "The test name."
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    },
                    {
                      "textRaw": "`parentId` {number|undefined} The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.",
                      "name": "parentId",
                      "type": "number|undefined",
                      "desc": "The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave."
                    },
                    {
                      "textRaw": "`tags` {string[]} The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.",
                      "name": "tags",
                      "type": "string[]",
                      "desc": "The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags."
                    },
                    {
                      "textRaw": "`testId` {number} A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.",
                      "name": "testId",
                      "type": "number",
                      "desc": "A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters."
                    },
                    {
                      "textRaw": "`type` {string} The test type. Either `'suite'` or `'test'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "The test type. Either `'suite'` or `'test'`."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a test is enqueued for execution.</p>"
            },
            {
              "textRaw": "Event: `'test:fail'`",
              "name": "test:fail",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "column",
                      "type": "number|undefined",
                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`details` {Object} Additional execution metadata.",
                      "name": "details",
                      "type": "Object",
                      "desc": "Additional execution metadata.",
                      "options": [
                        {
                          "textRaw": "`duration_ms` {number} The duration of the test in milliseconds.",
                          "name": "duration_ms",
                          "type": "number",
                          "desc": "The duration of the test in milliseconds."
                        },
                        {
                          "textRaw": "`error` {Error} An error wrapping the error thrown by the test.",
                          "name": "error",
                          "type": "Error",
                          "desc": "An error wrapping the error thrown by the test.",
                          "options": [
                            {
                              "textRaw": "`cause` {Error} The actual error thrown by the test.",
                              "name": "cause",
                              "type": "Error",
                              "desc": "The actual error thrown by the test."
                            }
                          ]
                        },
                        {
                          "textRaw": "`type` {string|undefined} The type of the test, used to denote whether this is a suite.",
                          "name": "type",
                          "type": "string|undefined",
                          "desc": "The type of the test, used to denote whether this is a suite."
                        },
                        {
                          "textRaw": "`attempt` {number|undefined} The attempt number of the test run, present only when using the `--test-rerun-failures` flag.",
                          "name": "attempt",
                          "type": "number|undefined",
                          "desc": "The attempt number of the test run, present only when using the `--test-rerun-failures` flag."
                        }
                      ]
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
                    },
                    {
                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "line",
                      "type": "number|undefined",
                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`name` {string} The test name.",
                      "name": "name",
                      "type": "string",
                      "desc": "The test name."
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    },
                    {
                      "textRaw": "`parentId` {number|undefined} The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.",
                      "name": "parentId",
                      "type": "number|undefined",
                      "desc": "The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave."
                    },
                    {
                      "textRaw": "`tags` {string[]} The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.",
                      "name": "tags",
                      "type": "string[]",
                      "desc": "The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags."
                    },
                    {
                      "textRaw": "`testId` {number} A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.",
                      "name": "testId",
                      "type": "number",
                      "desc": "A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters."
                    },
                    {
                      "textRaw": "`testNumber` {number} The ordinal number of the test.",
                      "name": "testNumber",
                      "type": "number",
                      "desc": "The ordinal number of the test."
                    },
                    {
                      "textRaw": "`todo` {string|boolean|undefined} Present if `context.todo` is called",
                      "name": "todo",
                      "type": "string|boolean|undefined",
                      "desc": "Present if `context.todo` is called"
                    },
                    {
                      "textRaw": "`skip` {string|boolean|undefined} Present if `context.skip` is called",
                      "name": "skip",
                      "type": "string|boolean|undefined",
                      "desc": "Present if `context.skip` is called"
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a test fails.\nThis event is guaranteed to be emitted in the same order as the tests are\ndefined.\nThe corresponding execution ordered event is <code>'test:complete'</code>.</p>"
            },
            {
              "textRaw": "Event: `'test:interrupted'`",
              "name": "test:interrupted",
              "type": "event",
              "meta": {
                "added": [
                  "v25.7.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`tests` {Array} An array of objects containing information about the interrupted tests.",
                      "name": "tests",
                      "type": "Array",
                      "desc": "An array of objects containing information about the interrupted tests.",
                      "options": [
                        {
                          "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                          "name": "column",
                          "type": "number|undefined",
                          "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                        },
                        {
                          "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                          "name": "file",
                          "type": "string|undefined",
                          "desc": "The path of the test file, `undefined` if test was run through the REPL."
                        },
                        {
                          "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                          "name": "line",
                          "type": "number|undefined",
                          "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                        },
                        {
                          "textRaw": "`name` {string} The test name.",
                          "name": "name",
                          "type": "string",
                          "desc": "The test name."
                        },
                        {
                          "textRaw": "`nesting` {number} The nesting level of the test.",
                          "name": "nesting",
                          "type": "number",
                          "desc": "The nesting level of the test."
                        }
                      ]
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when the test runner is interrupted by a <code>SIGINT</code> signal (e.g., when\npressing <kbd>Ctrl</kbd>+<kbd>C</kbd>). The event contains information about\nthe tests that were running at the time of interruption.</p>\n<p>When using process isolation (the default), the test name will be the file path\nsince the parent runner only knows about file-level tests. When using\n<code>--test-isolation=none</code>, the actual test name is shown.</p>"
            },
            {
              "textRaw": "Event: `'test:pass'`",
              "name": "test:pass",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "column",
                      "type": "number|undefined",
                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`details` {Object} Additional execution metadata.",
                      "name": "details",
                      "type": "Object",
                      "desc": "Additional execution metadata.",
                      "options": [
                        {
                          "textRaw": "`duration_ms` {number} The duration of the test in milliseconds.",
                          "name": "duration_ms",
                          "type": "number",
                          "desc": "The duration of the test in milliseconds."
                        },
                        {
                          "textRaw": "`type` {string|undefined} The type of the test, used to denote whether this is a suite.",
                          "name": "type",
                          "type": "string|undefined",
                          "desc": "The type of the test, used to denote whether this is a suite."
                        },
                        {
                          "textRaw": "`attempt` {number|undefined} The attempt number of the test run, present only when using the `--test-rerun-failures` flag.",
                          "name": "attempt",
                          "type": "number|undefined",
                          "desc": "The attempt number of the test run, present only when using the `--test-rerun-failures` flag."
                        },
                        {
                          "textRaw": "`passed_on_attempt` {number|undefined} The attempt number the test passed on, present only when using the `--test-rerun-failures` flag.",
                          "name": "passed_on_attempt",
                          "type": "number|undefined",
                          "desc": "The attempt number the test passed on, present only when using the `--test-rerun-failures` flag."
                        }
                      ]
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
                    },
                    {
                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "line",
                      "type": "number|undefined",
                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`name` {string} The test name.",
                      "name": "name",
                      "type": "string",
                      "desc": "The test name."
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    },
                    {
                      "textRaw": "`parentId` {number|undefined} The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.",
                      "name": "parentId",
                      "type": "number|undefined",
                      "desc": "The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave."
                    },
                    {
                      "textRaw": "`tags` {string[]} The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.",
                      "name": "tags",
                      "type": "string[]",
                      "desc": "The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags."
                    },
                    {
                      "textRaw": "`testId` {number} A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.",
                      "name": "testId",
                      "type": "number",
                      "desc": "A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters."
                    },
                    {
                      "textRaw": "`testNumber` {number} The ordinal number of the test.",
                      "name": "testNumber",
                      "type": "number",
                      "desc": "The ordinal number of the test."
                    },
                    {
                      "textRaw": "`todo` {string|boolean|undefined} Present if `context.todo` is called",
                      "name": "todo",
                      "type": "string|boolean|undefined",
                      "desc": "Present if `context.todo` is called"
                    },
                    {
                      "textRaw": "`skip` {string|boolean|undefined} Present if `context.skip` is called",
                      "name": "skip",
                      "type": "string|boolean|undefined",
                      "desc": "Present if `context.skip` is called"
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a test passes.\nThis event is guaranteed to be emitted in the same order as the tests are\ndefined.\nThe corresponding execution ordered event is <code>'test:complete'</code>.</p>"
            },
            {
              "textRaw": "Event: `'test:plan'`",
              "name": "test:plan",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "column",
                      "type": "number|undefined",
                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
                    },
                    {
                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "line",
                      "type": "number|undefined",
                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    },
                    {
                      "textRaw": "`count` {number} The number of subtests that have ran.",
                      "name": "count",
                      "type": "number",
                      "desc": "The number of subtests that have ran."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when all subtests have completed for a given test.\nThis event is guaranteed to be emitted in the same order as the tests are\ndefined.</p>"
            },
            {
              "textRaw": "Event: `'test:start'`",
              "name": "test:start",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`column` {number|undefined} The column number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "column",
                      "type": "number|undefined",
                      "desc": "The column number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file, `undefined` if test was run through the REPL.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file, `undefined` if test was run through the REPL."
                    },
                    {
                      "textRaw": "`line` {number|undefined} The line number where the test is defined, or `undefined` if the test was run through the REPL.",
                      "name": "line",
                      "type": "number|undefined",
                      "desc": "The line number where the test is defined, or `undefined` if the test was run through the REPL."
                    },
                    {
                      "textRaw": "`name` {string} The test name.",
                      "name": "name",
                      "type": "string",
                      "desc": "The test name."
                    },
                    {
                      "textRaw": "`nesting` {number} The nesting level of the test.",
                      "name": "nesting",
                      "type": "number",
                      "desc": "The nesting level of the test."
                    },
                    {
                      "textRaw": "`parentId` {number|undefined} The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave.",
                      "name": "parentId",
                      "type": "number|undefined",
                      "desc": "The `testId` of the enclosing test, or `undefined` for top-level tests. Lets custom reporters track lineage when concurrent siblings at the same nesting level interleave."
                    },
                    {
                      "textRaw": "`tags` {string[]} The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags.",
                      "name": "tags",
                      "type": "string[]",
                      "desc": "The flattened lowercased tags declared on the test and its ancestor suites, in declaration order. Empty for untagged tests. See Test tags."
                    },
                    {
                      "textRaw": "`testId` {number} A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters.",
                      "name": "testId",
                      "type": "number",
                      "desc": "A numeric identifier for this test instance, unique within the test file's process. Consistent across all events for the same test instance, enabling reliable correlation in custom reporters."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a test starts reporting its own and its subtests status.\nThis event is guaranteed to be emitted in the same order as the tests are\ndefined.\nThe corresponding execution ordered event is <code>'test:dequeue'</code>.</p>"
            },
            {
              "textRaw": "Event: `'test:stderr'`",
              "name": "test:stderr",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`file` {string} The path of the test file.",
                      "name": "file",
                      "type": "string",
                      "desc": "The path of the test file."
                    },
                    {
                      "textRaw": "`message` {string} The message written to `stderr`.",
                      "name": "message",
                      "type": "string",
                      "desc": "The message written to `stderr`."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a running test writes to <code>stderr</code>.\nThis event is only emitted if <code>--test</code> flag is passed.\nThis event is not guaranteed to be emitted in the same order as the tests are\ndefined.</p>"
            },
            {
              "textRaw": "Event: `'test:stdout'`",
              "name": "test:stdout",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`file` {string} The path of the test file.",
                      "name": "file",
                      "type": "string",
                      "desc": "The path of the test file."
                    },
                    {
                      "textRaw": "`message` {string} The message written to `stdout`.",
                      "name": "message",
                      "type": "string",
                      "desc": "The message written to `stdout`."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a running test writes to <code>stdout</code>.\nThis event is only emitted if <code>--test</code> flag is passed.\nThis event is not guaranteed to be emitted in the same order as the tests are\ndefined.</p>"
            },
            {
              "textRaw": "Event: `'test:summary'`",
              "name": "test:summary",
              "type": "event",
              "params": [
                {
                  "textRaw": "`data` {Object}",
                  "name": "data",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`counts` {Object} An object containing the counts of various test results.",
                      "name": "counts",
                      "type": "Object",
                      "desc": "An object containing the counts of various test results.",
                      "options": [
                        {
                          "textRaw": "`cancelled` {number} The total number of cancelled tests.",
                          "name": "cancelled",
                          "type": "number",
                          "desc": "The total number of cancelled tests."
                        },
                        {
                          "textRaw": "`failed` {number} The total number of failed tests.",
                          "name": "failed",
                          "type": "number",
                          "desc": "The total number of failed tests."
                        },
                        {
                          "textRaw": "`passed` {number} The total number of passed tests.",
                          "name": "passed",
                          "type": "number",
                          "desc": "The total number of passed tests."
                        },
                        {
                          "textRaw": "`skipped` {number} The total number of skipped tests.",
                          "name": "skipped",
                          "type": "number",
                          "desc": "The total number of skipped tests."
                        },
                        {
                          "textRaw": "`suites` {number} The total number of suites run.",
                          "name": "suites",
                          "type": "number",
                          "desc": "The total number of suites run."
                        },
                        {
                          "textRaw": "`tests` {number} The total number of tests run, excluding suites.",
                          "name": "tests",
                          "type": "number",
                          "desc": "The total number of tests run, excluding suites."
                        },
                        {
                          "textRaw": "`todo` {number} The total number of TODO tests.",
                          "name": "todo",
                          "type": "number",
                          "desc": "The total number of TODO tests."
                        },
                        {
                          "textRaw": "`topLevel` {number} The total number of top level tests and suites.",
                          "name": "topLevel",
                          "type": "number",
                          "desc": "The total number of top level tests and suites."
                        }
                      ]
                    },
                    {
                      "textRaw": "`duration_ms` {number} The duration of the test run in milliseconds.",
                      "name": "duration_ms",
                      "type": "number",
                      "desc": "The duration of the test run in milliseconds."
                    },
                    {
                      "textRaw": "`file` {string|undefined} The path of the test file that generated the summary. If the summary corresponds to multiple files, this value is `undefined`.",
                      "name": "file",
                      "type": "string|undefined",
                      "desc": "The path of the test file that generated the summary. If the summary corresponds to multiple files, this value is `undefined`."
                    },
                    {
                      "textRaw": "`success` {boolean} Indicates whether or not the test run is considered successful or not. If any error condition occurs, such as a failing test or unmet coverage threshold, this value will be set to `false`.",
                      "name": "success",
                      "type": "boolean",
                      "desc": "Indicates whether or not the test run is considered successful or not. If any error condition occurs, such as a failing test or unmet coverage threshold, this value will be set to `false`."
                    }
                  ]
                }
              ],
              "desc": "<p>Emitted when a test run completes. This event contains metrics pertaining to\nthe completed test run, and is useful for determining if a test run passed or\nfailed. If process-level test isolation is used, a <code>'test:summary'</code> event is\ngenerated for each test file in addition to a final cumulative summary.</p>"
            },
            {
              "textRaw": "Event: `'test:watch:drained'`",
              "name": "test:watch:drained",
              "type": "event",
              "params": [],
              "desc": "<p>Emitted when no more tests are queued for execution in watch mode.</p>"
            },
            {
              "textRaw": "Event: `'test:watch:restarted'`",
              "name": "test:watch:restarted",
              "type": "event",
              "params": [],
              "desc": "<p>Emitted when one or more tests are restarted due to a file change in watch mode.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `TestContext`",
          "name": "TestContext",
          "type": "class",
          "meta": {
            "added": [
              "v18.0.0",
              "v16.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v20.1.0",
                  "v18.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/47586",
                "description": "The `before` function was added to TestContext."
              }
            ]
          },
          "desc": "<p>An instance of <code>TestContext</code> is passed to each test function in order to\ninteract with the test runner. However, the <code>TestContext</code> constructor is not\nexposed as part of the API.</p>",
          "methods": [
            {
              "textRaw": "`context.before([fn][, options])`",
              "name": "before",
              "type": "method",
              "meta": {
                "added": [
                  "v20.1.0",
                  "v18.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function|AsyncFunction} The hook function. The first argument to this function is a `TestContext` object. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                      "name": "fn",
                      "type": "Function|AsyncFunction",
                      "default": "A no-op function",
                      "desc": "The hook function. The first argument to this function is a `TestContext` object. If the hook uses callbacks, the callback function is passed as the second argument.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Configuration options for the hook. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Allows aborting an in-progress hook."
                        },
                        {
                          "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`Infinity`",
                          "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to create a hook running before\nsubtest of the current test.</p>"
            },
            {
              "textRaw": "`context.beforeEach([fn][, options])`",
              "name": "beforeEach",
              "type": "method",
              "meta": {
                "added": [
                  "v18.8.0",
                  "v16.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function|AsyncFunction} The hook function. The first argument to this function is a `TestContext` object. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                      "name": "fn",
                      "type": "Function|AsyncFunction",
                      "default": "A no-op function",
                      "desc": "The hook function. The first argument to this function is a `TestContext` object. If the hook uses callbacks, the callback function is passed as the second argument.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Configuration options for the hook. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Allows aborting an in-progress hook."
                        },
                        {
                          "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`Infinity`",
                          "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to create a hook running\nbefore each subtest of the current test.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  t.beforeEach((t) => t.diagnostic(`about to run ${t.name}`));\n  await t.test(\n    'This is a subtest',\n    (t) => {\n      // Some relevant assertion here\n    },\n  );\n});\n</code></pre>"
            },
            {
              "textRaw": "`context.after([fn][, options])`",
              "name": "after",
              "type": "method",
              "meta": {
                "added": [
                  "v19.3.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function|AsyncFunction} The hook function. The first argument to this function is a `TestContext` object. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                      "name": "fn",
                      "type": "Function|AsyncFunction",
                      "default": "A no-op function",
                      "desc": "The hook function. The first argument to this function is a `TestContext` object. If the hook uses callbacks, the callback function is passed as the second argument.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Configuration options for the hook. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Allows aborting an in-progress hook."
                        },
                        {
                          "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`Infinity`",
                          "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to create a hook that runs after the current test\nfinishes.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  t.after((t) => t.diagnostic(`finished running ${t.name}`));\n  // Some relevant assertion here\n});\n</code></pre>"
            },
            {
              "textRaw": "`context.afterEach([fn][, options])`",
              "name": "afterEach",
              "type": "method",
              "meta": {
                "added": [
                  "v18.8.0",
                  "v16.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`fn` {Function|AsyncFunction} The hook function. The first argument to this function is a `TestContext` object. If the hook uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                      "name": "fn",
                      "type": "Function|AsyncFunction",
                      "default": "A no-op function",
                      "desc": "The hook function. The first argument to this function is a `TestContext` object. If the hook uses callbacks, the callback function is passed as the second argument.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Configuration options for the hook. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Configuration options for the hook. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress hook.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Allows aborting an in-progress hook."
                        },
                        {
                          "textRaw": "`timeout` {number} A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`Infinity`",
                          "desc": "A number of milliseconds the hook will fail after. If unspecified, subtests inherit this value from their parent."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to create a hook running\nafter each subtest of the current test.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  t.afterEach((t) => t.diagnostic(`finished running ${t.name}`));\n  await t.test(\n    'This is a subtest',\n    (t) => {\n      // Some relevant assertion here\n    },\n  );\n});\n</code></pre>"
            },
            {
              "textRaw": "`context.diagnostic(message)`",
              "name": "diagnostic",
              "type": "method",
              "meta": {
                "added": [
                  "v18.0.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {string} Message to be reported.",
                      "name": "message",
                      "type": "string",
                      "desc": "Message to be reported."
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to write diagnostics to the output. Any diagnostic\ninformation is included at the end of the test's results. This function does\nnot return a value.</p>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  t.diagnostic('A diagnostic message');\n});\n</code></pre>"
            },
            {
              "textRaw": "`context.plan(count[,options])`",
              "name": "plan",
              "type": "method",
              "meta": {
                "added": [
                  "v22.2.0",
                  "v20.15.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.9.0",
                      "v22.15.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/56765",
                    "description": "Add the `options` parameter."
                  },
                  {
                    "version": [
                      "v23.4.0",
                      "v22.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55895",
                    "description": "This function is no longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`count` {number} The number of assertions and subtests that are expected to run.",
                      "name": "count",
                      "type": "number",
                      "desc": "The number of assertions and subtests that are expected to run."
                    },
                    {
                      "textRaw": "`options` {Object} Additional options for the plan.",
                      "name": "options",
                      "type": "Object",
                      "desc": "Additional options for the plan.",
                      "options": [
                        {
                          "textRaw": "`wait` {boolean|number} The wait time for the plan:If `true`, the plan waits indefinitely for all assertions and subtests to run.If `false`, the plan performs an immediate check after the test function completes, without waiting for any pending assertions or subtests. Any assertions or subtests that complete after this check will not be counted towards the plan.If a number, it specifies the maximum wait time in milliseconds before timing out while waiting for expected assertions and subtests to be matched. If the timeout is reached, the test will fail. **Default:** `false`.",
                          "name": "wait",
                          "type": "boolean|number",
                          "default": "`false`",
                          "desc": "The wait time for the plan:If `true`, the plan waits indefinitely for all assertions and subtests to run.If `false`, the plan performs an immediate check after the test function completes, without waiting for any pending assertions or subtests. Any assertions or subtests that complete after this check will not be counted towards the plan.If a number, it specifies the maximum wait time in milliseconds before timing out while waiting for expected assertions and subtests to be matched. If the timeout is reached, the test will fail."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function is used to set the number of assertions and subtests that are expected to run\nwithin the test. If the number of assertions and subtests that run does not match the\nexpected count, the test will fail.</p>\n<blockquote>\n<p>Note: To make sure assertions are tracked, <code>t.assert</code> must be used instead of <code>assert</code> directly.</p>\n</blockquote>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  t.plan(2);\n  t.assert.ok('some relevant assertion here');\n  t.test('subtest', () => {});\n});\n</code></pre>\n<p>When working with asynchronous code, the <code>plan</code> function can be used to ensure that the\ncorrect number of assertions are run:</p>\n<pre><code class=\"language-js\">test('planning with streams', (t, done) => {\n  function* generate() {\n    yield 'a';\n    yield 'b';\n    yield 'c';\n  }\n  const expected = ['a', 'b', 'c'];\n  t.plan(expected.length);\n  const stream = Readable.from(generate());\n  stream.on('data', (chunk) => {\n    t.assert.strictEqual(chunk, expected.shift());\n  });\n\n  stream.on('end', () => {\n    done();\n  });\n});\n</code></pre>\n<p>When using the <code>wait</code> option, you can control how long the test will wait for the expected assertions.\nFor example, setting a maximum wait time ensures that the test will wait for asynchronous assertions\nto complete within the specified timeframe:</p>\n<pre><code class=\"language-js\">test('plan with wait: 2000 waits for async assertions', (t) => {\n  t.plan(1, { wait: 2000 }); // Waits for up to 2 seconds for the assertion to complete.\n\n  const asyncActivity = () => {\n    setTimeout(() => {\n      t.assert.ok(true, 'Async assertion completed within the wait time');\n    }, 1000); // Completes after 1 second, within the 2-second wait time.\n  };\n\n  asyncActivity(); // The test will pass because the assertion is completed in time.\n});\n</code></pre>\n<p>Note: If a <code>wait</code> timeout is specified, it begins counting down only after the test function finishes executing.</p>"
            },
            {
              "textRaw": "`context.runOnly(shouldRunOnlyTests)`",
              "name": "runOnly",
              "type": "method",
              "meta": {
                "added": [
                  "v18.0.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`shouldRunOnlyTests` {boolean} Whether or not to run `only` tests.",
                      "name": "shouldRunOnlyTests",
                      "type": "boolean",
                      "desc": "Whether or not to run `only` tests."
                    }
                  ]
                }
              ],
              "desc": "<p>If <code>shouldRunOnlyTests</code> is truthy, the test context will only run tests that\nhave the <code>only</code> option set. Otherwise, all tests are run. If Node.js was not\nstarted with the <a href=\"cli.html#--test-only\"><code>--test-only</code></a> command-line option, this function is a\nno-op.</p>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  // The test context can be set to run subtests with the 'only' option.\n  t.runOnly(true);\n  return Promise.all([\n    t.test('this subtest is now skipped'),\n    t.test('this subtest is run', { only: true }),\n  ]);\n});\n</code></pre>"
            },
            {
              "textRaw": "`context.skip([message])`",
              "name": "skip",
              "type": "method",
              "meta": {
                "added": [
                  "v18.0.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {string} Optional skip message.",
                      "name": "message",
                      "type": "string",
                      "desc": "Optional skip message.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function causes the test's output to indicate the test as skipped. If\n<code>message</code> is provided, it is included in the output. Calling <code>skip()</code> does\nnot terminate execution of the test function. This function does not return a\nvalue.</p>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  // Make sure to return here as well if the test contains additional logic.\n  t.skip('this is skipped');\n});\n</code></pre>"
            },
            {
              "textRaw": "`context.todo([message])`",
              "name": "todo",
              "type": "method",
              "meta": {
                "added": [
                  "v18.0.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {string} Optional `TODO` message.",
                      "name": "message",
                      "type": "string",
                      "desc": "Optional `TODO` message.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This function adds a <code>TODO</code> directive to the test's output. If <code>message</code> is\nprovided, it is included in the output. Calling <code>todo()</code> does not terminate\nexecution of the test function. This function does not return a value.</p>\n<pre><code class=\"language-js\">test('top level test', (t) => {\n  // This test is marked as `TODO`\n  t.todo('this is a todo');\n});\n</code></pre>"
            },
            {
              "textRaw": "`context.test([name][, options][, fn])`",
              "name": "test",
              "type": "method",
              "meta": {
                "added": [
                  "v18.0.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": "v26.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/63221",
                    "description": "Added the `tags` option."
                  },
                  {
                    "version": [
                      "v18.8.0",
                      "v16.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/43554",
                    "description": "Add a `signal` option."
                  },
                  {
                    "version": [
                      "v18.7.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/43505",
                    "description": "Add a `timeout` option."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} The name of the subtest, which is displayed when reporting test results. **Default:** The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name.",
                      "name": "name",
                      "type": "string",
                      "default": "The `name` property of `fn`, or `'<anonymous>'` if `fn` does not have a name",
                      "desc": "The name of the subtest, which is displayed when reporting test results.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Configuration options for the subtest. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Configuration options for the subtest. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`concurrency` {number|boolean|null} If a number is provided, then that many tests would run asynchronously (they are still managed by the single-threaded event loop). If `true`, it would run all subtests in parallel. If `false`, it would only run one test at a time. If unspecified, subtests inherit this value from their parent. **Default:** `null`.",
                          "name": "concurrency",
                          "type": "number|boolean|null",
                          "default": "`null`",
                          "desc": "If a number is provided, then that many tests would run asynchronously (they are still managed by the single-threaded event loop). If `true`, it would run all subtests in parallel. If `false`, it would only run one test at a time. If unspecified, subtests inherit this value from their parent."
                        },
                        {
                          "textRaw": "`only` {boolean} If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped. **Default:** `false`.",
                          "name": "only",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If truthy, and the test context is configured to run `only` tests, then this test will be run. Otherwise, the test is skipped."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} Allows aborting an in-progress test.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "Allows aborting an in-progress test."
                        },
                        {
                          "textRaw": "`skip` {boolean|string} If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test. **Default:** `false`.",
                          "name": "skip",
                          "type": "boolean|string",
                          "default": "`false`",
                          "desc": "If truthy, the test is skipped. If a string is provided, that string is displayed in the test results as the reason for skipping the test."
                        },
                        {
                          "textRaw": "`tags` {string[]} An array of string labels associated with the subtest. Used together with `--experimental-test-tag-filter` to filter which tests run. Tags inherit from the parent test or suite by union. See Test tags. **Default:** `[]`.",
                          "name": "tags",
                          "type": "string[]",
                          "default": "`[]`",
                          "desc": "An array of string labels associated with the subtest. Used together with `--experimental-test-tag-filter` to filter which tests run. Tags inherit from the parent test or suite by union. See Test tags."
                        },
                        {
                          "textRaw": "`todo` {boolean|string} If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in the test results as the reason why the test is `TODO`. **Default:** `false`.",
                          "name": "todo",
                          "type": "boolean|string",
                          "default": "`false`",
                          "desc": "If truthy, the test marked as `TODO`. If a string is provided, that string is displayed in the test results as the reason why the test is `TODO`."
                        },
                        {
                          "textRaw": "`timeout` {number} A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent. **Default:** `Infinity`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`Infinity`",
                          "desc": "A number of milliseconds the test will fail after. If unspecified, subtests inherit this value from their parent."
                        },
                        {
                          "textRaw": "`plan` {number} The number of assertions and subtests expected to be run in the test. If the number of assertions run in the test does not match the number specified in the plan, the test will fail. **Default:** `undefined`.",
                          "name": "plan",
                          "type": "number",
                          "default": "`undefined`",
                          "desc": "The number of assertions and subtests expected to be run in the test. If the number of assertions run in the test does not match the number specified in the plan, the test will fail."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`fn` {Function|AsyncFunction} The function under test. The first argument to this function is a `TestContext` object. If the test uses callbacks, the callback function is passed as the second argument. **Default:** A no-op function.",
                      "name": "fn",
                      "type": "Function|AsyncFunction",
                      "default": "A no-op function",
                      "desc": "The function under test. The first argument to this function is a `TestContext` object. If the test uses callbacks, the callback function is passed as the second argument.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfilled with `undefined` once the test completes.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfilled with `undefined` once the test completes."
                  }
                }
              ],
              "desc": "<p>This function is used to create subtests under the current test. This function\nbehaves in the same fashion as the top level <a href=\"#testname-options-fn\"><code>test()</code></a> function.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  await t.test(\n    'This is a subtest',\n    { only: false, skip: false, concurrency: 1, todo: false, plan: 1 },\n    (t) => {\n      t.assert.ok('some relevant assertion here');\n    },\n  );\n});\n</code></pre>"
            },
            {
              "textRaw": "`context.waitFor(condition[, options])`",
              "name": "waitFor",
              "type": "method",
              "meta": {
                "added": [
                  "v23.7.0",
                  "v22.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`condition` {Function|AsyncFunction} An assertion function that is invoked periodically until it completes successfully or the defined polling timeout elapses. Successful completion is defined as not throwing or rejecting. This function does not accept any arguments, and is allowed to return any value.",
                      "name": "condition",
                      "type": "Function|AsyncFunction",
                      "desc": "An assertion function that is invoked periodically until it completes successfully or the defined polling timeout elapses. Successful completion is defined as not throwing or rejecting. This function does not accept any arguments, and is allowed to return any value."
                    },
                    {
                      "textRaw": "`options` {Object} An optional configuration object for the polling operation. The following properties are supported:",
                      "name": "options",
                      "type": "Object",
                      "desc": "An optional configuration object for the polling operation. The following properties are supported:",
                      "options": [
                        {
                          "textRaw": "`interval` {number} The number of milliseconds to wait after an unsuccessful invocation of `condition` before trying again. **Default:** `50`.",
                          "name": "interval",
                          "type": "number",
                          "default": "`50`",
                          "desc": "The number of milliseconds to wait after an unsuccessful invocation of `condition` before trying again."
                        },
                        {
                          "textRaw": "`timeout` {number} The poll timeout in milliseconds. If `condition` has not succeeded by the time this elapses, an error occurs. **Default:** `1000`.",
                          "name": "timeout",
                          "type": "number",
                          "default": "`1000`",
                          "desc": "The poll timeout in milliseconds. If `condition` has not succeeded by the time this elapses, an error occurs."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfilled with the value returned by `condition`.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfilled with the value returned by `condition`."
                  }
                }
              ],
              "desc": "<p>This method polls a <code>condition</code> function until that function either returns\nsuccessfully or the operation times out.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`context.assert`",
              "name": "assert",
              "type": "property",
              "meta": {
                "added": [
                  "v22.2.0",
                  "v20.15.0"
                ],
                "changes": []
              },
              "desc": "<p>An object containing assertion methods bound to <code>context</code>. The top-level\nfunctions from the <code>node:assert</code> module are exposed here for the purpose of\ncreating test plans.</p>\n<pre><code class=\"language-js\">test('test', (t) => {\n  t.plan(1);\n  t.assert.strictEqual(true, true);\n});\n</code></pre>",
              "methods": [
                {
                  "textRaw": "`context.assert.fileSnapshot(value, path[, options])`",
                  "name": "fileSnapshot",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v23.7.0",
                      "v22.14.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`value` {any} A value to serialize to a string. If Node.js was started with the `--test-update-snapshots` flag, the serialized value is written to `path`. Otherwise, the serialized value is compared to the contents of the existing snapshot file.",
                          "name": "value",
                          "type": "any",
                          "desc": "A value to serialize to a string. If Node.js was started with the `--test-update-snapshots` flag, the serialized value is written to `path`. Otherwise, the serialized value is compared to the contents of the existing snapshot file."
                        },
                        {
                          "textRaw": "`path` {string} The file where the serialized `value` is written.",
                          "name": "path",
                          "type": "string",
                          "desc": "The file where the serialized `value` is written."
                        },
                        {
                          "textRaw": "`options` {Object} Optional configuration options. The following properties are supported:",
                          "name": "options",
                          "type": "Object",
                          "desc": "Optional configuration options. The following properties are supported:",
                          "options": [
                            {
                              "textRaw": "`serializers` {Array} An array of synchronous functions used to serialize `value` into a string. `value` is passed as the only argument to the first serializer function. The return value of each serializer is passed as input to the next serializer. Once all serializers have run, the resulting value is coerced to a string. **Default:** If no serializers are provided, the test runner's default serializers are used.",
                              "name": "serializers",
                              "type": "Array",
                              "default": "If no serializers are provided, the test runner's default serializers are used",
                              "desc": "An array of synchronous functions used to serialize `value` into a string. `value` is passed as the only argument to the first serializer function. The return value of each serializer is passed as input to the next serializer. Once all serializers have run, the resulting value is coerced to a string."
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This function serializes <code>value</code> and writes it to the file specified by <code>path</code>.</p>\n<pre><code class=\"language-js\">test('snapshot test with default serialization', (t) => {\n  t.assert.fileSnapshot({ value1: 1, value2: 2 }, './snapshots/snapshot.json');\n});\n</code></pre>\n<p>This function differs from <code>context.assert.snapshot()</code> in the following ways:</p>\n<ul>\n<li>The snapshot file path is explicitly provided by the user.</li>\n<li>Each snapshot file is limited to a single snapshot value.</li>\n<li>No additional escaping is performed by the test runner.</li>\n</ul>\n<p>These differences allow snapshot files to better support features such as syntax\nhighlighting.</p>"
                },
                {
                  "textRaw": "`context.assert.snapshot(value[, options])`",
                  "name": "snapshot",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v22.3.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`value` {any} A value to serialize to a string. If Node.js was started with the `--test-update-snapshots` flag, the serialized value is written to the snapshot file. Otherwise, the serialized value is compared to the corresponding value in the existing snapshot file.",
                          "name": "value",
                          "type": "any",
                          "desc": "A value to serialize to a string. If Node.js was started with the `--test-update-snapshots` flag, the serialized value is written to the snapshot file. Otherwise, the serialized value is compared to the corresponding value in the existing snapshot file."
                        },
                        {
                          "textRaw": "`options` {Object} Optional configuration options. The following properties are supported:",
                          "name": "options",
                          "type": "Object",
                          "desc": "Optional configuration options. The following properties are supported:",
                          "options": [
                            {
                              "textRaw": "`serializers` {Array} An array of synchronous functions used to serialize `value` into a string. `value` is passed as the only argument to the first serializer function. The return value of each serializer is passed as input to the next serializer. Once all serializers have run, the resulting value is coerced to a string. **Default:** If no serializers are provided, the test runner's default serializers are used.",
                              "name": "serializers",
                              "type": "Array",
                              "default": "If no serializers are provided, the test runner's default serializers are used",
                              "desc": "An array of synchronous functions used to serialize `value` into a string. `value` is passed as the only argument to the first serializer function. The return value of each serializer is passed as input to the next serializer. Once all serializers have run, the resulting value is coerced to a string."
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This function implements assertions for snapshot testing.</p>\n<pre><code class=\"language-js\">test('snapshot test with default serialization', (t) => {\n  t.assert.snapshot({ value1: 1, value2: 2 });\n});\n\ntest('snapshot test with custom serialization', (t) => {\n  t.assert.snapshot({ value3: 3, value4: 4 }, {\n    serializers: [(value) => JSON.stringify(value)],\n  });\n});\n</code></pre>"
                }
              ]
            },
            {
              "textRaw": "`context.filePath`",
              "name": "filePath",
              "type": "property",
              "meta": {
                "added": [
                  "v22.6.0",
                  "v20.16.0"
                ],
                "changes": []
              },
              "desc": "<p>The absolute path of the test file that created the current test. If a test file\nimports additional modules that generate tests, the imported tests will return\nthe path of the root test file.</p>"
            },
            {
              "textRaw": "`context.fullName`",
              "name": "fullName",
              "type": "property",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.16.0"
                ],
                "changes": []
              },
              "desc": "<p>The name of the test and each of its ancestors, separated by <code>></code>.</p>"
            },
            {
              "textRaw": "`context.name`",
              "name": "name",
              "type": "property",
              "meta": {
                "added": [
                  "v18.8.0",
                  "v16.18.0"
                ],
                "changes": []
              },
              "desc": "<p>The name of the test.</p>"
            },
            {
              "textRaw": "Type: {boolean} `false` before the test is executed, e.g. in a `beforeEach` hook.",
              "name": "passed",
              "type": "boolean",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "desc": "<p>Indicated whether the test succeeded.</p>",
              "shortDesc": "`false` before the test is executed, e.g. in a `beforeEach` hook."
            },
            {
              "textRaw": "Type: {Error|null}",
              "name": "error",
              "type": "Error|null",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "desc": "<p>The failure reason for the test/case; wrapped and available via <code>context.error.cause</code>.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "attempt",
              "type": "number",
              "meta": {
                "added": [
                  "v25.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The attempt number of the test. This value is zero-based, so the first attempt is <code>0</code>,\nthe second attempt is <code>1</code>, and so on. This property is useful in conjunction with the\n<code>--test-rerun-failures</code> option to determine which attempt the test is currently running.</p>"
            },
            {
              "textRaw": "Type: {string[]}",
              "name": "tags",
              "type": "string[]",
              "meta": {
                "added": [
                  "v26.2.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Early development",
              "desc": "<p>A frozen array of the test's flattened lowercased tags, in declaration\norder, including any tags inherited from ancestor suites. Empty when the\ntest has no tags. See <a href=\"#test-tags\">Test tags</a>.</p>"
            },
            {
              "textRaw": "Type: {number|undefined}",
              "name": "workerId",
              "type": "number|undefined",
              "meta": {
                "added": [
                  "v25.8.0"
                ],
                "changes": []
              },
              "desc": "<p>The unique identifier of the worker running the current test file. This value is\nderived from the <code>NODE_TEST_WORKER_ID</code> environment variable. When running tests\nwith <code>--test-isolation=process</code> (the default), each test file runs in a separate\nchild process and is assigned a worker ID from 1 to N, where N is the number of\nconcurrent workers. When running with <code>--test-isolation=none</code>, all tests run in\nthe same process and the worker ID is always 1. This value is <code>undefined</code> when\nnot running in a test context.</p>\n<p>This property is useful for splitting resources (like database connections or\nserver ports) across concurrent test files:</p>\n<pre><code class=\"language-mjs\">import { test } from 'node:test';\nimport { process } from 'node:process';\n\ntest('database operations', async (t) => {\n  // Worker ID is available via context\n  console.log(`Running in worker ${t.workerId}`);\n\n  // Or via environment variable (available at import time)\n  const workerId = process.env.NODE_TEST_WORKER_ID;\n  // Use workerId to allocate separate resources per worker\n});\n</code></pre>"
            },
            {
              "textRaw": "Type: {AbortSignal}",
              "name": "signal",
              "type": "AbortSignal",
              "meta": {
                "added": [
                  "v18.7.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Can be used to abort test subtasks when the test has been aborted.</p>\n<pre><code class=\"language-js\">test('top level test', async (t) => {\n  await fetch('some/uri', { signal: t.signal });\n});\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `SuiteContext`",
          "name": "SuiteContext",
          "type": "class",
          "meta": {
            "added": [
              "v18.7.0",
              "v16.17.0"
            ],
            "changes": []
          },
          "desc": "<p>An instance of <code>SuiteContext</code> is passed to each suite function in order to\ninteract with the test runner. However, the <code>SuiteContext</code> constructor is not\nexposed as part of the API.</p>",
          "properties": [
            {
              "textRaw": "`context.filePath`",
              "name": "filePath",
              "type": "property",
              "meta": {
                "added": [
                  "v22.6.0"
                ],
                "changes": []
              },
              "desc": "<p>The absolute path of the test file that created the current suite. If a test\nfile imports additional modules that generate suites, the imported suites will\nreturn the path of the root test file.</p>"
            },
            {
              "textRaw": "`context.fullName`",
              "name": "fullName",
              "type": "property",
              "meta": {
                "added": [
                  "v22.3.0",
                  "v20.16.0"
                ],
                "changes": []
              },
              "desc": "<p>The name of the suite and each of its ancestors, separated by <code>></code>.</p>"
            },
            {
              "textRaw": "`context.name`",
              "name": "name",
              "type": "property",
              "meta": {
                "added": [
                  "v18.8.0",
                  "v16.18.0"
                ],
                "changes": []
              },
              "desc": "<p>The name of the suite.</p>"
            },
            {
              "textRaw": "Type: {AbortSignal}",
              "name": "signal",
              "type": "AbortSignal",
              "meta": {
                "added": [
                  "v18.7.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Can be used to abort test subtasks when the test has been aborted.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "passed",
              "type": "boolean",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "desc": "<p>Indicates whether the suite and all of its subtests have passed.</p>"
            },
            {
              "textRaw": "Type: {number}",
              "name": "attempt",
              "type": "number",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "desc": "<p>The attempt number of the suite. This value is zero-based, so the first attempt is <code>0</code>,\nthe second attempt is <code>1</code>, and so on. This property is useful in conjunction with the\n<code>--test-rerun-failures</code> option to determine the attempt number of the current run.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`context.diagnostic(message)`",
              "name": "diagnostic",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {string} A diagnostic message to output.",
                      "name": "message",
                      "type": "string",
                      "desc": "A diagnostic message to output."
                    }
                  ]
                }
              ],
              "desc": "<p>Output a diagnostic message. This is typically used for logging information\nabout the current suite or its tests.</p>\n<pre><code class=\"language-js\">test.describe('my suite', (suite) => {\n  suite.diagnostic('Suite diagnostic message');\n});\n</code></pre>"
            }
          ]
        }
      ],
      "displayName": "Test runner",
      "source": "doc/api/test.md"
    },
    {
      "textRaw": "Timers",
      "name": "timers",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>timer</code> module exposes a global API for scheduling functions to\nbe called at some future period of time. Because the timer functions are\nglobals, there is no need to call <code>require('node:timers')</code> to use the API.</p>\n<p>The timer functions within Node.js implement a similar API as the timers API\nprovided by Web Browsers but use a different internal implementation that is\nbuilt around the Node.js <a href=\"https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/#setimmediate-vs-settimeout\">Event Loop</a>.</p>",
      "classes": [
        {
          "textRaw": "Class: `Immediate`",
          "name": "Immediate",
          "type": "class",
          "desc": "<p>This object is created internally and is returned from <a href=\"#setimmediatecallback-args\"><code>setImmediate()</code></a>. It\ncan be passed to <a href=\"#clearimmediateimmediate\"><code>clearImmediate()</code></a> in order to cancel the scheduled\nactions.</p>\n<p>By default, when an immediate is scheduled, the Node.js event loop will continue\nrunning as long as the immediate is active. The <code>Immediate</code> object returned by\n<a href=\"#setimmediatecallback-args\"><code>setImmediate()</code></a> exports both <code>immediate.ref()</code> and <code>immediate.unref()</code>\nfunctions that can be used to control this default behavior.</p>",
          "methods": [
            {
              "textRaw": "`immediate.hasRef()`",
              "name": "hasRef",
              "type": "method",
              "meta": {
                "added": [
                  "v11.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>If true, the <code>Immediate</code> object will keep the Node.js event loop active.</p>"
            },
            {
              "textRaw": "`immediate.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v9.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Immediate} a reference to `immediate`",
                    "name": "return",
                    "type": "Immediate",
                    "desc": "a reference to `immediate`"
                  }
                }
              ],
              "desc": "<p>When called, requests that the Node.js event loop <em>not</em> exit so long as the\n<code>Immediate</code> is active. Calling <code>immediate.ref()</code> multiple times will have no\neffect.</p>\n<p>By default, all <code>Immediate</code> objects are \"ref'ed\", making it normally unnecessary\nto call <code>immediate.ref()</code> unless <code>immediate.unref()</code> had been called previously.</p>"
            },
            {
              "textRaw": "`immediate.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v9.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Immediate} a reference to `immediate`",
                    "name": "return",
                    "type": "Immediate",
                    "desc": "a reference to `immediate`"
                  }
                }
              ],
              "desc": "<p>When called, the active <code>Immediate</code> object will not require the Node.js event\nloop to remain active. If there is no other activity keeping the event loop\nrunning, the process may exit before the <code>Immediate</code> object's callback is\ninvoked. Calling <code>immediate.unref()</code> multiple times will have no effect.</p>"
            },
            {
              "textRaw": "`immediate[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v20.5.0",
                  "v18.18.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58467",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Cancels the immediate. This is similar to calling <code>clearImmediate()</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Timeout`",
          "name": "Timeout",
          "type": "class",
          "desc": "<p>This object is created internally and is returned from <a href=\"#settimeoutcallback-delay-args\"><code>setTimeout()</code></a> and\n<a href=\"#setintervalcallback-delay-args\"><code>setInterval()</code></a>. It can be passed to either <a href=\"#cleartimeouttimeout\"><code>clearTimeout()</code></a> or\n<a href=\"#clearintervaltimeout\"><code>clearInterval()</code></a> in order to cancel the scheduled actions.</p>\n<p>By default, when a timer is scheduled using either <a href=\"#settimeoutcallback-delay-args\"><code>setTimeout()</code></a> or\n<a href=\"#setintervalcallback-delay-args\"><code>setInterval()</code></a>, the Node.js event loop will continue running as long as the\ntimer is active. Each of the <code>Timeout</code> objects returned by these functions\nexport both <code>timeout.ref()</code> and <code>timeout.unref()</code> functions that can be used to\ncontrol this default behavior.</p>",
          "methods": [
            {
              "textRaw": "`timeout.close()`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "stability": 3,
              "stabilityText": "Legacy: Use `clearTimeout()` instead.",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Timeout} a reference to `timeout`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "a reference to `timeout`"
                  }
                }
              ],
              "desc": "<p>Cancels the timeout.</p>"
            },
            {
              "textRaw": "`timeout.hasRef()`",
              "name": "hasRef",
              "type": "method",
              "meta": {
                "added": [
                  "v11.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>If true, the <code>Timeout</code> object will keep the Node.js event loop active.</p>"
            },
            {
              "textRaw": "`timeout.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Timeout} a reference to `timeout`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "a reference to `timeout`"
                  }
                }
              ],
              "desc": "<p>When called, requests that the Node.js event loop <em>not</em> exit so long as the\n<code>Timeout</code> is active. Calling <code>timeout.ref()</code> multiple times will have no effect.</p>\n<p>By default, all <code>Timeout</code> objects are \"ref'ed\", making it normally unnecessary\nto call <code>timeout.ref()</code> unless <code>timeout.unref()</code> had been called previously.</p>"
            },
            {
              "textRaw": "`timeout.refresh()`",
              "name": "refresh",
              "type": "method",
              "meta": {
                "added": [
                  "v10.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Timeout} a reference to `timeout`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "a reference to `timeout`"
                  }
                }
              ],
              "desc": "<p>Sets the timer's start time to the current time, and reschedules the timer to\ncall its callback at the previously specified duration adjusted to the current\ntime. This is useful for refreshing a timer without allocating a new\nJavaScript object.</p>\n<p>Using this on a timer that has already called its callback will reactivate the\ntimer.</p>"
            },
            {
              "textRaw": "`timeout.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Timeout} a reference to `timeout`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "a reference to `timeout`"
                  }
                }
              ],
              "desc": "<p>When called, the active <code>Timeout</code> object will not require the Node.js event loop\nto remain active. If there is no other activity keeping the event loop running,\nthe process may exit before the <code>Timeout</code> object's callback is invoked. Calling\n<code>timeout.unref()</code> multiple times will have no effect.</p>"
            },
            {
              "textRaw": "`timeout[Symbol.toPrimitive]()`",
              "name": "[Symbol.toPrimitive]",
              "type": "method",
              "meta": {
                "added": [
                  "v14.9.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {integer} a number that can be used to reference this `timeout`",
                    "name": "return",
                    "type": "integer",
                    "desc": "a number that can be used to reference this `timeout`"
                  }
                }
              ],
              "desc": "<p>Coerce a <code>Timeout</code> to a primitive. The primitive can be used to\nclear the <code>Timeout</code>. The primitive can only be used in the\nsame thread where the timeout was created. Therefore, to use it\nacross <a href=\"worker_threads.html\"><code>worker_threads</code></a> it must first be passed to the correct\nthread. This allows enhanced compatibility with browser\n<code>setTimeout()</code> and <code>setInterval()</code> implementations.</p>"
            },
            {
              "textRaw": "`timeout[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v20.5.0",
                  "v18.18.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58467",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Cancels the timeout.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Scheduling timers",
          "name": "scheduling_timers",
          "type": "module",
          "desc": "<p>A timer in Node.js is an internal construct that calls a given function after\na certain period of time. When a timer's function is called varies depending on\nwhich method was used to create the timer and what other work the Node.js\nevent loop is doing.</p>",
          "methods": [
            {
              "textRaw": "`setImmediate(callback[, ...args])`",
              "name": "setImmediate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} The function to call at the end of this turn of the Node.js Event Loop",
                      "name": "callback",
                      "type": "Function",
                      "desc": "The function to call at the end of this turn of the Node.js Event Loop"
                    },
                    {
                      "textRaw": "`...args` {any} Optional arguments to pass when the `callback` is called.",
                      "name": "...args",
                      "type": "any",
                      "desc": "Optional arguments to pass when the `callback` is called.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Immediate} for use with `clearImmediate()`",
                    "name": "return",
                    "type": "Immediate",
                    "desc": "for use with `clearImmediate()`"
                  }
                }
              ],
              "desc": "<p>Schedules the \"immediate\" execution of the <code>callback</code> after I/O events'\ncallbacks.</p>\n<p>When multiple calls to <code>setImmediate()</code> are made, the <code>callback</code> functions are\nqueued for execution in the order in which they are created. The entire callback\nqueue is processed every event loop iteration. If an immediate timer is queued\nfrom inside an executing callback, that timer will not be triggered until the\nnext event loop iteration.</p>\n<p>If <code>callback</code> is not a function, a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> will be thrown.</p>\n<p>This method has a custom variant for promises that is available using\n<a href=\"#timerspromisessetimmediatevalue-options\"><code>timersPromises.setImmediate()</code></a>.</p>"
            },
            {
              "textRaw": "`setInterval(callback[, delay[, ...args]])`",
              "name": "setInterval",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} The function to call when the timer elapses.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "The function to call when the timer elapses."
                    },
                    {
                      "textRaw": "`delay` {number} The number of milliseconds to wait before calling the `callback`. **Default:** `1`.",
                      "name": "delay",
                      "type": "number",
                      "default": "`1`",
                      "desc": "The number of milliseconds to wait before calling the `callback`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`...args` {any} Optional arguments to pass when the `callback` is called.",
                      "name": "...args",
                      "type": "any",
                      "desc": "Optional arguments to pass when the `callback` is called.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Timeout} for use with `clearInterval()`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "for use with `clearInterval()`"
                  }
                }
              ],
              "desc": "<p>Schedules repeated execution of <code>callback</code> every <code>delay</code> milliseconds.</p>\n<p>When <code>delay</code> is larger than <code>2147483647</code> or less than <code>1</code> or <code>NaN</code>, the <code>delay</code>\nwill be set to <code>1</code>. Non-integer delays are truncated to an integer.</p>\n<p>If <code>callback</code> is not a function, a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> will be thrown.</p>\n<p>This method has a custom variant for promises that is available using\n<a href=\"#timerspromisessetintervaldelay-value-options\"><code>timersPromises.setInterval()</code></a>.</p>"
            },
            {
              "textRaw": "`setTimeout(callback[, delay[, ...args]])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} The function to call when the timer elapses.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "The function to call when the timer elapses."
                    },
                    {
                      "textRaw": "`delay` {number} The number of milliseconds to wait before calling the `callback`. **Default:** `1`.",
                      "name": "delay",
                      "type": "number",
                      "default": "`1`",
                      "desc": "The number of milliseconds to wait before calling the `callback`.",
                      "optional": true
                    },
                    {
                      "textRaw": "`...args` {any} Optional arguments to pass when the `callback` is called.",
                      "name": "...args",
                      "type": "any",
                      "desc": "Optional arguments to pass when the `callback` is called.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Timeout} for use with `clearTimeout()`",
                    "name": "return",
                    "type": "Timeout",
                    "desc": "for use with `clearTimeout()`"
                  }
                }
              ],
              "desc": "<p>Schedules execution of a one-time <code>callback</code> after <code>delay</code> milliseconds.</p>\n<p>The <code>callback</code> will likely not be invoked in precisely <code>delay</code> milliseconds.\nNode.js makes no guarantees about the exact timing of when callbacks will fire,\nnor of their ordering. The callback will be called as close as possible to the\ntime specified.</p>\n<p>When <code>delay</code> is larger than <code>2147483647</code> or less than <code>1</code> or <code>NaN</code>, the <code>delay</code>\nwill be set to <code>1</code>. Non-integer delays are truncated to an integer.</p>\n<p>If <code>callback</code> is not a function, a <a href=\"errors.html#class-typeerror\"><code>TypeError</code></a> will be thrown.</p>\n<p>This method has a custom variant for promises that is available using\n<a href=\"#timerspromisessettimeoutdelay-value-options\"><code>timersPromises.setTimeout()</code></a>.</p>"
            }
          ],
          "displayName": "Scheduling timers"
        },
        {
          "textRaw": "Cancelling timers",
          "name": "cancelling_timers",
          "type": "module",
          "desc": "<p>The <a href=\"#setimmediatecallback-args\"><code>setImmediate()</code></a>, <a href=\"#setintervalcallback-delay-args\"><code>setInterval()</code></a>, and <a href=\"#settimeoutcallback-delay-args\"><code>setTimeout()</code></a> methods\neach return objects that represent the scheduled timers. These can be used to\ncancel the timer and prevent it from triggering.</p>\n<p>For the promisified variants of <a href=\"#setimmediatecallback-args\"><code>setImmediate()</code></a> and <a href=\"#settimeoutcallback-delay-args\"><code>setTimeout()</code></a>,\nan <a href=\"globals.html#class-abortcontroller\"><code>AbortController</code></a> may be used to cancel the timer. When canceled, the\nreturned Promises will be rejected with an <code>'AbortError'</code>.</p>\n<p>For <code>setImmediate()</code>:</p>\n<pre><code class=\"language-mjs\">import { setImmediate as setImmediatePromise } from 'node:timers/promises';\n\nconst ac = new AbortController();\nconst signal = ac.signal;\n\n// We do not `await` the promise so `ac.abort()` is called concurrently.\nsetImmediatePromise('foobar', { signal })\n  .then(console.log)\n  .catch((err) => {\n    if (err.name === 'AbortError')\n      console.error('The immediate was aborted');\n  });\n\nac.abort();\n</code></pre>\n<pre><code class=\"language-cjs\">const { setImmediate: setImmediatePromise } = require('node:timers/promises');\n\nconst ac = new AbortController();\nconst signal = ac.signal;\n\nsetImmediatePromise('foobar', { signal })\n  .then(console.log)\n  .catch((err) => {\n    if (err.name === 'AbortError')\n      console.error('The immediate was aborted');\n  });\n\nac.abort();\n</code></pre>\n<p>For <code>setTimeout()</code>:</p>\n<pre><code class=\"language-mjs\">import { setTimeout as setTimeoutPromise } from 'node:timers/promises';\n\nconst ac = new AbortController();\nconst signal = ac.signal;\n\n// We do not `await` the promise so `ac.abort()` is called concurrently.\nsetTimeoutPromise(1000, 'foobar', { signal })\n  .then(console.log)\n  .catch((err) => {\n    if (err.name === 'AbortError')\n      console.error('The timeout was aborted');\n  });\n\nac.abort();\n</code></pre>\n<pre><code class=\"language-cjs\">const { setTimeout: setTimeoutPromise } = require('node:timers/promises');\n\nconst ac = new AbortController();\nconst signal = ac.signal;\n\nsetTimeoutPromise(1000, 'foobar', { signal })\n  .then(console.log)\n  .catch((err) => {\n    if (err.name === 'AbortError')\n      console.error('The timeout was aborted');\n  });\n\nac.abort();\n</code></pre>",
          "methods": [
            {
              "textRaw": "`clearImmediate(immediate)`",
              "name": "clearImmediate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`immediate` {Immediate} An `Immediate` object as returned by `setImmediate()`.",
                      "name": "immediate",
                      "type": "Immediate",
                      "desc": "An `Immediate` object as returned by `setImmediate()`."
                    }
                  ]
                }
              ],
              "desc": "<p>Cancels an <code>Immediate</code> object created by <a href=\"#setimmediatecallback-args\"><code>setImmediate()</code></a>.</p>"
            },
            {
              "textRaw": "`clearInterval(timeout)`",
              "name": "clearInterval",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`timeout` {Timeout|string|number} A `Timeout` object as returned by `setInterval()` or the primitive of the `Timeout` object as a string or a number.",
                      "name": "timeout",
                      "type": "Timeout|string|number",
                      "desc": "A `Timeout` object as returned by `setInterval()` or the primitive of the `Timeout` object as a string or a number."
                    }
                  ]
                }
              ],
              "desc": "<p>Cancels a <code>Timeout</code> object created by <a href=\"#setintervalcallback-delay-args\"><code>setInterval()</code></a>.</p>"
            },
            {
              "textRaw": "`clearTimeout(timeout)`",
              "name": "clearTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v0.0.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`timeout` {Timeout|string|number} A `Timeout` object as returned by `setTimeout()` or the primitive of the `Timeout` object as a string or a number.",
                      "name": "timeout",
                      "type": "Timeout|string|number",
                      "desc": "A `Timeout` object as returned by `setTimeout()` or the primitive of the `Timeout` object as a string or a number."
                    }
                  ]
                }
              ],
              "desc": "<p>Cancels a <code>Timeout</code> object created by <a href=\"#settimeoutcallback-delay-args\"><code>setTimeout()</code></a>.</p>"
            }
          ],
          "displayName": "Cancelling timers"
        },
        {
          "textRaw": "Timers Promises API",
          "name": "timers_promises_api",
          "type": "module",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": [
              {
                "version": "v16.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/38112",
                "description": "Graduated from experimental."
              }
            ]
          },
          "desc": "<p>The <code>timers/promises</code> API provides an alternative set of timer functions\nthat return <code>Promise</code> objects. The API is accessible via\n<code>require('node:timers/promises')</code>.</p>\n<pre><code class=\"language-mjs\">import {\n  setTimeout,\n  setImmediate,\n  setInterval,\n} from 'node:timers/promises';\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  setTimeout,\n  setImmediate,\n  setInterval,\n} = require('node:timers/promises');\n</code></pre>",
          "methods": [
            {
              "textRaw": "`timersPromises.setTimeout([delay[, value[, options]]])`",
              "name": "setTimeout",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`delay` {number} The number of milliseconds to wait before fulfilling the promise. **Default:** `1`.",
                      "name": "delay",
                      "type": "number",
                      "default": "`1`",
                      "desc": "The number of milliseconds to wait before fulfilling the promise.",
                      "optional": true
                    },
                    {
                      "textRaw": "`value` {any} A value with which the promise is fulfilled.",
                      "name": "value",
                      "type": "any",
                      "desc": "A value with which the promise is fulfilled.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ref` {boolean} Set to `false` to indicate that the scheduled `Timeout` should not require the Node.js event loop to remain active. **Default:** `true`.",
                          "name": "ref",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Set to `false` to indicate that the scheduled `Timeout` should not require the Node.js event loop to remain active."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel the scheduled `Timeout`.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "An optional `AbortSignal` that can be used to cancel the scheduled `Timeout`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import {\n  setTimeout,\n} from 'node:timers/promises';\n\nconst res = await setTimeout(100, 'result');\n\nconsole.log(res);  // Prints 'result'\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  setTimeout,\n} = require('node:timers/promises');\n\nsetTimeout(100, 'result').then((res) => {\n  console.log(res);  // Prints 'result'\n});\n</code></pre>"
            },
            {
              "textRaw": "`timersPromises.setImmediate([value[, options]])`",
              "name": "setImmediate",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any} A value with which the promise is fulfilled.",
                      "name": "value",
                      "type": "any",
                      "desc": "A value with which the promise is fulfilled.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ref` {boolean} Set to `false` to indicate that the scheduled `Immediate` should not require the Node.js event loop to remain active. **Default:** `true`.",
                          "name": "ref",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Set to `false` to indicate that the scheduled `Immediate` should not require the Node.js event loop to remain active."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel the scheduled `Immediate`.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "An optional `AbortSignal` that can be used to cancel the scheduled `Immediate`."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<pre><code class=\"language-mjs\">import {\n  setImmediate,\n} from 'node:timers/promises';\n\nconst res = await setImmediate('result');\n\nconsole.log(res);  // Prints 'result'\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  setImmediate,\n} = require('node:timers/promises');\n\nsetImmediate('result').then((res) => {\n  console.log(res);  // Prints 'result'\n});\n</code></pre>"
            },
            {
              "textRaw": "`timersPromises.setInterval([delay[, value[, options]]])`",
              "name": "setInterval",
              "type": "method",
              "meta": {
                "added": [
                  "v15.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`delay` {number} The number of milliseconds to wait between iterations. **Default:** `1`.",
                      "name": "delay",
                      "type": "number",
                      "default": "`1`",
                      "desc": "The number of milliseconds to wait between iterations.",
                      "optional": true
                    },
                    {
                      "textRaw": "`value` {any} A value with which the iterator returns.",
                      "name": "value",
                      "type": "any",
                      "desc": "A value with which the iterator returns.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ref` {boolean} Set to `false` to indicate that the scheduled `Timeout` between iterations should not require the Node.js event loop to remain active. **Default:** `true`.",
                          "name": "ref",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Set to `false` to indicate that the scheduled `Timeout` between iterations should not require the Node.js event loop to remain active."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel the scheduled `Timeout` between operations.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "An optional `AbortSignal` that can be used to cancel the scheduled `Timeout` between operations."
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Returns an async iterator that generates values in an interval of <code>delay</code> ms.\nIf <code>ref</code> is <code>true</code>, you need to call <code>next()</code> of async iterator explicitly\nor implicitly to keep the event loop alive.</p>\n<pre><code class=\"language-mjs\">import {\n  setInterval,\n} from 'node:timers/promises';\n\nconst interval = 100;\nfor await (const startTime of setInterval(interval, Date.now())) {\n  const now = Date.now();\n  console.log(now);\n  if ((now - startTime) > 1000)\n    break;\n}\nconsole.log(Date.now());\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  setInterval,\n} = require('node:timers/promises');\nconst interval = 100;\n\n(async function() {\n  for await (const startTime of setInterval(interval, Date.now())) {\n    const now = Date.now();\n    console.log(now);\n    if ((now - startTime) > 1000)\n      break;\n  }\n  console.log(Date.now());\n})();\n</code></pre>"
            },
            {
              "textRaw": "`timersPromises.scheduler.wait(delay[, options])`",
              "name": "wait",
              "type": "method",
              "meta": {
                "added": [
                  "v17.3.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`delay` {number} The number of milliseconds to wait before resolving the promise.",
                      "name": "delay",
                      "type": "number",
                      "desc": "The number of milliseconds to wait before resolving the promise."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`ref` {boolean} Set to `false` to indicate that the scheduled `Timeout` should not require the Node.js event loop to remain active. **Default:** `true`.",
                          "name": "ref",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "Set to `false` to indicate that the scheduled `Timeout` should not require the Node.js event loop to remain active."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} An optional `AbortSignal` that can be used to cancel waiting.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "An optional `AbortSignal` that can be used to cancel waiting."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>An experimental API defined by the <a href=\"https://github.com/WICG/scheduling-apis\">Scheduling APIs</a> draft specification\nbeing developed as a standard Web Platform API.</p>\n<p>Calling <code>timersPromises.scheduler.wait(delay, options)</code> is equivalent\nto calling <code>timersPromises.setTimeout(delay, undefined, options)</code>.</p>\n<pre><code class=\"language-mjs\">import { scheduler } from 'node:timers/promises';\n\nawait scheduler.wait(1000); // Wait one second before continuing\n</code></pre>"
            },
            {
              "textRaw": "`timersPromises.scheduler.yield()`",
              "name": "yield",
              "type": "method",
              "meta": {
                "added": [
                  "v17.3.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>An experimental API defined by the <a href=\"https://github.com/WICG/scheduling-apis\">Scheduling APIs</a> draft specification\nbeing developed as a standard Web Platform API.</p>\n<p>Calling <code>timersPromises.scheduler.yield()</code> is equivalent to calling\n<code>timersPromises.setImmediate()</code> with no arguments.</p>"
            }
          ],
          "displayName": "Timers Promises API"
        }
      ],
      "displayName": "Timers",
      "source": "doc/api/timers.md"
    },
    {
      "textRaw": "TLS (SSL)",
      "name": "tls_(ssl)",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:tls</code> module provides an implementation of the Transport Layer Security\n(TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.\nThe module can be accessed using:</p>\n<pre><code class=\"language-mjs\">import tls from 'node:tls';\n</code></pre>\n<pre><code class=\"language-cjs\">const tls = require('node:tls');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Determining if crypto support is unavailable",
          "name": "determining_if_crypto_support_is_unavailable",
          "type": "module",
          "desc": "<p>It is possible for Node.js to be built without including support for the\n<code>node:crypto</code> module. In such cases, attempting to <code>import</code> from <code>tls</code> or\ncalling <code>require('node:tls')</code> will result in an error being thrown.</p>\n<p>When using CommonJS, the error thrown can be caught using try/catch:</p>\n<pre><code class=\"language-cjs\">let tls;\ntry {\n  tls = require('node:tls');\n} catch (err) {\n  console.error('tls support is disabled!');\n}\n</code></pre>\n<p>When using the lexical ESM <code>import</code> keyword, the error can only be\ncaught if a handler for <code>process.on('uncaughtException')</code> is registered\n<em>before</em> any attempt to load the module is made (using, for instance,\na preload module).</p>\n<p>When using ESM, if there is a chance that the code may be run on a build\nof Node.js where crypto support is not enabled, consider using the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import\"><code>import()</code></a> function instead of the lexical <code>import</code> keyword:</p>\n<pre><code class=\"language-mjs\">let tls;\ntry {\n  tls = await import('node:tls');\n} catch (err) {\n  console.error('tls support is disabled!');\n}\n</code></pre>",
          "displayName": "Determining if crypto support is unavailable"
        },
        {
          "textRaw": "TLS/SSL concepts",
          "name": "tls/ssl_concepts",
          "type": "module",
          "desc": "<p>TLS/SSL is a set of protocols that rely on a public key infrastructure (PKI) to\nenable secure communication between a client and a server. For most common\ncases, each server must have a private key.</p>\n<p>Private keys can be generated in multiple ways. The example below illustrates\nuse of the OpenSSL command-line interface to generate a 2048-bit RSA private\nkey:</p>\n<pre><code class=\"language-bash\">openssl genrsa -out ryans-key.pem 2048\n</code></pre>\n<p>With TLS/SSL, all servers (and some clients) must have a <em>certificate</em>.\nCertificates are <em>public keys</em> that correspond to a private key, and that are\ndigitally signed either by a Certificate Authority or by the owner of the\nprivate key (such certificates are referred to as \"self-signed\"). The first\nstep to obtaining a certificate is to create a <em>Certificate Signing Request</em>\n(CSR) file.</p>\n<p>The OpenSSL command-line interface can be used to generate a CSR for a private\nkey:</p>\n<pre><code class=\"language-bash\">openssl req -new -sha256 -key ryans-key.pem -out ryans-csr.pem\n</code></pre>\n<p>Once the CSR file is generated, it can either be sent to a Certificate\nAuthority for signing or used to generate a self-signed certificate.</p>\n<p>Creating a self-signed certificate using the OpenSSL command-line interface\nis illustrated in the example below:</p>\n<pre><code class=\"language-bash\">openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out ryans-cert.pem\n</code></pre>\n<p>Once the certificate is generated, it can be used to generate a <code>.pfx</code> or\n<code>.p12</code> file:</p>\n<pre><code class=\"language-bash\">openssl pkcs12 -export -in ryans-cert.pem -inkey ryans-key.pem \\\n      -certfile ca-cert.pem -out ryans.pfx\n</code></pre>\n<p>Where:</p>\n<ul>\n<li><code>in</code>: is the signed certificate</li>\n<li><code>inkey</code>: is the associated private key</li>\n<li><code>certfile</code>: is a concatenation of all Certificate Authority (CA) certs into\na single file, e.g. <code>cat ca1-cert.pem ca2-cert.pem > ca-cert.pem</code></li>\n</ul>",
          "miscs": [
            {
              "textRaw": "Perfect forward secrecy",
              "name": "Perfect forward secrecy",
              "type": "misc",
              "desc": "<p>The term <em><a href=\"https://en.wikipedia.org/wiki/Perfect_forward_secrecy\">forward secrecy</a></em> or <em>perfect forward secrecy</em> describes a feature\nof key-agreement (i.e., key-exchange) methods. That is, the server and client\nkeys are used to negotiate new temporary keys that are used specifically and\nonly for the current communication session. Practically, this means that even\nif the server's private key is compromised, communication can only be decrypted\nby eavesdroppers if the attacker manages to obtain the key-pair specifically\ngenerated for the session.</p>\n<p>Perfect forward secrecy is achieved by randomly generating a key pair for\nkey-agreement on every TLS/SSL handshake (in contrast to using the same key for\nall sessions). Methods implementing this technique are called \"ephemeral\".</p>\n<p>Currently two methods are commonly used to achieve perfect forward secrecy (note\nthe character \"E\" appended to the traditional abbreviations):</p>\n<ul>\n<li><a href=\"https://en.wikipedia.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman\">ECDHE</a>: An ephemeral version of the Elliptic Curve Diffie-Hellman\nkey-agreement protocol.</li>\n<li><a href=\"https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange\">DHE</a>: An ephemeral version of the Diffie-Hellman key-agreement protocol.</li>\n</ul>\n<p>Perfect forward secrecy using ECDHE is enabled by default. The <code>ecdhCurve</code>\noption can be used when creating a TLS server to customize the list of supported\nECDH curves to use. See <a href=\"#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a> for more info.</p>\n<p>DHE is disabled by default but can be enabled alongside ECDHE by setting the\n<code>dhparam</code> option to <code>'auto'</code>. Custom DHE parameters are also supported but\ndiscouraged in favor of automatically selected, well-known parameters.</p>\n<p>Perfect forward secrecy was optional up to TLSv1.2. As of TLSv1.3, (EC)DHE is\nalways used (with the exception of PSK-only connections).</p>"
            },
            {
              "textRaw": "ALPN and SNI",
              "name": "ALPN and SNI",
              "type": "misc",
              "desc": "<p>ALPN (Application-Layer Protocol Negotiation Extension) and\nSNI (Server Name Indication) are TLS handshake extensions:</p>\n<ul>\n<li>ALPN: Allows the use of one TLS server for multiple protocols (HTTP, HTTP/2)</li>\n<li>SNI: Allows the use of one TLS server for multiple hostnames with different\ncertificates.</li>\n</ul>"
            },
            {
              "textRaw": "Pre-shared keys",
              "name": "Pre-shared keys",
              "type": "misc",
              "desc": "<p>TLS-PSK support is available as an alternative to normal certificate-based\nauthentication. It uses a pre-shared key instead of certificates to\nauthenticate a TLS connection, providing mutual authentication.\nTLS-PSK and public key infrastructure are not mutually exclusive. Clients and\nservers can accommodate both, choosing either of them during the normal cipher\nnegotiation step.</p>\n<p>TLS-PSK is only a good choice where means exist to securely share a\nkey with every connecting machine, so it does not replace the public key\ninfrastructure (PKI) for the majority of TLS uses.\nThe TLS-PSK implementation in OpenSSL has seen many security flaws in\nrecent years, mostly because it is used only by a minority of applications.\nPlease consider all alternative solutions before switching to PSK ciphers.\nUpon generating PSK it is of critical importance to use sufficient entropy as\ndiscussed in <a href=\"https://tools.ietf.org/html/rfc4086\">RFC 4086</a>. Deriving a shared secret from a password or other\nlow-entropy sources is not secure.</p>\n<p>PSK ciphers are disabled by default, and using TLS-PSK thus requires explicitly\nspecifying a cipher suite with the <code>ciphers</code> option. The list of available\nciphers can be retrieved via <code>openssl ciphers -v 'PSK'</code>. All TLS 1.3\nciphers are eligible for PSK and can be retrieved via\n<code>openssl ciphers -v -s -tls1_3 -psk</code>.\nOn the client connection, a custom <code>checkServerIdentity</code> should be passed\nbecause the default one will fail in the absence of a certificate.</p>\n<p>According to the <a href=\"https://tools.ietf.org/html/rfc4279\">RFC 4279</a>, PSK identities up to 128 bytes in length and\nPSKs up to 64 bytes in length must be supported. As of OpenSSL 1.1.0\nmaximum identity size is 128 bytes, and maximum PSK length is 256 bytes.</p>\n<p>The current implementation doesn't support asynchronous PSK callbacks due to the\nlimitations of the underlying OpenSSL API.</p>\n<p>To use TLS-PSK, client and server must specify the <code>pskCallback</code> option,\na function that returns the PSK to use (which must be compatible with\nthe selected cipher's digest).</p>\n<p>It will be called first on the client:</p>\n<ul>\n<li><code>hint</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> optional message sent from the server to help the client\ndecide which identity to use during negotiation.\nAlways <code>null</code> if TLS 1.3 is used.</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> in the form <code>{ psk: &#x3C;Buffer|TypedArray|DataView>, identity: &#x3C;string> }</code> or <code>null</code>.</li>\n</ul>\n<p>Then on the server:</p>\n<ul>\n<li><code>socket</code> <a href=\"tls.html#tlstlssocket\"><code>&#x3C;tls.TLSSocket></code></a> the server socket instance, equivalent to <code>this</code>.</li>\n<li><code>identity</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> identity parameter sent from the client.</li>\n<li>Returns: <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> the PSK (or <code>null</code>).</li>\n</ul>\n<p>A return value of <code>null</code> stops the negotiation process and sends an\n<code>unknown_psk_identity</code> alert message to the other party.\nIf the server wishes to hide the fact that the PSK identity was not known,\nthe callback must provide some random data as <code>psk</code> to make the connection\nfail with <code>decrypt_error</code> before negotiation is finished.</p>"
            },
            {
              "textRaw": "Client-initiated renegotiation attack mitigation",
              "name": "Client-initiated renegotiation attack mitigation",
              "type": "misc",
              "desc": "<p>The TLS protocol allows clients to renegotiate certain aspects of the TLS\nsession. Unfortunately, session renegotiation requires a disproportionate amount\nof server-side resources, making it a potential vector for denial-of-service\nattacks.</p>\n<p>To mitigate the risk, renegotiation is limited to three times every ten minutes.\nAn <code>'error'</code> event is emitted on the <a href=\"#class-tlstlssocket\"><code>tls.TLSSocket</code></a> instance when this\nthreshold is exceeded. The limits are configurable:</p>\n<ul>\n<li><code>tls.CLIENT_RENEG_LIMIT</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Specifies the number of renegotiation\nrequests. <strong>Default:</strong> <code>3</code>.</li>\n<li><code>tls.CLIENT_RENEG_WINDOW</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Specifies the time renegotiation window\nin seconds. <strong>Default:</strong> <code>600</code> (10 minutes).</li>\n</ul>\n<p>The default renegotiation limits should not be modified without a full\nunderstanding of the implications and risks.</p>\n<p>TLSv1.3 does not support renegotiation.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "Session resumption",
              "name": "session_resumption",
              "type": "module",
              "desc": "<p>Establishing a TLS session can be relatively slow. The process can be sped\nup by saving and later reusing the session state. There are several mechanisms\nto do so, discussed here from oldest to newest (and preferred).</p>",
              "modules": [
                {
                  "textRaw": "Session identifiers",
                  "name": "session_identifiers",
                  "type": "module",
                  "desc": "<p>Servers generate a unique ID for new connections and\nsend it to the client. Clients and servers save the session state. When\nreconnecting, clients send the ID of their saved session state and if the server\nalso has the state for that ID, it can agree to use it. Otherwise, the server\nwill create a new session. See <a href=\"https://www.ietf.org/rfc/rfc2246.txt\">RFC 2246</a> for more information, page 23 and\n30.</p>\n<p>Resumption using session identifiers is supported by most web browsers when\nmaking HTTPS requests.</p>\n<p>For Node.js, clients wait for the <a href=\"#event-session\"><code>'session'</code></a> event to get the session data,\nand provide the data to the <code>session</code> option of a subsequent <a href=\"#tlsconnectoptions-callback\"><code>tls.connect()</code></a>\nto reuse the session. Servers must\nimplement handlers for the <a href=\"#event-newsession\"><code>'newSession'</code></a> and <a href=\"#event-resumesession\"><code>'resumeSession'</code></a> events\nto save and restore the session data using the session ID as the lookup key to\nreuse sessions. To reuse sessions across load balancers or cluster workers,\nservers must use a shared session cache (such as Redis) in their session\nhandlers.</p>",
                  "displayName": "Session identifiers"
                },
                {
                  "textRaw": "Session tickets",
                  "name": "session_tickets",
                  "type": "module",
                  "desc": "<p>The servers encrypt the entire session state and send it\nto the client as a \"ticket\". When reconnecting, the state is sent to the server\nin the initial connection. This mechanism avoids the need for a server-side\nsession cache. If the server doesn't use the ticket, for any reason (failure\nto decrypt it, it's too old, etc.), it will create a new session and send a new\nticket. See <a href=\"https://tools.ietf.org/html/rfc5077\">RFC 5077</a> for more information.</p>\n<p>Resumption using session tickets is becoming commonly supported by many web\nbrowsers when making HTTPS requests.</p>\n<p>For Node.js, clients use the same APIs for resumption with session identifiers\nas for resumption with session tickets. For debugging, if\n<a href=\"#tlssocketgettlsticket\"><code>tls.TLSSocket.getTLSTicket()</code></a> returns a value, the session data contains a\nticket, otherwise it contains client-side session state.</p>\n<p>With TLSv1.3, be aware that multiple tickets may be sent by the server,\nresulting in multiple <code>'session'</code> events, see <a href=\"#event-session\"><code>'session'</code></a> for more\ninformation.</p>\n<p>Single process servers need no specific implementation to use session tickets.\nTo use session tickets across server restarts or load balancers, servers must\nall have the same ticket keys. There are three 16-byte keys internally, but the\ntls API exposes them as a single 48-byte buffer for convenience.</p>\n<p>It's possible to get the ticket keys by calling <a href=\"#servergetticketkeys\"><code>server.getTicketKeys()</code></a> on\none server instance and then distribute them, but it is more reasonable to\nsecurely generate 48 bytes of secure random data and set them with the\n<code>ticketKeys</code> option of <a href=\"#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a>. The keys should be regularly\nregenerated and server's keys can be reset with\n<a href=\"#serversetticketkeyskeys\"><code>server.setTicketKeys()</code></a>.</p>\n<p>Session ticket keys are cryptographic keys, and they <em><strong>must be stored\nsecurely</strong></em>. With TLS 1.2 and below, if they are compromised all sessions that\nused tickets encrypted with them can be decrypted. They should not be stored\non disk, and they should be regenerated regularly.</p>\n<p>If clients advertise support for tickets, the server will send them. The\nserver can disable tickets by supplying\n<code>require('node:constants').SSL_OP_NO_TICKET</code> in <code>secureOptions</code>.</p>\n<p>Both session identifiers and session tickets timeout, causing the server to\ncreate new sessions. The timeout can be configured with the <code>sessionTimeout</code>\noption of <a href=\"#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a>.</p>\n<p>For all the mechanisms, when resumption fails, servers will create new sessions.\nSince failing to resume the session does not cause TLS/HTTPS connection\nfailures, it is easy to not notice unnecessarily poor TLS performance. The\nOpenSSL CLI can be used to verify that servers are resuming sessions. Use the\n<code>-reconnect</code> option to <code>openssl s_client</code>, for example:</p>\n<pre><code class=\"language-bash\">openssl s_client -connect localhost:443 -reconnect\n</code></pre>\n<p>Read through the debug output. The first connection should say \"New\", for\nexample:</p>\n<pre><code class=\"language-text\">New, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256\n</code></pre>\n<p>Subsequent connections should say \"Reused\", for example:</p>\n<pre><code class=\"language-text\">Reused, TLSv1.2, Cipher is ECDHE-RSA-AES128-GCM-SHA256\n</code></pre>",
                  "displayName": "Session tickets"
                }
              ],
              "displayName": "Session resumption"
            }
          ],
          "displayName": "TLS/SSL concepts"
        },
        {
          "textRaw": "Modifying the default TLS cipher suite",
          "name": "modifying_the_default_tls_cipher_suite",
          "type": "module",
          "desc": "<p>Node.js is built with a default suite of enabled and disabled TLS ciphers. This\ndefault cipher list can be configured when building Node.js to allow\ndistributions to provide their own default list.</p>\n<p>The following command can be used to show the default cipher suite:</p>\n<pre><code class=\"language-console\">node -p crypto.constants.defaultCoreCipherList | tr ':' '\\n'\nTLS_AES_256_GCM_SHA384\nTLS_CHACHA20_POLY1305_SHA256\nTLS_AES_128_GCM_SHA256\nECDHE-RSA-AES128-GCM-SHA256\nECDHE-ECDSA-AES128-GCM-SHA256\nECDHE-RSA-AES256-GCM-SHA384\nECDHE-ECDSA-AES256-GCM-SHA384\nDHE-RSA-AES128-GCM-SHA256\nECDHE-RSA-AES128-SHA256\nDHE-RSA-AES128-SHA256\nECDHE-RSA-AES256-SHA384\nDHE-RSA-AES256-SHA384\nECDHE-RSA-AES256-SHA256\nDHE-RSA-AES256-SHA256\nHIGH\n!aNULL\n!eNULL\n!EXPORT\n!DES\n!RC4\n!MD5\n!PSK\n!SRP\n!CAMELLIA\n</code></pre>\n<p>This default can be replaced entirely using the <a href=\"cli.html#--tls-cipher-listlist\"><code>--tls-cipher-list</code></a>\ncommand-line switch (directly, or via the <a href=\"cli.html#node_optionsoptions\"><code>NODE_OPTIONS</code></a> environment\nvariable). For instance, the following makes <code>ECDHE-RSA-AES128-GCM-SHA256:!RC4</code>\nthe default TLS cipher suite:</p>\n<pre><code class=\"language-bash\">node --tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4' server.js\n\nexport NODE_OPTIONS=--tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4'\nnode server.js\n</code></pre>\n<p>To verify, use the following command to show the set cipher list, note the\ndifference between <code>defaultCoreCipherList</code> and <code>defaultCipherList</code>:</p>\n<pre><code class=\"language-bash\">node --tls-cipher-list='ECDHE-RSA-AES128-GCM-SHA256:!RC4' -p crypto.constants.defaultCipherList | tr ':' '\\n'\nECDHE-RSA-AES128-GCM-SHA256\n!RC4\n</code></pre>\n<p>i.e. the <code>defaultCoreCipherList</code> list is set at compilation time and the\n<code>defaultCipherList</code> is set at runtime.</p>\n<p>To modify the default cipher suites from within the runtime, modify the\n<code>tls.DEFAULT_CIPHERS</code> variable, this must be performed before listening on any\nsockets, it will not affect sockets already opened. For example:</p>\n<pre><code class=\"language-js\">// Remove Obsolete CBC Ciphers and RSA Key Exchange based Ciphers as they don't provide Forward Secrecy\ntls.DEFAULT_CIPHERS +=\n  ':!ECDHE-RSA-AES128-SHA:!ECDHE-RSA-AES128-SHA256:!ECDHE-RSA-AES256-SHA:!ECDHE-RSA-AES256-SHA384' +\n  ':!ECDHE-ECDSA-AES128-SHA:!ECDHE-ECDSA-AES128-SHA256:!ECDHE-ECDSA-AES256-SHA:!ECDHE-ECDSA-AES256-SHA384' +\n  ':!kRSA';\n</code></pre>\n<p>The default can also be replaced on a per client or server basis using the\n<code>ciphers</code> option from <a href=\"#tlscreatesecurecontextoptions\"><code>tls.createSecureContext()</code></a>, which is also available\nin <a href=\"#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a>, <a href=\"#tlsconnectoptions-callback\"><code>tls.connect()</code></a>, and when creating new\n<a href=\"#class-tlstlssocket\"><code>tls.TLSSocket</code></a>s.</p>\n<p>The ciphers list can contain a mixture of TLSv1.3 cipher suite names, the ones\nthat start with <code>'TLS_'</code>, and specifications for TLSv1.2 and below cipher\nsuites. The TLSv1.2 ciphers support a legacy specification format, consult\nthe OpenSSL <a href=\"https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT\">cipher list format</a> documentation for details, but those\nspecifications do <em>not</em> apply to TLSv1.3 ciphers. The TLSv1.3 suites can only\nbe enabled by including their full name in the cipher list. They cannot, for\nexample, be enabled or disabled by using the legacy TLSv1.2 <code>'EECDH'</code> or\n<code>'!EECDH'</code> specification.</p>\n<p>Despite the relative order of TLSv1.3 and TLSv1.2 cipher suites, the TLSv1.3\nprotocol is significantly more secure than TLSv1.2, and will always be chosen\nover TLSv1.2 if the handshake indicates it is supported, and if any TLSv1.3\ncipher suites are enabled.</p>\n<p>The default cipher suite included within Node.js has been carefully\nselected to reflect current security best practices and risk mitigation.\nChanging the default cipher suite can have a significant impact on the security\nof an application. The <code>--tls-cipher-list</code> switch and <code>ciphers</code> option should by\nused only if absolutely necessary.</p>\n<p>The default cipher suite prefers GCM ciphers for <a href=\"https://www.chromium.org/Home/chromium-security/education/tls#TOC-Cipher-Suites\">Chrome's 'modern\ncryptography' setting</a> and also prefers ECDHE and DHE ciphers for perfect\nforward secrecy, while offering <em>some</em> backward compatibility.</p>\n<p>Old clients that rely on insecure and deprecated RC4 or DES-based ciphers\n(like Internet Explorer 6) cannot complete the handshaking process with\nthe default configuration. If these clients <em>must</em> be supported, the\n<a href=\"https://wiki.mozilla.org/Security/Server_Side_TLS\">TLS recommendations</a> may offer a compatible cipher suite. For more details\non the format, see the OpenSSL <a href=\"https://www.openssl.org/docs/man1.1.1/man1/ciphers.html#CIPHER-LIST-FORMAT\">cipher list format</a> documentation.</p>\n<p>There are only five TLSv1.3 cipher suites:</p>\n<ul>\n<li><code>'TLS_AES_256_GCM_SHA384'</code></li>\n<li><code>'TLS_CHACHA20_POLY1305_SHA256'</code></li>\n<li><code>'TLS_AES_128_GCM_SHA256'</code></li>\n<li><code>'TLS_AES_128_CCM_SHA256'</code></li>\n<li><code>'TLS_AES_128_CCM_8_SHA256'</code></li>\n</ul>\n<p>The first three are enabled by default. The two <code>CCM</code>-based suites are supported\nby TLSv1.3 because they may be more performant on constrained systems, but they\nare not enabled by default since they offer less security.</p>",
          "displayName": "Modifying the default TLS cipher suite"
        },
        {
          "textRaw": "OpenSSL security level",
          "name": "openssl_security_level",
          "type": "module",
          "desc": "<p>The OpenSSL library enforces security levels to control the minimum acceptable\nlevel of security for cryptographic operations. OpenSSL's security levels range\nfrom 0 to 5, with each level imposing stricter security requirements. The default\nsecurity level is 2, which is generally suitable for most modern applications.\nHowever, some legacy features and protocols, such as TLSv1, require a lower\nsecurity level (<code>SECLEVEL=0</code>) to function properly. For more detailed information,\nplease refer to the <a href=\"https://www.openssl.org/docs/manmaster/man3/SSL_CTX_set_security_level.html#DEFAULT-CALLBACK-BEHAVIOUR\">OpenSSL documentation on security levels</a>.</p>",
          "modules": [
            {
              "textRaw": "Setting security levels",
              "name": "setting_security_levels",
              "type": "module",
              "desc": "<p>To adjust the security level in your Node.js application, you can include <code>@SECLEVEL=X</code>\nwithin a cipher string, where <code>X</code> is the desired security level. For example,\nto set the security level to 0 while using the default OpenSSL cipher list, you could use:</p>\n<pre><code class=\"language-mjs\">import { createServer, connect } from 'node:tls';\nconst port = 443;\n\ncreateServer({ ciphers: 'DEFAULT@SECLEVEL=0', minVersion: 'TLSv1' }, function(socket) {\n  console.log('Client connected with protocol:', socket.getProtocol());\n  socket.end();\n  this.close();\n})\n.listen(port, () => {\n  connect(port, { ciphers: 'DEFAULT@SECLEVEL=0', maxVersion: 'TLSv1' });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { createServer, connect } = require('node:tls');\nconst port = 443;\n\ncreateServer({ ciphers: 'DEFAULT@SECLEVEL=0', minVersion: 'TLSv1' }, function(socket) {\n  console.log('Client connected with protocol:', socket.getProtocol());\n  socket.end();\n  this.close();\n})\n.listen(port, () => {\n  connect(port, { ciphers: 'DEFAULT@SECLEVEL=0', maxVersion: 'TLSv1' });\n});\n</code></pre>\n<p>This approach sets the security level to 0, allowing the use of legacy features while still\nleveraging the default OpenSSL ciphers.</p>",
              "displayName": "Setting security levels"
            },
            {
              "textRaw": "Using `--tls-cipher-list`",
              "name": "using_`--tls-cipher-list`",
              "type": "module",
              "desc": "<p>You can also set the security level and ciphers from the command line using the\n<code>--tls-cipher-list=DEFAULT@SECLEVEL=X</code> as described in <a href=\"#modifying-the-default-tls-cipher-suite\">Modifying the default TLS cipher suite</a>.\nHowever, it is generally discouraged to use the command line option for setting ciphers and it is\npreferable to configure the ciphers for individual contexts within your application code,\nas this approach provides finer control and reduces the risk of globally downgrading the security level.</p>",
              "displayName": "Using `--tls-cipher-list`"
            }
          ],
          "displayName": "OpenSSL security level"
        },
        {
          "textRaw": "X509 certificate error codes",
          "name": "x509_certificate_error_codes",
          "type": "module",
          "desc": "<p>Multiple functions can fail due to certificate errors that are reported by\nOpenSSL. In such a case, the function provides an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> via its callback that\nhas the property <code>code</code> which can take one of the following values:</p>\n<!--\nvalues are taken from src/crypto/crypto_common.cc\ndescription are taken from deps/openssl/openssl/crypto/x509/x509_txt.c\n-->\n<ul>\n<li><code>'UNABLE_TO_GET_ISSUER_CERT'</code>: Unable to get issuer certificate.</li>\n<li><code>'UNABLE_TO_GET_CRL'</code>: Unable to get certificate CRL.</li>\n<li><code>'UNABLE_TO_DECRYPT_CERT_SIGNATURE'</code>: Unable to decrypt certificate's\nsignature.</li>\n<li><code>'UNABLE_TO_DECRYPT_CRL_SIGNATURE'</code>: Unable to decrypt CRL's signature.</li>\n<li><code>'UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY'</code>: Unable to decode issuer public key.</li>\n<li><code>'CERT_SIGNATURE_FAILURE'</code>: Certificate signature failure.</li>\n<li><code>'CRL_SIGNATURE_FAILURE'</code>: CRL signature failure.</li>\n<li><code>'CERT_NOT_YET_VALID'</code>: Certificate is not yet valid.</li>\n<li><code>'CERT_HAS_EXPIRED'</code>: Certificate has expired.</li>\n<li><code>'CRL_NOT_YET_VALID'</code>: CRL is not yet valid.</li>\n<li><code>'CRL_HAS_EXPIRED'</code>: CRL has expired.</li>\n<li><code>'ERROR_IN_CERT_NOT_BEFORE_FIELD'</code>: Format error in certificate's notBefore\nfield.</li>\n<li><code>'ERROR_IN_CERT_NOT_AFTER_FIELD'</code>: Format error in certificate's notAfter\nfield.</li>\n<li><code>'ERROR_IN_CRL_LAST_UPDATE_FIELD'</code>: Format error in CRL's lastUpdate field.</li>\n<li><code>'ERROR_IN_CRL_NEXT_UPDATE_FIELD'</code>: Format error in CRL's nextUpdate field.</li>\n<li><code>'OUT_OF_MEM'</code>: Out of memory.</li>\n<li><code>'DEPTH_ZERO_SELF_SIGNED_CERT'</code>: Self signed certificate.</li>\n<li><code>'SELF_SIGNED_CERT_IN_CHAIN'</code>: Self signed certificate in certificate chain.</li>\n<li><code>'UNABLE_TO_GET_ISSUER_CERT_LOCALLY'</code>: Unable to get local issuer certificate.</li>\n<li><code>'UNABLE_TO_VERIFY_LEAF_SIGNATURE'</code>: Unable to verify the first certificate.</li>\n<li><code>'CERT_CHAIN_TOO_LONG'</code>: Certificate chain too long.</li>\n<li><code>'CERT_REVOKED'</code>: Certificate revoked.</li>\n<li><code>'INVALID_CA'</code>: Invalid CA certificate.</li>\n<li><code>'PATH_LENGTH_EXCEEDED'</code>: Path length constraint exceeded.</li>\n<li><code>'INVALID_PURPOSE'</code>: Unsupported certificate purpose.</li>\n<li><code>'CERT_UNTRUSTED'</code>: Certificate not trusted.</li>\n<li><code>'CERT_REJECTED'</code>: Certificate rejected.</li>\n<li><code>'HOSTNAME_MISMATCH'</code>: Hostname mismatch.</li>\n</ul>\n<p>When certificate errors like <code>UNABLE_TO_VERIFY_LEAF_SIGNATURE</code>,\n<code>DEPTH_ZERO_SELF_SIGNED_CERT</code>, or <code>UNABLE_TO_GET_ISSUER_CERT</code> occur, Node.js\nappends a hint suggesting that if the root CA is installed locally,\ntry running with the <code>--use-system-ca</code> flag to direct developers towards a\nsecure solution, to prevent unsafe workarounds.</p>",
          "displayName": "X509 certificate error codes"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `tls.Server`",
          "name": "tls.Server",
          "type": "class",
          "meta": {
            "added": [
              "v0.3.2"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#class-netserver\"><code>&#x3C;net.Server></code></a></li>\n</ul>\n<p>Accepts encrypted connections using TLS or SSL.</p>",
          "events": [
            {
              "textRaw": "Event: `'connection'`",
              "name": "connection",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`socket` {stream.Duplex}",
                  "name": "socket",
                  "type": "stream.Duplex"
                }
              ],
              "desc": "<p>This event is emitted when a new TCP stream is established, before the TLS\nhandshake begins. <code>socket</code> is typically an object of type <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a> but\nwill not receive events unlike the socket created from the <a href=\"net.html#class-netserver\"><code>net.Server</code></a>\n<code>'connection'</code> event. Usually users will not want to access this event.</p>\n<p>This event can also be explicitly emitted by users to inject connections\ninto the TLS server. In that case, any <a href=\"stream.html#class-streamduplex\"><code>Duplex</code></a> stream can be passed.</p>"
            },
            {
              "textRaw": "Event: `'keylog'`",
              "name": "keylog",
              "type": "event",
              "meta": {
                "added": [
                  "v12.3.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format.",
                  "name": "line",
                  "type": "Buffer",
                  "desc": "Line of ASCII text, in NSS `SSLKEYLOGFILE` format."
                },
                {
                  "textRaw": "`tlsSocket` {tls.TLSSocket} The `tls.TLSSocket` instance on which it was generated.",
                  "name": "tlsSocket",
                  "type": "tls.TLSSocket",
                  "desc": "The `tls.TLSSocket` instance on which it was generated."
                }
              ],
              "desc": "<p>The <code>keylog</code> event is emitted when key material is generated or received by\na connection to this server (typically before handshake has completed, but not\nnecessarily). This keying material can be stored for debugging, as it allows\ncaptured TLS traffic to be decrypted. It may be emitted multiple times for\neach socket.</p>\n<p>A typical use case is to append received lines to a common text file, which\nis later used by software (such as Wireshark) to decrypt the traffic:</p>\n<pre><code class=\"language-js\">const logFile = fs.createWriteStream('/tmp/ssl-keys.log', { flags: 'a' });\n// ...\nserver.on('keylog', (line, tlsSocket) => {\n  if (tlsSocket.remoteAddress !== '...')\n    return; // Only log keys for a particular IP\n  logFile.write(line);\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'newSession'`",
              "name": "newSession",
              "type": "event",
              "meta": {
                "added": [
                  "v0.9.2"
                ],
                "changes": [
                  {
                    "version": "v0.11.12",
                    "pr-url": "https://github.com/nodejs/node-v0.x-archive/pull/7118",
                    "description": "The `callback` argument is now supported."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`sessionId` {Buffer} The TLS session identifier",
                  "name": "sessionId",
                  "type": "Buffer",
                  "desc": "The TLS session identifier"
                },
                {
                  "textRaw": "`sessionData` {Buffer} The TLS session data",
                  "name": "sessionData",
                  "type": "Buffer",
                  "desc": "The TLS session data"
                },
                {
                  "textRaw": "`callback` {Function} A callback function taking no arguments that must be invoked in order for data to be sent or received over the secure connection.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "A callback function taking no arguments that must be invoked in order for data to be sent or received over the secure connection."
                }
              ],
              "desc": "<p>The <code>'newSession'</code> event is emitted upon creation of a new TLS session. This may\nbe used to store sessions in external storage. The data should be provided to\nthe <a href=\"#event-resumesession\"><code>'resumeSession'</code></a> callback.</p>\n<p>The listener callback is passed three arguments when called:</p>\n<p>Listening for this event will have an effect only on connections established\nafter the addition of the event listener.</p>"
            },
            {
              "textRaw": "Event: `'OCSPRequest'`",
              "name": "OCSPRequest",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`certificate` {Buffer} The server certificate",
                  "name": "certificate",
                  "type": "Buffer",
                  "desc": "The server certificate"
                },
                {
                  "textRaw": "`issuer` {Buffer} The issuer's certificate",
                  "name": "issuer",
                  "type": "Buffer",
                  "desc": "The issuer's certificate"
                },
                {
                  "textRaw": "`callback` {Function} A callback function that must be invoked to provide the results of the OCSP request.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "A callback function that must be invoked to provide the results of the OCSP request."
                }
              ],
              "desc": "<p>The <code>'OCSPRequest'</code> event is emitted when the client sends a certificate status\nrequest. The listener callback is passed three arguments when called:</p>\n<p>The server's current certificate can be parsed to obtain the OCSP URL\nand certificate ID; after obtaining an OCSP response, <code>callback(null, resp)</code> is\nthen invoked, where <code>resp</code> is a <code>Buffer</code> instance containing the OCSP response.\nBoth <code>certificate</code> and <code>issuer</code> are <code>Buffer</code> DER-representations of the\nprimary and issuer's certificates. These can be used to obtain the OCSP\ncertificate ID and OCSP endpoint URL.</p>\n<p>Alternatively, <code>callback(null, null)</code> may be called, indicating that there was\nno OCSP response.</p>\n<p>Calling <code>callback(err)</code> will result in a <code>socket.destroy(err)</code> call.</p>\n<p>The typical flow of an OCSP request is as follows:</p>\n<ol>\n<li>Client connects to the server and sends an <code>'OCSPRequest'</code> (via the status\ninfo extension in ClientHello).</li>\n<li>Server receives the request and emits the <code>'OCSPRequest'</code> event, calling the\nlistener if registered.</li>\n<li>Server extracts the OCSP URL from either the <code>certificate</code> or <code>issuer</code> and\nperforms an <a href=\"https://en.wikipedia.org/wiki/OCSP_stapling\">OCSP request</a> to the CA.</li>\n<li>Server receives <code>'OCSPResponse'</code> from the CA and sends it back to the client\nvia the <code>callback</code> argument</li>\n<li>Client validates the response and either destroys the socket or performs a\nhandshake.</li>\n</ol>\n<p>The <code>issuer</code> can be <code>null</code> if the certificate is either self-signed or the\nissuer is not in the root certificates list. (An issuer may be provided\nvia the <code>ca</code> option when establishing the TLS connection.)</p>\n<p>Listening for this event will have an effect only on connections established\nafter the addition of the event listener.</p>\n<p>An npm module like <a href=\"https://www.npmjs.com/package/asn1.js\">asn1.js</a> may be used to parse the certificates.</p>"
            },
            {
              "textRaw": "Event: `'resumeSession'`",
              "name": "resumeSession",
              "type": "event",
              "meta": {
                "added": [
                  "v0.9.2"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`sessionId` {Buffer} The TLS session identifier",
                  "name": "sessionId",
                  "type": "Buffer",
                  "desc": "The TLS session identifier"
                },
                {
                  "textRaw": "`callback` {Function} A callback function to be called when the prior session has been recovered: `callback([err[, sessionData]])`",
                  "name": "callback",
                  "type": "Function",
                  "desc": "A callback function to be called when the prior session has been recovered: `callback([err[, sessionData]])`",
                  "options": [
                    {
                      "textRaw": "`err` {Error}",
                      "name": "err",
                      "type": "Error"
                    },
                    {
                      "textRaw": "`sessionData` {Buffer}",
                      "name": "sessionData",
                      "type": "Buffer"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>'resumeSession'</code> event is emitted when the client requests to resume a\nprevious TLS session. The listener callback is passed two arguments when\ncalled:</p>\n<p>The event listener should perform a lookup in external storage for the\n<code>sessionData</code> saved by the <a href=\"#event-newsession\"><code>'newSession'</code></a> event handler using the given\n<code>sessionId</code>. If found, call <code>callback(null, sessionData)</code> to resume the session.\nIf not found, the session cannot be resumed. <code>callback()</code> must be called\nwithout <code>sessionData</code> so that the handshake can continue and a new session can\nbe created. It is possible to call <code>callback(err)</code> to terminate the incoming\nconnection and destroy the socket.</p>\n<p>Listening for this event will have an effect only on connections established\nafter the addition of the event listener.</p>\n<p>The following illustrates resuming a TLS session:</p>\n<pre><code class=\"language-js\">const tlsSessionStore = {};\nserver.on('newSession', (id, data, cb) => {\n  tlsSessionStore[id.toString('hex')] = data;\n  cb();\n});\nserver.on('resumeSession', (id, cb) => {\n  cb(null, tlsSessionStore[id.toString('hex')] || null);\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'secureConnection'`",
              "name": "secureConnection",
              "type": "event",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`tlsSocket` {tls.TLSSocket} The established TLS socket.",
                  "name": "tlsSocket",
                  "type": "tls.TLSSocket",
                  "desc": "The established TLS socket."
                }
              ],
              "desc": "<p>The <code>'secureConnection'</code> event is emitted after the handshaking process for a\nnew connection has successfully completed. The listener callback is passed a\nsingle argument when called:</p>\n<p>The <code>tlsSocket.authorized</code> property is a <code>boolean</code> indicating whether the\nclient has been verified by one of the supplied Certificate Authorities for the\nserver. If <code>tlsSocket.authorized</code> is <code>false</code>, then <code>socket.authorizationError</code>\nis set to describe how authorization failed. Depending on the settings\nof the TLS server, unauthorized connections may still be accepted.</p>\n<p>The <code>tlsSocket.alpnProtocol</code> property is a string that contains the selected\nALPN protocol. When ALPN has no selected protocol because the client or the\nserver did not send an ALPN extension, <code>tlsSocket.alpnProtocol</code> equals <code>false</code>.</p>\n<p>The <code>tlsSocket.servername</code> property is a string containing the server name\nrequested via SNI.</p>"
            },
            {
              "textRaw": "Event: `'tlsClientError'`",
              "name": "tlsClientError",
              "type": "event",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`exception` {Error} The `Error` object describing the error",
                  "name": "exception",
                  "type": "Error",
                  "desc": "The `Error` object describing the error"
                },
                {
                  "textRaw": "`tlsSocket` {tls.TLSSocket} The `tls.TLSSocket` instance from which the error originated.",
                  "name": "tlsSocket",
                  "type": "tls.TLSSocket",
                  "desc": "The `tls.TLSSocket` instance from which the error originated."
                }
              ],
              "desc": "<p>The <code>'tlsClientError'</code> event is emitted when an error occurs before a secure\nconnection is established. The listener callback is passed two arguments when\ncalled:</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`server.addContext(hostname, context)`",
              "name": "addContext",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.3"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`hostname` {string} A SNI host name or wildcard (e.g. `'*'`)",
                      "name": "hostname",
                      "type": "string",
                      "desc": "A SNI host name or wildcard (e.g. `'*'`)"
                    },
                    {
                      "textRaw": "`context` {Object|tls.SecureContext} An object containing any of the possible properties from the `tls.createSecureContext()` `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created with `tls.createSecureContext()` itself.",
                      "name": "context",
                      "type": "Object|tls.SecureContext",
                      "desc": "An object containing any of the possible properties from the `tls.createSecureContext()` `options` arguments (e.g. `key`, `cert`, `ca`, etc), or a TLS context object created with `tls.createSecureContext()` itself."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>server.addContext()</code> method adds a secure context that will be used if\nthe client request's SNI name matches the supplied <code>hostname</code> (or wildcard).</p>\n<p>When there are multiple matching contexts, the most recently added one is\nused.</p>"
            },
            {
              "textRaw": "`server.address()`",
              "name": "address",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns the bound address, the address family name, and port of the\nserver as reported by the operating system. See <a href=\"net.html#serveraddress\"><code>net.Server.address()</code></a> for\nmore information.</p>"
            },
            {
              "textRaw": "`server.close([callback])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.2"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} A listener callback that will be registered to listen for the server instance's `'close'` event.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "A listener callback that will be registered to listen for the server instance's `'close'` event.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {tls.Server}",
                    "name": "return",
                    "type": "tls.Server"
                  }
                }
              ],
              "desc": "<p>The <code>server.close()</code> method stops the server from accepting new connections.</p>\n<p>This function operates asynchronously. The <code>'close'</code> event will be emitted\nwhen the server has no more open connections.</p>"
            },
            {
              "textRaw": "`server.getTicketKeys()`",
              "name": "getTicketKeys",
              "type": "method",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer} A 48-byte buffer containing the session ticket keys.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "A 48-byte buffer containing the session ticket keys."
                  }
                }
              ],
              "desc": "<p>Returns the session ticket keys.</p>\n<p>See <a href=\"#session-resumption\">Session Resumption</a> for more information.</p>"
            },
            {
              "textRaw": "`server.listen()`",
              "name": "listen",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Starts the server listening for encrypted connections.\nThis method is identical to <a href=\"net.html#serverlisten\"><code>server.listen()</code></a> from <a href=\"net.html#class-netserver\"><code>net.Server</code></a>.</p>"
            },
            {
              "textRaw": "`server.setSecureContext(options)`",
              "name": "setSecureContext",
              "type": "method",
              "meta": {
                "added": [
                  "v11.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} An object containing any of the possible properties from the `tls.createSecureContext()` `options` arguments (e.g. `key`, `cert`, `ca`, etc).",
                      "name": "options",
                      "type": "Object",
                      "desc": "An object containing any of the possible properties from the `tls.createSecureContext()` `options` arguments (e.g. `key`, `cert`, `ca`, etc)."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>server.setSecureContext()</code> method replaces the secure context of an\nexisting server. Existing connections to the server are not interrupted.</p>"
            },
            {
              "textRaw": "`server.setTicketKeys(keys)`",
              "name": "setTicketKeys",
              "type": "method",
              "meta": {
                "added": [
                  "v3.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`keys` {Buffer|TypedArray|DataView} A 48-byte buffer containing the session ticket keys.",
                      "name": "keys",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "A 48-byte buffer containing the session ticket keys."
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the session ticket keys.</p>\n<p>Changes to the ticket keys are effective only for future server connections.\nExisting or currently pending server connections will use the previous keys.</p>\n<p>See <a href=\"#session-resumption\">Session Resumption</a> for more information.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `tls.TLSSocket`",
          "name": "tls.TLSSocket",
          "type": "class",
          "meta": {
            "added": [
              "v0.11.4"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a></li>\n</ul>\n<p>Performs transparent encryption of written data and all required TLS\nnegotiation.</p>\n<p>Instances of <code>tls.TLSSocket</code> implement the duplex <a href=\"stream.html#stream\">Stream</a> interface.</p>\n<p>Methods that return TLS connection metadata (e.g.\n<a href=\"#tlssocketgetpeercertificatedetailed\"><code>tls.TLSSocket.getPeerCertificate()</code></a>) will only return data while the\nconnection is open.</p>",
          "signatures": [
            {
              "textRaw": "`new tls.TLSSocket(socket[, options])`",
              "name": "tls.TLSSocket",
              "type": "ctor",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": [
                  {
                    "version": "v12.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/27497",
                    "description": "The `enableTrace` option is now supported."
                  },
                  {
                    "version": "v5.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/2564",
                    "description": "ALPN options are supported now."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`socket` {net.Socket|stream.Duplex} On the server side, any `Duplex` stream. On the client side, any instance of `net.Socket` (for generic `Duplex` stream support on the client side, `tls.connect()` must be used).",
                  "name": "socket",
                  "type": "net.Socket|stream.Duplex",
                  "desc": "On the server side, any `Duplex` stream. On the client side, any instance of `net.Socket` (for generic `Duplex` stream support on the client side, `tls.connect()` must be used)."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`enableTrace`: See `tls.createServer()`",
                      "name": "enableTrace",
                      "desc": "See `tls.createServer()`"
                    },
                    {
                      "textRaw": "`isServer`: The SSL/TLS protocol is asymmetrical, TLSSockets must know if they are to behave as a server or a client. If `true` the TLS socket will be instantiated as a server. **Default:** `false`.",
                      "name": "isServer",
                      "default": "`false`",
                      "desc": "The SSL/TLS protocol is asymmetrical, TLSSockets must know if they are to behave as a server or a client. If `true` the TLS socket will be instantiated as a server."
                    },
                    {
                      "textRaw": "`server` {net.Server} A `net.Server` instance.",
                      "name": "server",
                      "type": "net.Server",
                      "desc": "A `net.Server` instance."
                    },
                    {
                      "textRaw": "`requestCert`: Whether to authenticate the remote peer by requesting a certificate. Clients always request a server certificate. Servers (`isServer` is true) may set `requestCert` to true to request a client certificate.",
                      "name": "requestCert",
                      "desc": "Whether to authenticate the remote peer by requesting a certificate. Clients always request a server certificate. Servers (`isServer` is true) may set `requestCert` to true to request a client certificate."
                    },
                    {
                      "textRaw": "`rejectUnauthorized`: See `tls.createServer()`",
                      "name": "rejectUnauthorized",
                      "desc": "See `tls.createServer()`"
                    },
                    {
                      "textRaw": "`ALPNProtocols`: See `tls.createServer()`",
                      "name": "ALPNProtocols",
                      "desc": "See `tls.createServer()`"
                    },
                    {
                      "textRaw": "`SNICallback`: See `tls.createServer()`",
                      "name": "SNICallback",
                      "desc": "See `tls.createServer()`"
                    },
                    {
                      "textRaw": "`ALPNCallback`: See `tls.createServer()`",
                      "name": "ALPNCallback",
                      "desc": "See `tls.createServer()`"
                    },
                    {
                      "textRaw": "`session` {Buffer} A `Buffer` instance containing a TLS session.",
                      "name": "session",
                      "type": "Buffer",
                      "desc": "A `Buffer` instance containing a TLS session."
                    },
                    {
                      "textRaw": "`requestOCSP` {boolean} If `true`, specifies that the OCSP status request extension will be added to the client hello and an `'OCSPResponse'` event will be emitted on the socket before establishing a secure communication",
                      "name": "requestOCSP",
                      "type": "boolean",
                      "desc": "If `true`, specifies that the OCSP status request extension will be added to the client hello and an `'OCSPResponse'` event will be emitted on the socket before establishing a secure communication"
                    },
                    {
                      "textRaw": "`secureContext`: TLS context object created with `tls.createSecureContext()`. If a `secureContext` is _not_ provided, one will be created by passing the entire `options` object to `tls.createSecureContext()`.",
                      "name": "secureContext",
                      "desc": "TLS context object created with `tls.createSecureContext()`. If a `secureContext` is _not_ provided, one will be created by passing the entire `options` object to `tls.createSecureContext()`."
                    },
                    {
                      "textRaw": "...: `tls.createSecureContext()` options that are used if the `secureContext` option is missing. Otherwise, they are ignored.",
                      "name": "..",
                      "desc": "`tls.createSecureContext()` options that are used if the `secureContext` option is missing. Otherwise, they are ignored."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Construct a new <code>tls.TLSSocket</code> object from an existing TCP socket.</p>"
            }
          ],
          "events": [
            {
              "textRaw": "Event: `'keylog'`",
              "name": "keylog",
              "type": "event",
              "meta": {
                "added": [
                  "v12.3.0",
                  "v10.20.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`line` {Buffer} Line of ASCII text, in NSS `SSLKEYLOGFILE` format.",
                  "name": "line",
                  "type": "Buffer",
                  "desc": "Line of ASCII text, in NSS `SSLKEYLOGFILE` format."
                }
              ],
              "desc": "<p>The <code>keylog</code> event is emitted on a <code>tls.TLSSocket</code> when key material\nis generated or received by the socket. This keying material can be stored\nfor debugging, as it allows captured TLS traffic to be decrypted. It may\nbe emitted multiple times, before or after the handshake completes.</p>\n<p>A typical use case is to append received lines to a common text file, which\nis later used by software (such as Wireshark) to decrypt the traffic:</p>\n<pre><code class=\"language-js\">const logFile = fs.createWriteStream('/tmp/ssl-keys.log', { flags: 'a' });\n// ...\ntlsSocket.on('keylog', (line) => logFile.write(line));\n</code></pre>"
            },
            {
              "textRaw": "Event: `'OCSPResponse'`",
              "name": "OCSPResponse",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`response` {Buffer} The server's OCSP response",
                  "name": "response",
                  "type": "Buffer",
                  "desc": "The server's OCSP response"
                }
              ],
              "desc": "<p>The <code>'OCSPResponse'</code> event is emitted if the <code>requestOCSP</code> option was set\nwhen the <code>tls.TLSSocket</code> was created and an OCSP response has been received.\nThe listener callback is passed a single argument when called:</p>\n<p>Typically, the <code>response</code> is a digitally signed object from the server's CA that\ncontains information about server's certificate revocation status.</p>"
            },
            {
              "textRaw": "Event: `'secure'`",
              "name": "secure",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'secure'</code> event is emitted after the TLS handshake has successfully\ncompleted and a secure connection has been established.</p>\n<p>This event is emitted on both client and server <a href=\"tls.html#tlstlssocket\"><code>&#x3C;tls.TLSSocket></code></a> instances,\nincluding sockets created using the <code>new tls.TLSSocket()</code> constructor.</p>"
            },
            {
              "textRaw": "Event: `'secureConnect'`",
              "name": "secureConnect",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'secureConnect'</code> event is emitted after the handshaking process for a new\nconnection has successfully completed. The listener callback will be called\nregardless of whether or not the server's certificate has been authorized. It\nis the client's responsibility to check the <code>tlsSocket.authorized</code> property to\ndetermine if the server certificate was signed by one of the specified CAs. If\n<code>tlsSocket.authorized === false</code>, then the error can be found by examining the\n<code>tlsSocket.authorizationError</code> property. If ALPN was used, the\n<code>tlsSocket.alpnProtocol</code> property can be checked to determine the negotiated\nprotocol.</p>\n<p>The <code>'secureConnect'</code> event is not emitted when a <a href=\"tls.html#tlstlssocket\"><code>&#x3C;tls.TLSSocket></code></a> is created\nusing the <code>new tls.TLSSocket()</code> constructor.</p>"
            },
            {
              "textRaw": "Event: `'session'`",
              "name": "session",
              "type": "event",
              "meta": {
                "added": [
                  "v11.10.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`session` {Buffer}",
                  "name": "session",
                  "type": "Buffer"
                }
              ],
              "desc": "<p>The <code>'session'</code> event is emitted on a client <code>tls.TLSSocket</code> when a new session\nor TLS ticket is available. This may or may not be before the handshake is\ncomplete, depending on the TLS protocol version that was negotiated. The event\nis not emitted on the server, or if a new session was not created, for example,\nwhen the connection was resumed. For some TLS protocol versions the event may be\nemitted multiple times, in which case all the sessions can be used for\nresumption.</p>\n<p>On the client, the <code>session</code> can be provided to the <code>session</code> option of\n<a href=\"#tlsconnectoptions-callback\"><code>tls.connect()</code></a> to resume the connection.</p>\n<p>See <a href=\"#session-resumption\">Session Resumption</a> for more information.</p>\n<p>For TLSv1.2 and below, <a href=\"#tlssocketgetsession\"><code>tls.TLSSocket.getSession()</code></a> can be called once\nthe handshake is complete. For TLSv1.3, only ticket-based resumption is allowed\nby the protocol, multiple tickets are sent, and the tickets aren't sent until\nafter the handshake completes. So it is necessary to wait for the\n<code>'session'</code> event to get a resumable session. Applications\nshould use the <code>'session'</code> event instead of <code>getSession()</code> to ensure\nthey will work for all TLS versions. Applications that only expect to\nget or use one session should listen for this event only once:</p>\n<pre><code class=\"language-js\">tlsSocket.once('session', (session) => {\n  // The session can be used immediately or later.\n  tls.connect({\n    session: session,\n    // Other connect options...\n  });\n});\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`tlsSocket.address()`",
              "name": "address",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": [
                  {
                    "version": "v18.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/43054",
                    "description": "The `family` property now returns a string instead of a number."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41431",
                    "description": "The `family` property now returns a number instead of a string."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns the bound <code>address</code>, the address <code>family</code> name, and <code>port</code> of the\nunderlying socket as reported by the operating system:\n<code>{ port: 12346, family: 'IPv4', address: '127.0.0.1' }</code>.</p>"
            },
            {
              "textRaw": "`tlsSocket.disableRenegotiation()`",
              "name": "disableRenegotiation",
              "type": "method",
              "meta": {
                "added": [
                  "v8.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Disables TLS renegotiation for this <code>TLSSocket</code> instance. Once called, attempts\nto renegotiate will trigger an <code>'error'</code> event on the <code>TLSSocket</code>.</p>"
            },
            {
              "textRaw": "`tlsSocket.enableTrace()`",
              "name": "enableTrace",
              "type": "method",
              "meta": {
                "added": [
                  "v12.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>When enabled, TLS packet trace information is written to <code>stderr</code>. This can be\nused to debug TLS connection problems.</p>\n<p>The format of the output is identical to the output of\n<code>openssl s_client -trace</code> or <code>openssl s_server -trace</code>. While it is produced by\nOpenSSL's <code>SSL_trace()</code> function, the format is undocumented, can change\nwithout notice, and should not be relied on.</p>"
            },
            {
              "textRaw": "`tlsSocket.exportKeyingMaterial(length, label[, context])`",
              "name": "exportKeyingMaterial",
              "type": "method",
              "meta": {
                "added": [
                  "v13.10.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`length` {number} number of bytes to retrieve from keying material",
                      "name": "length",
                      "type": "number",
                      "desc": "number of bytes to retrieve from keying material"
                    },
                    {
                      "textRaw": "`label` {string} an application specific label, typically this will be a value from the IANA Exporter Label Registry.",
                      "name": "label",
                      "type": "string",
                      "desc": "an application specific label, typically this will be a value from the IANA Exporter Label Registry."
                    },
                    {
                      "textRaw": "`context` {Buffer} Optionally provide a context.",
                      "name": "context",
                      "type": "Buffer",
                      "desc": "Optionally provide a context.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} requested bytes of the keying material",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "requested bytes of the keying material"
                  }
                }
              ],
              "desc": "<p>Keying material is used for validations to prevent different kind of attacks in\nnetwork protocols, for example in the specifications of IEEE 802.1X.</p>\n<p>Example</p>\n<pre><code class=\"language-js\">const keyingMaterial = tlsSocket.exportKeyingMaterial(\n  128,\n  'client finished');\n\n/*\n Example return value of keyingMaterial:\n &#x3C;Buffer 76 26 af 99 c5 56 8e 42 09 91 ef 9f 93 cb ad 6c 7b 65 f8 53 f1 d8 d9\n    12 5a 33 b8 b5 25 df 7b 37 9f e0 e2 4f b8 67 83 a3 2f cd 5d 41 42 4c 91\n    74 ef 2c ... 78 more bytes>\n*/\n</code></pre>\n<p>See the OpenSSL <a href=\"https://www.openssl.org/docs/man1.1.1/man3/SSL_export_keying_material.html\"><code>SSL_export_keying_material</code></a> documentation for more\ninformation.</p>"
            },
            {
              "textRaw": "`tlsSocket.getCertificate()`",
              "name": "getCertificate",
              "type": "method",
              "meta": {
                "added": [
                  "v11.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns an object representing the local certificate. The returned object has\nsome properties corresponding to the fields of the certificate.</p>\n<p>See <a href=\"#tlssocketgetpeercertificatedetailed\"><code>tls.TLSSocket.getPeerCertificate()</code></a> for an example of the certificate\nstructure.</p>\n<p>If there is no local certificate, an empty object will be returned. If the\nsocket has been destroyed, <code>null</code> will be returned.</p>"
            },
            {
              "textRaw": "`tlsSocket.getCipher()`",
              "name": "getCipher",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.4.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30637",
                    "description": "Return the IETF cipher name as `standardName`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26625",
                    "description": "Return the minimum cipher version, instead of a fixed string (`'TLSv1/SSLv3'`)."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`name` {string} OpenSSL name for the cipher suite.",
                        "name": "name",
                        "type": "string",
                        "desc": "OpenSSL name for the cipher suite."
                      },
                      {
                        "textRaw": "`standardName` {string} IETF name for the cipher suite.",
                        "name": "standardName",
                        "type": "string",
                        "desc": "IETF name for the cipher suite."
                      },
                      {
                        "textRaw": "`version` {string} The minimum TLS protocol version supported by this cipher suite. For the actual negotiated protocol, see `tls.TLSSocket.getProtocol()`.",
                        "name": "version",
                        "type": "string",
                        "desc": "The minimum TLS protocol version supported by this cipher suite. For the actual negotiated protocol, see `tls.TLSSocket.getProtocol()`."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>Returns an object containing information on the negotiated cipher suite.</p>\n<p>For example, a TLSv1.2 protocol with AES256-SHA cipher:</p>\n<pre><code class=\"language-json\">{\n    \"name\": \"AES256-SHA\",\n    \"standardName\": \"TLS_RSA_WITH_AES_256_CBC_SHA\",\n    \"version\": \"SSLv3\"\n}\n</code></pre>\n<p>See\n<a href=\"https://www.openssl.org/docs/man1.1.1/man3/SSL_CIPHER_get_name.html\">SSL_CIPHER_get_name</a>\nfor more information.</p>"
            },
            {
              "textRaw": "`tlsSocket.getEphemeralKeyInfo()`",
              "name": "getEphemeralKeyInfo",
              "type": "method",
              "meta": {
                "added": [
                  "v5.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns an object representing the type, name, and size of parameter of\nan ephemeral key exchange in <a href=\"#perfect-forward-secrecy\">perfect forward secrecy</a> on a client\nconnection. It returns an empty object when the key exchange is not\nephemeral. As this is only supported on a client socket; <code>null</code> is returned\nif called on a server socket. The supported types are <code>'DH'</code> and <code>'ECDH'</code>. The\n<code>name</code> property is available only when type is <code>'ECDH'</code>.</p>\n<p>For example: <code>{ type: 'ECDH', name: 'prime256v1', size: 256 }</code>.</p>"
            },
            {
              "textRaw": "`tlsSocket.getFinished()`",
              "name": "getFinished",
              "type": "method",
              "meta": {
                "added": [
                  "v9.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer|undefined} The latest `Finished` message that has been sent to the socket as part of an SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet.",
                    "name": "return",
                    "type": "Buffer|undefined",
                    "desc": "The latest `Finished` message that has been sent to the socket as part of an SSL/TLS handshake, or `undefined` if no `Finished` message has been sent yet."
                  }
                }
              ],
              "desc": "<p>As the <code>Finished</code> messages are message digests of the complete handshake\n(with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can\nbe used for external authentication procedures when the authentication\nprovided by SSL/TLS is not desired or is not enough.</p>\n<p>Corresponds to the <code>SSL_get_finished</code> routine in OpenSSL and may be used\nto implement the <code>tls-unique</code> channel binding from <a href=\"https://tools.ietf.org/html/rfc5929\">RFC 5929</a>.</p>"
            },
            {
              "textRaw": "`tlsSocket.getPeerCertificate([detailed])`",
              "name": "getPeerCertificate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`detailed` {boolean} Include the full certificate chain if `true`, otherwise include just the peer's certificate.",
                      "name": "detailed",
                      "type": "boolean",
                      "desc": "Include the full certificate chain if `true`, otherwise include just the peer's certificate.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A certificate object.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A certificate object."
                  }
                }
              ],
              "desc": "<p>Returns an object representing the peer's certificate. If the peer does not\nprovide a certificate, an empty object will be returned. If the socket has been\ndestroyed, <code>null</code> will be returned.</p>\n<p>If the full certificate chain was requested, each certificate will include an\n<code>issuerCertificate</code> property containing an object representing its issuer's\ncertificate.</p>",
              "modules": [
                {
                  "textRaw": "Certificate object",
                  "name": "certificate_object",
                  "type": "module",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v19.1.0",
                          "v18.13.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/44935",
                        "description": "Add \"ca\" property."
                      },
                      {
                        "version": [
                          "v17.2.0",
                          "v16.14.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/39809",
                        "description": "Add fingerprint512."
                      },
                      {
                        "version": "v11.4.0",
                        "pr-url": "https://github.com/nodejs/node/pull/24358",
                        "description": "Support Elliptic Curve public key info."
                      }
                    ]
                  },
                  "desc": "<p>A certificate object has properties corresponding to the fields of the\ncertificate.</p>\n<ul>\n<li><code>ca</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> <code>true</code> if a Certificate Authority (CA), <code>false</code> otherwise.</li>\n<li><code>raw</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> The DER encoded X.509 certificate data.</li>\n<li><code>subject</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The certificate subject, described in terms of\nCountry (<code>C</code>), StateOrProvince (<code>ST</code>), Locality (<code>L</code>), Organization (<code>O</code>),\nOrganizationalUnit (<code>OU</code>), and CommonName (<code>CN</code>). The CommonName is typically\na DNS name with TLS certificates. Example:\n<code>{C: 'UK', ST: 'BC', L: 'Metro', O: 'Node Fans', OU: 'Docs', CN: 'example.com'}</code>.</li>\n<li><code>issuer</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The certificate issuer, described in the same terms as the <code>subject</code>.</li>\n<li><code>valid_from</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The date-time the certificate is valid from.</li>\n<li><code>valid_to</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The date-time the certificate is valid to.</li>\n<li><code>serialNumber</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The certificate serial number, as a hex string.\nExample: <code>'B9B0D332A1AA5635'</code>.</li>\n<li><code>fingerprint</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The SHA-1 digest of the DER encoded certificate. It is\nreturned as a <code>:</code> separated hexadecimal string. Example: <code>'2A:7A:C2:DD:...'</code>.</li>\n<li><code>fingerprint256</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The SHA-256 digest of the DER encoded certificate.\nIt is returned as a <code>:</code> separated hexadecimal string. Example:\n<code>'2A:7A:C2:DD:...'</code>.</li>\n<li><code>fingerprint512</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The SHA-512 digest of the DER encoded certificate.\nIt is returned as a <code>:</code> separated hexadecimal string. Example:\n<code>'2A:7A:C2:DD:...'</code>.</li>\n<li><code>ext_key_usage</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\"><code>&#x3C;Array></code></a> (Optional) The extended key usage, a set of OIDs.</li>\n<li><code>subjectaltname</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> (Optional) A string containing concatenated names\nfor the subject, an alternative to the <code>subject</code> names.</li>\n<li><code>infoAccess</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\"><code>&#x3C;Array></code></a> (Optional) An array describing the AuthorityInfoAccess,\nused with OCSP.</li>\n<li><code>issuerCertificate</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> (Optional) The issuer certificate object. For\nself-signed certificates, this may be a circular reference.</li>\n</ul>\n<p>The certificate may contain information about the public key, depending on\nthe key type.</p>\n<p>For RSA keys, the following properties may be defined:</p>\n<ul>\n<li><code>bits</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The RSA bit size. Example: <code>1024</code>.</li>\n<li><code>exponent</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The RSA exponent, as a string in hexadecimal number\nnotation. Example: <code>'0x010001'</code>.</li>\n<li><code>modulus</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The RSA modulus, as a hexadecimal string. Example: <code>'B56CE45CB7...'</code>.</li>\n<li><code>pubkey</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> The public key.</li>\n</ul>\n<p>For EC keys, the following properties may be defined:</p>\n<ul>\n<li><code>pubkey</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> The public key.</li>\n<li><code>bits</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The key size in bits. Example: <code>256</code>.</li>\n<li><code>asn1Curve</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> (Optional) The ASN.1 name of the OID of the elliptic\ncurve. Well-known curves are identified by an OID. While it is unusual, it is\npossible that the curve is identified by its mathematical properties, in which\ncase it will not have an OID. Example: <code>'prime256v1'</code>.</li>\n<li><code>nistCurve</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> (Optional) The NIST name for the elliptic curve, if it\nhas one (not all well-known curves have been assigned names by NIST). Example: <code>'P-256'</code>.</li>\n</ul>\n<p>Example certificate:</p>\n<pre><code class=\"language-js\">{ subject:\n   { OU: [ 'Domain Control Validated', 'PositiveSSL Wildcard' ],\n     CN: '*.nodejs.org' },\n  issuer:\n   { C: 'GB',\n     ST: 'Greater Manchester',\n     L: 'Salford',\n     O: 'COMODO CA Limited',\n     CN: 'COMODO RSA Domain Validation Secure Server CA' },\n  subjectaltname: 'DNS:*.nodejs.org, DNS:nodejs.org',\n  infoAccess:\n   { 'CA Issuers - URI':\n      [ 'http://crt.comodoca.com/COMODORSADomainValidationSecureServerCA.crt' ],\n     'OCSP - URI': [ 'http://ocsp.comodoca.com' ] },\n  modulus: 'B56CE45CB740B09A13F64AC543B712FF9EE8E4C284B542A1708A27E82A8D151CA178153E12E6DDA15BF70FFD96CB8A88618641BDFCCA03527E665B70D779C8A349A6F88FD4EF6557180BD4C98192872BCFE3AF56E863C09DDD8BC1EC58DF9D94F914F0369102B2870BECFA1348A0838C9C49BD1C20124B442477572347047506B1FCD658A80D0C44BCC16BC5C5496CFE6E4A8428EF654CD3D8972BF6E5BFAD59C93006830B5EB1056BBB38B53D1464FA6E02BFDF2FF66CD949486F0775EC43034EC2602AEFBF1703AD221DAA2A88353C3B6A688EFE8387811F645CEED7B3FE46E1F8B9F59FAD028F349B9BC14211D5830994D055EEA3D547911E07A0ADDEB8A82B9188E58720D95CD478EEC9AF1F17BE8141BE80906F1A339445A7EB5B285F68039B0F294598A7D1C0005FC22B5271B0752F58CCDEF8C8FD856FB7AE21C80B8A2CE983AE94046E53EDE4CB89F42502D31B5360771C01C80155918637490550E3F555E2EE75CC8C636DDE3633CFEDD62E91BF0F7688273694EEEBA20C2FC9F14A2A435517BC1D7373922463409AB603295CEB0BB53787A334C9CA3CA8B30005C5A62FC0715083462E00719A8FA3ED0A9828C3871360A73F8B04A4FC1E71302844E9BB9940B77E745C9D91F226D71AFCAD4B113AAF68D92B24DDB4A2136B55A1CD1ADF39605B63CB639038ED0F4C987689866743A68769CC55847E4A06D6E2E3F1',\n  exponent: '0x10001',\n  pubkey: &#x3C;Buffer ... >,\n  valid_from: 'Aug 14 00:00:00 2017 GMT',\n  valid_to: 'Nov 20 23:59:59 2019 GMT',\n  fingerprint: '01:02:59:D9:C3:D2:0D:08:F7:82:4E:44:A4:B4:53:C5:E2:3A:87:4D',\n  fingerprint256: '69:AE:1A:6A:D4:3D:C6:C1:1B:EA:C6:23:DE:BA:2A:14:62:62:93:5C:7A:EA:06:41:9B:0B:BC:87:CE:48:4E:02',\n  fingerprint512: '19:2B:3E:C3:B3:5B:32:E8:AE:BB:78:97:27:E4:BA:6C:39:C9:92:79:4F:31:46:39:E2:70:E5:5F:89:42:17:C9:E8:64:CA:FF:BB:72:56:73:6E:28:8A:92:7E:A3:2A:15:8B:C2:E0:45:CA:C3:BC:EA:40:52:EC:CA:A2:68:CB:32',\n  ext_key_usage: [ '1.3.6.1.5.5.7.3.1', '1.3.6.1.5.5.7.3.2' ],\n  serialNumber: '66593D57F20CBC573E433381B5FEC280',\n  raw: &#x3C;Buffer ... > }\n</code></pre>",
                  "displayName": "Certificate object"
                }
              ]
            },
            {
              "textRaw": "`tlsSocket.getPeerFinished()`",
              "name": "getPeerFinished",
              "type": "method",
              "meta": {
                "added": [
                  "v9.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer|undefined} The latest `Finished` message that is expected or has actually been received from the socket as part of an SSL/TLS handshake, or `undefined` if there is no `Finished` message so far.",
                    "name": "return",
                    "type": "Buffer|undefined",
                    "desc": "The latest `Finished` message that is expected or has actually been received from the socket as part of an SSL/TLS handshake, or `undefined` if there is no `Finished` message so far."
                  }
                }
              ],
              "desc": "<p>As the <code>Finished</code> messages are message digests of the complete handshake\n(with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can\nbe used for external authentication procedures when the authentication\nprovided by SSL/TLS is not desired or is not enough.</p>\n<p>Corresponds to the <code>SSL_get_peer_finished</code> routine in OpenSSL and may be used\nto implement the <code>tls-unique</code> channel binding from <a href=\"https://tools.ietf.org/html/rfc5929\">RFC 5929</a>.</p>"
            },
            {
              "textRaw": "`tlsSocket.getPeerX509Certificate()`",
              "name": "getPeerX509Certificate",
              "type": "method",
              "meta": {
                "added": [
                  "v15.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {X509Certificate}",
                    "name": "return",
                    "type": "X509Certificate"
                  }
                }
              ],
              "desc": "<p>Returns the peer certificate as an <a href=\"crypto.html#class-x509certificate\"><code>&#x3C;X509Certificate></code></a> object.</p>\n<p>If there is no peer certificate, or the socket has been destroyed,\n<code>undefined</code> will be returned.</p>"
            },
            {
              "textRaw": "`tlsSocket.getProtocol()`",
              "name": "getProtocol",
              "type": "method",
              "meta": {
                "added": [
                  "v5.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string|null}",
                    "name": "return",
                    "type": "string|null"
                  }
                }
              ],
              "desc": "<p>Returns a string containing the negotiated SSL/TLS protocol version of the\ncurrent connection. The value <code>'unknown'</code> will be returned for connected\nsockets that have not completed the handshaking process. The value <code>null</code> will\nbe returned for server sockets or disconnected client sockets.</p>\n<p>Protocol versions are:</p>\n<ul>\n<li><code>'SSLv3'</code></li>\n<li><code>'TLSv1'</code></li>\n<li><code>'TLSv1.1'</code></li>\n<li><code>'TLSv1.2'</code></li>\n<li><code>'TLSv1.3'</code></li>\n</ul>\n<p>See the OpenSSL <a href=\"https://www.openssl.org/docs/man1.1.1/man3/SSL_get_version.html\"><code>SSL_get_version</code></a> documentation for more information.</p>"
            },
            {
              "textRaw": "`tlsSocket.getSession()`",
              "name": "getSession",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Returns the TLS session data or <code>undefined</code> if no session was\nnegotiated. On the client, the data can be provided to the <code>session</code> option of\n<a href=\"#tlsconnectoptions-callback\"><code>tls.connect()</code></a> to resume the connection. On the server, it may be useful\nfor debugging.</p>\n<p>See <a href=\"#session-resumption\">Session Resumption</a> for more information.</p>\n<p>Note: <code>getSession()</code> works only for TLSv1.2 and below. For TLSv1.3, applications\nmust use the <a href=\"#event-session\"><code>'session'</code></a> event (it also works for TLSv1.2 and below).</p>"
            },
            {
              "textRaw": "`tlsSocket.getSharedSigalgs()`",
              "name": "getSharedSigalgs",
              "type": "method",
              "meta": {
                "added": [
                  "v12.11.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Array} List of signature algorithms shared between the server and the client in the order of decreasing preference.",
                    "name": "return",
                    "type": "Array",
                    "desc": "List of signature algorithms shared between the server and the client in the order of decreasing preference."
                  }
                }
              ],
              "desc": "<p>See\n<a href=\"https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html\">SSL_get_shared_sigalgs</a>\nfor more information.</p>"
            },
            {
              "textRaw": "`tlsSocket.getTLSTicket()`",
              "name": "getTLSTicket",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>For a client, returns the TLS session ticket if one is available, or\n<code>undefined</code>. For a server, always returns <code>undefined</code>.</p>\n<p>It may be useful for debugging.</p>\n<p>See <a href=\"#session-resumption\">Session Resumption</a> for more information.</p>"
            },
            {
              "textRaw": "`tlsSocket.getX509Certificate()`",
              "name": "getX509Certificate",
              "type": "method",
              "meta": {
                "added": [
                  "v15.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {X509Certificate}",
                    "name": "return",
                    "type": "X509Certificate"
                  }
                }
              ],
              "desc": "<p>Returns the local certificate as an <a href=\"crypto.html#class-x509certificate\"><code>&#x3C;X509Certificate></code></a> object.</p>\n<p>If there is no local certificate, or the socket has been destroyed,\n<code>undefined</code> will be returned.</p>"
            },
            {
              "textRaw": "`tlsSocket.isSessionReused()`",
              "name": "isSessionReused",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.6"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if the session was reused, `false` otherwise.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if the session was reused, `false` otherwise."
                  }
                }
              ],
              "desc": "<p>See <a href=\"#session-resumption\">Session Resumption</a> for more information.</p>"
            },
            {
              "textRaw": "`tlsSocket.renegotiate(options, callback)`",
              "name": "renegotiate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.8"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41678",
                    "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`rejectUnauthorized` {boolean} If not `false`, the server certificate is verified against the list of supplied CAs. An `'error'` event is emitted if verification fails; `err.code` contains the OpenSSL error code. **Default:** `true`.",
                          "name": "rejectUnauthorized",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If not `false`, the server certificate is verified against the list of supplied CAs. An `'error'` event is emitted if verification fails; `err.code` contains the OpenSSL error code."
                        },
                        {
                          "textRaw": "`requestCert`",
                          "name": "requestCert"
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function} If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "If `renegotiate()` returned `true`, callback is attached once to the `'secure'` event. If `renegotiate()` returned `false`, `callback` will be called in the next tick with an error, unless the `tlsSocket` has been destroyed, in which case `callback` will not be called at all."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `true` if renegotiation was initiated, `false` otherwise.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`true` if renegotiation was initiated, `false` otherwise."
                  }
                }
              ],
              "desc": "<p>The <code>tlsSocket.renegotiate()</code> method initiates a TLS renegotiation process.\nUpon completion, the <code>callback</code> function will be passed a single argument\nthat is either an <code>Error</code> (if the request failed) or <code>null</code>.</p>\n<p>This method can be used to request a peer's certificate after the secure\nconnection has been established.</p>\n<p>When running as the server, the socket will be destroyed with an error after\n<code>handshakeTimeout</code> timeout.</p>\n<p>For TLSv1.3, renegotiation cannot be initiated, it is not supported by the\nprotocol.</p>"
            },
            {
              "textRaw": "`tlsSocket.setKeyCert(context)`",
              "name": "setKeyCert",
              "type": "method",
              "meta": {
                "added": [
                  "v22.5.0",
                  "v20.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`context` {Object|tls.SecureContext} An object containing at least `key` and `cert` properties from the `tls.createSecureContext()` `options`, or a TLS context object created with `tls.createSecureContext()` itself.",
                      "name": "context",
                      "type": "Object|tls.SecureContext",
                      "desc": "An object containing at least `key` and `cert` properties from the `tls.createSecureContext()` `options`, or a TLS context object created with `tls.createSecureContext()` itself."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>tlsSocket.setKeyCert()</code> method sets the private key and certificate to use\nfor the socket. This is mainly useful if you wish to select a server certificate\nfrom a TLS server's <code>ALPNCallback</code>.</p>"
            },
            {
              "textRaw": "`tlsSocket.setMaxSendFragment(size)`",
              "name": "setMaxSendFragment",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.11"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {number} The maximum TLS fragment size. The maximum value is `16384`. **Default:** `16384`.",
                      "name": "size",
                      "type": "number",
                      "default": "`16384`",
                      "desc": "The maximum TLS fragment size. The maximum value is `16384`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>The <code>tlsSocket.setMaxSendFragment()</code> method sets the maximum TLS fragment size.\nReturns <code>true</code> if setting the limit succeeded; <code>false</code> otherwise.</p>\n<p>Smaller fragment sizes decrease the buffering latency on the client: larger\nfragments are buffered by the TLS layer until the entire fragment is received\nand its integrity is verified; large fragments can span multiple roundtrips\nand their processing can be delayed due to packet loss or reordering. However,\nsmaller fragments add extra TLS framing bytes and CPU overhead, which may\ndecrease overall server throughput.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`tlsSocket.authorizationError`",
              "name": "authorizationError",
              "type": "property",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the reason why the peer's certificate was not been verified. This\nproperty is set only when <code>tlsSocket.authorized === false</code>.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "authorized",
              "type": "boolean",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>This property is <code>true</code> if the peer certificate was signed by one of the CAs\nspecified when creating the <code>tls.TLSSocket</code> instance, otherwise <code>false</code>.</p>"
            },
            {
              "textRaw": "`tlsSocket.encrypted`",
              "name": "encrypted",
              "type": "property",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Always returns <code>true</code>. This may be used to distinguish TLS sockets from regular\n<code>net.Socket</code> instances.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "localAddress",
              "type": "string",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the string representation of the local IP address.</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "localPort",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the numeric representation of the local port.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "remoteAddress",
              "type": "string",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the string representation of the remote IP address. For example,\n<code>'74.125.127.100'</code> or <code>'2001:4860:a005::68'</code>.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "remoteFamily",
              "type": "string",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the string representation of the remote IP family. <code>'IPv4'</code> or <code>'IPv6'</code>.</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "remotePort",
              "type": "integer",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "desc": "<p>Returns the numeric representation of the remote port. For example, <code>443</code>.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`tls.checkServerIdentity(hostname, cert)`",
          "name": "checkServerIdentity",
          "type": "method",
          "meta": {
            "added": [
              "v0.8.4"
            ],
            "changes": [
              {
                "version": [
                  "v17.3.1",
                  "v16.13.2",
                  "v14.18.3",
                  "v12.22.9"
                ],
                "pr-url": "https://github.com/nodejs-private/node-private/pull/300",
                "description": "Support for `uniformResourceIdentifier` subject alternative names has been disabled in response to CVE-2021-44531."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`hostname` {string} The host name or IP address to verify the certificate against.",
                  "name": "hostname",
                  "type": "string",
                  "desc": "The host name or IP address to verify the certificate against."
                },
                {
                  "textRaw": "`cert` {Object} A certificate object representing the peer's certificate.",
                  "name": "cert",
                  "type": "Object",
                  "desc": "A certificate object representing the peer's certificate."
                }
              ],
              "return": {
                "textRaw": "Returns: {Error|undefined}",
                "name": "return",
                "type": "Error|undefined"
              }
            }
          ],
          "desc": "<p>Verifies the certificate <code>cert</code> is issued to <code>hostname</code>.</p>\n<p>Returns <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> object, populating it with <code>reason</code>, <code>host</code>, and <code>cert</code> on\nfailure. On success, returns <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a>.</p>\n<p>This function is intended to be used in combination with the\n<code>checkServerIdentity</code> option that can be passed to <a href=\"#tlsconnectoptions-callback\"><code>tls.connect()</code></a> and as\nsuch operates on a <a href=\"#certificate-object\">certificate object</a>. For other purposes, consider using\n<a href=\"crypto.html#x509checkhostname-options\"><code>x509.checkHost()</code></a> instead.</p>\n<p>This function can be overwritten by providing an alternative function as the\n<code>options.checkServerIdentity</code> option that is passed to <code>tls.connect()</code>. The\noverwriting function can call <code>tls.checkServerIdentity()</code> of course, to augment\nthe checks done with additional verification.</p>\n<p>This function is only called if the certificate passed all other checks, such as\nbeing issued by trusted CA (<code>options.ca</code>).</p>\n<p>Earlier versions of Node.js incorrectly accepted certificates for a given\n<code>hostname</code> if a matching <code>uniformResourceIdentifier</code> subject alternative name\nwas present (see <a href=\"https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-44531\">CVE-2021-44531</a>). Applications that wish to accept\n<code>uniformResourceIdentifier</code> subject alternative names can use a custom\n<code>options.checkServerIdentity</code> function that implements the desired behavior.</p>"
        },
        {
          "textRaw": "`tls.connect(options[, callback])`",
          "name": "connect",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": [
              {
                "version": [
                  "v15.1.0",
                  "v14.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/35753",
                "description": "Added `onread` option."
              },
              {
                "version": [
                  "v14.1.0",
                  "v13.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/32786",
                "description": "The `highWaterMark` option is accepted now."
              },
              {
                "version": [
                  "v13.6.0",
                  "v12.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/23188",
                "description": "The `pskCallback` option is now supported."
              },
              {
                "version": "v12.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/27836",
                "description": "Support the `allowHalfOpen` option."
              },
              {
                "version": "v12.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/27816",
                "description": "The `hints` option is now supported."
              },
              {
                "version": "v12.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/27497",
                "description": "The `enableTrace` option is now supported."
              },
              {
                "version": [
                  "v11.8.0",
                  "v10.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/25517",
                "description": "The `timeout` option is supported now."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12839",
                "description": "The `lookup` option is supported now."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/11984",
                "description": "The `ALPNProtocols` option can be a `TypedArray` or `DataView` now."
              },
              {
                "version": [
                  "v5.3.0",
                  "v4.7.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/4246",
                "description": "The `secureContext` option is supported now."
              },
              {
                "version": "v5.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/2564",
                "description": "ALPN options are supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`enableTrace`: See `tls.createServer()`",
                      "name": "enableTrace",
                      "desc": "See `tls.createServer()`"
                    },
                    {
                      "textRaw": "`host` {string} Host the client should connect to. **Default:** `'localhost'`.",
                      "name": "host",
                      "type": "string",
                      "default": "`'localhost'`",
                      "desc": "Host the client should connect to."
                    },
                    {
                      "textRaw": "`port` {number} Port the client should connect to.",
                      "name": "port",
                      "type": "number",
                      "desc": "Port the client should connect to."
                    },
                    {
                      "textRaw": "`path` {string} Creates Unix socket connection to path. If this option is specified, `host` and `port` are ignored.",
                      "name": "path",
                      "type": "string",
                      "desc": "Creates Unix socket connection to path. If this option is specified, `host` and `port` are ignored."
                    },
                    {
                      "textRaw": "`socket` {stream.Duplex} Establish secure connection on a given socket rather than creating a new socket. Typically, this is an instance of `net.Socket`, but any `Duplex` stream is allowed. If this option is specified, `path`, `host`, and `port` are ignored, except for certificate validation. Usually, a socket is already connected when passed to `tls.connect()`, but it can be connected later. Connection/disconnection/destruction of `socket` is the user's responsibility; calling `tls.connect()` will not cause `net.connect()` to be called.",
                      "name": "socket",
                      "type": "stream.Duplex",
                      "desc": "Establish secure connection on a given socket rather than creating a new socket. Typically, this is an instance of `net.Socket`, but any `Duplex` stream is allowed. If this option is specified, `path`, `host`, and `port` are ignored, except for certificate validation. Usually, a socket is already connected when passed to `tls.connect()`, but it can be connected later. Connection/disconnection/destruction of `socket` is the user's responsibility; calling `tls.connect()` will not cause `net.connect()` to be called."
                    },
                    {
                      "textRaw": "`allowHalfOpen` {boolean} If set to `false`, then the socket will automatically end the writable side when the readable side ends. If the `socket` option is set, this option has no effect. See the `allowHalfOpen` option of `net.Socket` for details. **Default:** `false`.",
                      "name": "allowHalfOpen",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If set to `false`, then the socket will automatically end the writable side when the readable side ends. If the `socket` option is set, this option has no effect. See the `allowHalfOpen` option of `net.Socket` for details."
                    },
                    {
                      "textRaw": "`rejectUnauthorized` {boolean} If not `false`, the server certificate is verified against the list of supplied CAs. An `'error'` event is emitted if verification fails; `err.code` contains the OpenSSL error code. **Default:** `true`.",
                      "name": "rejectUnauthorized",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If not `false`, the server certificate is verified against the list of supplied CAs. An `'error'` event is emitted if verification fails; `err.code` contains the OpenSSL error code."
                    },
                    {
                      "textRaw": "`pskCallback` {Function} For TLS-PSK negotiation, see Pre-shared keys.",
                      "name": "pskCallback",
                      "type": "Function",
                      "desc": "For TLS-PSK negotiation, see Pre-shared keys."
                    },
                    {
                      "textRaw": "`ALPNProtocols` {string[]|Buffer|TypedArray|DataView} An array of strings, or a single `Buffer`, `TypedArray`, or `DataView` containing the supported ALPN protocols. Buffers should have the format `[len][name][len][name]...` e.g. `'\\x08http/1.1\\x08http/1.0'`, where the `len` byte is the length of the next protocol name. Passing an array is usually much simpler, e.g. `['http/1.1', 'http/1.0']`. Protocols earlier in the list have higher preference than those later.",
                      "name": "ALPNProtocols",
                      "type": "string[]|Buffer|TypedArray|DataView",
                      "desc": "An array of strings, or a single `Buffer`, `TypedArray`, or `DataView` containing the supported ALPN protocols. Buffers should have the format `[len][name][len][name]...` e.g. `'\\x08http/1.1\\x08http/1.0'`, where the `len` byte is the length of the next protocol name. Passing an array is usually much simpler, e.g. `['http/1.1', 'http/1.0']`. Protocols earlier in the list have higher preference than those later."
                    },
                    {
                      "textRaw": "`servername` {string} Server name for the SNI (Server Name Indication) TLS extension. It is the name of the host being connected to, and must be a host name, and not an IP address. It can be used by a multi-homed server to choose the correct certificate to present to the client, see the `SNICallback` option to `tls.createServer()`.",
                      "name": "servername",
                      "type": "string",
                      "desc": "Server name for the SNI (Server Name Indication) TLS extension. It is the name of the host being connected to, and must be a host name, and not an IP address. It can be used by a multi-homed server to choose the correct certificate to present to the client, see the `SNICallback` option to `tls.createServer()`."
                    },
                    {
                      "textRaw": "`checkServerIdentity(servername, cert)` {Function} A callback function to be used (instead of the builtin `tls.checkServerIdentity()` function) when checking the server's host name (or the provided `servername` when explicitly set) against the certificate. This should return an {Error} if verification fails. The method should return `undefined` if the `servername` and `cert` are verified.",
                      "name": "checkServerIdentity(servername,",
                      "desc": "cert)` {Function} A callback function to be used (instead of the builtin `tls.checkServerIdentity()` function) when checking the server's host name (or the provided `servername` when explicitly set) against the certificate. This should return an {Error} if verification fails. The method should return `undefined` if the `servername` and `cert` are verified."
                    },
                    {
                      "textRaw": "`session` {Buffer} A `Buffer` instance, containing TLS session.",
                      "name": "session",
                      "type": "Buffer",
                      "desc": "A `Buffer` instance, containing TLS session."
                    },
                    {
                      "textRaw": "`requestOCSP` {boolean} If `true`, specifies that the OCSP status request extension will be added to the client hello and an `'OCSPResponse'` event will be emitted on the socket before establishing a secure communication.",
                      "name": "requestOCSP",
                      "type": "boolean",
                      "desc": "If `true`, specifies that the OCSP status request extension will be added to the client hello and an `'OCSPResponse'` event will be emitted on the socket before establishing a secure communication."
                    },
                    {
                      "textRaw": "`minDHSize` {number} Minimum size of the DH parameter in bits to accept a TLS connection. When a server offers a DH parameter with a size less than `minDHSize`, the TLS connection is destroyed and an error is thrown. **Default:** `1024`.",
                      "name": "minDHSize",
                      "type": "number",
                      "default": "`1024`",
                      "desc": "Minimum size of the DH parameter in bits to accept a TLS connection. When a server offers a DH parameter with a size less than `minDHSize`, the TLS connection is destroyed and an error is thrown."
                    },
                    {
                      "textRaw": "`highWaterMark` {number} Consistent with the readable stream `highWaterMark` parameter. **Default:** `16 * 1024`.",
                      "name": "highWaterMark",
                      "type": "number",
                      "default": "`16 * 1024`",
                      "desc": "Consistent with the readable stream `highWaterMark` parameter."
                    },
                    {
                      "textRaw": "`timeout`: {number} If set and if a socket is created internally, will call `socket.setTimeout(timeout)` after the socket is created, but before it starts the connection.",
                      "name": "timeout",
                      "type": "number",
                      "desc": "If set and if a socket is created internally, will call `socket.setTimeout(timeout)` after the socket is created, but before it starts the connection."
                    },
                    {
                      "textRaw": "`secureContext`: TLS context object created with `tls.createSecureContext()`. If a `secureContext` is _not_ provided, one will be created by passing the entire `options` object to `tls.createSecureContext()`.",
                      "name": "secureContext",
                      "desc": "TLS context object created with `tls.createSecureContext()`. If a `secureContext` is _not_ provided, one will be created by passing the entire `options` object to `tls.createSecureContext()`."
                    },
                    {
                      "textRaw": "`onread` {Object} If the `socket` option is missing, incoming data is stored in a single `buffer` and passed to the supplied `callback` when data arrives on the socket, otherwise the option is ignored. See the `onread` option of `net.Socket` for details.",
                      "name": "onread",
                      "type": "Object",
                      "desc": "If the `socket` option is missing, incoming data is stored in a single `buffer` and passed to the supplied `callback` when data arrives on the socket, otherwise the option is ignored. See the `onread` option of `net.Socket` for details."
                    },
                    {
                      "textRaw": "...: `tls.createSecureContext()` options that are used if the `secureContext` option is missing, otherwise they are ignored.",
                      "name": "..",
                      "desc": "`tls.createSecureContext()` options that are used if the `secureContext` option is missing, otherwise they are ignored."
                    },
                    {
                      "textRaw": "...: Any `socket.connect()` option not already listed.",
                      "name": "..",
                      "desc": "Any `socket.connect()` option not already listed."
                    }
                  ]
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {tls.TLSSocket}",
                "name": "return",
                "type": "tls.TLSSocket"
              }
            }
          ],
          "desc": "<p>The <code>callback</code> function, if specified, will be added as a listener for the\n<a href=\"#event-secureconnect\"><code>'secureConnect'</code></a> event.</p>\n<p><code>tls.connect()</code> returns a <a href=\"#class-tlstlssocket\"><code>tls.TLSSocket</code></a> object.</p>\n<p>Unlike the <code>https</code> API, <code>tls.connect()</code> does not enable the\nSNI (Server Name Indication) extension by default, which may cause some\nservers to return an incorrect certificate or reject the connection\naltogether. To enable SNI, set the <code>servername</code> option in addition\nto <code>host</code>.</p>\n<p>The following illustrates a client for the echo server example from\n<a href=\"#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a>:</p>\n<pre><code class=\"language-mjs\">// Assumes an echo server that is listening on port 8000.\nimport { connect } from 'node:tls';\nimport { readFileSync } from 'node:fs';\nimport { stdin } from 'node:process';\n\nconst options = {\n  // Necessary only if the server requires client certificate authentication.\n  key: readFileSync('client-key.pem'),\n  cert: readFileSync('client-cert.pem'),\n\n  // Necessary only if the server uses a self-signed certificate.\n  ca: [ readFileSync('server-cert.pem') ],\n\n  // Necessary only if the server's cert isn't for \"localhost\".\n  checkServerIdentity: () => { return null; },\n};\n\nconst socket = connect(8000, options, () => {\n  console.log('client connected',\n              socket.authorized ? 'authorized' : 'unauthorized');\n  stdin.pipe(socket);\n  stdin.resume();\n});\nsocket.setEncoding('utf8');\nsocket.on('data', (data) => {\n  console.log(data);\n});\nsocket.on('end', () => {\n  console.log('server ends connection');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Assumes an echo server that is listening on port 8000.\nconst { connect } = require('node:tls');\nconst { readFileSync } = require('node:fs');\n\nconst options = {\n  // Necessary only if the server requires client certificate authentication.\n  key: readFileSync('client-key.pem'),\n  cert: readFileSync('client-cert.pem'),\n\n  // Necessary only if the server uses a self-signed certificate.\n  ca: [ readFileSync('server-cert.pem') ],\n\n  // Necessary only if the server's cert isn't for \"localhost\".\n  checkServerIdentity: () => { return null; },\n};\n\nconst socket = connect(8000, options, () => {\n  console.log('client connected',\n              socket.authorized ? 'authorized' : 'unauthorized');\n  process.stdin.pipe(socket);\n  process.stdin.resume();\n});\nsocket.setEncoding('utf8');\nsocket.on('data', (data) => {\n  console.log(data);\n});\nsocket.on('end', () => {\n  console.log('server ends connection');\n});\n</code></pre>\n<p>To generate the certificate and key for this example, run:</p>\n<pre><code class=\"language-bash\">openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \\\n  -keyout client-key.pem -out client-cert.pem\n</code></pre>\n<p>Then, to generate the <code>server-cert.pem</code> certificate for this example, run:</p>\n<pre><code class=\"language-bash\">openssl pkcs12 -certpbe AES-256-CBC -export -out server-cert.pem \\\n  -inkey client-key.pem -in client-cert.pem\n</code></pre>"
        },
        {
          "textRaw": "`tls.connect(path[, options][, callback])`",
          "name": "connect",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string} Default value for `options.path`.",
                  "name": "path",
                  "type": "string",
                  "desc": "Default value for `options.path`."
                },
                {
                  "textRaw": "`options` {Object} See `tls.connect()`.",
                  "name": "options",
                  "type": "Object",
                  "desc": "See `tls.connect()`.",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function} See `tls.connect()`.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "See `tls.connect()`.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {tls.TLSSocket}",
                "name": "return",
                "type": "tls.TLSSocket"
              }
            }
          ],
          "desc": "<p>Same as <a href=\"#tlsconnectoptions-callback\"><code>tls.connect()</code></a> except that <code>path</code> can be provided\nas an argument instead of an option.</p>\n<p>A path option, if specified, will take precedence over the path argument.</p>"
        },
        {
          "textRaw": "`tls.connect(port[, host][, options][, callback])`",
          "name": "connect",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`port` {number} Default value for `options.port`.",
                  "name": "port",
                  "type": "number",
                  "desc": "Default value for `options.port`."
                },
                {
                  "textRaw": "`host` {string} Default value for `options.host`.",
                  "name": "host",
                  "type": "string",
                  "desc": "Default value for `options.host`.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} See `tls.connect()`.",
                  "name": "options",
                  "type": "Object",
                  "desc": "See `tls.connect()`.",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function} See `tls.connect()`.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "See `tls.connect()`.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {tls.TLSSocket}",
                "name": "return",
                "type": "tls.TLSSocket"
              }
            }
          ],
          "desc": "<p>Same as <a href=\"#tlsconnectoptions-callback\"><code>tls.connect()</code></a> except that <code>port</code> and <code>host</code> can be provided\nas arguments instead of options.</p>\n<p>A port or host option, if specified, will take precedence over any port or host\nargument.</p>"
        },
        {
          "textRaw": "`tls.createSecureContext([options])`",
          "name": "createSecureContext",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.13"
            ],
            "changes": [
              {
                "version": [
                  "v22.9.0",
                  "v20.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/54790",
                "description": "The `allowPartialTrustChain` option has been added."
              },
              {
                "version": [
                  "v22.4.0",
                  "v20.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/53329",
                "description": "The `clientCertEngine`, `privateKeyEngine` and `privateKeyIdentifier` options depend on custom engine support in OpenSSL which is deprecated in OpenSSL 3."
              },
              {
                "version": [
                  "v19.8.0",
                  "v18.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46978",
                "description": "The `dhparam` option can now be set to `'auto'` to enable DHE with appropriate well-known parameters."
              },
              {
                "version": "v12.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/28973",
                "description": "Added `privateKeyIdentifier` and `privateKeyEngine` options to get private key from an OpenSSL engine."
              },
              {
                "version": "v12.11.0",
                "pr-url": "https://github.com/nodejs/node/pull/29598",
                "description": "Added `sigalgs` option to override supported signature algorithms."
              },
              {
                "version": "v12.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/26209",
                "description": "TLSv1.3 support added."
              },
              {
                "version": "v11.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/24733",
                "description": "The `ca:` option now supports `BEGIN TRUSTED CERTIFICATE`."
              },
              {
                "version": [
                  "v11.4.0",
                  "v10.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/24405",
                "description": "The `minVersion` and `maxVersion` can be used to restrict the allowed TLS protocol versions."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/19794",
                "description": "The `ecdhCurve` cannot be set to `false` anymore due to a change in OpenSSL."
              },
              {
                "version": "v9.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/14903",
                "description": "The `options` parameter can now include `clientCertEngine`."
              },
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15206",
                "description": "The `ecdhCurve` option can now be multiple `':'` separated curve names or `'auto'`."
              },
              {
                "version": "v7.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/10294",
                "description": "If the `key` option is an array, individual entries do not need a `passphrase` property anymore. `Array` entries can also just be `string`s or `Buffer`s now."
              },
              {
                "version": "v5.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/4099",
                "description": "The `ca` option can now be a single string containing multiple CA certificates."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`allowPartialTrustChain` {boolean} Treat intermediate (non-self-signed) certificates in the trust CA certificate list as trusted.",
                      "name": "allowPartialTrustChain",
                      "type": "boolean",
                      "desc": "Treat intermediate (non-self-signed) certificates in the trust CA certificate list as trusted."
                    },
                    {
                      "textRaw": "`ca` {string|string[]|Buffer|Buffer[]} Optionally override the trusted CA certificates. If not specified, the CA certificates trusted by default are the same as the ones returned by `tls.getCACertificates()` using the `default` type. If specified, the default list would be completely replaced (instead of being concatenated) by the certificates in the `ca` option. Users need to concatenate manually if they wish to add additional certificates instead of completely overriding the default. The value can be a string or `Buffer`, or an `Array` of strings and/or `Buffer`s. Any string or `Buffer` can contain multiple PEM CAs concatenated together. The peer's certificate must be chainable to a CA trusted by the server for the connection to be authenticated. When using certificates that are not chainable to a well-known CA, the certificate's CA must be explicitly specified as a trusted or the connection will fail to authenticate. If the peer uses a certificate that doesn't match or chain to one of the default CAs, use the `ca` option to provide a CA certificate that the peer's certificate can match or chain to. For self-signed certificates, the certificate is its own CA, and must be provided. For PEM encoded certificates, supported types are \"TRUSTED CERTIFICATE\", \"X509 CERTIFICATE\", and \"CERTIFICATE\".",
                      "name": "ca",
                      "type": "string|string[]|Buffer|Buffer[]",
                      "desc": "Optionally override the trusted CA certificates. If not specified, the CA certificates trusted by default are the same as the ones returned by `tls.getCACertificates()` using the `default` type. If specified, the default list would be completely replaced (instead of being concatenated) by the certificates in the `ca` option. Users need to concatenate manually if they wish to add additional certificates instead of completely overriding the default. The value can be a string or `Buffer`, or an `Array` of strings and/or `Buffer`s. Any string or `Buffer` can contain multiple PEM CAs concatenated together. The peer's certificate must be chainable to a CA trusted by the server for the connection to be authenticated. When using certificates that are not chainable to a well-known CA, the certificate's CA must be explicitly specified as a trusted or the connection will fail to authenticate. If the peer uses a certificate that doesn't match or chain to one of the default CAs, use the `ca` option to provide a CA certificate that the peer's certificate can match or chain to. For self-signed certificates, the certificate is its own CA, and must be provided. For PEM encoded certificates, supported types are \"TRUSTED CERTIFICATE\", \"X509 CERTIFICATE\", and \"CERTIFICATE\"."
                    },
                    {
                      "textRaw": "`cert` {string|string[]|Buffer|Buffer[]} Cert chains in PEM format. One cert chain should be provided per private key. Each cert chain should consist of the PEM formatted certificate for a provided private `key`, followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA (the root CA must be pre-known to the peer, see `ca`). When providing multiple cert chains, they do not have to be in the same order as their private keys in `key`. If the intermediate certificates are not provided, the peer will not be able to validate the certificate, and the handshake will fail.",
                      "name": "cert",
                      "type": "string|string[]|Buffer|Buffer[]",
                      "desc": "Cert chains in PEM format. One cert chain should be provided per private key. Each cert chain should consist of the PEM formatted certificate for a provided private `key`, followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA (the root CA must be pre-known to the peer, see `ca`). When providing multiple cert chains, they do not have to be in the same order as their private keys in `key`. If the intermediate certificates are not provided, the peer will not be able to validate the certificate, and the handshake will fail."
                    },
                    {
                      "textRaw": "`sigalgs` {string} Colon-separated list of supported signature algorithms. The list can contain digest algorithms (`SHA256`, `MD5` etc.), public key algorithms (`RSA-PSS`, `ECDSA` etc.), combination of both (e.g 'RSA+SHA384') or TLS v1.3 scheme names (e.g. `rsa_pss_pss_sha512`). See OpenSSL man pages for more info.",
                      "name": "sigalgs",
                      "type": "string",
                      "desc": "Colon-separated list of supported signature algorithms. The list can contain digest algorithms (`SHA256`, `MD5` etc.), public key algorithms (`RSA-PSS`, `ECDSA` etc.), combination of both (e.g 'RSA+SHA384') or TLS v1.3 scheme names (e.g. `rsa_pss_pss_sha512`). See OpenSSL man pages for more info."
                    },
                    {
                      "textRaw": "`ciphers` {string} Cipher suite specification, replacing the default. For more information, see Modifying the default TLS cipher suite. Permitted ciphers can be obtained via `tls.getCiphers()`. Cipher names must be uppercased in order for OpenSSL to accept them.",
                      "name": "ciphers",
                      "type": "string",
                      "desc": "Cipher suite specification, replacing the default. For more information, see Modifying the default TLS cipher suite. Permitted ciphers can be obtained via `tls.getCiphers()`. Cipher names must be uppercased in order for OpenSSL to accept them."
                    },
                    {
                      "textRaw": "`clientCertEngine` {string} Name of an OpenSSL engine which can provide the client certificate. **Deprecated.**",
                      "name": "clientCertEngine",
                      "type": "string",
                      "desc": "Name of an OpenSSL engine which can provide the client certificate. **Deprecated.**"
                    },
                    {
                      "textRaw": "`crl` {string|string[]|Buffer|Buffer[]} PEM formatted CRLs (Certificate Revocation Lists).",
                      "name": "crl",
                      "type": "string|string[]|Buffer|Buffer[]",
                      "desc": "PEM formatted CRLs (Certificate Revocation Lists)."
                    },
                    {
                      "textRaw": "`dhparam` {string|Buffer} `'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. ECDHE-based perfect forward secrecy will still be available.",
                      "name": "dhparam",
                      "type": "string|Buffer",
                      "desc": "`'auto'` or custom Diffie-Hellman parameters, required for non-ECDHE perfect forward secrecy. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available. ECDHE-based perfect forward secrecy will still be available."
                    },
                    {
                      "textRaw": "`ecdhCurve` {string} A string describing a named curve or a colon separated list of curve NIDs or names, for example `P-521:P-384:P-256`, to use for ECDH key agreement. Set to `auto` to select the curve automatically. Use `crypto.getCurves()` to obtain a list of available curve names. On recent releases, `openssl ecparam -list_curves` will also display the name and description of each available elliptic curve. **Default:** `tls.DEFAULT_ECDH_CURVE`.",
                      "name": "ecdhCurve",
                      "type": "string",
                      "default": "`tls.DEFAULT_ECDH_CURVE`",
                      "desc": "A string describing a named curve or a colon separated list of curve NIDs or names, for example `P-521:P-384:P-256`, to use for ECDH key agreement. Set to `auto` to select the curve automatically. Use `crypto.getCurves()` to obtain a list of available curve names. On recent releases, `openssl ecparam -list_curves` will also display the name and description of each available elliptic curve."
                    },
                    {
                      "textRaw": "`honorCipherOrder` {boolean} Attempt to use the server's cipher suite preferences instead of the client's. When `true`, causes `SSL_OP_CIPHER_SERVER_PREFERENCE` to be set in `secureOptions`, see OpenSSL Options for more information.",
                      "name": "honorCipherOrder",
                      "type": "boolean",
                      "desc": "Attempt to use the server's cipher suite preferences instead of the client's. When `true`, causes `SSL_OP_CIPHER_SERVER_PREFERENCE` to be set in `secureOptions`, see OpenSSL Options for more information."
                    },
                    {
                      "textRaw": "`key` {string|string[]|Buffer|Buffer[]|Object[]} Private keys in PEM format. PEM allows the option of private keys being encrypted. Encrypted keys will be decrypted with `options.passphrase`. Multiple keys using different algorithms can be provided either as an array of unencrypted key strings or buffers, or an array of objects in the form `{pem: <string|buffer>[, passphrase: <string>]}`. The object form can only occur in an array. `object.passphrase` is optional. Encrypted keys will be decrypted with `object.passphrase` if provided, or `options.passphrase` if it is not.",
                      "name": "key",
                      "type": "string|string[]|Buffer|Buffer[]|Object[]",
                      "desc": "Private keys in PEM format. PEM allows the option of private keys being encrypted. Encrypted keys will be decrypted with `options.passphrase`. Multiple keys using different algorithms can be provided either as an array of unencrypted key strings or buffers, or an array of objects in the form `{pem: <string|buffer>[, passphrase: <string>]}`. The object form can only occur in an array. `object.passphrase` is optional. Encrypted keys will be decrypted with `object.passphrase` if provided, or `options.passphrase` if it is not."
                    },
                    {
                      "textRaw": "`privateKeyEngine` {string} Name of an OpenSSL engine to get private key from. Should be used together with `privateKeyIdentifier`. **Deprecated.**",
                      "name": "privateKeyEngine",
                      "type": "string",
                      "desc": "Name of an OpenSSL engine to get private key from. Should be used together with `privateKeyIdentifier`. **Deprecated.**"
                    },
                    {
                      "textRaw": "`privateKeyIdentifier` {string} Identifier of a private key managed by an OpenSSL engine. Should be used together with `privateKeyEngine`. Should not be set together with `key`, because both options define a private key in different ways. **Deprecated.**",
                      "name": "privateKeyIdentifier",
                      "type": "string",
                      "desc": "Identifier of a private key managed by an OpenSSL engine. Should be used together with `privateKeyEngine`. Should not be set together with `key`, because both options define a private key in different ways. **Deprecated.**"
                    },
                    {
                      "textRaw": "`maxVersion` {string} Optionally set the maximum TLS version to allow. One of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the `secureProtocol` option; use one or the other. **Default:** `tls.DEFAULT_MAX_VERSION`.",
                      "name": "maxVersion",
                      "type": "string",
                      "default": "`tls.DEFAULT_MAX_VERSION`",
                      "desc": "Optionally set the maximum TLS version to allow. One of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the `secureProtocol` option; use one or the other."
                    },
                    {
                      "textRaw": "`minVersion` {string} Optionally set the minimum TLS version to allow. One of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the `secureProtocol` option; use one or the other. Avoid setting to less than TLSv1.2, but it may be required for interoperability. Versions before TLSv1.2 may require downgrading the OpenSSL Security Level. **Default:** `tls.DEFAULT_MIN_VERSION`.",
                      "name": "minVersion",
                      "type": "string",
                      "default": "`tls.DEFAULT_MIN_VERSION`",
                      "desc": "Optionally set the minimum TLS version to allow. One of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the `secureProtocol` option; use one or the other. Avoid setting to less than TLSv1.2, but it may be required for interoperability. Versions before TLSv1.2 may require downgrading the OpenSSL Security Level."
                    },
                    {
                      "textRaw": "`passphrase` {string} Shared passphrase used for a single private key and/or a PFX.",
                      "name": "passphrase",
                      "type": "string",
                      "desc": "Shared passphrase used for a single private key and/or a PFX."
                    },
                    {
                      "textRaw": "`pfx` {string|string[]|Buffer|Buffer[]|Object[]} PFX or PKCS12 encoded private key and certificate chain. `pfx` is an alternative to providing `key` and `cert` individually. PFX is usually encrypted, if it is, `passphrase` will be used to decrypt it. Multiple PFX can be provided either as an array of unencrypted PFX buffers, or an array of objects in the form `{buf: <string|buffer>[, passphrase: <string>]}`. The object form can only occur in an array. `object.passphrase` is optional. Encrypted PFX will be decrypted with `object.passphrase` if provided, or `options.passphrase` if it is not.",
                      "name": "pfx",
                      "type": "string|string[]|Buffer|Buffer[]|Object[]",
                      "desc": "PFX or PKCS12 encoded private key and certificate chain. `pfx` is an alternative to providing `key` and `cert` individually. PFX is usually encrypted, if it is, `passphrase` will be used to decrypt it. Multiple PFX can be provided either as an array of unencrypted PFX buffers, or an array of objects in the form `{buf: <string|buffer>[, passphrase: <string>]}`. The object form can only occur in an array. `object.passphrase` is optional. Encrypted PFX will be decrypted with `object.passphrase` if provided, or `options.passphrase` if it is not."
                    },
                    {
                      "textRaw": "`secureOptions` {number} Optionally affect the OpenSSL protocol behavior, which is not usually necessary. This should be used carefully if at all! Value is a numeric bitmask of the `SSL_OP_*` options from OpenSSL Options.",
                      "name": "secureOptions",
                      "type": "number",
                      "desc": "Optionally affect the OpenSSL protocol behavior, which is not usually necessary. This should be used carefully if at all! Value is a numeric bitmask of the `SSL_OP_*` options from OpenSSL Options."
                    },
                    {
                      "textRaw": "`secureProtocol` {string} Legacy mechanism to select the TLS protocol version to use, it does not support independent control of the minimum and maximum version, and does not support limiting the protocol to TLSv1.3. Use `minVersion` and `maxVersion` instead. The possible values are listed as SSL_METHODS, use the function names as strings. For example, use `'TLSv1_1_method'` to force TLS version 1.1, or `'TLS_method'` to allow any TLS protocol version up to TLSv1.3. It is not recommended to use TLS versions less than 1.2, but it may be required for interoperability. **Default:** none, see `minVersion`.",
                      "name": "secureProtocol",
                      "type": "string",
                      "default": "none, see `minVersion`",
                      "desc": "Legacy mechanism to select the TLS protocol version to use, it does not support independent control of the minimum and maximum version, and does not support limiting the protocol to TLSv1.3. Use `minVersion` and `maxVersion` instead. The possible values are listed as SSL_METHODS, use the function names as strings. For example, use `'TLSv1_1_method'` to force TLS version 1.1, or `'TLS_method'` to allow any TLS protocol version up to TLSv1.3. It is not recommended to use TLS versions less than 1.2, but it may be required for interoperability."
                    },
                    {
                      "textRaw": "`sessionIdContext` {string} Opaque identifier used by servers to ensure session state is not shared between applications. Unused by clients.",
                      "name": "sessionIdContext",
                      "type": "string",
                      "desc": "Opaque identifier used by servers to ensure session state is not shared between applications. Unused by clients."
                    },
                    {
                      "textRaw": "`ticketKeys` {Buffer} 48-bytes of cryptographically strong pseudorandom data. See Session Resumption for more information.",
                      "name": "ticketKeys",
                      "type": "Buffer",
                      "desc": "48-bytes of cryptographically strong pseudorandom data. See Session Resumption for more information."
                    },
                    {
                      "textRaw": "`sessionTimeout` {number} The number of seconds after which a TLS session created by the server will no longer be resumable. See Session Resumption for more information. **Default:** `300`.",
                      "name": "sessionTimeout",
                      "type": "number",
                      "default": "`300`",
                      "desc": "The number of seconds after which a TLS session created by the server will no longer be resumable. See Session Resumption for more information."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><a href=\"#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a> sets the default value of the <code>honorCipherOrder</code> option\nto <code>true</code>, other APIs that create secure contexts leave it unset.</p>\n<p><a href=\"#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a> uses a 128 bit truncated SHA1 hash value generated\nfrom <code>process.argv</code> as the default value of the <code>sessionIdContext</code> option, other\nAPIs that create secure contexts have no default value.</p>\n<p>The <code>tls.createSecureContext()</code> method creates a <code>SecureContext</code> object. It is\nusable as an argument to several <code>tls</code> APIs, such as <a href=\"#serveraddcontexthostname-context\"><code>server.addContext()</code></a>,\nbut has no public methods. The <a href=\"#class-tlsserver\"><code>tls.Server</code></a> constructor and the\n<a href=\"#tlscreateserveroptions-secureconnectionlistener\"><code>tls.createServer()</code></a> method do not support the <code>secureContext</code> option.</p>\n<p>A key is <em>required</em> for ciphers that use certificates. Either <code>key</code> or\n<code>pfx</code> can be used to provide it.</p>\n<p>If the <code>ca</code> option is not given, then Node.js will default to using\n<a href=\"https://hg.mozilla.org/mozilla-central/raw-file/tip/security/nss/lib/ckfw/builtins/certdata.txt\">Mozilla's publicly trusted list of CAs</a>.</p>\n<p>Custom DHE parameters are discouraged in favor of the new <code>dhparam: 'auto'</code>\noption. When set to <code>'auto'</code>, well-known DHE parameters of sufficient strength\nwill be selected automatically. Otherwise, if necessary, <code>openssl dhparam</code> can\nbe used to create custom parameters. The key length must be greater than or\nequal to 1024 bits or else an error will be thrown. Although 1024 bits is\npermissible, use 2048 bits or larger for stronger security.</p>"
        },
        {
          "textRaw": "`tls.createServer([options][, secureConnectionListener])`",
          "name": "createServer",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.2"
            ],
            "changes": [
              {
                "version": [
                  "v22.4.0",
                  "v20.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/53329",
                "description": "The `clientCertEngine` option depends on custom engine support in OpenSSL which is deprecated in OpenSSL 3."
              },
              {
                "version": [
                  "v20.4.0",
                  "v18.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/45190",
                "description": "The `options` parameter can now include `ALPNCallback`."
              },
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/44031",
                "description": "If `ALPNProtocols` is set, incoming connections that send an ALPN extension with no supported protocols are terminated with a fatal `no_application_protocol` alert."
              },
              {
                "version": "v12.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/27665",
                "description": "The `options` parameter now supports `net.createServer()` options."
              },
              {
                "version": "v9.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/14903",
                "description": "The `options` parameter can now include `clientCertEngine`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/11984",
                "description": "The `ALPNProtocols` option can be a `TypedArray` or `DataView` now."
              },
              {
                "version": "v5.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/2564",
                "description": "ALPN options are supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`ALPNProtocols` {string[]|Buffer|TypedArray|DataView} An array of strings, or a single `Buffer`, `TypedArray`, or `DataView` containing the supported ALPN protocols. Buffers should have the format `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first byte is the length of the next protocol name. Passing an array is usually much simpler, e.g. `['hello', 'world']`. (Protocols should be ordered by their priority.)",
                      "name": "ALPNProtocols",
                      "type": "string[]|Buffer|TypedArray|DataView",
                      "desc": "An array of strings, or a single `Buffer`, `TypedArray`, or `DataView` containing the supported ALPN protocols. Buffers should have the format `[len][name][len][name]...` e.g. `0x05hello0x05world`, where the first byte is the length of the next protocol name. Passing an array is usually much simpler, e.g. `['hello', 'world']`. (Protocols should be ordered by their priority.)"
                    },
                    {
                      "textRaw": "`ALPNCallback` {Function} If set, this will be called when a client opens a connection using the ALPN extension. One argument will be passed to the callback: an object containing `servername` and `protocols` fields, respectively containing the server name from the SNI extension (if any) and an array of ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, which will be returned to the client as the selected ALPN protocol, or `undefined`, to reject the connection with a fatal alert. If a string is returned that does not match one of the client's ALPN protocols, an error will be thrown. This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error.",
                      "name": "ALPNCallback",
                      "type": "Function",
                      "desc": "If set, this will be called when a client opens a connection using the ALPN extension. One argument will be passed to the callback: an object containing `servername` and `protocols` fields, respectively containing the server name from the SNI extension (if any) and an array of ALPN protocol name strings. The callback must return either one of the strings listed in `protocols`, which will be returned to the client as the selected ALPN protocol, or `undefined`, to reject the connection with a fatal alert. If a string is returned that does not match one of the client's ALPN protocols, an error will be thrown. This option cannot be used with the `ALPNProtocols` option, and setting both options will throw an error."
                    },
                    {
                      "textRaw": "`clientCertEngine` {string} Name of an OpenSSL engine which can provide the client certificate. **Deprecated.**",
                      "name": "clientCertEngine",
                      "type": "string",
                      "desc": "Name of an OpenSSL engine which can provide the client certificate. **Deprecated.**"
                    },
                    {
                      "textRaw": "`enableTrace` {boolean} If `true`, `tls.TLSSocket.enableTrace()` will be called on new connections. Tracing can be enabled after the secure connection is established, but this option must be used to trace the secure connection setup. **Default:** `false`.",
                      "name": "enableTrace",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, `tls.TLSSocket.enableTrace()` will be called on new connections. Tracing can be enabled after the secure connection is established, but this option must be used to trace the secure connection setup."
                    },
                    {
                      "textRaw": "`handshakeTimeout` {number} Abort the connection if the SSL/TLS handshake does not finish in the specified number of milliseconds. A `'tlsClientError'` is emitted on the `tls.Server` object whenever a handshake times out. **Default:** `120000` (120 seconds).",
                      "name": "handshakeTimeout",
                      "type": "number",
                      "default": "`120000` (120 seconds)",
                      "desc": "Abort the connection if the SSL/TLS handshake does not finish in the specified number of milliseconds. A `'tlsClientError'` is emitted on the `tls.Server` object whenever a handshake times out."
                    },
                    {
                      "textRaw": "`rejectUnauthorized` {boolean} If not `false` the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if `requestCert` is `true`. **Default:** `true`.",
                      "name": "rejectUnauthorized",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If not `false` the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if `requestCert` is `true`."
                    },
                    {
                      "textRaw": "`requestCert` {boolean} If `true` the server will request a certificate from clients that connect and attempt to verify that certificate. **Default:** `false`.",
                      "name": "requestCert",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true` the server will request a certificate from clients that connect and attempt to verify that certificate."
                    },
                    {
                      "textRaw": "`sessionTimeout` {number} The number of seconds after which a TLS session created by the server will no longer be resumable. See Session Resumption for more information. **Default:** `300`.",
                      "name": "sessionTimeout",
                      "type": "number",
                      "default": "`300`",
                      "desc": "The number of seconds after which a TLS session created by the server will no longer be resumable. See Session Resumption for more information."
                    },
                    {
                      "textRaw": "`SNICallback(servername, callback)` {Function} A function that will be called if the client supports SNI TLS extension. Two arguments will be passed when called: `servername` and `callback`. `callback` is an error-first callback that takes two optional arguments: `error` and `ctx`. `ctx`, if provided, is a `SecureContext` instance. `tls.createSecureContext()` can be used to get a proper `SecureContext`. If `callback` is called with a falsy `ctx` argument, the default secure context of the server will be used. If `SNICallback` wasn't provided the default callback with high-level API will be used (see below).",
                      "name": "SNICallback(servername,",
                      "desc": "callback)` {Function} A function that will be called if the client supports SNI TLS extension. Two arguments will be passed when called: `servername` and `callback`. `callback` is an error-first callback that takes two optional arguments: `error` and `ctx`. `ctx`, if provided, is a `SecureContext` instance. `tls.createSecureContext()` can be used to get a proper `SecureContext`. If `callback` is called with a falsy `ctx` argument, the default secure context of the server will be used. If `SNICallback` wasn't provided the default callback with high-level API will be used (see below)."
                    },
                    {
                      "textRaw": "`ticketKeys` {Buffer} 48-bytes of cryptographically strong pseudorandom data. See Session Resumption for more information.",
                      "name": "ticketKeys",
                      "type": "Buffer",
                      "desc": "48-bytes of cryptographically strong pseudorandom data. See Session Resumption for more information."
                    },
                    {
                      "textRaw": "`pskCallback` {Function} For TLS-PSK negotiation, see Pre-shared keys.",
                      "name": "pskCallback",
                      "type": "Function",
                      "desc": "For TLS-PSK negotiation, see Pre-shared keys."
                    },
                    {
                      "textRaw": "`pskIdentityHint` {string} optional hint to send to a client to help with selecting the identity during TLS-PSK negotiation. Will be ignored in TLS 1.3. Upon failing to set pskIdentityHint `'tlsClientError'` will be emitted with `'ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED'` code.",
                      "name": "pskIdentityHint",
                      "type": "string",
                      "desc": "optional hint to send to a client to help with selecting the identity during TLS-PSK negotiation. Will be ignored in TLS 1.3. Upon failing to set pskIdentityHint `'tlsClientError'` will be emitted with `'ERR_TLS_PSK_SET_IDENTITY_HINT_FAILED'` code."
                    },
                    {
                      "textRaw": "...: Any `tls.createSecureContext()` option can be provided. For servers, the identity options (`pfx`, `key`/`cert`, or `pskCallback`) are usually required.",
                      "name": "..",
                      "desc": "Any `tls.createSecureContext()` option can be provided. For servers, the identity options (`pfx`, `key`/`cert`, or `pskCallback`) are usually required."
                    },
                    {
                      "textRaw": "...: Any `net.createServer()` option can be provided.",
                      "name": "..",
                      "desc": "Any `net.createServer()` option can be provided."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`secureConnectionListener` {Function}",
                  "name": "secureConnectionListener",
                  "type": "Function",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {tls.Server}",
                "name": "return",
                "type": "tls.Server"
              }
            }
          ],
          "desc": "<p>Creates a new <a href=\"#class-tlsserver\"><code>tls.Server</code></a>. The <code>secureConnectionListener</code>, if provided, is\nautomatically set as a listener for the <a href=\"#event-secureconnection\"><code>'secureConnection'</code></a> event.</p>\n<p>The <code>ticketKeys</code> option is automatically shared between <code>node:cluster</code> module\nworkers.</p>\n<p>The following illustrates a simple echo server:</p>\n<pre><code class=\"language-mjs\">import { createServer } from 'node:tls';\nimport { readFileSync } from 'node:fs';\n\nconst options = {\n  key: readFileSync('server-key.pem'),\n  cert: readFileSync('server-cert.pem'),\n\n  // This is necessary only if using client certificate authentication.\n  requestCert: true,\n\n  // This is necessary only if the client uses a self-signed certificate.\n  ca: [ readFileSync('client-cert.pem') ],\n};\n\nconst server = createServer(options, (socket) => {\n  console.log('server connected',\n              socket.authorized ? 'authorized' : 'unauthorized');\n  socket.write('welcome!\\n');\n  socket.setEncoding('utf8');\n  socket.pipe(socket);\n});\nserver.listen(8000, () => {\n  console.log('server bound');\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { createServer } = require('node:tls');\nconst { readFileSync } = require('node:fs');\n\nconst options = {\n  key: readFileSync('server-key.pem'),\n  cert: readFileSync('server-cert.pem'),\n\n  // This is necessary only if using client certificate authentication.\n  requestCert: true,\n\n  // This is necessary only if the client uses a self-signed certificate.\n  ca: [ readFileSync('client-cert.pem') ],\n};\n\nconst server = createServer(options, (socket) => {\n  console.log('server connected',\n              socket.authorized ? 'authorized' : 'unauthorized');\n  socket.write('welcome!\\n');\n  socket.setEncoding('utf8');\n  socket.pipe(socket);\n});\nserver.listen(8000, () => {\n  console.log('server bound');\n});\n</code></pre>\n<p>To generate the certificate and key for this example, run:</p>\n<pre><code class=\"language-bash\">openssl req -x509 -newkey rsa:2048 -nodes -sha256 -subj '/CN=localhost' \\\n  -keyout server-key.pem -out server-cert.pem\n</code></pre>\n<p>Then, to generate the <code>client-cert.pem</code> certificate for this example, run:</p>\n<pre><code class=\"language-bash\">openssl pkcs12 -certpbe AES-256-CBC -export -out client-cert.pem \\\n  -inkey server-key.pem -in server-cert.pem\n</code></pre>\n<p>The server can be tested by connecting to it using the example client from\n<a href=\"#tlsconnectoptions-callback\"><code>tls.connect()</code></a>.</p>"
        },
        {
          "textRaw": "`tls.setDefaultCACertificates(certs)`",
          "name": "setDefaultCACertificates",
          "type": "method",
          "meta": {
            "added": [
              "v24.5.0",
              "v22.19.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`certs` {string[]} An array of CA certificates in PEM format.",
                  "name": "certs",
                  "type": "string[]",
                  "desc": "An array of CA certificates in PEM format."
                }
              ]
            }
          ],
          "desc": "<p>Sets the default CA certificates used by Node.js TLS clients. If the provided\ncertificates are parsed successfully, they will become the default CA\ncertificate list returned by <a href=\"#tlsgetcacertificatestype\"><code>tls.getCACertificates()</code></a> and used\nby subsequent TLS connections that don't specify their own CA certificates.\nThe certificates will be deduplicated before being set as the default.</p>\n<p>This function only affects the current Node.js thread. Previous\nsessions cached by the HTTPS agent won't be affected by this change, so\nthis method should be called before any unwanted cachable TLS connections are\nmade.</p>\n<p>To use system CA certificates as the default:</p>\n<pre><code class=\"language-cjs\">const tls = require('node:tls');\ntls.setDefaultCACertificates(tls.getCACertificates('system'));\n</code></pre>\n<pre><code class=\"language-mjs\">import tls from 'node:tls';\ntls.setDefaultCACertificates(tls.getCACertificates('system'));\n</code></pre>\n<p>This function completely replaces the default CA certificate list. To add additional\ncertificates to the existing defaults, get the current certificates and append to them:</p>\n<pre><code class=\"language-cjs\">const tls = require('node:tls');\nconst currentCerts = tls.getCACertificates('default');\nconst additionalCerts = ['-----BEGIN CERTIFICATE-----\\n...'];\ntls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);\n</code></pre>\n<pre><code class=\"language-mjs\">import tls from 'node:tls';\nconst currentCerts = tls.getCACertificates('default');\nconst additionalCerts = ['-----BEGIN CERTIFICATE-----\\n...'];\ntls.setDefaultCACertificates([...currentCerts, ...additionalCerts]);\n</code></pre>"
        },
        {
          "textRaw": "`tls.getCACertificates([type])`",
          "name": "getCACertificates",
          "type": "method",
          "meta": {
            "added": [
              "v23.10.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`type` {string|undefined} The type of CA certificates that will be returned. Valid values are `\"default\"`, `\"system\"`, `\"bundled\"` and `\"extra\"`. **Default:** `\"default\"`.",
                  "name": "type",
                  "type": "string|undefined",
                  "default": "`\"default\"`",
                  "desc": "The type of CA certificates that will be returned. Valid values are `\"default\"`, `\"system\"`, `\"bundled\"` and `\"extra\"`.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string[]} An array of PEM-encoded certificates. The array may contain duplicates if the same certificate is repeatedly stored in multiple sources.",
                "name": "return",
                "type": "string[]",
                "desc": "An array of PEM-encoded certificates. The array may contain duplicates if the same certificate is repeatedly stored in multiple sources."
              }
            }
          ],
          "desc": "<p>Returns an array containing the CA certificates from various sources, depending on <code>type</code>:</p>\n<ul>\n<li><code>\"default\"</code>: return the CA certificates that will be used by the Node.js TLS clients by default.\n<ul>\n<li>When <a href=\"cli.html#--use-bundled-ca---use-openssl-ca\"><code>--use-bundled-ca</code></a> is enabled (default), or <a href=\"cli.html#--use-bundled-ca---use-openssl-ca\"><code>--use-openssl-ca</code></a> is not enabled,\nthis would include CA certificates from the bundled Mozilla CA store.</li>\n<li>When <a href=\"cli.html#--use-system-ca\"><code>--use-system-ca</code></a> is enabled, this would also include certificates from the system's\ntrusted store.</li>\n<li>When <a href=\"cli.html#node_extra_ca_certsfile\"><code>NODE_EXTRA_CA_CERTS</code></a> is used, this would also include certificates loaded from the specified\nfile.</li>\n</ul>\n</li>\n<li><code>\"system\"</code>: return the CA certificates that are loaded from the system's trusted store, according\nto rules set by <a href=\"cli.html#--use-system-ca\"><code>--use-system-ca</code></a>. This can be used to get the certificates from the system\nwhen <a href=\"cli.html#--use-system-ca\"><code>--use-system-ca</code></a> is not enabled.</li>\n<li><code>\"bundled\"</code>: return the CA certificates from the bundled Mozilla CA store. This would be the same\nas <a href=\"#tlsrootcertificates\"><code>tls.rootCertificates</code></a>.</li>\n<li><code>\"extra\"</code>: return the CA certificates loaded from <a href=\"cli.html#node_extra_ca_certsfile\"><code>NODE_EXTRA_CA_CERTS</code></a>. It's an empty array if\n<a href=\"cli.html#node_extra_ca_certsfile\"><code>NODE_EXTRA_CA_CERTS</code></a> is not set.</li>\n</ul>"
        },
        {
          "textRaw": "`tls.getCiphers()`",
          "name": "getCiphers",
          "type": "method",
          "meta": {
            "added": [
              "v0.10.2"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string[]}",
                "name": "return",
                "type": "string[]"
              }
            }
          ],
          "desc": "<p>Returns an array with the names of the supported TLS ciphers. The names are\nlower-case for historical reasons, but must be uppercased to be used in\nthe <code>ciphers</code> option of <a href=\"#tlscreatesecurecontextoptions\"><code>tls.createSecureContext()</code></a>.</p>\n<p>Not all supported ciphers are enabled by default. See\n<a href=\"#modifying-the-default-tls-cipher-suite\">Modifying the default TLS cipher suite</a>.</p>\n<p>Cipher names that start with <code>'tls_'</code> are for TLSv1.3, all the others are for\nTLSv1.2 and below.</p>\n<pre><code class=\"language-js\">console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...]\n</code></pre>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {string[]}",
          "name": "rootCertificates",
          "type": "string[]",
          "meta": {
            "added": [
              "v12.3.0"
            ],
            "changes": []
          },
          "desc": "<p>An immutable array of strings representing the root certificates (in PEM format)\nfrom the bundled Mozilla CA store as supplied by the current Node.js version.</p>\n<p>The bundled CA store, as supplied by Node.js, is a snapshot of Mozilla CA store\nthat is fixed at release time. It is identical on all supported platforms.</p>\n<p>To get the actual CA certificates used by the current Node.js instance, which\nmay include certificates loaded from the system store (if <code>--use-system-ca</code> is used)\nor loaded from a file indicated by <code>NODE_EXTRA_CA_CERTS</code>, use\n<a href=\"#tlsgetcacertificatestype\"><code>tls.getCACertificates()</code></a>.</p>"
        },
        {
          "textRaw": "`tls.DEFAULT_ECDH_CURVE`",
          "name": "DEFAULT_ECDH_CURVE",
          "type": "property",
          "meta": {
            "added": [
              "v0.11.13"
            ],
            "changes": [
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/16853",
                "description": "Default value changed to `'auto'`."
              }
            ]
          },
          "desc": "<p>The default curve name to use for ECDH key agreement in a tls server. The\ndefault value is <code>'auto'</code>. See <a href=\"#tlscreatesecurecontextoptions\"><code>tls.createSecureContext()</code></a> for further\ninformation.</p>"
        },
        {
          "textRaw": "Type: {string} The default value of the `maxVersion` option of `tls.createSecureContext()`. It can be assigned any of the supported TLS protocol versions, `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. **Default:** `'TLSv1.3'`, unless changed using CLI options. Using `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.",
          "name": "DEFAULT_MAX_VERSION",
          "type": "string",
          "meta": {
            "added": [
              "v11.4.0"
            ],
            "changes": []
          },
          "default": "`'TLSv1.3'`, unless changed using CLI options. Using `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used",
          "desc": "The default value of the `maxVersion` option of `tls.createSecureContext()`. It can be assigned any of the supported TLS protocol versions, `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`."
        },
        {
          "textRaw": "Type: {string} The default value of the `minVersion` option of `tls.createSecureContext()`. It can be assigned any of the supported TLS protocol versions, `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Versions before TLSv1.2 may require downgrading the OpenSSL Security Level. **Default:** `'TLSv1.2'`, unless changed using CLI options. Using `--tls-min-v1.0` sets the default to `'TLSv1'`. Using `--tls-min-v1.1` sets the default to `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options are provided, the lowest minimum is used.",
          "name": "DEFAULT_MIN_VERSION",
          "type": "string",
          "meta": {
            "added": [
              "v11.4.0"
            ],
            "changes": []
          },
          "default": "`'TLSv1.2'`, unless changed using CLI options. Using `--tls-min-v1.0` sets the default to `'TLSv1'`. Using `--tls-min-v1.1` sets the default to `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to `'TLSv1.3'`. If multiple of the options are provided, the lowest minimum is used",
          "desc": "The default value of the `minVersion` option of `tls.createSecureContext()`. It can be assigned any of the supported TLS protocol versions, `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Versions before TLSv1.2 may require downgrading the OpenSSL Security Level."
        },
        {
          "textRaw": "Type: {string} The default value of the `ciphers` option of `tls.createSecureContext()`. It can be assigned any of the supported OpenSSL ciphers. Defaults to the content of `crypto.constants.defaultCoreCipherList`, unless changed using CLI options using `--tls-default-ciphers`.",
          "name": "DEFAULT_CIPHERS",
          "type": "string",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "desc": "The default value of the `ciphers` option of `tls.createSecureContext()`. It can be assigned any of the supported OpenSSL ciphers. Defaults to the content of `crypto.constants.defaultCoreCipherList`, unless changed using CLI options using `--tls-default-ciphers`."
        }
      ],
      "displayName": "TLS (SSL)",
      "source": "doc/api/tls.md"
    },
    {
      "textRaw": "Trace events",
      "name": "trace_events",
      "introduced_in": "v7.7.0",
      "type": "module",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The <code>node:trace_events</code> module provides a mechanism to centralize tracing\ninformation generated by V8, Node.js core, and userspace code.</p>\n<p>Tracing can be enabled with the <code>--trace-event-categories</code> command-line flag\nor by using the <code>node:trace_events</code> module. The <code>--trace-event-categories</code> flag\naccepts a list of comma-separated category names.</p>\n<p>The available categories are:</p>\n<ul>\n<li><code>node</code>: An empty placeholder.</li>\n<li><code>node.async_hooks</code>: Enables capture of detailed <a href=\"async_hooks.html\"><code>async_hooks</code></a> trace data.\nThe <a href=\"async_hooks.html\"><code>async_hooks</code></a> events have a unique <code>asyncId</code> and a special <code>triggerId</code>\n<code>triggerAsyncId</code> property.</li>\n<li><code>node.bootstrap</code>: Enables capture of Node.js bootstrap milestones.</li>\n<li><code>node.console</code>: Enables capture of <code>console.time()</code> and <code>console.count()</code>\noutput.</li>\n<li><code>node.threadpoolwork.sync</code>: Enables capture of trace data for threadpool\nsynchronous operations, such as <code>blob</code>, <code>zlib</code>, <code>crypto</code> and <code>node_api</code>.</li>\n<li><code>node.threadpoolwork.async</code>: Enables capture of trace data for threadpool\nasynchronous operations, such as <code>blob</code>, <code>zlib</code>, <code>crypto</code> and <code>node_api</code>.</li>\n<li><code>node.dns.native</code>: Enables capture of trace data for DNS queries.</li>\n<li><code>node.net.native</code>: Enables capture of trace data for network.</li>\n<li><code>node.environment</code>: Enables capture of Node.js Environment milestones.</li>\n<li><code>node.fs.sync</code>: Enables capture of trace data for file system sync methods.</li>\n<li><code>node.fs_dir.sync</code>: Enables capture of trace data for file system sync\ndirectory methods.</li>\n<li><code>node.fs.async</code>: Enables capture of trace data for file system async methods.</li>\n<li><code>node.fs_dir.async</code>: Enables capture of trace data for file system async\ndirectory methods.</li>\n<li><code>node.perf</code>: Enables capture of <a href=\"perf_hooks.html\">Performance API</a> measurements.\n<ul>\n<li><code>node.perf.usertiming</code>: Enables capture of only Performance API User Timing\nmeasures and marks.</li>\n<li><code>node.perf.timerify</code>: Enables capture of only Performance API timerify\nmeasurements.</li>\n</ul>\n</li>\n<li><code>node.promises.rejections</code>: Enables capture of trace data tracking the number\nof unhandled Promise rejections and handled-after-rejections.</li>\n<li><code>node.vm.script</code>: Enables capture of trace data for the <code>node:vm</code> module's\n<code>runInNewContext()</code>, <code>runInContext()</code>, and <code>runInThisContext()</code> methods.</li>\n<li><code>v8</code>: The <a href=\"v8.html\">V8</a> events are GC, compiling, and execution related.</li>\n<li><code>node.http</code>: Enables capture of trace data for http request / response.</li>\n<li><code>node.module_timer</code>: Enables capture of trace data for CJS Module loading.</li>\n</ul>\n<p>By default the <code>node</code>, <code>node.async_hooks</code>, and <code>v8</code> categories are enabled.</p>\n<pre><code class=\"language-bash\">node --trace-event-categories v8,node,node.async_hooks server.js\n</code></pre>\n<p>Prior versions of Node.js required the use of the <code>--trace-events-enabled</code>\nflag to enable trace events. This requirement has been removed. However, the\n<code>--trace-events-enabled</code> flag <em>may</em> still be used and will enable the\n<code>node</code>, <code>node.async_hooks</code>, and <code>v8</code> trace event categories by default.</p>\n<pre><code class=\"language-bash\">node --trace-events-enabled\n\n# is equivalent to\n\nnode --trace-event-categories v8,node,node.async_hooks\n</code></pre>\n<p>Alternatively, trace events may be enabled using the <code>node:trace_events</code> module:</p>\n<pre><code class=\"language-mjs\">import { createTracing } from 'node:trace_events';\nconst tracing = createTracing({ categories: ['node.perf'] });\ntracing.enable();  // Enable trace event capture for the 'node.perf' category\n\n// do work\n\ntracing.disable();  // Disable trace event capture for the 'node.perf' category\n</code></pre>\n<pre><code class=\"language-cjs\">const { createTracing } = require('node:trace_events');\nconst tracing = createTracing({ categories: ['node.perf'] });\ntracing.enable();  // Enable trace event capture for the 'node.perf' category\n\n// do work\n\ntracing.disable();  // Disable trace event capture for the 'node.perf' category\n</code></pre>\n<p>Running Node.js with tracing enabled will produce log files that can be opened\nin the <a href=\"https://www.chromium.org/developers/how-tos/trace-event-profiling-tool\"><code>chrome://tracing</code></a>\ntab of Chrome.</p>\n<p>The logging file is by default called <code>node_trace.${rotation}.log</code>, where\n<code>${rotation}</code> is an incrementing log-rotation id. The filepath pattern can\nbe specified with <code>--trace-event-file-pattern</code> that accepts a template\nstring that supports <code>${rotation}</code> and <code>${pid}</code>:</p>\n<pre><code class=\"language-bash\">node --trace-event-categories v8 --trace-event-file-pattern '${pid}-${rotation}.log' server.js\n</code></pre>\n<p>To guarantee that the log file is properly generated after signal events like\n<code>SIGINT</code>, <code>SIGTERM</code>, or <code>SIGBREAK</code>, make sure to have the appropriate handlers\nin your code, such as:</p>\n<pre><code class=\"language-js\">process.on('SIGINT', function onSigint() {\n  console.info('Received SIGINT.');\n  process.exit(130);  // Or applicable exit code depending on OS and signal\n});\n</code></pre>\n<p>The tracing system uses the same time source\nas the one used by <code>process.hrtime()</code>.\nHowever the trace-event timestamps are expressed in microseconds,\nunlike <code>process.hrtime()</code> which returns nanoseconds.</p>\n<p>The features from this module are not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>",
      "modules": [
        {
          "textRaw": "The `node:trace_events` module",
          "name": "the_`node:trace_events`_module",
          "type": "module",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "modules": [
            {
              "textRaw": "`Tracing` object",
              "name": "`tracing`_object",
              "type": "module",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>Tracing</code> object is used to enable or disable tracing for sets of\ncategories. Instances are created using the <code>trace_events.createTracing()</code>\nmethod.</p>\n<p>When created, the <code>Tracing</code> object is disabled. Calling the\n<code>tracing.enable()</code> method adds the categories to the set of enabled trace event\ncategories. Calling <code>tracing.disable()</code> will remove the categories from the\nset of enabled trace event categories.</p>",
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "categories",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>A comma-separated list of the trace event categories covered by this\n<code>Tracing</code> object.</p>"
                },
                {
                  "textRaw": "Type: {boolean} `true` only if the `Tracing` object has been enabled.",
                  "name": "enabled",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "`true` only if the `Tracing` object has been enabled."
                }
              ],
              "methods": [
                {
                  "textRaw": "`tracing.disable()`",
                  "name": "disable",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Disables this <code>Tracing</code> object.</p>\n<p>Only trace event categories <em>not</em> covered by other enabled <code>Tracing</code> objects\nand <em>not</em> specified by the <code>--trace-event-categories</code> flag will be disabled.</p>\n<pre><code class=\"language-mjs\">import { createTracing, getEnabledCategories } from 'node:trace_events';\nconst t1 = createTracing({ categories: ['node', 'v8'] });\nconst t2 = createTracing({ categories: ['node.perf', 'node'] });\nt1.enable();\nt2.enable();\n\n// Prints 'node,node.perf,v8'\nconsole.log(getEnabledCategories());\n\nt2.disable(); // Will only disable emission of the 'node.perf' category\n\n// Prints 'node,v8'\nconsole.log(getEnabledCategories());\n</code></pre>\n<pre><code class=\"language-cjs\">const { createTracing, getEnabledCategories } = require('node:trace_events');\nconst t1 = createTracing({ categories: ['node', 'v8'] });\nconst t2 = createTracing({ categories: ['node.perf', 'node'] });\nt1.enable();\nt2.enable();\n\n// Prints 'node,node.perf,v8'\nconsole.log(getEnabledCategories());\n\nt2.disable(); // Will only disable emission of the 'node.perf' category\n\n// Prints 'node,v8'\nconsole.log(getEnabledCategories());\n</code></pre>"
                },
                {
                  "textRaw": "`tracing.enable()`",
                  "name": "enable",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v10.0.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Enables this <code>Tracing</code> object for the set of categories covered by the\n<code>Tracing</code> object.</p>"
                }
              ],
              "displayName": "`Tracing` object"
            }
          ],
          "methods": [
            {
              "textRaw": "`trace_events.createTracing(options)`",
              "name": "createTracing",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`categories` {string[]} An array of trace category names. Values included in the array are coerced to a string when possible. An error will be thrown if the value cannot be coerced.",
                          "name": "categories",
                          "type": "string[]",
                          "desc": "An array of trace category names. Values included in the array are coerced to a string when possible. An error will be thrown if the value cannot be coerced."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Tracing}.",
                    "name": "return",
                    "type": "Tracing",
                    "desc": "."
                  }
                }
              ],
              "desc": "<p>Creates and returns a <code>Tracing</code> object for the given set of <code>categories</code>.</p>\n<pre><code class=\"language-mjs\">import { createTracing } from 'node:trace_events';\nconst categories = ['node.perf', 'node.async_hooks'];\nconst tracing = createTracing({ categories });\ntracing.enable();\n// do stuff\ntracing.disable();\n</code></pre>\n<pre><code class=\"language-cjs\">const { createTracing } = require('node:trace_events');\nconst categories = ['node.perf', 'node.async_hooks'];\nconst tracing = createTracing({ categories });\ntracing.enable();\n// do stuff\ntracing.disable();\n</code></pre>"
            },
            {
              "textRaw": "`trace_events.getEnabledCategories()`",
              "name": "getEnabledCategories",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Returns a comma-separated list of all currently-enabled trace event\ncategories. The current set of enabled trace event categories is determined\nby the <em>union</em> of all currently-enabled <code>Tracing</code> objects and any categories\nenabled using the <code>--trace-event-categories</code> flag.</p>\n<p>Given the file <code>test.js</code> below, the command\n<code>node --trace-event-categories node.perf test.js</code> will print\n<code>'node.async_hooks,node.perf'</code> to the console.</p>\n<pre><code class=\"language-mjs\">import { createTracing, getEnabledCategories } from 'node:trace_events';\nconst t1 = createTracing({ categories: ['node.async_hooks'] });\nconst t2 = createTracing({ categories: ['node.perf'] });\nconst t3 = createTracing({ categories: ['v8'] });\n\nt1.enable();\nt2.enable();\n\nconsole.log(getEnabledCategories());\n</code></pre>\n<pre><code class=\"language-cjs\">const { createTracing, getEnabledCategories } = require('node:trace_events');\nconst t1 = createTracing({ categories: ['node.async_hooks'] });\nconst t2 = createTracing({ categories: ['node.perf'] });\nconst t3 = createTracing({ categories: ['v8'] });\n\nt1.enable();\nt2.enable();\n\nconsole.log(getEnabledCategories());\n</code></pre>"
            }
          ],
          "displayName": "The `node:trace_events` module"
        },
        {
          "textRaw": "Examples",
          "name": "examples",
          "type": "module",
          "modules": [
            {
              "textRaw": "Collect trace events data by inspector",
              "name": "collect_trace_events_data_by_inspector",
              "type": "module",
              "desc": "<pre><code class=\"language-mjs\">import { Session } from 'node:inspector';\nconst session = new Session();\nsession.connect();\n\nfunction post(message, data) {\n  return new Promise((resolve, reject) => {\n    session.post(message, data, (err, result) => {\n      if (err)\n        reject(new Error(JSON.stringify(err)));\n      else\n        resolve(result);\n    });\n  });\n}\n\nasync function collect() {\n  const data = [];\n  session.on('NodeTracing.dataCollected', (chunk) => data.push(chunk));\n  session.on('NodeTracing.tracingComplete', () => {\n    // done\n  });\n  const traceConfig = { includedCategories: ['v8'] };\n  await post('NodeTracing.start', { traceConfig });\n  // do something\n  setTimeout(() => {\n    post('NodeTracing.stop').then(() => {\n      session.disconnect();\n      console.log(data);\n    });\n  }, 1000);\n}\n\ncollect();\n</code></pre>\n<pre><code class=\"language-cjs\">const { Session } = require('node:inspector');\nconst session = new Session();\nsession.connect();\n\nfunction post(message, data) {\n  return new Promise((resolve, reject) => {\n    session.post(message, data, (err, result) => {\n      if (err)\n        reject(new Error(JSON.stringify(err)));\n      else\n        resolve(result);\n    });\n  });\n}\n\nasync function collect() {\n  const data = [];\n  session.on('NodeTracing.dataCollected', (chunk) => data.push(chunk));\n  session.on('NodeTracing.tracingComplete', () => {\n    // done\n  });\n  const traceConfig = { includedCategories: ['v8'] };\n  await post('NodeTracing.start', { traceConfig });\n  // do something\n  setTimeout(() => {\n    post('NodeTracing.stop').then(() => {\n      session.disconnect();\n      console.log(data);\n    });\n  }, 1000);\n}\n\ncollect();\n</code></pre>",
              "displayName": "Collect trace events data by inspector"
            }
          ],
          "displayName": "Examples"
        }
      ],
      "displayName": "Trace events",
      "source": "doc/api/tracing.md"
    },
    {
      "textRaw": "TTY",
      "name": "tty",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:tty</code> module provides the <code>tty.ReadStream</code> and <code>tty.WriteStream</code>\nclasses. In most cases, it will not be necessary or possible to use this module\ndirectly. However, it can be accessed using:</p>\n<pre><code class=\"language-js\">const tty = require('node:tty');\n</code></pre>\n<p>When Node.js detects that it is being run with a text terminal (\"TTY\")\nattached, <a href=\"process.html#processstdin\"><code>process.stdin</code></a> will, by default, be initialized as an instance of\n<code>tty.ReadStream</code> and both <a href=\"process.html#processstdout\"><code>process.stdout</code></a> and <a href=\"process.html#processstderr\"><code>process.stderr</code></a> will, by\ndefault, be instances of <code>tty.WriteStream</code>. The preferred method of determining\nwhether Node.js is being run within a TTY context is to check that the value of\nthe <code>process.stdout.isTTY</code> property is <code>true</code>:</p>\n<pre><code class=\"language-console\">$ node -p -e \"Boolean(process.stdout.isTTY)\"\ntrue\n$ node -p -e \"Boolean(process.stdout.isTTY)\" | cat\nfalse\n</code></pre>\n<p>In most cases, there should be little to no reason for an application to\nmanually create instances of the <code>tty.ReadStream</code> and <code>tty.WriteStream</code>\nclasses.</p>",
      "classes": [
        {
          "textRaw": "Class: `tty.ReadStream`",
          "name": "tty.ReadStream",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a></li>\n</ul>\n<p>Represents the readable side of a TTY. In normal circumstances\n<a href=\"process.html#processstdin\"><code>process.stdin</code></a> will be the only <code>tty.ReadStream</code> instance in a Node.js\nprocess and there should be no reason to create additional instances.</p>",
          "properties": [
            {
              "textRaw": "`readStream.isRaw`",
              "name": "isRaw",
              "type": "property",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "desc": "<p>A <code>boolean</code> that is <code>true</code> if the TTY is currently configured to operate as a\nraw device.</p>\n<p>This flag is always <code>false</code> when a process starts, even if the terminal is\noperating in raw mode. Its value will change with subsequent calls to\n<code>setRawMode</code>.</p>"
            },
            {
              "textRaw": "`readStream.isTTY`",
              "name": "isTTY",
              "type": "property",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "desc": "<p>A <code>boolean</code> that is always <code>true</code> for <code>tty.ReadStream</code> instances.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`readStream.setRawMode(mode)`",
              "name": "setRawMode",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`mode` {boolean} If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` property will be set to the resulting mode.",
                      "name": "mode",
                      "type": "boolean",
                      "desc": "If `true`, configures the `tty.ReadStream` to operate as a raw device. If `false`, configures the `tty.ReadStream` to operate in its default mode. The `readStream.isRaw` property will be set to the resulting mode."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {this} The read stream instance.",
                    "name": "return",
                    "type": "this",
                    "desc": "The read stream instance."
                  }
                }
              ],
              "desc": "<p>Allows configuration of <code>tty.ReadStream</code> so that it operates as a raw device.</p>\n<p>When in raw mode, input is always available character-by-character, not\nincluding modifiers. Additionally, all special processing of characters by the\nterminal is disabled, including echoing input\ncharacters. <kbd>Ctrl</kbd>+<kbd>C</kbd> will no longer cause a <code>SIGINT</code> when\nin this mode.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `tty.WriteStream`",
          "name": "tty.WriteStream",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"net.html#class-netsocket\"><code>&#x3C;net.Socket></code></a></li>\n</ul>\n<p>Represents the writable side of a TTY. In normal circumstances,\n<a href=\"process.html#processstdout\"><code>process.stdout</code></a> and <a href=\"process.html#processstderr\"><code>process.stderr</code></a> will be the only\n<code>tty.WriteStream</code> instances created for a Node.js process and there\nshould be no reason to create additional instances.</p>",
          "signatures": [
            {
              "textRaw": "`new tty.ReadStream(fd[, options])`",
              "name": "tty.ReadStream",
              "type": "ctor",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": [
                  {
                    "version": "v0.9.4",
                    "description": "The `options` argument is supported."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`fd` {number} A file descriptor associated with a TTY.",
                  "name": "fd",
                  "type": "number",
                  "desc": "A file descriptor associated with a TTY."
                },
                {
                  "textRaw": "`options` {Object} Options passed to parent `net.Socket`, see `options` of `net.Socket` constructor.",
                  "name": "options",
                  "type": "Object",
                  "desc": "Options passed to parent `net.Socket`, see `options` of `net.Socket` constructor.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {tty.ReadStream}",
                "name": "return",
                "type": "tty.ReadStream"
              },
              "desc": "<p>Creates a <code>ReadStream</code> for <code>fd</code> associated with a TTY.</p>"
            },
            {
              "textRaw": "`new tty.WriteStream(fd)`",
              "name": "tty.WriteStream",
              "type": "ctor",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`fd` {number} A file descriptor associated with a TTY.",
                  "name": "fd",
                  "type": "number",
                  "desc": "A file descriptor associated with a TTY."
                }
              ],
              "return": {
                "textRaw": "Returns: {tty.WriteStream}",
                "name": "return",
                "type": "tty.WriteStream"
              },
              "desc": "<p>Creates a <code>WriteStream</code> for <code>fd</code> associated with a TTY.</p>"
            }
          ],
          "events": [
            {
              "textRaw": "Event: `'resize'`",
              "name": "resize",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'resize'</code> event is emitted whenever either of the <code>writeStream.columns</code>\nor <code>writeStream.rows</code> properties have changed. No arguments are passed to the\nlistener callback when called.</p>\n<pre><code class=\"language-js\">process.stdout.on('resize', () => {\n  console.log('screen size has changed!');\n  console.log(`${process.stdout.columns}x${process.stdout.rows}`);\n});\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`writeStream.clearLine(dir[, callback])`",
              "name": "clearLine",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v12.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28721",
                    "description": "The stream's write() callback and return value are exposed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`dir` {number}",
                      "name": "dir",
                      "type": "number",
                      "options": [
                        {
                          "textRaw": "`-1`: to the left from cursor",
                          "name": "-1",
                          "desc": "to the left from cursor"
                        },
                        {
                          "textRaw": "`1`: to the right from cursor",
                          "name": "1",
                          "desc": "to the right from cursor"
                        },
                        {
                          "textRaw": "`0`: the entire line",
                          "name": "0",
                          "desc": "the entire line"
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                  }
                }
              ],
              "desc": "<p><code>writeStream.clearLine()</code> clears the current line of this <code>WriteStream</code> in a\ndirection identified by <code>dir</code>.</p>"
            },
            {
              "textRaw": "`writeStream.clearScreenDown([callback])`",
              "name": "clearScreenDown",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v12.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28721",
                    "description": "The stream's write() callback and return value are exposed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                  }
                }
              ],
              "desc": "<p><code>writeStream.clearScreenDown()</code> clears this <code>WriteStream</code> from the current\ncursor down.</p>"
            },
            {
              "textRaw": "`writeStream.cursorTo(x[, y][, callback])`",
              "name": "cursorTo",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v12.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28721",
                    "description": "The stream's write() callback and return value are exposed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`x` {number}",
                      "name": "x",
                      "type": "number"
                    },
                    {
                      "textRaw": "`y` {number}",
                      "name": "y",
                      "type": "number",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                  }
                }
              ],
              "desc": "<p><code>writeStream.cursorTo()</code> moves this <code>WriteStream</code>'s cursor to the specified\nposition.</p>"
            },
            {
              "textRaw": "`writeStream.getColorDepth([env])`",
              "name": "getColorDepth",
              "type": "method",
              "meta": {
                "added": [
                  "v9.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`env` {Object} An object containing the environment variables to check. This enables simulating the usage of a specific terminal. **Default:** `process.env`.",
                      "name": "env",
                      "type": "Object",
                      "default": "`process.env`",
                      "desc": "An object containing the environment variables to check. This enables simulating the usage of a specific terminal.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number}",
                    "name": "return",
                    "type": "number"
                  }
                }
              ],
              "desc": "<p>Returns:</p>\n<ul>\n<li><code>1</code> for 2,</li>\n<li><code>4</code> for 16,</li>\n<li><code>8</code> for 256,</li>\n<li><code>24</code> for 16,777,216 colors supported.</li>\n</ul>\n<p>Use this to determine what colors the terminal supports. Due to the nature of\ncolors in terminals it is possible to either have false positives or false\nnegatives. It depends on process information and the environment variables that\nmay lie about what terminal is used.\nIt is possible to pass in an <code>env</code> object to simulate the usage of a specific\nterminal. This can be useful to check how specific environment settings behave.</p>\n<p>To enforce a specific color support, use one of the below environment settings.</p>\n<ul>\n<li>2 colors: <code>FORCE_COLOR = 0</code> (Disables colors)</li>\n<li>16 colors: <code>FORCE_COLOR = 1</code></li>\n<li>256 colors: <code>FORCE_COLOR = 2</code></li>\n<li>16,777,216 colors: <code>FORCE_COLOR = 3</code></li>\n</ul>\n<p>Disabling color support is also possible by using the <code>NO_COLOR</code> and\n<code>NODE_DISABLE_COLORS</code> environment variables.</p>"
            },
            {
              "textRaw": "`writeStream.getWindowSize()`",
              "name": "getWindowSize",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number[]}",
                    "name": "return",
                    "type": "number[]"
                  }
                }
              ],
              "desc": "<p><code>writeStream.getWindowSize()</code> returns the size of the TTY\ncorresponding to this <code>WriteStream</code>. The array is of the type\n<code>[numColumns, numRows]</code> where <code>numColumns</code> and <code>numRows</code> represent the number\nof columns and rows in the corresponding TTY.</p>"
            },
            {
              "textRaw": "`writeStream.hasColors([count][, env])`",
              "name": "hasColors",
              "type": "method",
              "meta": {
                "added": [
                  "v11.13.0",
                  "v10.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`count` {integer} The number of colors that are requested (minimum 2). **Default:** 16.",
                      "name": "count",
                      "type": "integer",
                      "default": "16",
                      "desc": "The number of colors that are requested (minimum 2).",
                      "optional": true
                    },
                    {
                      "textRaw": "`env` {Object} An object containing the environment variables to check. This enables simulating the usage of a specific terminal. **Default:** `process.env`.",
                      "name": "env",
                      "type": "Object",
                      "default": "`process.env`",
                      "desc": "An object containing the environment variables to check. This enables simulating the usage of a specific terminal.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the <code>writeStream</code> supports at least as many colors as provided\nin <code>count</code>. Minimum support is 2 (black and white).</p>\n<p>This has the same false positives and negatives as described in\n<a href=\"#writestreamgetcolordepthenv\"><code>writeStream.getColorDepth()</code></a>.</p>\n<pre><code class=\"language-js\">process.stdout.hasColors();\n// Returns true or false depending on if `stdout` supports at least 16 colors.\nprocess.stdout.hasColors(256);\n// Returns true or false depending on if `stdout` supports at least 256 colors.\nprocess.stdout.hasColors({ TMUX: '1' });\n// Returns true.\nprocess.stdout.hasColors(2 ** 24, { TMUX: '1' });\n// Returns false (the environment setting pretends to support 2 ** 8 colors).\n</code></pre>"
            },
            {
              "textRaw": "`writeStream.moveCursor(dx, dy[, callback])`",
              "name": "moveCursor",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": [
                  {
                    "version": "v12.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28721",
                    "description": "The stream's write() callback and return value are exposed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`dx` {number}",
                      "name": "dx",
                      "type": "number"
                    },
                    {
                      "textRaw": "`dy` {number}",
                      "name": "dy",
                      "type": "number"
                    },
                    {
                      "textRaw": "`callback` {Function} Invoked once the operation completes.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Invoked once the operation completes.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.",
                    "name": "return",
                    "type": "boolean",
                    "desc": "`false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`."
                  }
                }
              ],
              "desc": "<p><code>writeStream.moveCursor()</code> moves this <code>WriteStream</code>'s cursor <em>relative</em> to its\ncurrent position.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "`writeStream.columns`",
              "name": "columns",
              "type": "property",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "desc": "<p>A <code>number</code> specifying the number of columns the TTY currently has. This property\nis updated whenever the <code>'resize'</code> event is emitted.</p>"
            },
            {
              "textRaw": "`writeStream.isTTY`",
              "name": "isTTY",
              "type": "property",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "desc": "<p>A <code>boolean</code> that is always <code>true</code>.</p>"
            },
            {
              "textRaw": "`writeStream.rows`",
              "name": "rows",
              "type": "property",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "desc": "<p>A <code>number</code> specifying the number of rows the TTY currently has. This property\nis updated whenever the <code>'resize'</code> event is emitted.</p>"
            }
          ]
        }
      ],
      "methods": [
        {
          "textRaw": "`tty.isatty(fd)`",
          "name": "isatty",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fd` {number} A numeric file descriptor",
                  "name": "fd",
                  "type": "number",
                  "desc": "A numeric file descriptor"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>The <code>tty.isatty()</code> method returns <code>true</code> if the given <code>fd</code> is associated with\na TTY and <code>false</code> if it is not, including whenever <code>fd</code> is not a non-negative\ninteger.</p>"
        }
      ],
      "displayName": "TTY",
      "source": "doc/api/tty.md"
    },
    {
      "textRaw": "UDP/datagram sockets",
      "name": "udp/datagram_sockets",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:dgram</code> module provides an implementation of UDP datagram sockets.</p>\n<pre><code class=\"language-mjs\">import dgram from 'node:dgram';\n\nconst server = dgram.createSocket('udp4');\n\nserver.on('error', (err) => {\n  console.error(`server error:\\n${err.stack}`);\n  server.close();\n});\n\nserver.on('message', (msg, rinfo) => {\n  console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);\n});\n\nserver.on('listening', () => {\n  const address = server.address();\n  console.log(`server listening ${address.address}:${address.port}`);\n});\n\nserver.bind(41234);\n// Prints: server listening 0.0.0.0:41234\n</code></pre>\n<pre><code class=\"language-cjs\">const dgram = require('node:dgram');\nconst server = dgram.createSocket('udp4');\n\nserver.on('error', (err) => {\n  console.error(`server error:\\n${err.stack}`);\n  server.close();\n});\n\nserver.on('message', (msg, rinfo) => {\n  console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);\n});\n\nserver.on('listening', () => {\n  const address = server.address();\n  console.log(`server listening ${address.address}:${address.port}`);\n});\n\nserver.bind(41234);\n// Prints: server listening 0.0.0.0:41234\n</code></pre>",
      "classes": [
        {
          "textRaw": "Class: `dgram.Socket`",
          "name": "dgram.Socket",
          "type": "class",
          "meta": {
            "added": [
              "v0.1.99"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>Encapsulates the datagram functionality.</p>\n<p>New instances of <code>dgram.Socket</code> are created using <a href=\"#dgramcreatesocketoptions-callback\"><code>dgram.createSocket()</code></a>.\nThe <code>new</code> keyword is not to be used to create <code>dgram.Socket</code> instances.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'close'</code> event is emitted after a socket is closed with <a href=\"#socketclosecallback\"><code>close()</code></a>.\nOnce triggered, no new <code>'message'</code> events will be emitted on this socket.</p>"
            },
            {
              "textRaw": "Event: `'connect'`",
              "name": "connect",
              "type": "event",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'connect'</code> event is emitted after a socket is associated to a remote\naddress as a result of a successful <a href=\"#socketconnectport-address-callback\"><code>connect()</code></a> call.</p>"
            },
            {
              "textRaw": "Event: `'error'`",
              "name": "error",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`exception` {Error}",
                  "name": "exception",
                  "type": "Error"
                }
              ],
              "desc": "<p>The <code>'error'</code> event is emitted whenever any error occurs. The event handler\nfunction is passed a single <code>Error</code> object.</p>"
            },
            {
              "textRaw": "Event: `'listening'`",
              "name": "listening",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'listening'</code> event is emitted once the <code>dgram.Socket</code> is addressable and\ncan receive data. This happens either explicitly with <code>socket.bind()</code> or\nimplicitly the first time data is sent using <code>socket.send()</code>.\nUntil the <code>dgram.Socket</code> is listening, the underlying system resources do not\nexist and calls such as <code>socket.address()</code> and <code>socket.setTTL()</code> will fail.</p>"
            },
            {
              "textRaw": "Event: `'message'`",
              "name": "message",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": [
                  {
                    "version": "v18.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/43054",
                    "description": "The `family` property now returns a string instead of a number."
                  },
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/41431",
                    "description": "The `family` property now returns a number instead of a string."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`msg` {Buffer} The message.",
                  "name": "msg",
                  "type": "Buffer",
                  "desc": "The message."
                },
                {
                  "textRaw": "`rinfo` {Object} Remote address information.",
                  "name": "rinfo",
                  "type": "Object",
                  "desc": "Remote address information.",
                  "options": [
                    {
                      "textRaw": "`address` {string} The sender address.",
                      "name": "address",
                      "type": "string",
                      "desc": "The sender address."
                    },
                    {
                      "textRaw": "`family` {string} The address family (`'IPv4'` or `'IPv6'`).",
                      "name": "family",
                      "type": "string",
                      "desc": "The address family (`'IPv4'` or `'IPv6'`)."
                    },
                    {
                      "textRaw": "`port` {number} The sender port.",
                      "name": "port",
                      "type": "number",
                      "desc": "The sender port."
                    },
                    {
                      "textRaw": "`size` {number} The message size.",
                      "name": "size",
                      "type": "number",
                      "desc": "The message size."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>'message'</code> event is emitted when a new datagram is available on a socket.\nThe event handler function is passed two arguments: <code>msg</code> and <code>rinfo</code>.</p>\n<p>If the source address of the incoming packet is an IPv6 link-local\naddress, the interface name is added to the <code>address</code>. For\nexample, a packet received on the <code>en0</code> interface might have the\naddress field set to <code>'fe80::2618:1234:ab11:3b9c%en0'</code>, where <code>'%en0'</code>\nis the interface name as a zone ID suffix.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`socket.addMembership(multicastAddress[, multicastInterface])`",
              "name": "addMembership",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`multicastAddress` {string}",
                      "name": "multicastAddress",
                      "type": "string"
                    },
                    {
                      "textRaw": "`multicastInterface` {string}",
                      "name": "multicastInterface",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Tells the kernel to join a multicast group at the given <code>multicastAddress</code> and\n<code>multicastInterface</code> using the <code>IP_ADD_MEMBERSHIP</code> socket option. If the\n<code>multicastInterface</code> argument is not specified, the operating system will choose\none interface and will add membership to it. To add membership to every\navailable interface, call <code>addMembership</code> multiple times, once per interface.</p>\n<p>When called on an unbound socket, this method will implicitly bind to a random\nport, listening on all interfaces.</p>\n<p>When sharing a UDP socket across multiple <code>cluster</code> workers, the\n<code>socket.addMembership()</code> function must be called only once or an\n<code>EADDRINUSE</code> error will occur:</p>\n<pre><code class=\"language-mjs\">import cluster from 'node:cluster';\nimport dgram from 'node:dgram';\n\nif (cluster.isPrimary) {\n  cluster.fork(); // Works ok.\n  cluster.fork(); // Fails with EADDRINUSE.\n} else {\n  const s = dgram.createSocket('udp4');\n  s.bind(1234, () => {\n    s.addMembership('224.0.0.114');\n  });\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const cluster = require('node:cluster');\nconst dgram = require('node:dgram');\n\nif (cluster.isPrimary) {\n  cluster.fork(); // Works ok.\n  cluster.fork(); // Fails with EADDRINUSE.\n} else {\n  const s = dgram.createSocket('udp4');\n  s.bind(1234, () => {\n    s.addMembership('224.0.0.114');\n  });\n}\n</code></pre>"
            },
            {
              "textRaw": "`socket.addSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])`",
              "name": "addSourceSpecificMembership",
              "type": "method",
              "meta": {
                "added": [
                  "v13.1.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`sourceAddress` {string}",
                      "name": "sourceAddress",
                      "type": "string"
                    },
                    {
                      "textRaw": "`groupAddress` {string}",
                      "name": "groupAddress",
                      "type": "string"
                    },
                    {
                      "textRaw": "`multicastInterface` {string}",
                      "name": "multicastInterface",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Tells the kernel to join a source-specific multicast channel at the given\n<code>sourceAddress</code> and <code>groupAddress</code>, using the <code>multicastInterface</code> with the\n<code>IP_ADD_SOURCE_MEMBERSHIP</code> socket option. If the <code>multicastInterface</code> argument\nis not specified, the operating system will choose one interface and will add\nmembership to it. To add membership to every available interface, call\n<code>socket.addSourceSpecificMembership()</code> multiple times, once per interface.</p>\n<p>When called on an unbound socket, this method will implicitly bind to a random\nport, listening on all interfaces.</p>"
            },
            {
              "textRaw": "`socket.address()`",
              "name": "address",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns an object containing the address information for a socket.\nFor UDP sockets, this object will contain <code>address</code>, <code>family</code>, and <code>port</code>\nproperties.</p>\n<p>This method throws <code>EBADF</code> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.bind([port][, address][, callback])`",
              "name": "bind",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": [
                  {
                    "version": "v0.9.1",
                    "commit": "332fea5ac1816e498030109c4211bca24a7fa667",
                    "description": "The method was changed to an asynchronous execution model. Legacy code would need to be changed to pass a callback function to the method call."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`port` {integer}",
                      "name": "port",
                      "type": "integer",
                      "optional": true
                    },
                    {
                      "textRaw": "`address` {string}",
                      "name": "address",
                      "type": "string",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} with no parameters. Called when binding is complete.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "with no parameters. Called when binding is complete.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>For UDP sockets, causes the <code>dgram.Socket</code> to listen for datagram\nmessages on a named <code>port</code> and optional <code>address</code>. If <code>port</code> is not\nspecified or is <code>0</code>, the operating system will attempt to bind to a\nrandom port. If <code>address</code> is not specified, the operating system will\nattempt to listen on all addresses. Once binding is complete, a\n<code>'listening'</code> event is emitted and the optional <code>callback</code> function is\ncalled.</p>\n<p>Specifying both a <code>'listening'</code> event listener and passing a\n<code>callback</code> to the <code>socket.bind()</code> method is not harmful but not very\nuseful.</p>\n<p>A bound datagram socket keeps the Node.js process running to receive\ndatagram messages.</p>\n<p>If binding fails, an <code>'error'</code> event is generated. In rare case (e.g.\nattempting to bind with a closed socket), an <a href=\"errors.html#class-error\"><code>Error</code></a> may be thrown.</p>\n<p>Example of a UDP server listening on port 41234:</p>\n<pre><code class=\"language-mjs\">import dgram from 'node:dgram';\n\nconst server = dgram.createSocket('udp4');\n\nserver.on('error', (err) => {\n  console.error(`server error:\\n${err.stack}`);\n  server.close();\n});\n\nserver.on('message', (msg, rinfo) => {\n  console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);\n});\n\nserver.on('listening', () => {\n  const address = server.address();\n  console.log(`server listening ${address.address}:${address.port}`);\n});\n\nserver.bind(41234);\n// Prints: server listening 0.0.0.0:41234\n</code></pre>\n<pre><code class=\"language-cjs\">const dgram = require('node:dgram');\nconst server = dgram.createSocket('udp4');\n\nserver.on('error', (err) => {\n  console.error(`server error:\\n${err.stack}`);\n  server.close();\n});\n\nserver.on('message', (msg, rinfo) => {\n  console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);\n});\n\nserver.on('listening', () => {\n  const address = server.address();\n  console.log(`server listening ${address.address}:${address.port}`);\n});\n\nserver.bind(41234);\n// Prints: server listening 0.0.0.0:41234\n</code></pre>"
            },
            {
              "textRaw": "`socket.bind(options[, callback])`",
              "name": "bind",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.14"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} Required. Supports the following properties:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Required. Supports the following properties:",
                      "options": [
                        {
                          "textRaw": "`port` {integer}",
                          "name": "port",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`address` {string}",
                          "name": "address",
                          "type": "string"
                        },
                        {
                          "textRaw": "`exclusive` {boolean}",
                          "name": "exclusive",
                          "type": "boolean"
                        },
                        {
                          "textRaw": "`fd` {integer}",
                          "name": "fd",
                          "type": "integer"
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>For UDP sockets, causes the <code>dgram.Socket</code> to listen for datagram\nmessages on a named <code>port</code> and optional <code>address</code> that are passed as\nproperties of an <code>options</code> object passed as the first argument. If\n<code>port</code> is not specified or is <code>0</code>, the operating system will attempt\nto bind to a random port. If <code>address</code> is not specified, the operating\nsystem will attempt to listen on all addresses. Once binding is\ncomplete, a <code>'listening'</code> event is emitted and the optional <code>callback</code>\nfunction is called.</p>\n<p>The <code>options</code> object may contain a <code>fd</code> property. When a <code>fd</code> greater\nthan <code>0</code> is set, it will wrap around an existing socket with the given\nfile descriptor. In this case, the properties of <code>port</code> and <code>address</code>\nwill be ignored.</p>\n<p>Specifying both a <code>'listening'</code> event listener and passing a\n<code>callback</code> to the <code>socket.bind()</code> method is not harmful but not very\nuseful.</p>\n<p>The <code>options</code> object may contain an additional <code>exclusive</code> property that is\nused when using <code>dgram.Socket</code> objects with the <a href=\"cluster.html\"><code>cluster</code></a> module. When\n<code>exclusive</code> is set to <code>false</code> (the default), cluster workers will use the same\nunderlying socket handle allowing connection handling duties to be shared.\nWhen <code>exclusive</code> is <code>true</code>, however, the handle is not shared and attempted\nport sharing results in an error. Creating a <code>dgram.Socket</code> with the <code>reusePort</code>\noption set to <code>true</code> causes <code>exclusive</code> to always be <code>true</code> when <code>socket.bind()</code>\nis called.</p>\n<p>A bound datagram socket keeps the Node.js process running to receive\ndatagram messages.</p>\n<p>If binding fails, an <code>'error'</code> event is generated. In rare case (e.g.\nattempting to bind with a closed socket), an <a href=\"errors.html#class-error\"><code>Error</code></a> may be thrown.</p>\n<p>An example socket listening on an exclusive port is shown below.</p>\n<pre><code class=\"language-js\">socket.bind({\n  address: 'localhost',\n  port: 8000,\n  exclusive: true,\n});\n</code></pre>"
            },
            {
              "textRaw": "`socket.close([callback])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} Called when the socket has been closed.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Called when the socket has been closed.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Close the underlying socket and stop listening for data on it. If a callback is\nprovided, it is added as a listener for the <a href=\"#event-close\"><code>'close'</code></a> event.</p>"
            },
            {
              "textRaw": "`socket[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v20.5.0",
                  "v18.18.0"
                ],
                "changes": [
                  {
                    "version": "v24.2.0",
                    "pr-url": "https://github.com/nodejs/node/pull/58467",
                    "description": "No longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <a href=\"#socketclosecallback\"><code>socket.close()</code></a> and returns a promise that fulfills when the\nsocket has closed.</p>"
            },
            {
              "textRaw": "`socket.connect(port[, address][, callback])`",
              "name": "connect",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`port` {integer}",
                      "name": "port",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`address` {string}",
                      "name": "address",
                      "type": "string",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} Called when the connection is completed or on error.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Called when the connection is completed or on error.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Associates the <code>dgram.Socket</code> to a remote address and port. Every\nmessage sent by this handle is automatically sent to that destination. Also,\nthe socket will only receive messages from that remote peer.\nTrying to call <code>connect()</code> on an already connected socket will result\nin an <a href=\"errors.html#err_socket_dgram_is_connected\"><code>ERR_SOCKET_DGRAM_IS_CONNECTED</code></a> exception. If <code>address</code> is not\nprovided, <code>'127.0.0.1'</code> (for <code>udp4</code> sockets) or <code>'::1'</code> (for <code>udp6</code> sockets)\nwill be used by default. Once the connection is complete, a <code>'connect'</code> event\nis emitted and the optional <code>callback</code> function is called. In case of failure,\nthe <code>callback</code> is called or, failing this, an <code>'error'</code> event is emitted.</p>"
            },
            {
              "textRaw": "`socket.disconnect()`",
              "name": "disconnect",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>A synchronous function that disassociates a connected <code>dgram.Socket</code> from\nits remote address. Trying to call <code>disconnect()</code> on an unbound or already\ndisconnected socket will result in an <a href=\"errors.html#err_socket_dgram_not_connected\"><code>ERR_SOCKET_DGRAM_NOT_CONNECTED</code></a>\nexception.</p>"
            },
            {
              "textRaw": "`socket.dropMembership(multicastAddress[, multicastInterface])`",
              "name": "dropMembership",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`multicastAddress` {string}",
                      "name": "multicastAddress",
                      "type": "string"
                    },
                    {
                      "textRaw": "`multicastInterface` {string}",
                      "name": "multicastInterface",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Instructs the kernel to leave a multicast group at <code>multicastAddress</code> using the\n<code>IP_DROP_MEMBERSHIP</code> socket option. This method is automatically called by the\nkernel when the socket is closed or the process terminates, so most apps will\nnever have reason to call this.</p>\n<p>If <code>multicastInterface</code> is not specified, the operating system will attempt to\ndrop membership on all valid interfaces.</p>"
            },
            {
              "textRaw": "`socket.dropSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])`",
              "name": "dropSourceSpecificMembership",
              "type": "method",
              "meta": {
                "added": [
                  "v13.1.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`sourceAddress` {string}",
                      "name": "sourceAddress",
                      "type": "string"
                    },
                    {
                      "textRaw": "`groupAddress` {string}",
                      "name": "groupAddress",
                      "type": "string"
                    },
                    {
                      "textRaw": "`multicastInterface` {string}",
                      "name": "multicastInterface",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Instructs the kernel to leave a source-specific multicast channel at the given\n<code>sourceAddress</code> and <code>groupAddress</code> using the <code>IP_DROP_SOURCE_MEMBERSHIP</code>\nsocket option. This method is automatically called by the kernel when the\nsocket is closed or the process terminates, so most apps will never have\nreason to call this.</p>\n<p>If <code>multicastInterface</code> is not specified, the operating system will attempt to\ndrop membership on all valid interfaces.</p>"
            },
            {
              "textRaw": "`socket.getRecvBufferSize()`",
              "name": "getRecvBufferSize",
              "type": "method",
              "meta": {
                "added": [
                  "v8.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} the `SO_RCVBUF` socket receive buffer size in bytes.",
                    "name": "return",
                    "type": "number",
                    "desc": "the `SO_RCVBUF` socket receive buffer size in bytes."
                  }
                }
              ],
              "desc": "<p>This method throws <a href=\"errors.html#err_socket_buffer_size\"><code>ERR_SOCKET_BUFFER_SIZE</code></a> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.getSendBufferSize()`",
              "name": "getSendBufferSize",
              "type": "method",
              "meta": {
                "added": [
                  "v8.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} the `SO_SNDBUF` socket send buffer size in bytes.",
                    "name": "return",
                    "type": "number",
                    "desc": "the `SO_SNDBUF` socket send buffer size in bytes."
                  }
                }
              ],
              "desc": "<p>This method throws <a href=\"errors.html#err_socket_buffer_size\"><code>ERR_SOCKET_BUFFER_SIZE</code></a> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.getSendQueueSize()`",
              "name": "getSendQueueSize",
              "type": "method",
              "meta": {
                "added": [
                  "v18.8.0",
                  "v16.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} Number of bytes queued for sending.",
                    "name": "return",
                    "type": "number",
                    "desc": "Number of bytes queued for sending."
                  }
                }
              ]
            },
            {
              "textRaw": "`socket.getSendQueueCount()`",
              "name": "getSendQueueCount",
              "type": "method",
              "meta": {
                "added": [
                  "v18.8.0",
                  "v16.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {number} Number of send requests currently in the queue awaiting to be processed.",
                    "name": "return",
                    "type": "number",
                    "desc": "Number of send requests currently in the queue awaiting to be processed."
                  }
                }
              ]
            },
            {
              "textRaw": "`socket.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {dgram.Socket}",
                    "name": "return",
                    "type": "dgram.Socket"
                  }
                }
              ],
              "desc": "<p>By default, binding a socket will cause it to block the Node.js process from\nexiting as long as the socket is open. The <code>socket.unref()</code> method can be used\nto exclude the socket from the reference counting that keeps the Node.js\nprocess active. The <code>socket.ref()</code> method adds the socket back to the reference\ncounting and restores the default behavior.</p>\n<p>Calling <code>socket.ref()</code> multiples times will have no additional effect.</p>\n<p>The <code>socket.ref()</code> method returns a reference to the socket so calls can be\nchained.</p>"
            },
            {
              "textRaw": "`socket.remoteAddress()`",
              "name": "remoteAddress",
              "type": "method",
              "meta": {
                "added": [
                  "v12.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns an object containing the <code>address</code>, <code>family</code>, and <code>port</code> of the remote\nendpoint. This method throws an <a href=\"errors.html#err_socket_dgram_not_connected\"><code>ERR_SOCKET_DGRAM_NOT_CONNECTED</code></a> exception\nif the socket is not connected.</p>"
            },
            {
              "textRaw": "`socket.send(msg[, offset, length][, port][, address][, callback])`",
              "name": "send",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": [
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/39190",
                    "description": "The `address` parameter now only accepts a `string`, `null` or `undefined`."
                  },
                  {
                    "version": [
                      "v14.5.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/22413",
                    "description": "The `msg` parameter can now be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v12.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26871",
                    "description": "Added support for sending data on connected sockets."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/11985",
                    "description": "The `msg` parameter can be an `Uint8Array` now."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/10473",
                    "description": "The `address` parameter is always optional now."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/5929",
                    "description": "On success, `callback` will now be called with an `error` argument of `null` rather than `0`."
                  },
                  {
                    "version": "v5.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4374",
                    "description": "The `msg` parameter can be an array now. Also, the `offset` and `length` parameters are optional now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`msg` {Buffer|TypedArray|DataView|string|Array} Message to be sent.",
                      "name": "msg",
                      "type": "Buffer|TypedArray|DataView|string|Array",
                      "desc": "Message to be sent."
                    },
                    {
                      "textRaw": "`offset` {integer} Offset in the buffer where the message starts.",
                      "name": "offset",
                      "type": "integer",
                      "desc": "Offset in the buffer where the message starts.",
                      "optional": true
                    },
                    {
                      "textRaw": "`length` {integer} Number of bytes in the message.",
                      "name": "length",
                      "type": "integer",
                      "desc": "Number of bytes in the message.",
                      "optional": true
                    },
                    {
                      "textRaw": "`port` {integer} Destination port.",
                      "name": "port",
                      "type": "integer",
                      "desc": "Destination port.",
                      "optional": true
                    },
                    {
                      "textRaw": "`address` {string} Destination host name or IP address.",
                      "name": "address",
                      "type": "string",
                      "desc": "Destination host name or IP address.",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function} Called when the message has been sent.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Called when the message has been sent.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Broadcasts a datagram on the socket.\nFor connectionless sockets, the destination <code>port</code> and <code>address</code> must be\nspecified. Connected sockets, on the other hand, will use their associated\nremote endpoint, so the <code>port</code> and <code>address</code> arguments must not be set.</p>\n<p>The <code>msg</code> argument contains the message to be sent.\nDepending on its type, different behavior can apply. If <code>msg</code> is a <code>Buffer</code>,\nany <code>TypedArray</code> or a <code>DataView</code>,\nthe <code>offset</code> and <code>length</code> specify the offset within the <code>Buffer</code> where the\nmessage begins and the number of bytes in the message, respectively.\nIf <code>msg</code> is a <code>String</code>, then it is automatically converted to a <code>Buffer</code>\nwith <code>'utf8'</code> encoding. With messages that\ncontain multi-byte characters, <code>offset</code> and <code>length</code> will be calculated with\nrespect to <a href=\"buffer.html#static-method-bufferbytelengthstring-encoding\">byte length</a> and not the character position.\nIf <code>msg</code> is an array, <code>offset</code> and <code>length</code> must not be specified.</p>\n<p>The <code>address</code> argument is a string. If the value of <code>address</code> is a host name,\nDNS will be used to resolve the address of the host. If <code>address</code> is not\nprovided or otherwise nullish, <code>'127.0.0.1'</code> (for <code>udp4</code> sockets) or <code>'::1'</code>\n(for <code>udp6</code> sockets) will be used by default.</p>\n<p>If the socket has not been previously bound with a call to <code>bind</code>, the socket\nis assigned a random port number and is bound to the \"all interfaces\" address\n(<code>'0.0.0.0'</code> for <code>udp4</code> sockets, <code>'::0'</code> for <code>udp6</code> sockets.)</p>\n<p>An optional <code>callback</code> function may be specified to as a way of reporting\nDNS errors or for determining when it is safe to reuse the <code>buf</code> object.\nDNS lookups delay the time to send for at least one tick of the\nNode.js event loop.</p>\n<p>The only way to know for sure that the datagram has been sent is by using a\n<code>callback</code>. If an error occurs and a <code>callback</code> is given, the error will be\npassed as the first argument to the <code>callback</code>. If a <code>callback</code> is not given,\nthe error is emitted as an <code>'error'</code> event on the <code>socket</code> object.</p>\n<p>Offset and length are optional but both <em>must</em> be set if either are used.\nThey are supported only when the first argument is a <code>Buffer</code>, a <code>TypedArray</code>,\nor a <code>DataView</code>.</p>\n<p>This method throws <a href=\"errors.html#err_socket_bad_port\"><code>ERR_SOCKET_BAD_PORT</code></a> if called on an unbound socket.</p>\n<p>Example of sending a UDP packet to a port on <code>localhost</code>;</p>\n<pre><code class=\"language-mjs\">import dgram from 'node:dgram';\nimport { Buffer } from 'node:buffer';\n\nconst message = Buffer.from('Some bytes');\nconst client = dgram.createSocket('udp4');\nclient.send(message, 41234, 'localhost', (err) => {\n  client.close();\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dgram = require('node:dgram');\nconst { Buffer } = require('node:buffer');\n\nconst message = Buffer.from('Some bytes');\nconst client = dgram.createSocket('udp4');\nclient.send(message, 41234, 'localhost', (err) => {\n  client.close();\n});\n</code></pre>\n<p>Example of sending a UDP packet composed of multiple buffers to a port on\n<code>127.0.0.1</code>;</p>\n<pre><code class=\"language-mjs\">import dgram from 'node:dgram';\nimport { Buffer } from 'node:buffer';\n\nconst buf1 = Buffer.from('Some ');\nconst buf2 = Buffer.from('bytes');\nconst client = dgram.createSocket('udp4');\nclient.send([buf1, buf2], 41234, (err) => {\n  client.close();\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dgram = require('node:dgram');\nconst { Buffer } = require('node:buffer');\n\nconst buf1 = Buffer.from('Some ');\nconst buf2 = Buffer.from('bytes');\nconst client = dgram.createSocket('udp4');\nclient.send([buf1, buf2], 41234, (err) => {\n  client.close();\n});\n</code></pre>\n<p>Sending multiple buffers might be faster or slower depending on the\napplication and operating system. Run benchmarks to\ndetermine the optimal strategy on a case-by-case basis. Generally speaking,\nhowever, sending multiple buffers is faster.</p>\n<p>Example of sending a UDP packet using a socket connected to a port on\n<code>localhost</code>:</p>\n<pre><code class=\"language-mjs\">import dgram from 'node:dgram';\nimport { Buffer } from 'node:buffer';\n\nconst message = Buffer.from('Some bytes');\nconst client = dgram.createSocket('udp4');\nclient.connect(41234, 'localhost', (err) => {\n  client.send(message, (err) => {\n    client.close();\n  });\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const dgram = require('node:dgram');\nconst { Buffer } = require('node:buffer');\n\nconst message = Buffer.from('Some bytes');\nconst client = dgram.createSocket('udp4');\nclient.connect(41234, 'localhost', (err) => {\n  client.send(message, (err) => {\n    client.close();\n  });\n});\n</code></pre>",
              "modules": [
                {
                  "textRaw": "Note about UDP datagram size",
                  "name": "note_about_udp_datagram_size",
                  "type": "module",
                  "desc": "<p>The maximum size of an IPv4/v6 datagram depends on the <code>MTU</code>\n(Maximum Transmission Unit) and on the <code>Payload Length</code> field size.</p>\n<ul>\n<li>\n<p>The <code>Payload Length</code> field is 16 bits wide, which means that a normal\npayload cannot exceed 64K octets including the internet header and data\n(65,507 bytes = 65,535 − 8 bytes UDP header − 20 bytes IP header);\nthis is generally true for loopback interfaces, but such long datagram\nmessages are impractical for most hosts and networks.</p>\n</li>\n<li>\n<p>The <code>MTU</code> is the largest size a given link layer technology can support for\ndatagram messages. For any link, IPv4 mandates a minimum <code>MTU</code> of 68\noctets, while the recommended <code>MTU</code> for IPv4 is 576 (typically recommended\nas the <code>MTU</code> for dial-up type applications), whether they arrive whole or in\nfragments.</p>\n<p>For IPv6, the minimum <code>MTU</code> is 1280 octets. However, the mandatory minimum\nfragment reassembly buffer size is 1500 octets. The value of 68 octets is\nvery small, since most current link layer technologies, like Ethernet, have a\nminimum <code>MTU</code> of 1500.</p>\n</li>\n</ul>\n<p>It is impossible to know in advance the MTU of each link through which\na packet might travel. Sending a datagram greater than the receiver <code>MTU</code> will\nnot work because the packet will get silently dropped without informing the\nsource that the data did not reach its intended recipient.</p>",
                  "displayName": "Note about UDP datagram size"
                }
              ]
            },
            {
              "textRaw": "`socket.setBroadcast(flag)`",
              "name": "setBroadcast",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.9"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`flag` {boolean}",
                      "name": "flag",
                      "type": "boolean"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets or clears the <code>SO_BROADCAST</code> socket option. When set to <code>true</code>, UDP\npackets may be sent to a local interface's broadcast address.</p>\n<p>This method throws <code>EBADF</code> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.setMulticastInterface(multicastInterface)`",
              "name": "setMulticastInterface",
              "type": "method",
              "meta": {
                "added": [
                  "v8.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`multicastInterface` {string}",
                      "name": "multicastInterface",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p><em>All references to scope in this section are referring to\n<a href=\"https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses\">IPv6 Zone Indexes</a>, which are defined by <a href=\"https://tools.ietf.org/html/rfc4007\">RFC 4007</a>. In string form, an IP\nwith a scope index is written as <code>'IP%scope'</code> where scope is an interface name\nor interface number.</em></p>\n<p>Sets the default outgoing multicast interface of the socket to a chosen\ninterface or back to system interface selection. The <code>multicastInterface</code> must\nbe a valid string representation of an IP from the socket's family.</p>\n<p>For IPv4 sockets, this should be the IP configured for the desired physical\ninterface. All packets sent to multicast on the socket will be sent on the\ninterface determined by the most recent successful use of this call.</p>\n<p>For IPv6 sockets, <code>multicastInterface</code> should include a scope to indicate the\ninterface as in the examples that follow. In IPv6, individual <code>send</code> calls can\nalso use explicit scope in addresses, so only packets sent to a multicast\naddress without specifying an explicit scope are affected by the most recent\nsuccessful use of this call.</p>\n<p>This method throws <code>EBADF</code> if called on an unbound socket.</p>",
              "modules": [
                {
                  "textRaw": "Example: IPv6 outgoing multicast interface",
                  "name": "example:_ipv6_outgoing_multicast_interface",
                  "type": "module",
                  "desc": "<p>On most systems, where scope format uses the interface name:</p>\n<pre><code class=\"language-js\">const socket = dgram.createSocket('udp6');\n\nsocket.bind(1234, () => {\n  socket.setMulticastInterface('::%eth1');\n});\n</code></pre>\n<p>On Windows, where scope format uses an interface number:</p>\n<pre><code class=\"language-js\">const socket = dgram.createSocket('udp6');\n\nsocket.bind(1234, () => {\n  socket.setMulticastInterface('::%2');\n});\n</code></pre>",
                  "displayName": "Example: IPv6 outgoing multicast interface"
                },
                {
                  "textRaw": "Example: IPv4 outgoing multicast interface",
                  "name": "example:_ipv4_outgoing_multicast_interface",
                  "type": "module",
                  "desc": "<p>All systems use an IP of the host on the desired physical interface:</p>\n<pre><code class=\"language-js\">const socket = dgram.createSocket('udp4');\n\nsocket.bind(1234, () => {\n  socket.setMulticastInterface('10.0.0.2');\n});\n</code></pre>",
                  "displayName": "Example: IPv4 outgoing multicast interface"
                },
                {
                  "textRaw": "Call results",
                  "name": "call_results",
                  "type": "module",
                  "desc": "<p>A call on a socket that is not ready to send or no longer open may throw a <em>Not\nrunning</em> <a href=\"errors.html#class-error\"><code>Error</code></a>.</p>\n<p>If <code>multicastInterface</code> can not be parsed into an IP then an <em>EINVAL</em>\n<a href=\"errors.html#class-systemerror\"><code>System Error</code></a> is thrown.</p>\n<p>On IPv4, if <code>multicastInterface</code> is a valid address but does not match any\ninterface, or if the address does not match the family then\na <a href=\"errors.html#class-systemerror\"><code>System Error</code></a> such as <code>EADDRNOTAVAIL</code> or <code>EPROTONOSUP</code> is thrown.</p>\n<p>On IPv6, most errors with specifying or omitting scope will result in the socket\ncontinuing to use (or returning to) the system's default interface selection.</p>\n<p>A socket's address family's ANY address (IPv4 <code>'0.0.0.0'</code> or IPv6 <code>'::'</code>) can be\nused to return control of the sockets default outgoing interface to the system\nfor future multicast packets.</p>",
                  "displayName": "Call results"
                }
              ]
            },
            {
              "textRaw": "`socket.setMulticastLoopback(flag)`",
              "name": "setMulticastLoopback",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.8"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`flag` {boolean}",
                      "name": "flag",
                      "type": "boolean"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets or clears the <code>IP_MULTICAST_LOOP</code> socket option. When set to <code>true</code>,\nmulticast packets will also be received on the local interface.</p>\n<p>This method throws <code>EBADF</code> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.setMulticastTTL(ttl)`",
              "name": "setMulticastTTL",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.8"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`ttl` {integer}",
                      "name": "ttl",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the <code>IP_MULTICAST_TTL</code> socket option. While TTL generally stands for\n\"Time to Live\", in this context it specifies the number of IP hops that a\npacket is allowed to travel through, specifically for multicast traffic. Each\nrouter or gateway that forwards a packet decrements the TTL. If the TTL is\ndecremented to 0 by a router, it will not be forwarded.</p>\n<p>The <code>ttl</code> argument may be between 0 and 255. The default on most systems is <code>1</code>.</p>\n<p>This method throws <code>EBADF</code> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.setRecvBufferSize(size)`",
              "name": "setRecvBufferSize",
              "type": "method",
              "meta": {
                "added": [
                  "v8.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {integer}",
                      "name": "size",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the <code>SO_RCVBUF</code> socket option. Sets the maximum socket receive buffer\nin bytes.</p>\n<p>This method throws <a href=\"errors.html#err_socket_buffer_size\"><code>ERR_SOCKET_BUFFER_SIZE</code></a> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.setSendBufferSize(size)`",
              "name": "setSendBufferSize",
              "type": "method",
              "meta": {
                "added": [
                  "v8.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`size` {integer}",
                      "name": "size",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the <code>SO_SNDBUF</code> socket option. Sets the maximum socket send buffer\nin bytes.</p>\n<p>This method throws <a href=\"errors.html#err_socket_buffer_size\"><code>ERR_SOCKET_BUFFER_SIZE</code></a> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.setTTL(ttl)`",
              "name": "setTTL",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.101"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`ttl` {integer}",
                      "name": "ttl",
                      "type": "integer"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the <code>IP_TTL</code> socket option. While TTL generally stands for \"Time to Live\",\nin this context it specifies the number of IP hops that a packet is allowed to\ntravel through. Each router or gateway that forwards a packet decrements the\nTTL. If the TTL is decremented to 0 by a router, it will not be forwarded.\nChanging TTL values is typically done for network probes or when multicasting.</p>\n<p>The <code>ttl</code> argument may be between 1 and 255. The default on most systems\nis 64.</p>\n<p>This method throws <code>EBADF</code> if called on an unbound socket.</p>"
            },
            {
              "textRaw": "`socket.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {dgram.Socket}",
                    "name": "return",
                    "type": "dgram.Socket"
                  }
                }
              ],
              "desc": "<p>By default, binding a socket will cause it to block the Node.js process from\nexiting as long as the socket is open. The <code>socket.unref()</code> method can be used\nto exclude the socket from the reference counting that keeps the Node.js\nprocess active, allowing the process to exit even if the socket is still\nlistening.</p>\n<p>Calling <code>socket.unref()</code> multiple times will have no additional effect.</p>\n<p>The <code>socket.unref()</code> method returns a reference to the socket so calls can be\nchained.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "`node:dgram` module functions",
          "name": "`node:dgram`_module_functions",
          "type": "module",
          "methods": [
            {
              "textRaw": "`dgram.createSocket(options[, callback])`",
              "name": "createSocket",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.13"
                ],
                "changes": [
                  {
                    "version": [
                      "v23.1.0",
                      "v22.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55403",
                    "description": "The `reusePort` option is supported."
                  },
                  {
                    "version": "v15.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37026",
                    "description": "AbortSignal support was added."
                  },
                  {
                    "version": "v11.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/23798",
                    "description": "The `ipv6Only` option is supported."
                  },
                  {
                    "version": "v8.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13623",
                    "description": "The `recvBufferSize` and `sendBufferSize` options are supported now."
                  },
                  {
                    "version": "v8.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/14560",
                    "description": "The `lookup` option is supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object} Available options are:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Available options are:",
                      "options": [
                        {
                          "textRaw": "`type` {string} The family of socket. Must be either `'udp4'` or `'udp6'`. Required.",
                          "name": "type",
                          "type": "string",
                          "desc": "The family of socket. Must be either `'udp4'` or `'udp6'`. Required."
                        },
                        {
                          "textRaw": "`reuseAddr` {boolean} When `true` `socket.bind()` will reuse the address, even if another process has already bound a socket on it, but only one socket can receive the data. **Default:** `false`.",
                          "name": "reuseAddr",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true` `socket.bind()` will reuse the address, even if another process has already bound a socket on it, but only one socket can receive the data."
                        },
                        {
                          "textRaw": "`reusePort` {boolean} When `true` `socket.bind()` will reuse the port, even if another process has already bound a socket on it. Incoming datagrams are distributed to listening sockets. The option is available only on some platforms, such as Linux 3.9+, DragonFlyBSD 3.6+, FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+. On unsupported platforms, this option raises an error when the socket is bound. **Default:** `false`.",
                          "name": "reusePort",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true` `socket.bind()` will reuse the port, even if another process has already bound a socket on it. Incoming datagrams are distributed to listening sockets. The option is available only on some platforms, such as Linux 3.9+, DragonFlyBSD 3.6+, FreeBSD 12.0+, Solaris 11.4, and AIX 7.2.5+. On unsupported platforms, this option raises an error when the socket is bound."
                        },
                        {
                          "textRaw": "`ipv6Only` {boolean} Setting `ipv6Only` to `true` will disable dual-stack support, i.e., binding to address `::` won't make `0.0.0.0` be bound. **Default:** `false`.",
                          "name": "ipv6Only",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Setting `ipv6Only` to `true` will disable dual-stack support, i.e., binding to address `::` won't make `0.0.0.0` be bound."
                        },
                        {
                          "textRaw": "`recvBufferSize` {number} Sets the `SO_RCVBUF` socket value.",
                          "name": "recvBufferSize",
                          "type": "number",
                          "desc": "Sets the `SO_RCVBUF` socket value."
                        },
                        {
                          "textRaw": "`sendBufferSize` {number} Sets the `SO_SNDBUF` socket value.",
                          "name": "sendBufferSize",
                          "type": "number",
                          "desc": "Sets the `SO_SNDBUF` socket value."
                        },
                        {
                          "textRaw": "`lookup` {Function} Custom lookup function. **Default:** `dns.lookup()`.",
                          "name": "lookup",
                          "type": "Function",
                          "default": "`dns.lookup()`",
                          "desc": "Custom lookup function."
                        },
                        {
                          "textRaw": "`signal` {AbortSignal} An AbortSignal that may be used to close a socket.",
                          "name": "signal",
                          "type": "AbortSignal",
                          "desc": "An AbortSignal that may be used to close a socket."
                        },
                        {
                          "textRaw": "`receiveBlockList` {net.BlockList} `receiveBlockList` can be used for discarding inbound datagram to specific IP addresses, IP ranges, or IP subnets. This does not work if the server is behind a reverse proxy, NAT, etc. because the address checked against the blocklist is the address of the proxy, or the one specified by the NAT.",
                          "name": "receiveBlockList",
                          "type": "net.BlockList",
                          "desc": "`receiveBlockList` can be used for discarding inbound datagram to specific IP addresses, IP ranges, or IP subnets. This does not work if the server is behind a reverse proxy, NAT, etc. because the address checked against the blocklist is the address of the proxy, or the one specified by the NAT."
                        },
                        {
                          "textRaw": "`sendBlockList` {net.BlockList} `sendBlockList` can be used for disabling outbound access to specific IP addresses, IP ranges, or IP subnets.",
                          "name": "sendBlockList",
                          "type": "net.BlockList",
                          "desc": "`sendBlockList` can be used for disabling outbound access to specific IP addresses, IP ranges, or IP subnets."
                        }
                      ]
                    },
                    {
                      "textRaw": "`callback` {Function} Attached as a listener for `'message'` events. Optional.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Attached as a listener for `'message'` events. Optional.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {dgram.Socket}",
                    "name": "return",
                    "type": "dgram.Socket"
                  }
                }
              ],
              "desc": "<p>Creates a <code>dgram.Socket</code> object. Once the socket is created, calling\n<a href=\"#socketbindport-address-callback\"><code>socket.bind()</code></a> will instruct the socket to begin listening for datagram\nmessages. When <code>address</code> and <code>port</code> are not passed to <a href=\"#socketbindport-address-callback\"><code>socket.bind()</code></a> the\nmethod will bind the socket to the \"all interfaces\" address on a random port\n(it does the right thing for both <code>udp4</code> and <code>udp6</code> sockets). The bound address\nand port can be retrieved using <a href=\"#socketaddress\"><code>socket.address().address</code></a> and\n<a href=\"#socketaddress\"><code>socket.address().port</code></a>.</p>\n<p>If the <code>signal</code> option is enabled, calling <code>.abort()</code> on the corresponding\n<code>AbortController</code> is similar to calling <code>.close()</code> on the socket:</p>\n<pre><code class=\"language-js\">const controller = new AbortController();\nconst { signal } = controller;\nconst server = dgram.createSocket({ type: 'udp4', signal });\nserver.on('message', (msg, rinfo) => {\n  console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);\n});\n// Later, when you want to close the server.\ncontroller.abort();\n</code></pre>"
            },
            {
              "textRaw": "`dgram.createSocket(type[, callback])`",
              "name": "createSocket",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.99"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`type` {string} Either `'udp4'` or `'udp6'`.",
                      "name": "type",
                      "type": "string",
                      "desc": "Either `'udp4'` or `'udp6'`."
                    },
                    {
                      "textRaw": "`callback` {Function} Attached as a listener to `'message'` events.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Attached as a listener to `'message'` events.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {dgram.Socket}",
                    "name": "return",
                    "type": "dgram.Socket"
                  }
                }
              ],
              "desc": "<p>Creates a <code>dgram.Socket</code> object of the specified <code>type</code>.</p>\n<p>Once the socket is created, calling <a href=\"#socketbindport-address-callback\"><code>socket.bind()</code></a> will instruct the\nsocket to begin listening for datagram messages. When <code>address</code> and <code>port</code> are\nnot passed to <a href=\"#socketbindport-address-callback\"><code>socket.bind()</code></a> the method will bind the socket to the \"all\ninterfaces\" address on a random port (it does the right thing for both <code>udp4</code>\nand <code>udp6</code> sockets). The bound address and port can be retrieved using\n<a href=\"#socketaddress\"><code>socket.address().address</code></a> and <a href=\"#socketaddress\"><code>socket.address().port</code></a>.</p>"
            }
          ],
          "displayName": "`node:dgram` module functions"
        }
      ],
      "displayName": "UDP/datagram sockets",
      "source": "doc/api/dgram.md"
    },
    {
      "textRaw": "URL",
      "name": "url",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:url</code> module provides utilities for URL resolution and parsing. It can\nbe accessed using:</p>\n<pre><code class=\"language-mjs\">import url from 'node:url';\n</code></pre>\n<pre><code class=\"language-cjs\">const url = require('node:url');\n</code></pre>",
      "modules": [
        {
          "textRaw": "URL strings and URL objects",
          "name": "url_strings_and_url_objects",
          "type": "module",
          "desc": "<p>A URL string is a structured string containing multiple meaningful components.\nWhen parsed, a URL object is returned containing properties for each of these\ncomponents.</p>\n<p>The <code>node:url</code> module provides two APIs for working with URLs: a legacy API that\nis Node.js specific, and a newer API that implements the same\n<a href=\"https://url.spec.whatwg.org/\">WHATWG URL Standard</a> used by web browsers.</p>\n<p>A comparison between the WHATWG and legacy APIs is provided below. Above the URL\n<code>'https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'</code>, properties\nof an object returned by the legacy <code>url.parse()</code> are shown. Below it are\nproperties of a WHATWG <code>URL</code> object.</p>\n<p>WHATWG URL's <code>origin</code> property includes <code>protocol</code> and <code>host</code>, but not\n<code>username</code> or <code>password</code>.</p>\n<pre><code class=\"language-text\">┌────────────────────────────────────────────────────────────────────────────────────────────────┐\n│                                              href                                              │\n├──────────┬──┬─────────────────────┬────────────────────────┬───────────────────────────┬───────┤\n│ protocol │  │        auth         │          host          │           path            │ hash  │\n│          │  │                     ├─────────────────┬──────┼──────────┬────────────────┤       │\n│          │  │                     │    hostname     │ port │ pathname │     search     │       │\n│          │  │                     │                 │      │          ├─┬──────────────┤       │\n│          │  │                     │                 │      │          │ │    query     │       │\n\"  https:   //    user   :   pass   @ sub.example.com : 8080   /p/a/t/h  ?  query=string   #hash \"\n│          │  │          │          │    hostname     │ port │          │                │       │\n│          │  │          │          ├─────────────────┴──────┤          │                │       │\n│ protocol │  │ username │ password │          host          │          │                │       │\n├──────────┴──┼──────────┴──────────┼────────────────────────┤          │                │       │\n│   origin    │                     │         origin         │ pathname │     search     │ hash  │\n├─────────────┴─────────────────────┴────────────────────────┴──────────┴────────────────┴───────┤\n│                                              href                                              │\n└────────────────────────────────────────────────────────────────────────────────────────────────┘\n(All spaces in the \"\" line should be ignored. They are purely for formatting.)\n</code></pre>\n<p>Parsing the URL string using the WHATWG API:</p>\n<pre><code class=\"language-js\">const myURL =\n  new URL('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash');\n</code></pre>\n<p>Parsing the URL string using the legacy API:</p>\n<pre><code class=\"language-mjs\">import url from 'node:url';\nconst myURL =\n  url.parse('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash');\n</code></pre>\n<pre><code class=\"language-cjs\">const url = require('node:url');\nconst myURL =\n  url.parse('https://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash');\n</code></pre>",
          "modules": [
            {
              "textRaw": "Constructing a URL from component parts and getting the constructed string",
              "name": "constructing_a_url_from_component_parts_and_getting_the_constructed_string",
              "type": "module",
              "desc": "<p>It is possible to construct a WHATWG URL from component parts using either the\nproperty setters or a template literal string:</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org');\nmyURL.pathname = '/a/b/c';\nmyURL.search = '?d=e';\nmyURL.hash = '#fgh';\n</code></pre>\n<pre><code class=\"language-js\">const pathname = '/a/b/c';\nconst search = '?d=e';\nconst hash = '#fgh';\nconst myURL = new URL(`https://example.org${pathname}${search}${hash}`);\n</code></pre>\n<p>To get the constructed URL string, use the <code>href</code> property accessor:</p>\n<pre><code class=\"language-js\">console.log(myURL.href);\n</code></pre>",
              "displayName": "Constructing a URL from component parts and getting the constructed string"
            }
          ],
          "displayName": "URL strings and URL objects"
        },
        {
          "textRaw": "The WHATWG URL API",
          "name": "the_whatwg_url_api",
          "type": "module",
          "classes": [
            {
              "textRaw": "Class: `URL`",
              "name": "URL",
              "type": "class",
              "meta": {
                "added": [
                  "v7.0.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18281",
                    "description": "The class is now available on the global object."
                  }
                ]
              },
              "desc": "<p>Browser-compatible <code>URL</code> class, implemented by following the WHATWG URL\nStandard. <a href=\"https://url.spec.whatwg.org/#example-url-parsing\">Examples of parsed URLs</a> may be found in the Standard itself.\nThe <code>URL</code> class is also available on the global object.</p>\n<p>In accordance with browser conventions, all properties of <code>URL</code> objects\nare implemented as getters and setters on the class prototype, rather than as\ndata properties on the object itself. Thus, unlike <a href=\"#legacy-urlobject\">legacy <code>urlObject</code></a>s,\nusing the <code>delete</code> keyword on any properties of <code>URL</code> objects (e.g. <code>delete myURL.protocol</code>, <code>delete myURL.pathname</code>, etc) has no effect but will still\nreturn <code>true</code>.</p>",
              "signatures": [
                {
                  "textRaw": "`new URL(input[, base])`",
                  "name": "URL",
                  "type": "ctor",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v20.0.0",
                          "v18.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/47339",
                        "description": "ICU requirement is removed."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`input` {string} The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is converted to a string first.",
                      "name": "input",
                      "type": "string",
                      "desc": "The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is converted to a string first."
                    },
                    {
                      "textRaw": "`base` {string} The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is converted to a string first.",
                      "name": "base",
                      "type": "string",
                      "desc": "The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is converted to a string first.",
                      "optional": true
                    }
                  ],
                  "desc": "<p>Creates a new <code>URL</code> object by parsing the <code>input</code> relative to the <code>base</code>. If\n<code>base</code> is passed as a string, it will be parsed equivalent to <code>new URL(base)</code>.</p>\n<pre><code class=\"language-js\">const myURL = new URL('/foo', 'https://example.org/');\n// https://example.org/foo\n</code></pre>\n<p>The URL constructor is accessible as a property on the global object.\nIt can also be imported from the built-in url module:</p>\n<pre><code class=\"language-mjs\">import { URL } from 'node:url';\nconsole.log(URL === globalThis.URL); // Prints 'true'.\n</code></pre>\n<pre><code class=\"language-cjs\">console.log(URL === require('node:url').URL); // Prints 'true'.\n</code></pre>\n<p>A <code>TypeError</code> will be thrown if the <code>input</code> or <code>base</code> are not valid URLs. Note\nthat an effort will be made to coerce the given values into strings. For\ninstance:</p>\n<pre><code class=\"language-js\">const myURL = new URL({ toString: () => 'https://example.org/' });\n// https://example.org/\n</code></pre>\n<p>Unicode characters appearing within the host name of <code>input</code> will be\nautomatically converted to ASCII using the <a href=\"https://tools.ietf.org/html/rfc5891#section-4.4\">Punycode</a> algorithm.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://測試');\n// https://xn--g6w251d/\n</code></pre>\n<p>In cases where it is not known in advance if <code>input</code> is an absolute URL\nand a <code>base</code> is provided, it is advised to validate that the <code>origin</code> of\nthe <code>URL</code> object is what is expected.</p>\n<pre><code class=\"language-js\">let myURL = new URL('http://Example.com/', 'https://example.org/');\n// http://example.com/\n\nmyURL = new URL('https://Example.com/', 'https://example.org/');\n// https://example.com/\n\nmyURL = new URL('foo://Example.com/', 'https://example.org/');\n// foo://Example.com/\n\nmyURL = new URL('http:Example.com/', 'https://example.org/');\n// http://example.com/\n\nmyURL = new URL('https:Example.com/', 'https://example.org/');\n// https://example.org/Example.com/\n\nmyURL = new URL('foo:Example.com/', 'https://example.org/');\n// foo:Example.com/\n</code></pre>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "hash",
                  "type": "string",
                  "desc": "<p>Gets and sets the fragment portion of the URL.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org/foo#bar');\nconsole.log(myURL.hash);\n// Prints #bar\n\nmyURL.hash = 'baz';\nconsole.log(myURL.href);\n// Prints https://example.org/foo#baz\n</code></pre>\n<p>Invalid URL characters included in the value assigned to the <code>hash</code> property\nare <a href=\"#percent-encoding-in-urls\">percent-encoded</a>. The selection of which characters to\npercent-encode may vary somewhat from what the <a href=\"#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a> and\n<a href=\"#urlformaturlobject\"><code>url.format()</code></a> methods would produce.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "host",
                  "type": "string",
                  "desc": "<p>Gets and sets the host portion of the URL.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org:81/foo');\nconsole.log(myURL.host);\n// Prints example.org:81\n\nmyURL.host = 'example.com:82';\nconsole.log(myURL.href);\n// Prints https://example.com:82/foo\n</code></pre>\n<p>Invalid host values assigned to the <code>host</code> property are ignored.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "hostname",
                  "type": "string",
                  "desc": "<p>Gets and sets the host name portion of the URL. The key difference between\n<code>url.host</code> and <code>url.hostname</code> is that <code>url.hostname</code> does <em>not</em> include the\nport.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org:81/foo');\nconsole.log(myURL.hostname);\n// Prints example.org\n\n// Setting the hostname does not change the port\nmyURL.hostname = 'example.com';\nconsole.log(myURL.href);\n// Prints https://example.com:81/foo\n\n// Use myURL.host to change the hostname and port\nmyURL.host = 'example.org:82';\nconsole.log(myURL.href);\n// Prints https://example.org:82/foo\n</code></pre>\n<p>Invalid host name values assigned to the <code>hostname</code> property are ignored.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "href",
                  "type": "string",
                  "desc": "<p>Gets and sets the serialized URL.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org/foo');\nconsole.log(myURL.href);\n// Prints https://example.org/foo\n\nmyURL.href = 'https://example.com/bar';\nconsole.log(myURL.href);\n// Prints https://example.com/bar\n</code></pre>\n<p>Getting the value of the <code>href</code> property is equivalent to calling\n<a href=\"#urltostring\"><code>url.toString()</code></a>.</p>\n<p>Setting the value of this property to a new value is equivalent to creating a\nnew <code>URL</code> object using <a href=\"#new-urlinput-base\"><code>new URL(value)</code></a>. Each of the <code>URL</code>\nobject's properties will be modified.</p>\n<p>If the value assigned to the <code>href</code> property is not a valid URL, a <code>TypeError</code>\nwill be thrown.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "origin",
                  "type": "string",
                  "meta": {
                    "changes": [
                      {
                        "version": "v15.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/33325",
                        "description": "The scheme \"gopher\" is no longer special and `url.origin` now returns `'null'` for it."
                      }
                    ]
                  },
                  "desc": "<p>Gets the read-only serialization of the URL's origin.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org/foo/bar?baz');\nconsole.log(myURL.origin);\n// Prints https://example.org\n</code></pre>\n<pre><code class=\"language-js\">const idnURL = new URL('https://測試');\nconsole.log(idnURL.origin);\n// Prints https://xn--g6w251d\n\nconsole.log(idnURL.hostname);\n// Prints xn--g6w251d\n</code></pre>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "password",
                  "type": "string",
                  "desc": "<p>Gets and sets the password portion of the URL.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://abc:xyz@example.com');\nconsole.log(myURL.password);\n// Prints xyz\n\nmyURL.password = '123';\nconsole.log(myURL.href);\n// Prints https://abc:123@example.com/\n</code></pre>\n<p>Invalid URL characters included in the value assigned to the <code>password</code> property\nare <a href=\"#percent-encoding-in-urls\">percent-encoded</a>. The selection of which characters to\npercent-encode may vary somewhat from what the <a href=\"#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a> and\n<a href=\"#urlformaturlobject\"><code>url.format()</code></a> methods would produce.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "pathname",
                  "type": "string",
                  "desc": "<p>Gets and sets the path portion of the URL.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org/abc/xyz?123');\nconsole.log(myURL.pathname);\n// Prints /abc/xyz\n\nmyURL.pathname = '/abcdef';\nconsole.log(myURL.href);\n// Prints https://example.org/abcdef?123\n</code></pre>\n<p>Invalid URL characters included in the value assigned to the <code>pathname</code>\nproperty are <a href=\"#percent-encoding-in-urls\">percent-encoded</a>. The selection of which characters\nto percent-encode may vary somewhat from what the <a href=\"#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a> and\n<a href=\"#urlformaturlobject\"><code>url.format()</code></a> methods would produce.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "port",
                  "type": "string",
                  "meta": {
                    "changes": [
                      {
                        "version": "v15.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/33325",
                        "description": "The scheme \"gopher\" is no longer special."
                      }
                    ]
                  },
                  "desc": "<p>Gets and sets the port portion of the URL.</p>\n<p>The port value may be a number or a string containing a number in the range\n<code>0</code> to <code>65535</code> (inclusive). Setting the value to the default port of the\n<code>URL</code> objects given <code>protocol</code> will result in the <code>port</code> value becoming\nthe empty string (<code>''</code>).</p>\n<p>The port value can be an empty string in which case the port depends on\nthe protocol/scheme:</p>\n<table>\n<thead>\n<tr>\n<th>protocol</th>\n<th>port</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\"ftp\"</td>\n<td>21</td>\n</tr>\n<tr>\n<td>\"file\"</td>\n<td></td>\n</tr>\n<tr>\n<td>\"http\"</td>\n<td>80</td>\n</tr>\n<tr>\n<td>\"https\"</td>\n<td>443</td>\n</tr>\n<tr>\n<td>\"ws\"</td>\n<td>80</td>\n</tr>\n<tr>\n<td>\"wss\"</td>\n<td>443</td>\n</tr>\n</tbody>\n</table>\n<p>Upon assigning a value to the port, the value will first be converted to a\nstring using <code>.toString()</code>.</p>\n<p>If that string is invalid but it begins with a number, the leading number is\nassigned to <code>port</code>.\nIf the number lies outside the range denoted above, it is ignored.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org:8888');\nconsole.log(myURL.port);\n// Prints 8888\n\n// Default ports are automatically transformed to the empty string\n// (HTTPS protocol's default port is 443)\nmyURL.port = '443';\nconsole.log(myURL.port);\n// Prints the empty string\nconsole.log(myURL.href);\n// Prints https://example.org/\n\nmyURL.port = 1234;\nconsole.log(myURL.port);\n// Prints 1234\nconsole.log(myURL.href);\n// Prints https://example.org:1234/\n\n// Completely invalid port strings are ignored\nmyURL.port = 'abcd';\nconsole.log(myURL.port);\n// Prints 1234\n\n// Leading numbers are treated as a port number\nmyURL.port = '5678abcd';\nconsole.log(myURL.port);\n// Prints 5678\n\n// Non-integers are truncated\nmyURL.port = 1234.5678;\nconsole.log(myURL.port);\n// Prints 1234\n\n// Out-of-range numbers which are not represented in scientific notation\n// will be ignored.\nmyURL.port = 1e10; // 10000000000, will be range-checked as described below\nconsole.log(myURL.port);\n// Prints 1234\n</code></pre>\n<p>Numbers which contain a decimal point,\nsuch as floating-point numbers or numbers in scientific notation,\nare not an exception to this rule.\nLeading numbers up to the decimal point will be set as the URL's port,\nassuming they are valid:</p>\n<pre><code class=\"language-js\">myURL.port = 4.567e21;\nconsole.log(myURL.port);\n// Prints 4 (because it is the leading number in the string '4.567e21')\n</code></pre>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "protocol",
                  "type": "string",
                  "desc": "<p>Gets and sets the protocol portion of the URL.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org');\nconsole.log(myURL.protocol);\n// Prints https:\n\nmyURL.protocol = 'ftp';\nconsole.log(myURL.href);\n// Prints ftp://example.org/\n</code></pre>\n<p>Invalid URL protocol values assigned to the <code>protocol</code> property are ignored.</p>",
                  "modules": [
                    {
                      "textRaw": "Special schemes",
                      "name": "special_schemes",
                      "type": "module",
                      "meta": {
                        "changes": [
                          {
                            "version": "v15.0.0",
                            "pr-url": "https://github.com/nodejs/node/pull/33325",
                            "description": "The scheme \"gopher\" is no longer special."
                          }
                        ]
                      },
                      "desc": "<p>The <a href=\"https://url.spec.whatwg.org/\">WHATWG URL Standard</a> considers a handful of URL protocol schemes to be\n<em>special</em> in terms of how they are parsed and serialized. When a URL is\nparsed using one of these special protocols, the <code>url.protocol</code> property\nmay be changed to another special protocol but cannot be changed to a\nnon-special protocol, and vice versa.</p>\n<p>For instance, changing from <code>http</code> to <code>https</code> works:</p>\n<pre><code class=\"language-js\">const u = new URL('http://example.org');\nu.protocol = 'https';\nconsole.log(u.href);\n// https://example.org/\n</code></pre>\n<p>However, changing from <code>http</code> to a hypothetical <code>fish</code> protocol does not\nbecause the new protocol is not special.</p>\n<pre><code class=\"language-js\">const u = new URL('http://example.org');\nu.protocol = 'fish';\nconsole.log(u.href);\n// http://example.org/\n</code></pre>\n<p>Likewise, changing from a non-special protocol to a special protocol is also\nnot permitted:</p>\n<pre><code class=\"language-js\">const u = new URL('fish://example.org');\nu.protocol = 'http';\nconsole.log(u.href);\n// fish://example.org\n</code></pre>\n<p>According to the WHATWG URL Standard, special protocol schemes are <code>ftp</code>,\n<code>file</code>, <code>http</code>, <code>https</code>, <code>ws</code>, and <code>wss</code>.</p>",
                      "displayName": "Special schemes"
                    }
                  ]
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "search",
                  "type": "string",
                  "desc": "<p>Gets and sets the serialized query portion of the URL.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org/abc?123');\nconsole.log(myURL.search);\n// Prints ?123\n\nmyURL.search = 'abc=xyz';\nconsole.log(myURL.href);\n// Prints https://example.org/abc?abc=xyz\n</code></pre>\n<p>Any invalid URL characters appearing in the value assigned the <code>search</code>\nproperty will be <a href=\"#percent-encoding-in-urls\">percent-encoded</a>. The selection of which\ncharacters to percent-encode may vary somewhat from what the <a href=\"#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a>\nand <a href=\"#urlformaturlobject\"><code>url.format()</code></a> methods would produce.</p>"
                },
                {
                  "textRaw": "Type: {URLSearchParams}",
                  "name": "searchParams",
                  "type": "URLSearchParams",
                  "desc": "<p>Gets the <a href=\"#class-urlsearchparams\"><code>URLSearchParams</code></a> object representing the query parameters of the\nURL. This property is read-only but the <code>URLSearchParams</code> object it provides\ncan be used to mutate the URL instance; to replace the entirety of query\nparameters of the URL, use the <a href=\"#urlsearch\"><code>url.search</code></a> setter. See\n<a href=\"#class-urlsearchparams\"><code>URLSearchParams</code></a> documentation for details.</p>\n<p>Use care when using <code>.searchParams</code> to modify the <code>URL</code> because,\nper the WHATWG specification, the <code>URLSearchParams</code> object uses\ndifferent rules to determine which characters to percent-encode. For\ninstance, the <code>URL</code> object will not percent encode the ASCII tilde (<code>~</code>)\ncharacter, while <code>URLSearchParams</code> will always encode it:</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org/abc?foo=~bar');\n\nconsole.log(myURL.search);  // prints ?foo=~bar\n\n// Modify the URL via searchParams...\nmyURL.searchParams.sort();\n\nconsole.log(myURL.search);  // prints ?foo=%7Ebar\n</code></pre>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "username",
                  "type": "string",
                  "desc": "<p>Gets and sets the username portion of the URL.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://abc:xyz@example.com');\nconsole.log(myURL.username);\n// Prints abc\n\nmyURL.username = '123';\nconsole.log(myURL.href);\n// Prints https://123:xyz@example.com/\n</code></pre>\n<p>Any invalid URL characters appearing in the value assigned the <code>username</code>\nproperty will be <a href=\"#percent-encoding-in-urls\">percent-encoded</a>. The selection of which\ncharacters to percent-encode may vary somewhat from what the <a href=\"#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a>\nand <a href=\"#urlformaturlobject\"><code>url.format()</code></a> methods would produce.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`url.toString()`",
                  "name": "toString",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      }
                    }
                  ],
                  "desc": "<p>The <code>toString()</code> method on the <code>URL</code> object returns the serialized URL. The\nvalue returned is equivalent to that of <a href=\"#urlhref\"><code>url.href</code></a> and <a href=\"#urltojson\"><code>url.toJSON()</code></a>.</p>"
                },
                {
                  "textRaw": "`url.toJSON()`",
                  "name": "toJSON",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v7.7.0",
                      "v6.13.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      }
                    }
                  ],
                  "desc": "<p>The <code>toJSON()</code> method on the <code>URL</code> object returns the serialized URL. The\nvalue returned is equivalent to that of <a href=\"#urlhref\"><code>url.href</code></a> and\n<a href=\"#urltostring\"><code>url.toString()</code></a>.</p>\n<p>This method is automatically called when an <code>URL</code> object is serialized\nwith <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\"><code>JSON.stringify()</code></a>.</p>\n<pre><code class=\"language-js\">const myURLs = [\n  new URL('https://www.example.com'),\n  new URL('https://test.example.org'),\n];\nconsole.log(JSON.stringify(myURLs));\n// Prints [\"https://www.example.com/\",\"https://test.example.org/\"]\n</code></pre>"
                },
                {
                  "textRaw": "`URL.createObjectURL(blob)`",
                  "name": "createObjectURL",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.7.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.0.0",
                          "v22.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/57513",
                        "description": "Marking the API stable."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`blob` {Blob}",
                          "name": "blob",
                          "type": "Blob"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      }
                    }
                  ],
                  "desc": "<p>Creates a <code>'blob:nodedata:...'</code> URL string that represents the given <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a>\nobject and can be used to retrieve the <code>Blob</code> later.</p>\n<pre><code class=\"language-js\">const {\n  Blob,\n  resolveObjectURL,\n} = require('node:buffer');\n\nconst blob = new Blob(['hello']);\nconst id = URL.createObjectURL(blob);\n\n// later...\n\nconst otherBlob = resolveObjectURL(id);\nconsole.log(otherBlob.size);\n</code></pre>\n<p>The data stored by the registered <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> will be retained in memory until <code>URL.revokeObjectURL()</code> is called to remove it.</p>\n<p><code>Blob</code> objects are registered within the current thread. If using Worker\nThreads, <code>Blob</code> objects registered within one Worker will not be available\nto other workers or the main thread.</p>"
                },
                {
                  "textRaw": "`URL.revokeObjectURL(id)`",
                  "name": "revokeObjectURL",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.7.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.0.0",
                          "v22.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/57513",
                        "description": "Marking the API stable."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`id` {string} A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`.",
                          "name": "id",
                          "type": "string",
                          "desc": "A `'blob:nodedata:...` URL string returned by a prior call to `URL.createObjectURL()`."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Removes the stored <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a> identified by the given ID. Attempting to revoke a\nID that isn't registered will silently fail.</p>"
                },
                {
                  "textRaw": "`URL.canParse(input[, base])`",
                  "name": "canParse",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v19.9.0",
                      "v18.17.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`input` {string} The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is converted to a string first.",
                          "name": "input",
                          "type": "string",
                          "desc": "The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is converted to a string first."
                        },
                        {
                          "textRaw": "`base` {string} The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is converted to a string first.",
                          "name": "base",
                          "type": "string",
                          "desc": "The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is converted to a string first.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Checks if an <code>input</code> relative to the <code>base</code> can be parsed to a <code>URL</code>.</p>\n<pre><code class=\"language-js\">const isValid = URL.canParse('/foo', 'https://example.org/'); // true\n\nconst isNotValid = URL.canParse('/foo'); // false\n</code></pre>"
                },
                {
                  "textRaw": "`URL.parse(input[, base])`",
                  "name": "parse",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v22.1.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`input` {string} The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is converted to a string first.",
                          "name": "input",
                          "type": "string",
                          "desc": "The absolute or relative input URL to parse. If `input` is relative, then `base` is required. If `input` is absolute, the `base` is ignored. If `input` is not a string, it is converted to a string first."
                        },
                        {
                          "textRaw": "`base` {string} The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is converted to a string first.",
                          "name": "base",
                          "type": "string",
                          "desc": "The base URL to resolve against if the `input` is not absolute. If `base` is not a string, it is converted to a string first.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {URL|null}",
                        "name": "return",
                        "type": "URL|null"
                      }
                    }
                  ],
                  "desc": "<p>Parses a string as a URL. If <code>base</code> is provided, it will be used as the base\nURL for the purpose of resolving non-absolute <code>input</code> URLs. Returns <code>null</code>\nif the parameters can't be resolved to a valid URL.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `URLPattern`",
              "name": "URLPattern",
              "type": "class",
              "meta": {
                "added": [
                  "v23.8.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>The <code>URLPattern</code> API provides an interface to match URLs or parts of URLs\nagainst a pattern.</p>\n<pre><code class=\"language-js\">const myPattern = new URLPattern('https://nodejs.org/docs/latest/api/*.html');\nconsole.log(myPattern.exec('https://nodejs.org/docs/latest/api/dns.html'));\n// Prints:\n// {\n//  \"hash\": { \"groups\": {  \"0\": \"\" },  \"input\": \"\" },\n//  \"hostname\": { \"groups\": {}, \"input\": \"nodejs.org\" },\n//  \"inputs\": [\n//    \"https://nodejs.org/docs/latest/api/dns.html\"\n//  ],\n//  \"password\": { \"groups\": { \"0\": \"\" }, \"input\": \"\" },\n//  \"pathname\": { \"groups\": { \"0\": \"dns\" }, \"input\": \"/docs/latest/api/dns.html\" },\n//  \"port\": { \"groups\": {}, \"input\": \"\" },\n//  \"protocol\": { \"groups\": {}, \"input\": \"https\" },\n//  \"search\": { \"groups\": { \"0\": \"\" }, \"input\": \"\" },\n//  \"username\": { \"groups\": { \"0\": \"\" }, \"input\": \"\" }\n// }\n\nconsole.log(myPattern.test('https://nodejs.org/docs/latest/api/dns.html'));\n// Prints: true\n</code></pre>",
              "signatures": [
                {
                  "textRaw": "`new URLPattern()`",
                  "name": "URLPattern",
                  "type": "ctor",
                  "params": [],
                  "desc": "<p>Instantiate a new empty <code>URLPattern</code> object.</p>"
                },
                {
                  "textRaw": "`new URLPattern(string[, baseURL][, options])`",
                  "name": "URLPattern",
                  "type": "ctor",
                  "params": [
                    {
                      "textRaw": "`string` {string} A URL string",
                      "name": "string",
                      "type": "string",
                      "desc": "A URL string"
                    },
                    {
                      "textRaw": "`baseURL` {string|undefined} A base URL string",
                      "name": "baseURL",
                      "type": "string|undefined",
                      "desc": "A base URL string",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Options",
                      "name": "options",
                      "type": "Object",
                      "desc": "Options",
                      "optional": true
                    }
                  ],
                  "desc": "<p>Parse the <code>string</code> as a URL, and use it to instantiate a new\n<code>URLPattern</code> object.</p>\n<p>If <code>baseURL</code> is not specified, it defaults to <code>undefined</code>.</p>\n<p>An option can have <code>ignoreCase</code> boolean attribute which enables\ncase-insensitive matching if set to true.</p>\n<p>The constructor can throw a <code>TypeError</code> to indicate parsing failure.</p>"
                },
                {
                  "textRaw": "`new URLPattern(obj[, baseURL][, options])`",
                  "name": "URLPattern",
                  "type": "ctor",
                  "params": [
                    {
                      "textRaw": "`obj` {Object} An input pattern",
                      "name": "obj",
                      "type": "Object",
                      "desc": "An input pattern"
                    },
                    {
                      "textRaw": "`baseURL` {string|undefined} A base URL string",
                      "name": "baseURL",
                      "type": "string|undefined",
                      "desc": "A base URL string",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object} Options",
                      "name": "options",
                      "type": "Object",
                      "desc": "Options",
                      "optional": true
                    }
                  ],
                  "desc": "<p>Parse the <code>Object</code> as an input pattern, and use it to instantiate a new\n<code>URLPattern</code> object. The object members can be any of <code>protocol</code>, <code>username</code>,\n<code>password</code>, <code>hostname</code>, <code>port</code>, <code>pathname</code>, <code>search</code>, <code>hash</code> or <code>baseURL</code>.</p>\n<p>If <code>baseURL</code> is not specified, it defaults to <code>undefined</code>.</p>\n<p>An option can have <code>ignoreCase</code> boolean attribute which enables\ncase-insensitive matching if set to true.</p>\n<p>The constructor can throw a <code>TypeError</code> to indicate parsing failure.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`urlPattern.exec(input[, baseURL])`",
                  "name": "exec",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`input` {string|Object} A URL or URL parts",
                          "name": "input",
                          "type": "string|Object",
                          "desc": "A URL or URL parts"
                        },
                        {
                          "textRaw": "`baseURL` {string|undefined} A base URL string",
                          "name": "baseURL",
                          "type": "string|undefined",
                          "desc": "A base URL string",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Input can be a string or an object providing the individual URL parts. The\nobject members can be any of <code>protocol</code>, <code>username</code>, <code>password</code>, <code>hostname</code>,\n<code>port</code>, <code>pathname</code>, <code>search</code>, <code>hash</code> or <code>baseURL</code>.</p>\n<p>If <code>baseURL</code> is not specified, it will default to <code>undefined</code>.</p>\n<p>Returns an object with an <code>inputs</code> key containing the array of arguments\npassed into the function and keys of the URL components which contains the\nmatched input and matched groups.</p>\n<pre><code class=\"language-js\">const myPattern = new URLPattern('https://nodejs.org/docs/latest/api/*.html');\nconsole.log(myPattern.exec('https://nodejs.org/docs/latest/api/dns.html'));\n// Prints:\n// {\n//  \"hash\": { \"groups\": {  \"0\": \"\" },  \"input\": \"\" },\n//  \"hostname\": { \"groups\": {}, \"input\": \"nodejs.org\" },\n//  \"inputs\": [\n//    \"https://nodejs.org/docs/latest/api/dns.html\"\n//  ],\n//  \"password\": { \"groups\": { \"0\": \"\" }, \"input\": \"\" },\n//  \"pathname\": { \"groups\": { \"0\": \"dns\" }, \"input\": \"/docs/latest/api/dns.html\" },\n//  \"port\": { \"groups\": {}, \"input\": \"\" },\n//  \"protocol\": { \"groups\": {}, \"input\": \"https\" },\n//  \"search\": { \"groups\": { \"0\": \"\" }, \"input\": \"\" },\n//  \"username\": { \"groups\": { \"0\": \"\" }, \"input\": \"\" }\n// }\n</code></pre>"
                },
                {
                  "textRaw": "`urlPattern.test(input[, baseURL])`",
                  "name": "test",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`input` {string|Object} A URL or URL parts",
                          "name": "input",
                          "type": "string|Object",
                          "desc": "A URL or URL parts"
                        },
                        {
                          "textRaw": "`baseURL` {string|undefined} A base URL string",
                          "name": "baseURL",
                          "type": "string|undefined",
                          "desc": "A base URL string",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Input can be a string or an object providing the individual URL parts. The\nobject members can be any of <code>protocol</code>, <code>username</code>, <code>password</code>, <code>hostname</code>,\n<code>port</code>, <code>pathname</code>, <code>search</code>, <code>hash</code> or <code>baseURL</code>.</p>\n<p>If <code>baseURL</code> is not specified, it will default to <code>undefined</code>.</p>\n<p>Returns a boolean indicating if the input matches the current pattern.</p>\n<pre><code class=\"language-js\">const myPattern = new URLPattern('https://nodejs.org/docs/latest/api/*.html');\nconsole.log(myPattern.test('https://nodejs.org/docs/latest/api/dns.html'));\n// Prints: true\n</code></pre>"
                }
              ]
            },
            {
              "textRaw": "Class: `URLSearchParams`",
              "name": "URLSearchParams",
              "type": "class",
              "meta": {
                "added": [
                  "v7.5.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/18281",
                    "description": "The class is now available on the global object."
                  }
                ]
              },
              "desc": "<p>The <code>URLSearchParams</code> API provides read and write access to the query of a\n<code>URL</code>. The <code>URLSearchParams</code> class can also be used standalone with one of the\nfour following constructors.\nThe <code>URLSearchParams</code> class is also available on the global object.</p>\n<p>The WHATWG <code>URLSearchParams</code> interface and the <a href=\"querystring.html\"><code>querystring</code></a> module have\nsimilar purpose, but the purpose of the <a href=\"querystring.html\"><code>querystring</code></a> module is more\ngeneral, as it allows the customization of delimiter characters (<code>&#x26;</code> and <code>=</code>).\nOn the other hand, this API is designed purely for URL query strings.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org/?abc=123');\nconsole.log(myURL.searchParams.get('abc'));\n// Prints 123\n\nmyURL.searchParams.append('abc', 'xyz');\nconsole.log(myURL.href);\n// Prints https://example.org/?abc=123&#x26;abc=xyz\n\nmyURL.searchParams.delete('abc');\nmyURL.searchParams.set('a', 'b');\nconsole.log(myURL.href);\n// Prints https://example.org/?a=b\n\nconst newSearchParams = new URLSearchParams(myURL.searchParams);\n// The above is equivalent to\n// const newSearchParams = new URLSearchParams(myURL.search);\n\nnewSearchParams.append('a', 'c');\nconsole.log(myURL.href);\n// Prints https://example.org/?a=b\nconsole.log(newSearchParams.toString());\n// Prints a=b&#x26;a=c\n\n// newSearchParams.toString() is implicitly called\nmyURL.search = newSearchParams;\nconsole.log(myURL.href);\n// Prints https://example.org/?a=b&#x26;a=c\nnewSearchParams.delete('a');\nconsole.log(myURL.href);\n// Prints https://example.org/?a=b&#x26;a=c\n</code></pre>",
              "signatures": [
                {
                  "textRaw": "`new URLSearchParams()`",
                  "name": "URLSearchParams",
                  "type": "ctor",
                  "params": [],
                  "desc": "<p>Instantiate a new empty <code>URLSearchParams</code> object.</p>"
                },
                {
                  "textRaw": "`new URLSearchParams(string)`",
                  "name": "URLSearchParams",
                  "type": "ctor",
                  "params": [
                    {
                      "textRaw": "`string` {string} A query string",
                      "name": "string",
                      "type": "string",
                      "desc": "A query string"
                    }
                  ],
                  "desc": "<p>Parse the <code>string</code> as a query string, and use it to instantiate a new\n<code>URLSearchParams</code> object. A leading <code>'?'</code>, if present, is ignored.</p>\n<pre><code class=\"language-js\">let params;\n\nparams = new URLSearchParams('user=abc&#x26;query=xyz');\nconsole.log(params.get('user'));\n// Prints 'abc'\nconsole.log(params.toString());\n// Prints 'user=abc&#x26;query=xyz'\n\nparams = new URLSearchParams('?user=abc&#x26;query=xyz');\nconsole.log(params.toString());\n// Prints 'user=abc&#x26;query=xyz'\n</code></pre>"
                },
                {
                  "textRaw": "`new URLSearchParams(obj)`",
                  "name": "URLSearchParams",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v7.10.0",
                      "v6.13.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`obj` {Object} An object representing a collection of key-value pairs",
                      "name": "obj",
                      "type": "Object",
                      "desc": "An object representing a collection of key-value pairs"
                    }
                  ],
                  "desc": "<p>Instantiate a new <code>URLSearchParams</code> object with a query hash map. The key and\nvalue of each property of <code>obj</code> are always coerced to strings.</p>\n<p>Unlike <a href=\"querystring.html\"><code>querystring</code></a> module, duplicate keys in the form of array values are\nnot allowed. Arrays are stringified using <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString\"><code>array.toString()</code></a>, which simply\njoins all array elements with commas.</p>\n<pre><code class=\"language-js\">const params = new URLSearchParams({\n  user: 'abc',\n  query: ['first', 'second'],\n});\nconsole.log(params.getAll('query'));\n// Prints [ 'first,second' ]\nconsole.log(params.toString());\n// Prints 'user=abc&#x26;query=first%2Csecond'\n</code></pre>"
                },
                {
                  "textRaw": "`new URLSearchParams(iterable)`",
                  "name": "URLSearchParams",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v7.10.0",
                      "v6.13.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "name": "iterable"
                    }
                  ],
                  "desc": "<ul>\n<li><code>iterable</code> {Iterable} An iterable object whose elements are key-value pairs</li>\n</ul>\n<p>Instantiate a new <code>URLSearchParams</code> object with an iterable map in a way that\nis similar to <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>&#x3C;Map></code></a>'s constructor. <code>iterable</code> can be an <code>Array</code> or any\niterable object. That means <code>iterable</code> can be another <code>URLSearchParams</code>, in\nwhich case the constructor will simply create a clone of the provided\n<code>URLSearchParams</code>. Elements of <code>iterable</code> are key-value pairs, and can\nthemselves be any iterable object.</p>\n<p>Duplicate keys are allowed.</p>\n<pre><code class=\"language-js\">let params;\n\n// Using an array\nparams = new URLSearchParams([\n  ['user', 'abc'],\n  ['query', 'first'],\n  ['query', 'second'],\n]);\nconsole.log(params.toString());\n// Prints 'user=abc&#x26;query=first&#x26;query=second'\n\n// Using a Map object\nconst map = new Map();\nmap.set('user', 'abc');\nmap.set('query', 'xyz');\nparams = new URLSearchParams(map);\nconsole.log(params.toString());\n// Prints 'user=abc&#x26;query=xyz'\n\n// Using a generator function\nfunction* getQueryPairs() {\n  yield ['user', 'abc'];\n  yield ['query', 'first'];\n  yield ['query', 'second'];\n}\nparams = new URLSearchParams(getQueryPairs());\nconsole.log(params.toString());\n// Prints 'user=abc&#x26;query=first&#x26;query=second'\n\n// Each key-value pair must have exactly two elements\nnew URLSearchParams([\n  ['user', 'abc', 'error'],\n]);\n// Throws TypeError [ERR_INVALID_TUPLE]:\n//        Each query pair must be an iterable [name, value] tuple\n</code></pre>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`urlSearchParams.append(name, value)`",
                  "name": "append",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        },
                        {
                          "textRaw": "`value` {string}",
                          "name": "value",
                          "type": "string"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Append a new name-value pair to the query string.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.delete(name[, value])`",
                  "name": "delete",
                  "type": "method",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v20.2.0",
                          "v18.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/47885",
                        "description": "Add support for optional `value` argument."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        },
                        {
                          "textRaw": "`value` {string}",
                          "name": "value",
                          "type": "string",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>If <code>value</code> is provided, removes all name-value pairs\nwhere name is <code>name</code> and value is <code>value</code>..</p>\n<p>If <code>value</code> is not provided, removes all name-value pairs whose name is <code>name</code>.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.entries()`",
                  "name": "entries",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Iterator}",
                        "name": "return",
                        "type": "Iterator"
                      }
                    }
                  ],
                  "desc": "<p>Returns an ES6 <code>Iterator</code> over each of the name-value pairs in the query.\nEach item of the iterator is a JavaScript <code>Array</code>. The first item of the <code>Array</code>\nis the <code>name</code>, the second item of the <code>Array</code> is the <code>value</code>.</p>\n<p>Alias for <a href=\"#urlsearchparamssymboliterator\"><code>urlSearchParams[Symbol.iterator]()</code></a>.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.forEach(fn[, thisArg])`",
                  "name": "forEach",
                  "type": "method",
                  "meta": {
                    "changes": [
                      {
                        "version": "v18.0.0",
                        "pr-url": "https://github.com/nodejs/node/pull/41678",
                        "description": "Passing an invalid callback to the `fn` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`fn` {Function} Invoked for each name-value pair in the query",
                          "name": "fn",
                          "type": "Function",
                          "desc": "Invoked for each name-value pair in the query"
                        },
                        {
                          "textRaw": "`thisArg` {Object} To be used as `this` value for when `fn` is called",
                          "name": "thisArg",
                          "type": "Object",
                          "desc": "To be used as `this` value for when `fn` is called",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Iterates over each name-value pair in the query and invokes the given function.</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://example.org/?a=b&#x26;c=d');\nmyURL.searchParams.forEach((value, name, searchParams) => {\n  console.log(name, value, myURL.searchParams === searchParams);\n});\n// Prints:\n//   a b true\n//   c d true\n</code></pre>"
                },
                {
                  "textRaw": "`urlSearchParams.get(name)`",
                  "name": "get",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {string|null} A string or `null` if there is no name-value pair with the given `name`.",
                        "name": "return",
                        "type": "string|null",
                        "desc": "A string or `null` if there is no name-value pair with the given `name`."
                      }
                    }
                  ],
                  "desc": "<p>Returns the value of the first name-value pair whose name is <code>name</code>. If there\nare no such pairs, <code>null</code> is returned.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.getAll(name)`",
                  "name": "getAll",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {string[]}",
                        "name": "return",
                        "type": "string[]"
                      }
                    }
                  ],
                  "desc": "<p>Returns the values of all name-value pairs whose name is <code>name</code>. If there are\nno such pairs, an empty array is returned.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.has(name[, value])`",
                  "name": "has",
                  "type": "method",
                  "meta": {
                    "changes": [
                      {
                        "version": [
                          "v20.2.0",
                          "v18.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/47885",
                        "description": "Add support for optional `value` argument."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        },
                        {
                          "textRaw": "`value` {string}",
                          "name": "value",
                          "type": "string",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {boolean}",
                        "name": "return",
                        "type": "boolean"
                      }
                    }
                  ],
                  "desc": "<p>Checks if the <code>URLSearchParams</code> object contains key-value pair(s) based on\n<code>name</code> and an optional <code>value</code> argument.</p>\n<p>If <code>value</code> is provided, returns <code>true</code> when name-value pair with\nsame <code>name</code> and <code>value</code> exists.</p>\n<p>If <code>value</code> is not provided, returns <code>true</code> if there is at least one name-value\npair whose name is <code>name</code>.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.keys()`",
                  "name": "keys",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Iterator}",
                        "name": "return",
                        "type": "Iterator"
                      }
                    }
                  ],
                  "desc": "<p>Returns an ES6 <code>Iterator</code> over the names of each name-value pair.</p>\n<pre><code class=\"language-js\">const params = new URLSearchParams('foo=bar&#x26;foo=baz');\nfor (const name of params.keys()) {\n  console.log(name);\n}\n// Prints:\n//   foo\n//   foo\n</code></pre>"
                },
                {
                  "textRaw": "`urlSearchParams.set(name, value)`",
                  "name": "set",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        },
                        {
                          "textRaw": "`value` {string}",
                          "name": "value",
                          "type": "string"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Sets the value in the <code>URLSearchParams</code> object associated with <code>name</code> to\n<code>value</code>. If there are any pre-existing name-value pairs whose names are <code>name</code>,\nset the first such pair's value to <code>value</code> and remove all others. If not,\nappend the name-value pair to the query string.</p>\n<pre><code class=\"language-js\">const params = new URLSearchParams();\nparams.append('foo', 'bar');\nparams.append('foo', 'baz');\nparams.append('abc', 'def');\nconsole.log(params.toString());\n// Prints foo=bar&#x26;foo=baz&#x26;abc=def\n\nparams.set('foo', 'def');\nparams.set('xyz', 'opq');\nconsole.log(params.toString());\n// Prints foo=def&#x26;abc=def&#x26;xyz=opq\n</code></pre>"
                },
                {
                  "textRaw": "`urlSearchParams.sort()`",
                  "name": "sort",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v7.7.0",
                      "v6.13.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Sort all existing name-value pairs in-place by their names. Sorting is done\nwith a <a href=\"https://en.wikipedia.org/wiki/Sorting_algorithm#Stability\">stable sorting algorithm</a>, so relative order between name-value pairs\nwith the same name is preserved.</p>\n<p>This method can be used, in particular, to increase cache hits.</p>\n<pre><code class=\"language-js\">const params = new URLSearchParams('query[]=abc&#x26;type=search&#x26;query[]=123');\nparams.sort();\nconsole.log(params.toString());\n// Prints query%5B%5D=abc&#x26;query%5B%5D=123&#x26;type=search\n</code></pre>"
                },
                {
                  "textRaw": "`urlSearchParams.toString()`",
                  "name": "toString",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {string}",
                        "name": "return",
                        "type": "string"
                      }
                    }
                  ],
                  "desc": "<p>Returns the search parameters serialized as a string, with characters\npercent-encoded where necessary.</p>"
                },
                {
                  "textRaw": "`urlSearchParams.values()`",
                  "name": "values",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Iterator}",
                        "name": "return",
                        "type": "Iterator"
                      }
                    }
                  ],
                  "desc": "<p>Returns an ES6 <code>Iterator</code> over the values of each name-value pair.</p>"
                },
                {
                  "textRaw": "`urlSearchParams[Symbol.iterator]()`",
                  "name": "[Symbol.iterator]",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Iterator}",
                        "name": "return",
                        "type": "Iterator"
                      }
                    }
                  ],
                  "desc": "<p>Returns an ES6 <code>Iterator</code> over each of the name-value pairs in the query string.\nEach item of the iterator is a JavaScript <code>Array</code>. The first item of the <code>Array</code>\nis the <code>name</code>, the second item of the <code>Array</code> is the <code>value</code>.</p>\n<p>Alias for <a href=\"#urlsearchparamsentries\"><code>urlSearchParams.entries()</code></a>.</p>\n<pre><code class=\"language-js\">const params = new URLSearchParams('foo=bar&#x26;xyz=baz');\nfor (const [name, value] of params) {\n  console.log(name, value);\n}\n// Prints:\n//   foo bar\n//   xyz baz\n</code></pre>"
                }
              ],
              "properties": [
                {
                  "textRaw": "`urlSearchParams.size`",
                  "name": "size",
                  "type": "property",
                  "meta": {
                    "added": [
                      "v19.8.0",
                      "v18.16.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The total number of parameter entries.</p>"
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`url.domainToASCII(domain)`",
              "name": "domainToASCII",
              "type": "method",
              "meta": {
                "added": [
                  "v7.4.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.0.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47339",
                    "description": "ICU requirement is removed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`domain` {string}",
                      "name": "domain",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Returns the <a href=\"https://tools.ietf.org/html/rfc5891#section-4.4\">Punycode</a> ASCII serialization of the <code>domain</code>. If <code>domain</code> is an\ninvalid domain, the empty string is returned.</p>\n<p>It performs the inverse operation to <a href=\"#urldomaintounicodedomain\"><code>url.domainToUnicode()</code></a>.</p>\n<pre><code class=\"language-mjs\">import url from 'node:url';\n\nconsole.log(url.domainToASCII('español.com'));\n// Prints xn--espaol-zwa.com\nconsole.log(url.domainToASCII('中文.com'));\n// Prints xn--fiq228c.com\nconsole.log(url.domainToASCII('xn--iñvalid.com'));\n// Prints an empty string\n</code></pre>\n<pre><code class=\"language-cjs\">const url = require('node:url');\n\nconsole.log(url.domainToASCII('español.com'));\n// Prints xn--espaol-zwa.com\nconsole.log(url.domainToASCII('中文.com'));\n// Prints xn--fiq228c.com\nconsole.log(url.domainToASCII('xn--iñvalid.com'));\n// Prints an empty string\n</code></pre>"
            },
            {
              "textRaw": "`url.domainToUnicode(domain)`",
              "name": "domainToUnicode",
              "type": "method",
              "meta": {
                "added": [
                  "v7.4.0",
                  "v6.13.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v20.0.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47339",
                    "description": "ICU requirement is removed."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`domain` {string}",
                      "name": "domain",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Returns the Unicode serialization of the <code>domain</code>. If <code>domain</code> is an invalid\ndomain, the empty string is returned.</p>\n<p>It performs the inverse operation to <a href=\"#urldomaintoasciidomain\"><code>url.domainToASCII()</code></a>.</p>\n<pre><code class=\"language-mjs\">import url from 'node:url';\n\nconsole.log(url.domainToUnicode('xn--espaol-zwa.com'));\n// Prints español.com\nconsole.log(url.domainToUnicode('xn--fiq228c.com'));\n// Prints 中文.com\nconsole.log(url.domainToUnicode('xn--iñvalid.com'));\n// Prints an empty string\n</code></pre>\n<pre><code class=\"language-cjs\">const url = require('node:url');\n\nconsole.log(url.domainToUnicode('xn--espaol-zwa.com'));\n// Prints español.com\nconsole.log(url.domainToUnicode('xn--fiq228c.com'));\n// Prints 中文.com\nconsole.log(url.domainToUnicode('xn--iñvalid.com'));\n// Prints an empty string\n</code></pre>"
            },
            {
              "textRaw": "`url.fileURLToPath(url[, options])`",
              "name": "fileURLToPath",
              "type": "method",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.1.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52509",
                    "description": "The `options` argument can now be used to determine how to parse the `path` argument."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`url` {URL|string} The file URL string or URL object to convert to a path.",
                      "name": "url",
                      "type": "URL|string",
                      "desc": "The file URL string or URL object to convert to a path."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`windows` {boolean|undefined} `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. **Default:** `undefined`.",
                          "name": "windows",
                          "type": "boolean|undefined",
                          "default": "`undefined`",
                          "desc": "`true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string} The fully-resolved platform-specific Node.js file path.",
                    "name": "return",
                    "type": "string",
                    "desc": "The fully-resolved platform-specific Node.js file path."
                  }
                }
              ],
              "desc": "<p>This function ensures the correct decodings of percent-encoded characters as\nwell as ensuring a cross-platform valid absolute path string.</p>\n<p><strong>Security Considerations:</strong></p>\n<p>This function decodes percent-encoded characters, including encoded dot-segments\n(<code>%2e</code> as <code>.</code> and <code>%2e%2e</code> as <code>..</code>), and then normalizes the resulting path.\nThis means that encoded directory traversal sequences (such as <code>%2e%2e</code>) are\ndecoded and processed as actual path traversal, even though encoded slashes\n(<code>%2F</code>, <code>%5C</code>) are correctly rejected.</p>\n<p><strong>Applications must not rely on <code>fileURLToPath()</code> alone to prevent directory\ntraversal attacks.</strong> Always perform explicit path validation and security checks\non the returned path value to ensure it remains within expected boundaries\nbefore using it for file system operations.</p>\n<pre><code class=\"language-mjs\">import { fileURLToPath } from 'node:url';\n\nconst __filename = fileURLToPath(import.meta.url);\n\nnew URL('file:///C:/path/').pathname;      // Incorrect: /C:/path/\nfileURLToPath('file:///C:/path/');         // Correct:   C:\\path\\ (Windows)\n\nnew URL('file://nas/foo.txt').pathname;    // Incorrect: /foo.txt\nfileURLToPath('file://nas/foo.txt');       // Correct:   \\\\nas\\foo.txt (Windows)\n\nnew URL('file:///你好.txt').pathname;      // Incorrect: /%E4%BD%A0%E5%A5%BD.txt\nfileURLToPath('file:///你好.txt');         // Correct:   /你好.txt (POSIX)\n\nnew URL('file:///hello world').pathname;   // Incorrect: /hello%20world\nfileURLToPath('file:///hello world');      // Correct:   /hello world (POSIX)\n</code></pre>\n<pre><code class=\"language-cjs\">const { fileURLToPath } = require('node:url');\nnew URL('file:///C:/path/').pathname;      // Incorrect: /C:/path/\nfileURLToPath('file:///C:/path/');         // Correct:   C:\\path\\ (Windows)\n\nnew URL('file://nas/foo.txt').pathname;    // Incorrect: /foo.txt\nfileURLToPath('file://nas/foo.txt');       // Correct:   \\\\nas\\foo.txt (Windows)\n\nnew URL('file:///你好.txt').pathname;      // Incorrect: /%E4%BD%A0%E5%A5%BD.txt\nfileURLToPath('file:///你好.txt');         // Correct:   /你好.txt (POSIX)\n\nnew URL('file:///hello world').pathname;   // Incorrect: /hello%20world\nfileURLToPath('file:///hello world');      // Correct:   /hello world (POSIX)\n</code></pre>"
            },
            {
              "textRaw": "`url.fileURLToPathBuffer(url[, options])`",
              "name": "fileURLToPathBuffer",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`url` {URL|string} The file URL string or URL object to convert to a path.",
                      "name": "url",
                      "type": "URL|string",
                      "desc": "The file URL string or URL object to convert to a path."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`windows` {boolean|undefined} `true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default. **Default:** `undefined`.",
                          "name": "windows",
                          "type": "boolean|undefined",
                          "default": "`undefined`",
                          "desc": "`true` if the `path` should be return as a windows filepath, `false` for posix, and `undefined` for the system default."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer} The fully-resolved platform-specific Node.js file path as a {Buffer}.",
                    "name": "return",
                    "type": "Buffer",
                    "desc": "The fully-resolved platform-specific Node.js file path as a {Buffer}."
                  }
                }
              ],
              "desc": "<!--\nadded:\n - v24.3.0\n - v22.18.0\n-->\n<p>Like <code>url.fileURLToPath(...)</code> except that instead of returning a string\nrepresentation of the path, a <code>Buffer</code> is returned. This conversion is\nhelpful when the input URL contains percent-encoded segments that are\nnot valid UTF-8 / Unicode sequences.</p>\n<p><strong>Security Considerations:</strong></p>\n<p>This function has the same security considerations as <a href=\"#urlfileurltopathurl-options\"><code>url.fileURLToPath()</code></a>.\nIt decodes percent-encoded characters, including encoded dot-segments\n(<code>%2e</code> as <code>.</code> and <code>%2e%2e</code> as <code>..</code>), and normalizes the path. <strong>Applications\nmust not rely on this function alone to prevent directory traversal attacks.</strong>\nAlways perform explicit path validation on the returned buffer value before\nusing it for file system operations.</p>"
            },
            {
              "textRaw": "`url.format(URL[, options])`",
              "name": "format",
              "type": "method",
              "meta": {
                "added": [
                  "v7.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`URL` {URL} A WHATWG URL object",
                      "name": "URL",
                      "type": "URL",
                      "desc": "A WHATWG URL object"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`auth` {boolean} `true` if the serialized URL string should include the username and password, `false` otherwise. **Default:** `true`.",
                          "name": "auth",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "`true` if the serialized URL string should include the username and password, `false` otherwise."
                        },
                        {
                          "textRaw": "`fragment` {boolean} `true` if the serialized URL string should include the fragment, `false` otherwise. **Default:** `true`.",
                          "name": "fragment",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "`true` if the serialized URL string should include the fragment, `false` otherwise."
                        },
                        {
                          "textRaw": "`search` {boolean} `true` if the serialized URL string should include the search query, `false` otherwise. **Default:** `true`.",
                          "name": "search",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "`true` if the serialized URL string should include the search query, `false` otherwise."
                        },
                        {
                          "textRaw": "`unicode` {boolean} `true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to being Punycode encoded. **Default:** `false`.",
                          "name": "unicode",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "`true` if Unicode characters appearing in the host component of the URL string should be encoded directly as opposed to being Punycode encoded."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Returns a customizable serialization of a URL <code>String</code> representation of a\n<a href=\"#the-whatwg-url-api\">WHATWG URL</a> object.</p>\n<p>The URL object has both a <code>toString()</code> method and <code>href</code> property that return\nstring serializations of the URL. These are not, however, customizable in\nany way. The <code>url.format(URL[, options])</code> method allows for basic customization\nof the output.</p>\n<pre><code class=\"language-mjs\">import url from 'node:url';\nconst myURL = new URL('https://a:b@測試?abc#foo');\n\nconsole.log(myURL.href);\n// Prints https://a:b@xn--g6w251d/?abc#foo\n\nconsole.log(myURL.toString());\n// Prints https://a:b@xn--g6w251d/?abc#foo\n\nconsole.log(url.format(myURL, { fragment: false, unicode: true, auth: false }));\n// Prints 'https://測試/?abc'\n</code></pre>\n<pre><code class=\"language-cjs\">const url = require('node:url');\nconst myURL = new URL('https://a:b@測試?abc#foo');\n\nconsole.log(myURL.href);\n// Prints https://a:b@xn--g6w251d/?abc#foo\n\nconsole.log(myURL.toString());\n// Prints https://a:b@xn--g6w251d/?abc#foo\n\nconsole.log(url.format(myURL, { fragment: false, unicode: true, auth: false }));\n// Prints 'https://測試/?abc'\n</code></pre>"
            },
            {
              "textRaw": "`url.pathToFileURL(path[, options])`",
              "name": "pathToFileURL",
              "type": "method",
              "meta": {
                "added": [
                  "v10.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.1.0",
                      "v20.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/52509",
                    "description": "The `options` argument can now be used to determine how to return the `path` value."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`path` {string} The path to convert to a File URL.",
                      "name": "path",
                      "type": "string",
                      "desc": "The path to convert to a File URL."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`windows` {boolean|undefined} `true` if the `path` should be treated as a windows filepath, `false` for posix, and `undefined` for the system default. **Default:** `undefined`.",
                          "name": "windows",
                          "type": "boolean|undefined",
                          "default": "`undefined`",
                          "desc": "`true` if the `path` should be treated as a windows filepath, `false` for posix, and `undefined` for the system default."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {URL} The file URL object.",
                    "name": "return",
                    "type": "URL",
                    "desc": "The file URL object."
                  }
                }
              ],
              "desc": "<p>This function ensures that <code>path</code> is resolved absolutely, and that the URL\ncontrol characters are correctly encoded when converting into a File URL.</p>\n<pre><code class=\"language-mjs\">import { pathToFileURL } from 'node:url';\n\nnew URL('/foo#1', 'file:');           // Incorrect: file:///foo#1\npathToFileURL('/foo#1');              // Correct:   file:///foo%231 (POSIX)\n\nnew URL('/some/path%.c', 'file:');    // Incorrect: file:///some/path%.c\npathToFileURL('/some/path%.c');       // Correct:   file:///some/path%25.c (POSIX)\n</code></pre>\n<pre><code class=\"language-cjs\">const { pathToFileURL } = require('node:url');\nnew URL(__filename);                  // Incorrect: throws (POSIX)\nnew URL(__filename);                  // Incorrect: C:\\... (Windows)\npathToFileURL(__filename);            // Correct:   file:///... (POSIX)\npathToFileURL(__filename);            // Correct:   file:///C:/... (Windows)\n\nnew URL('/foo#1', 'file:');           // Incorrect: file:///foo#1\npathToFileURL('/foo#1');              // Correct:   file:///foo%231 (POSIX)\n\nnew URL('/some/path%.c', 'file:');    // Incorrect: file:///some/path%.c\npathToFileURL('/some/path%.c');       // Correct:   file:///some/path%25.c (POSIX)\n</code></pre>"
            },
            {
              "textRaw": "`url.urlToHttpOptions(url)`",
              "name": "urlToHttpOptions",
              "type": "method",
              "meta": {
                "added": [
                  "v15.7.0",
                  "v14.18.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.9.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46989",
                    "description": "The returned object will also contain all the own enumerable properties of the `url` argument."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`url` {URL} The WHATWG URL object to convert to an options object.",
                      "name": "url",
                      "type": "URL",
                      "desc": "The WHATWG URL object to convert to an options object."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} Options object",
                    "name": "return",
                    "type": "Object",
                    "desc": "Options object",
                    "options": [
                      {
                        "textRaw": "`protocol` {string} Protocol to use.",
                        "name": "protocol",
                        "type": "string",
                        "desc": "Protocol to use."
                      },
                      {
                        "textRaw": "`hostname` {string} A domain name or IP address of the server to issue the request to.",
                        "name": "hostname",
                        "type": "string",
                        "desc": "A domain name or IP address of the server to issue the request to."
                      },
                      {
                        "textRaw": "`hash` {string} The fragment portion of the URL.",
                        "name": "hash",
                        "type": "string",
                        "desc": "The fragment portion of the URL."
                      },
                      {
                        "textRaw": "`search` {string} The serialized query portion of the URL.",
                        "name": "search",
                        "type": "string",
                        "desc": "The serialized query portion of the URL."
                      },
                      {
                        "textRaw": "`pathname` {string} The path portion of the URL.",
                        "name": "pathname",
                        "type": "string",
                        "desc": "The path portion of the URL."
                      },
                      {
                        "textRaw": "`path` {string} Request path. Should include query string if any. E.G. `'/index.html?page=12'`. An exception is thrown when the request path contains illegal characters. Currently, only spaces are rejected but that may change in the future.",
                        "name": "path",
                        "type": "string",
                        "desc": "Request path. Should include query string if any. E.G. `'/index.html?page=12'`. An exception is thrown when the request path contains illegal characters. Currently, only spaces are rejected but that may change in the future."
                      },
                      {
                        "textRaw": "`href` {string} The serialized URL.",
                        "name": "href",
                        "type": "string",
                        "desc": "The serialized URL."
                      },
                      {
                        "textRaw": "`port` {number} Port of remote server.",
                        "name": "port",
                        "type": "number",
                        "desc": "Port of remote server."
                      },
                      {
                        "textRaw": "`auth` {string} Basic authentication i.e. `'user:password'` to compute an Authorization header.",
                        "name": "auth",
                        "type": "string",
                        "desc": "Basic authentication i.e. `'user:password'` to compute an Authorization header."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>This utility function converts a URL object into an ordinary options object as\nexpected by the <a href=\"http.html#httprequestoptions-callback\"><code>http.request()</code></a> and <a href=\"https.html#httpsrequestoptions-callback\"><code>https.request()</code></a> APIs.</p>\n<pre><code class=\"language-mjs\">import { urlToHttpOptions } from 'node:url';\nconst myURL = new URL('https://a:b@測試?abc#foo');\n\nconsole.log(urlToHttpOptions(myURL));\n/*\n{\n  protocol: 'https:',\n  hostname: 'xn--g6w251d',\n  hash: '#foo',\n  search: '?abc',\n  pathname: '/',\n  path: '/?abc',\n  href: 'https://a:b@xn--g6w251d/?abc#foo',\n  auth: 'a:b'\n}\n*/\n</code></pre>\n<pre><code class=\"language-cjs\">const { urlToHttpOptions } = require('node:url');\nconst myURL = new URL('https://a:b@測試?abc#foo');\n\nconsole.log(urlToHttpOptions(myURL));\n/*\n{\n  protocol: 'https:',\n  hostname: 'xn--g6w251d',\n  hash: '#foo',\n  search: '?abc',\n  pathname: '/',\n  path: '/?abc',\n  href: 'https://a:b@xn--g6w251d/?abc#foo',\n  auth: 'a:b'\n}\n*/\n</code></pre>"
            }
          ],
          "displayName": "The WHATWG URL API"
        },
        {
          "textRaw": "Legacy URL API",
          "name": "legacy_url_api",
          "type": "module",
          "meta": {
            "changes": [
              {
                "version": [
                  "v15.13.0",
                  "v14.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/37784",
                "description": "Deprecation revoked. Status changed to \"Legacy\"."
              },
              {
                "version": "v11.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/22715",
                "description": "This API is deprecated."
              }
            ]
          },
          "stability": 3,
          "stabilityText": "Legacy: Use the WHATWG URL API instead.",
          "modules": [
            {
              "textRaw": "Legacy `urlObject`",
              "name": "legacy_`urlobject`",
              "type": "module",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v15.13.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37784",
                    "description": "Deprecation revoked. Status changed to \"Legacy\"."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22715",
                    "description": "The Legacy URL API is deprecated. Use the WHATWG URL API."
                  }
                ]
              },
              "desc": "<p>The legacy <code>urlObject</code> (<code>require('node:url').Url</code> or\n<code>import { Url } from 'node:url'</code>) is\ncreated and returned by the <code>url.parse()</code> function.</p>",
              "properties": [
                {
                  "textRaw": "`urlObject.auth`",
                  "name": "auth",
                  "type": "property",
                  "desc": "<p>The <code>auth</code> property is the username and password portion of the URL, also\nreferred to as <em>userinfo</em>. This string subset follows the <code>protocol</code> and\ndouble slashes (if present) and precedes the <code>host</code> component, delimited by <code>@</code>.\nThe string is either the username, or it is the username and password separated\nby <code>:</code>.</p>\n<p>For example: <code>'user:pass'</code>.</p>"
                },
                {
                  "textRaw": "`urlObject.hash`",
                  "name": "hash",
                  "type": "property",
                  "desc": "<p>The <code>hash</code> property is the fragment identifier portion of the URL including the\nleading <code>#</code> character.</p>\n<p>For example: <code>'#hash'</code>.</p>"
                },
                {
                  "textRaw": "`urlObject.host`",
                  "name": "host",
                  "type": "property",
                  "desc": "<p>The <code>host</code> property is the full lower-cased host portion of the URL, including\nthe <code>port</code> if specified.</p>\n<p>For example: <code>'sub.example.com:8080'</code>.</p>"
                },
                {
                  "textRaw": "`urlObject.hostname`",
                  "name": "hostname",
                  "type": "property",
                  "desc": "<p>The <code>hostname</code> property is the lower-cased host name portion of the <code>host</code>\ncomponent <em>without</em> the <code>port</code> included.</p>\n<p>For example: <code>'sub.example.com'</code>.</p>"
                },
                {
                  "textRaw": "`urlObject.href`",
                  "name": "href",
                  "type": "property",
                  "desc": "<p>The <code>href</code> property is the full URL string that was parsed with both the\n<code>protocol</code> and <code>host</code> components converted to lower-case.</p>\n<p>For example: <code>'http://user:pass@sub.example.com:8080/p/a/t/h?query=string#hash'</code>.</p>"
                },
                {
                  "textRaw": "`urlObject.path`",
                  "name": "path",
                  "type": "property",
                  "desc": "<p>The <code>path</code> property is a concatenation of the <code>pathname</code> and <code>search</code>\ncomponents.</p>\n<p>For example: <code>'/p/a/t/h?query=string'</code>.</p>\n<p>No decoding of the <code>path</code> is performed.</p>"
                },
                {
                  "textRaw": "`urlObject.pathname`",
                  "name": "pathname",
                  "type": "property",
                  "desc": "<p>The <code>pathname</code> property consists of the entire path section of the URL. This\nis everything following the <code>host</code> (including the <code>port</code>) and before the start\nof the <code>query</code> or <code>hash</code> components, delimited by either the ASCII question\nmark (<code>?</code>) or hash (<code>#</code>) characters.</p>\n<p>For example: <code>'/p/a/t/h'</code>.</p>\n<p>No decoding of the path string is performed.</p>"
                },
                {
                  "textRaw": "`urlObject.port`",
                  "name": "port",
                  "type": "property",
                  "desc": "<p>The <code>port</code> property is the numeric port portion of the <code>host</code> component.</p>\n<p>For example: <code>'8080'</code>.</p>"
                },
                {
                  "textRaw": "`urlObject.protocol`",
                  "name": "protocol",
                  "type": "property",
                  "desc": "<p>The <code>protocol</code> property identifies the URL's lower-cased protocol scheme.</p>\n<p>For example: <code>'http:'</code>.</p>"
                },
                {
                  "textRaw": "`urlObject.query`",
                  "name": "query",
                  "type": "property",
                  "desc": "<p>The <code>query</code> property is either the query string without the leading ASCII\nquestion mark (<code>?</code>), or an object returned by the <a href=\"querystring.html\"><code>querystring</code></a> module's\n<code>parse()</code> method. Whether the <code>query</code> property is a string or object is\ndetermined by the <code>parseQueryString</code> argument passed to <code>url.parse()</code>.</p>\n<p>For example: <code>'query=string'</code> or <code>{'query': 'string'}</code>.</p>\n<p>If returned as a string, no decoding of the query string is performed. If\nreturned as an object, both keys and values are decoded.</p>"
                },
                {
                  "textRaw": "`urlObject.search`",
                  "name": "search",
                  "type": "property",
                  "desc": "<p>The <code>search</code> property consists of the entire \"query string\" portion of the\nURL, including the leading ASCII question mark (<code>?</code>) character.</p>\n<p>For example: <code>'?query=string'</code>.</p>\n<p>No decoding of the query string is performed.</p>"
                },
                {
                  "textRaw": "`urlObject.slashes`",
                  "name": "slashes",
                  "type": "property",
                  "desc": "<p>The <code>slashes</code> property is a <code>boolean</code> with a value of <code>true</code> if two ASCII\nforward-slash characters (<code>/</code>) are required following the colon in the\n<code>protocol</code>.</p>"
                }
              ],
              "displayName": "Legacy `urlObject`"
            }
          ],
          "methods": [
            {
              "textRaw": "`url.format(urlObject)`",
              "name": "format",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.25"
                ],
                "changes": [
                  {
                    "version": "v17.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/38631",
                    "description": "Now throws an `ERR_INVALID_URL` exception when Punycode conversion of a hostname introduces changes that could cause the URL to be re-parsed differently."
                  },
                  {
                    "version": [
                      "v15.13.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37784",
                    "description": "Deprecation revoked. Status changed to \"Legacy\"."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22715",
                    "description": "The Legacy URL API is deprecated. Use the WHATWG URL API."
                  },
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/7234",
                    "description": "URLs with a `file:` scheme will now always use the correct number of slashes regardless of `slashes` option. A falsy `slashes` option with no protocol is now also respected at all times."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`urlObject` {Object} A URL object (as returned by `url.parse()` or constructed otherwise).",
                      "name": "urlObject",
                      "type": "Object",
                      "desc": "A URL object (as returned by `url.parse()` or constructed otherwise)."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>url.format()</code> method returns a formatted URL string derived from\n<code>urlObject</code>.</p>\n<pre><code class=\"language-js\">const url = require('node:url');\nurl.format({\n  protocol: 'https',\n  hostname: 'example.com',\n  pathname: '/some/path',\n  query: {\n    page: 1,\n    format: 'json',\n  },\n});\n\n// => 'https://example.com/some/path?page=1&#x26;format=json'\n</code></pre>\n<p>If <code>urlObject</code> is not an object or a string, <code>url.format()</code> will throw a\n<a href=\"errors.html#class-typeerror\"><code>TypeError</code></a>.</p>\n<p>The formatting process operates as follows:</p>\n<ul>\n<li>A new empty string <code>result</code> is created.</li>\n<li>If <code>urlObject.protocol</code> is a string, it is appended as-is to <code>result</code>.</li>\n<li>Otherwise, if <code>urlObject.protocol</code> is not <code>undefined</code> and is not a string, an\n<a href=\"errors.html#class-error\"><code>Error</code></a> is thrown.</li>\n<li>For all string values of <code>urlObject.protocol</code> that <em>do not end</em> with an ASCII\ncolon (<code>:</code>) character, the literal string <code>:</code> will be appended to <code>result</code>.</li>\n<li>If either of the following conditions is true, then the literal string <code>//</code>\nwill be appended to <code>result</code>:\n<ul>\n<li><code>urlObject.slashes</code> property is true;</li>\n<li><code>urlObject.protocol</code> begins with <code>http</code>, <code>https</code>, <code>ftp</code>, <code>gopher</code>, or\n<code>file</code>;</li>\n</ul>\n</li>\n<li>If the value of the <code>urlObject.auth</code> property is truthy, and either\n<code>urlObject.host</code> or <code>urlObject.hostname</code> are not <code>undefined</code>, the value of\n<code>urlObject.auth</code> will be coerced into a string and appended to <code>result</code>\nfollowed by the literal string <code>@</code>.</li>\n<li>If the <code>urlObject.host</code> property is <code>undefined</code> then:\n<ul>\n<li>If the <code>urlObject.hostname</code> is a string, it is appended to <code>result</code>.</li>\n<li>Otherwise, if <code>urlObject.hostname</code> is not <code>undefined</code> and is not a string,\nan <a href=\"errors.html#class-error\"><code>Error</code></a> is thrown.</li>\n<li>If the <code>urlObject.port</code> property value is truthy, and <code>urlObject.hostname</code>\nis not <code>undefined</code>:\n<ul>\n<li>The literal string <code>:</code> is appended to <code>result</code>, and</li>\n<li>The value of <code>urlObject.port</code> is coerced to a string and appended to\n<code>result</code>.</li>\n</ul>\n</li>\n</ul>\n</li>\n<li>Otherwise, if the <code>urlObject.host</code> property value is truthy, the value of\n<code>urlObject.host</code> is coerced to a string and appended to <code>result</code>.</li>\n<li>If the <code>urlObject.pathname</code> property is a string that is not an empty string:\n<ul>\n<li>If the <code>urlObject.pathname</code> <em>does not start</em> with an ASCII forward slash\n(<code>/</code>), then the literal string <code>'/'</code> is appended to <code>result</code>.</li>\n<li>The value of <code>urlObject.pathname</code> is appended to <code>result</code>.</li>\n</ul>\n</li>\n<li>Otherwise, if <code>urlObject.pathname</code> is not <code>undefined</code> and is not a string, an\n<a href=\"errors.html#class-error\"><code>Error</code></a> is thrown.</li>\n<li>If the <code>urlObject.search</code> property is <code>undefined</code> and if the <code>urlObject.query</code>\nproperty is an <code>Object</code>, the literal string <code>?</code> is appended to <code>result</code>\nfollowed by the output of calling the <a href=\"querystring.html\"><code>querystring</code></a> module's <code>stringify()</code>\nmethod passing the value of <code>urlObject.query</code>.</li>\n<li>Otherwise, if <code>urlObject.search</code> is a string:\n<ul>\n<li>If the value of <code>urlObject.search</code> <em>does not start</em> with the ASCII question\nmark (<code>?</code>) character, the literal string <code>?</code> is appended to <code>result</code>.</li>\n<li>The value of <code>urlObject.search</code> is appended to <code>result</code>.</li>\n</ul>\n</li>\n<li>Otherwise, if <code>urlObject.search</code> is not <code>undefined</code> and is not a string, an\n<a href=\"errors.html#class-error\"><code>Error</code></a> is thrown.</li>\n<li>If the <code>urlObject.hash</code> property is a string:\n<ul>\n<li>If the value of <code>urlObject.hash</code> <em>does not start</em> with the ASCII hash (<code>#</code>)\ncharacter, the literal string <code>#</code> is appended to <code>result</code>.</li>\n<li>The value of <code>urlObject.hash</code> is appended to <code>result</code>.</li>\n</ul>\n</li>\n<li>Otherwise, if the <code>urlObject.hash</code> property is not <code>undefined</code> and is not a\nstring, an <a href=\"errors.html#class-error\"><code>Error</code></a> is thrown.</li>\n<li><code>result</code> is returned.</li>\n</ul>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/node-url-to-whatwg-url\">source</a>).</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/node-url-to-whatwg-url\n</code></pre>"
            },
            {
              "textRaw": "`url.format(urlString)`",
              "name": "format",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.25"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55017",
                    "description": "Application deprecation."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use the WHATWG URL API instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`urlString` {string} A string that will be passed to `url.parse()` and then formatted.",
                      "name": "urlString",
                      "type": "string",
                      "desc": "A string that will be passed to `url.parse()` and then formatted."
                    }
                  ]
                }
              ],
              "desc": "<p><code>url.format(urlString)</code> is shorthand for <code>url.format(url.parse(urlString))</code>.</p>\n<p>Because it invokes the deprecated <a href=\"#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a> internally, passing a string argument\nto <code>url.format()</code> is itself deprecated.</p>\n<p>Canonicalizing a URL string can be performed using the WHATWG URL API, by\nconstructing a new URL object and calling <a href=\"#urltostring\"><code>url.toString()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { URL } from 'node:url';\n\nconst unformatted = 'http://[fe80:0:0:0:0:0:0:1]:/a/b?a=b#abc';\nconst formatted = new URL(unformatted).toString();\n\nconsole.log(formatted); // Prints: http://[fe80::1]/a/b?a=b#abc\n</code></pre>\n<pre><code class=\"language-cjs\">const { URL } = require('node:url');\n\nconst unformatted = 'http://[fe80:0:0:0:0:0:0:1]:/a/b?a=b#abc';\nconst formatted = new URL(unformatted).toString();\n\nconsole.log(formatted); // Prints: http://[fe80::1]/a/b?a=b#abc\n</code></pre>"
            },
            {
              "textRaw": "`url.parse(urlString[, parseQueryString[, slashesDenoteHost]])`",
              "name": "parse",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.25"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55017",
                    "description": "Application deprecation."
                  },
                  {
                    "version": [
                      "v19.9.0",
                      "v18.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/47203",
                    "description": "Added support for `--pending-deprecation`."
                  },
                  {
                    "version": [
                      "v19.0.0",
                      "v18.13.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/44919",
                    "description": "Documentation-only deprecation."
                  },
                  {
                    "version": [
                      "v15.13.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37784",
                    "description": "Deprecation revoked. Status changed to \"Legacy\"."
                  },
                  {
                    "version": "v11.14.0",
                    "pr-url": "https://github.com/nodejs/node/pull/26941",
                    "description": "The `pathname` property on the returned URL object is now `/` when there is no path and the protocol scheme is `ws:` or `wss:`."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22715",
                    "description": "The Legacy URL API is deprecated. Use the WHATWG URL API."
                  },
                  {
                    "version": "v9.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/13606",
                    "description": "The `search` property on the returned URL object is now `null` when no query string is present."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use the WHATWG URL API instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`urlString` {string} The URL string to parse.",
                      "name": "urlString",
                      "type": "string",
                      "desc": "The URL string to parse."
                    },
                    {
                      "textRaw": "`parseQueryString` {boolean} If `true`, the `query` property will always be set to an object returned by the `querystring` module's `parse()` method. If `false`, the `query` property on the returned URL object will be an unparsed, undecoded string. **Default:** `false`.",
                      "name": "parseQueryString",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, the `query` property will always be set to an object returned by the `querystring` module's `parse()` method. If `false`, the `query` property on the returned URL object will be an unparsed, undecoded string.",
                      "optional": true
                    },
                    {
                      "textRaw": "`slashesDenoteHost` {boolean} If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`. **Default:** `false`.",
                      "name": "slashesDenoteHost",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, the first token after the literal string `//` and preceding the next `/` will be interpreted as the `host`. For instance, given `//foo/bar`, the result would be `{host: 'foo', pathname: '/bar'}` rather than `{pathname: '//foo/bar'}`.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>url.parse()</code> method takes a URL string, parses it, and returns a URL\nobject.</p>\n<p>A <code>TypeError</code> is thrown if <code>urlString</code> is not a string.</p>\n<p>A <code>URIError</code> is thrown if the <code>auth</code> property is present but cannot be decoded.</p>\n<p><code>url.parse()</code> uses a lenient, non-standard algorithm for parsing URL\nstrings. It is prone to security issues such as <a href=\"https://hackerone.com/reports/678487\">host name spoofing</a>\nand incorrect handling of usernames and passwords. Do not use with untrusted\ninput. CVEs are not issued for <code>url.parse()</code> vulnerabilities. Use the\n<a href=\"#the-whatwg-url-api\">WHATWG URL</a> API instead, for example:</p>\n<pre><code class=\"language-js\">function getURL(req) {\n  const proto = req.headers['x-forwarded-proto'] || 'https';\n  const host = req.headers['x-forwarded-host'] || req.headers.host || 'example.com';\n  return new URL(`${proto}://${host}${req.url || '/'}`);\n}\n</code></pre>\n<p>The example above assumes well-formed headers are forwarded from a reverse\nproxy to your Node.js server. If you are not using a reverse proxy, you should\nuse the example below:</p>\n<pre><code class=\"language-js\">function getURL(req) {\n  return new URL(`https://example.com${req.url || '/'}`);\n}\n</code></pre>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/node-url-to-whatwg-url\">source</a>).</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/node-url-to-whatwg-url\n</code></pre>"
            },
            {
              "textRaw": "`url.resolve(from, to)`",
              "name": "resolve",
              "type": "method",
              "meta": {
                "added": [
                  "v0.1.25"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/55017",
                    "description": "Deprecated again through DEP0169."
                  },
                  {
                    "version": [
                      "v15.13.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37784",
                    "description": "Deprecation revoked. Status changed to \"Legacy\"."
                  },
                  {
                    "version": "v11.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/22715",
                    "description": "The Legacy URL API is deprecated. Use the WHATWG URL API."
                  },
                  {
                    "version": "v6.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8215",
                    "description": "The `auth` fields are now kept intact when `from` and `to` refer to the same host."
                  },
                  {
                    "version": [
                      "v6.5.0",
                      "v4.6.2"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/8214",
                    "description": "The `port` field is copied correctly now."
                  },
                  {
                    "version": "v6.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/1480",
                    "description": "The `auth` fields is cleared now the `to` parameter contains a hostname."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use the WHATWG URL API instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`from` {string} The base URL to use if `to` is a relative URL.",
                      "name": "from",
                      "type": "string",
                      "desc": "The base URL to use if `to` is a relative URL."
                    },
                    {
                      "textRaw": "`to` {string} The target URL to resolve.",
                      "name": "to",
                      "type": "string",
                      "desc": "The target URL to resolve."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>url.resolve()</code> method resolves a target URL relative to a base URL in a\nmanner similar to that of a web browser resolving an anchor tag.</p>\n<pre><code class=\"language-js\">const url = require('node:url');\nurl.resolve('/one/two/three', 'four');         // '/one/two/four'\nurl.resolve('http://example.com/', '/one');    // 'http://example.com/one'\nurl.resolve('http://example.com/one', '/two'); // 'http://example.com/two'\n</code></pre>\n<p>Because it invokes the deprecated <a href=\"#urlparseurlstring-parsequerystring-slashesdenotehost\"><code>url.parse()</code></a> internally, <code>url.resolve()</code> is itself deprecated.</p>\n<p>To achieve the same result using the WHATWG URL API:</p>\n<pre><code class=\"language-js\">function resolve(from, to) {\n  const resolvedUrl = new URL(to, new URL(from, 'resolve://'));\n  if (resolvedUrl.protocol === 'resolve:') {\n    // `from` is a relative URL.\n    const { pathname, search, hash } = resolvedUrl;\n    return pathname + search + hash;\n  }\n  return resolvedUrl.toString();\n}\n\nresolve('/one/two/three', 'four');         // '/one/two/four'\nresolve('http://example.com/', '/one');    // 'http://example.com/one'\nresolve('http://example.com/one', '/two'); // 'http://example.com/two'\n</code></pre>\n<p><a id=\"whatwg-percent-encoding\"></a></p>"
            }
          ],
          "displayName": "Legacy URL API"
        },
        {
          "textRaw": "Percent-encoding in URLs",
          "name": "percent-encoding_in_urls",
          "type": "module",
          "desc": "<p>URLs are permitted to only contain a certain range of characters. Any character\nfalling outside of that range must be encoded. How such characters are encoded,\nand which characters to encode depends entirely on where the character is\nlocated within the structure of the URL.</p>",
          "modules": [
            {
              "textRaw": "Legacy API",
              "name": "legacy_api",
              "type": "module",
              "desc": "<p>Within the Legacy API, spaces (<code>' '</code>) and the following characters will be\nautomatically escaped in the properties of URL objects:</p>\n<pre><code class=\"language-text\">&#x3C; > \" ` \\r \\n \\t { } | \\ ^ '\n</code></pre>\n<p>For example, the ASCII space character (<code>' '</code>) is encoded as <code>%20</code>. The ASCII\nforward slash (<code>/</code>) character is encoded as <code>%3C</code>.</p>",
              "displayName": "Legacy API"
            },
            {
              "textRaw": "WHATWG API",
              "name": "whatwg_api",
              "type": "module",
              "desc": "<p>The <a href=\"https://url.spec.whatwg.org/\">WHATWG URL Standard</a> uses a more selective and fine grained approach to\nselecting encoded characters than that used by the Legacy API.</p>\n<p>The WHATWG algorithm defines four \"percent-encode sets\" that describe ranges\nof characters that must be percent-encoded:</p>\n<ul>\n<li>\n<p>The <em>C0 control percent-encode set</em> includes code points in range U+0000 to\nU+001F (inclusive) and all code points greater than U+007E (~).</p>\n</li>\n<li>\n<p>The <em>fragment percent-encode set</em> includes the <em>C0 control percent-encode set</em>\nand code points U+0020 SPACE, U+0022 (\"), U+003C (&#x3C;), U+003E (>),\nand U+0060 (`).</p>\n</li>\n<li>\n<p>The <em>path percent-encode set</em> includes the <em>C0 control percent-encode set</em>\nand code points U+0020 SPACE, U+0022 (\"), U+0023 (#), U+003C (&#x3C;), U+003E (>),\nU+003F (?), U+0060 (`), U+007B ({), and U+007D (}).</p>\n</li>\n<li>\n<p>The <em>userinfo encode set</em> includes the <em>path percent-encode set</em> and code\npoints U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@),\nU+005B ([) to U+005E(^), and U+007C (|).</p>\n</li>\n</ul>\n<p>The <em>userinfo percent-encode set</em> is used exclusively for username and\npasswords encoded within the URL. The <em>path percent-encode set</em> is used for the\npath of most URLs. The <em>fragment percent-encode set</em> is used for URL fragments.\nThe <em>C0 control percent-encode set</em> is used for host and path under certain\nspecific conditions, in addition to all other cases.</p>\n<p>When non-ASCII characters appear within a host name, the host name is encoded\nusing the <a href=\"https://tools.ietf.org/html/rfc5891#section-4.4\">Punycode</a> algorithm. Note, however, that a host name <em>may</em> contain\n<em>both</em> Punycode encoded and percent-encoded characters:</p>\n<pre><code class=\"language-js\">const myURL = new URL('https://%CF%80.example.com/foo');\nconsole.log(myURL.href);\n// Prints https://xn--1xa.example.com/foo\nconsole.log(myURL.origin);\n// Prints https://xn--1xa.example.com\n</code></pre>",
              "displayName": "WHATWG API"
            }
          ],
          "displayName": "Percent-encoding in URLs"
        }
      ],
      "displayName": "URL",
      "source": "doc/api/url.md"
    },
    {
      "textRaw": "Util",
      "name": "util",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:util</code> module supports the needs of Node.js internal APIs. Many of the\nutilities are useful for application and module developers as well. To access\nit:</p>\n<pre><code class=\"language-mjs\">import util from 'node:util';\n</code></pre>\n<pre><code class=\"language-cjs\">const util = require('node:util');\n</code></pre>",
      "methods": [
        {
          "textRaw": "`util.callbackify(original)`",
          "name": "callbackify",
          "type": "method",
          "meta": {
            "added": [
              "v8.2.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`original` {Function} An `async` function",
                  "name": "original",
                  "type": "Function",
                  "desc": "An `async` function"
                }
              ],
              "return": {
                "textRaw": "Returns: {Function} a callback style function",
                "name": "return",
                "type": "Function",
                "desc": "a callback style function"
              }
            }
          ],
          "desc": "<p>Takes an <code>async</code> function (or a function that returns a <code>Promise</code>) and returns a\nfunction following the error-first callback style, i.e. taking\nan <code>(err, value) => ...</code> callback as the last argument. In the callback, the\nfirst argument will be the rejection reason (or <code>null</code> if the <code>Promise</code>\nresolved), and the second argument will be the resolved value.</p>\n<pre><code class=\"language-mjs\">import { callbackify } from 'node:util';\n\nasync function fn() {\n  return 'hello world';\n}\nconst callbackFunction = callbackify(fn);\n\ncallbackFunction((err, ret) => {\n  if (err) throw err;\n  console.log(ret);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { callbackify } = require('node:util');\n\nasync function fn() {\n  return 'hello world';\n}\nconst callbackFunction = callbackify(fn);\n\ncallbackFunction((err, ret) => {\n  if (err) throw err;\n  console.log(ret);\n});\n</code></pre>\n<p>Will print:</p>\n<pre><code class=\"language-text\">hello world\n</code></pre>\n<p>The callback is executed asynchronously, and will have a limited stack trace.\nIf the callback throws, the process will emit an <a href=\"process.html#event-uncaughtexception\"><code>'uncaughtException'</code></a>\nevent, and if not handled will exit.</p>\n<p>Since <code>null</code> has a special meaning as the first argument to a callback, if a\nwrapped function rejects a <code>Promise</code> with a falsy value as a reason, the value\nis wrapped in an <code>Error</code> with the original value stored in a field named\n<code>reason</code>.</p>\n<pre><code class=\"language-mjs\">import util from 'node:util';\n\nfunction fn() {\n  return Promise.reject(null);\n}\nconst callbackFunction = util.callbackify(fn);\n\ncallbackFunction((err, ret) => {\n  // When the Promise was rejected with `null` it is wrapped with an Error and\n  // the original value is stored in `reason`.\n  err &#x26;&#x26; Object.hasOwn(err, 'reason') &#x26;&#x26; err.reason === null;  // true\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const util = require('node:util');\n\nfunction fn() {\n  return Promise.reject(null);\n}\nconst callbackFunction = util.callbackify(fn);\n\ncallbackFunction((err, ret) => {\n  // When the Promise was rejected with `null` it is wrapped with an Error and\n  // the original value is stored in `reason`.\n  err &#x26;&#x26; Object.hasOwn(err, 'reason') &#x26;&#x26; err.reason === null;  // true\n});\n</code></pre>"
        },
        {
          "textRaw": "`util.convertProcessSignalToExitCode(signal)`",
          "name": "convertProcessSignalToExitCode",
          "type": "method",
          "meta": {
            "added": [
              "v25.4.0",
              "v24.14.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`signal` {string} A signal name (e.g. `'SIGTERM'`)",
                  "name": "signal",
                  "type": "string",
                  "desc": "A signal name (e.g. `'SIGTERM'`)"
                }
              ],
              "return": {
                "textRaw": "Returns: {number} The exit code corresponding to `signal`",
                "name": "return",
                "type": "number",
                "desc": "The exit code corresponding to `signal`"
              }
            }
          ],
          "desc": "<p>The <code>util.convertProcessSignalToExitCode()</code> method converts a signal name to its\ncorresponding POSIX exit code. Following the POSIX standard, the exit code\nfor a process terminated by a signal is calculated as <code>128 + signal number</code>.</p>\n<p>If <code>signal</code> is not a valid signal name, then an error will be thrown. See\n<a href=\"https://man7.org/linux/man-pages/man7/signal.7.html\"><code>signal(7)</code></a> for a list of valid signals.</p>\n<pre><code class=\"language-mjs\">import { convertProcessSignalToExitCode } from 'node:util';\n\nconsole.log(convertProcessSignalToExitCode('SIGTERM')); // 143 (128 + 15)\nconsole.log(convertProcessSignalToExitCode('SIGKILL')); // 137 (128 + 9)\n</code></pre>\n<pre><code class=\"language-cjs\">const { convertProcessSignalToExitCode } = require('node:util');\n\nconsole.log(convertProcessSignalToExitCode('SIGTERM')); // 143 (128 + 15)\nconsole.log(convertProcessSignalToExitCode('SIGKILL')); // 137 (128 + 9)\n</code></pre>\n<p>This is particularly useful when working with processes to determine\nthe exit code based on the signal that terminated the process.</p>"
        },
        {
          "textRaw": "`util.debuglog(section[, callback])`",
          "name": "debuglog",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.3"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`section` {string} A string identifying the portion of the application for which the `debuglog` function is being created.",
                  "name": "section",
                  "type": "string",
                  "desc": "A string identifying the portion of the application for which the `debuglog` function is being created."
                },
                {
                  "textRaw": "`callback` {Function} A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "A callback invoked the first time the logging function is called with a function argument that is a more optimized logging function.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Function} The logging function",
                "name": "return",
                "type": "Function",
                "desc": "The logging function"
              }
            }
          ],
          "desc": "<p>The <code>util.debuglog()</code> method is used to create a function that conditionally\nwrites debug messages to <code>stderr</code> based on the existence of the <code>NODE_DEBUG</code>\nenvironment variable. If the <code>section</code> name appears within the value of that\nenvironment variable, then the returned function operates similar to\n<a href=\"console.html#consoleerrordata-args\"><code>console.error()</code></a>. If not, then the returned function is a no-op.</p>\n<pre><code class=\"language-mjs\">import { debuglog } from 'node:util';\nconst log = debuglog('foo');\n\nlog('hello from foo [%d]', 123);\n</code></pre>\n<pre><code class=\"language-cjs\">const { debuglog } = require('node:util');\nconst log = debuglog('foo');\n\nlog('hello from foo [%d]', 123);\n</code></pre>\n<p>If this program is run with <code>NODE_DEBUG=foo</code> in the environment, then\nit will output something like:</p>\n<pre><code class=\"language-console\">FOO 3245: hello from foo [123]\n</code></pre>\n<p>where <code>3245</code> is the process id. If it is not run with that\nenvironment variable set, then it will not print anything.</p>\n<p>The <code>section</code> supports wildcard also:</p>\n<pre><code class=\"language-mjs\">import { debuglog } from 'node:util';\nconst log = debuglog('foo-bar');\n\nlog('hi there, it\\'s foo-bar [%d]', 2333);\n</code></pre>\n<pre><code class=\"language-cjs\">const { debuglog } = require('node:util');\nconst log = debuglog('foo-bar');\n\nlog('hi there, it\\'s foo-bar [%d]', 2333);\n</code></pre>\n<p>if it is run with <code>NODE_DEBUG=foo*</code> in the environment, then it will output\nsomething like:</p>\n<pre><code class=\"language-console\">FOO-BAR 3257: hi there, it's foo-bar [2333]\n</code></pre>\n<p>Multiple comma-separated <code>section</code> names may be specified in the <code>NODE_DEBUG</code>\nenvironment variable: <code>NODE_DEBUG=fs,net,tls</code>.</p>\n<p>The optional <code>callback</code> argument can be used to replace the logging function\nwith a different function that doesn't have any initialization or\nunnecessary wrapping.</p>\n<pre><code class=\"language-mjs\">import { debuglog } from 'node:util';\nlet log = debuglog('internals', (debug) => {\n  // Replace with a logging function that optimizes out\n  // testing if the section is enabled\n  log = debug;\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { debuglog } = require('node:util');\nlet log = debuglog('internals', (debug) => {\n  // Replace with a logging function that optimizes out\n  // testing if the section is enabled\n  log = debug;\n});\n</code></pre>",
          "modules": [
            {
              "textRaw": "`debuglog().enabled`",
              "name": "`debuglog().enabled`",
              "type": "module",
              "meta": {
                "added": [
                  "v14.9.0"
                ],
                "changes": []
              },
              "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n</ul>\n<p>The <code>util.debuglog().enabled</code> getter is used to create a test that can be used\nin conditionals based on the existence of the <code>NODE_DEBUG</code> environment variable.\nIf the <code>section</code> name appears within the value of that environment variable,\nthen the returned value will be <code>true</code>. If not, then the returned value will be\n<code>false</code>.</p>\n<pre><code class=\"language-mjs\">import { debuglog } from 'node:util';\nconst enabled = debuglog('foo').enabled;\nif (enabled) {\n  console.log('hello from foo [%d]', 123);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { debuglog } = require('node:util');\nconst enabled = debuglog('foo').enabled;\nif (enabled) {\n  console.log('hello from foo [%d]', 123);\n}\n</code></pre>\n<p>If this program is run with <code>NODE_DEBUG=foo</code> in the environment, then it will\noutput something like:</p>\n<pre><code class=\"language-console\">hello from foo [123]\n</code></pre>",
              "displayName": "`debuglog().enabled`"
            }
          ]
        },
        {
          "textRaw": "`util.debug(section)`",
          "name": "debug",
          "type": "method",
          "meta": {
            "added": [
              "v14.9.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "name": "section"
                }
              ]
            }
          ],
          "desc": "<p>Alias for <code>util.debuglog</code>. Usage allows for readability of that doesn't imply\nlogging when only using <code>util.debuglog().enabled</code>.</p>"
        },
        {
          "textRaw": "`util.deprecate(fn, msg[, code[, options]])`",
          "name": "deprecate",
          "type": "method",
          "meta": {
            "added": [
              "v0.8.0"
            ],
            "changes": [
              {
                "version": [
                  "v25.2.0",
                  "v24.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59982",
                "description": "Add options object with modifyPrototype to conditionally modify the prototype of the deprecated object."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/16393",
                "description": "Deprecation warnings are only emitted once for each code."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function} The function that is being deprecated.",
                  "name": "fn",
                  "type": "Function",
                  "desc": "The function that is being deprecated."
                },
                {
                  "textRaw": "`msg` {string} A warning message to display when the deprecated function is invoked.",
                  "name": "msg",
                  "type": "string",
                  "desc": "A warning message to display when the deprecated function is invoked."
                },
                {
                  "textRaw": "`code` {string} A deprecation code. See the list of deprecated APIs for a list of codes.",
                  "name": "code",
                  "type": "string",
                  "desc": "A deprecation code. See the list of deprecated APIs for a list of codes.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`modifyPrototype` {boolean} When false do not change the prototype of object while emitting the deprecation warning. **Default:** `true`.",
                      "name": "modifyPrototype",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "When false do not change the prototype of object while emitting the deprecation warning."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Function} The deprecated function wrapped to emit a warning.",
                "name": "return",
                "type": "Function",
                "desc": "The deprecated function wrapped to emit a warning."
              }
            }
          ],
          "desc": "<p>The <code>util.deprecate()</code> method wraps <code>fn</code> (which may be a function or class) in\nsuch a way that it is marked as deprecated.</p>\n<pre><code class=\"language-mjs\">import { deprecate } from 'node:util';\n\nexport const obsoleteFunction = deprecate(() => {\n  // Do something here.\n}, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');\n</code></pre>\n<pre><code class=\"language-cjs\">const { deprecate } = require('node:util');\n\nexports.obsoleteFunction = deprecate(() => {\n  // Do something here.\n}, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');\n</code></pre>\n<p>When called, <code>util.deprecate()</code> will return a function that will emit a\n<code>DeprecationWarning</code> using the <a href=\"process.html#event-warning\"><code>'warning'</code></a> event. The warning will\nbe emitted and printed to <code>stderr</code> the first time the returned function is\ncalled. After the warning is emitted, the wrapped function is called without\nemitting a warning.</p>\n<p>If the same optional <code>code</code> is supplied in multiple calls to <code>util.deprecate()</code>,\nthe warning will be emitted only once for that <code>code</code>.</p>\n<pre><code class=\"language-mjs\">import { deprecate } from 'node:util';\n\nconst fn1 = deprecate(\n  () => 'a value',\n  'deprecation message',\n  'DEP0001',\n);\nconst fn2 = deprecate(\n  () => 'a  different value',\n  'other dep message',\n  'DEP0001',\n);\nfn1(); // Emits a deprecation warning with code DEP0001\nfn2(); // Does not emit a deprecation warning because it has the same code\n</code></pre>\n<pre><code class=\"language-cjs\">const { deprecate } = require('node:util');\n\nconst fn1 = deprecate(\n  function() {\n    return 'a value';\n  },\n  'deprecation message',\n  'DEP0001',\n);\nconst fn2 = deprecate(\n  function() {\n    return 'a  different value';\n  },\n  'other dep message',\n  'DEP0001',\n);\nfn1(); // Emits a deprecation warning with code DEP0001\nfn2(); // Does not emit a deprecation warning because it has the same code\n</code></pre>\n<p>If either the <code>--no-deprecation</code> or <code>--no-warnings</code> command-line flags are\nused, or if the <code>process.noDeprecation</code> property is set to <code>true</code> <em>prior</em> to\nthe first deprecation warning, the <code>util.deprecate()</code> method does nothing.</p>\n<p>If the <code>--trace-deprecation</code> or <code>--trace-warnings</code> command-line flags are set,\nor the <code>process.traceDeprecation</code> property is set to <code>true</code>, a warning and a\nstack trace are printed to <code>stderr</code> the first time the deprecated function is\ncalled.</p>\n<p>If the <code>--throw-deprecation</code> command-line flag is set, or the\n<code>process.throwDeprecation</code> property is set to <code>true</code>, then an exception will be\nthrown when the deprecated function is called.</p>\n<p>The <code>--throw-deprecation</code> command-line flag and <code>process.throwDeprecation</code>\nproperty take precedence over <code>--trace-deprecation</code> and\n<code>process.traceDeprecation</code>.</p>"
        },
        {
          "textRaw": "`util.diff(actual, expected)`",
          "name": "diff",
          "type": "method",
          "meta": {
            "added": [
              "v23.11.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`actual` {Array|string} The first value to compare",
                  "name": "actual",
                  "type": "Array|string",
                  "desc": "The first value to compare"
                },
                {
                  "textRaw": "`expected` {Array|string} The second value to compare",
                  "name": "expected",
                  "type": "Array|string",
                  "desc": "The second value to compare"
                }
              ],
              "return": {
                "textRaw": "Returns: {Array} An array of difference entries. Each entry is an array with two elements:",
                "name": "return",
                "type": "Array",
                "desc": "An array of difference entries. Each entry is an array with two elements:",
                "options": [
                  {
                    "textRaw": "`0` {number} Operation code: `-1` for delete, `0` for no-op/unchanged, `1` for insert",
                    "name": "0",
                    "type": "number",
                    "desc": "Operation code: `-1` for delete, `0` for no-op/unchanged, `1` for insert"
                  },
                  {
                    "textRaw": "`1` {string} The value associated with the operation",
                    "name": "1",
                    "type": "string",
                    "desc": "The value associated with the operation"
                  }
                ]
              }
            }
          ],
          "desc": "<p><a href=\"#utildiffactual-expected\"><code>util.diff()</code></a> compares two string or array values and returns an array of difference entries.\nIt uses the Myers diff algorithm to compute minimal differences, which is the same algorithm\nused internally by assertion error messages.</p>\n<p>If the values are equal, an empty array is returned.</p>\n<pre><code class=\"language-js\">const { diff } = require('node:util');\n\n// Comparing strings\nconst actualString = '12345678';\nconst expectedString = '12!!5!7!';\nconsole.log(diff(actualString, expectedString));\n// [\n//   [0, '1'],\n//   [0, '2'],\n//   [1, '3'],\n//   [1, '4'],\n//   [-1, '!'],\n//   [-1, '!'],\n//   [0, '5'],\n//   [1, '6'],\n//   [-1, '!'],\n//   [0, '7'],\n//   [1, '8'],\n//   [-1, '!'],\n// ]\n// Comparing arrays\nconst actualArray = ['1', '2', '3'];\nconst expectedArray = ['1', '3', '4'];\nconsole.log(diff(actualArray, expectedArray));\n// [\n//   [0, '1'],\n//   [1, '2'],\n//   [0, '3'],\n//   [-1, '4'],\n// ]\n// Equal values return empty array\nconsole.log(diff('same', 'same'));\n// []\n</code></pre>"
        },
        {
          "textRaw": "`util.format(format[, ...args])`",
          "name": "format",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.3"
            ],
            "changes": [
              {
                "version": "v12.11.0",
                "pr-url": "https://github.com/nodejs/node/pull/29606",
                "description": "The `%c` specifier is ignored now."
              },
              {
                "version": "v12.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/23162",
                "description": "The `format` argument is now only taken as such if it actually contains format specifiers."
              },
              {
                "version": "v12.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/23162",
                "description": "If the `format` argument is not a format string, the output string's formatting is no longer dependent on the type of the first argument. This change removes previously present quotes from strings that were being output when the first argument was not a string."
              },
              {
                "version": "v11.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/23708",
                "description": "The `%d`, `%f`, and `%i` specifiers now support Symbols properly."
              },
              {
                "version": "v11.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/24806",
                "description": "The `%o` specifier's `depth` has default depth of 4 again."
              },
              {
                "version": "v11.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/17907",
                "description": "The `%o` specifier's `depth` option will now fall back to the default depth."
              },
              {
                "version": "v10.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/22097",
                "description": "The `%d` and `%i` specifiers now support BigInt."
              },
              {
                "version": "v8.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/14558",
                "description": "The `%o` and `%O` specifiers are supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`format` {string} A `printf`-like format string.",
                  "name": "format",
                  "type": "string",
                  "desc": "A `printf`-like format string."
                },
                {
                  "name": "...args",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>util.format()</code> method returns a formatted string using the first argument\nas a <code>printf</code>-like format string which can contain zero or more format\nspecifiers. Each specifier is replaced with the converted value from the\ncorresponding argument. Supported specifiers are:</p>\n<ul>\n<li><code>%s</code>: <code>String</code> will be used to convert all values except <code>BigInt</code>, <code>Object</code>\nand <code>-0</code>. <code>BigInt</code> values will be represented with an <code>n</code> and Objects that\nhave neither a user defined <code>toString</code> function nor <code>Symbol.toPrimitive</code> function are inspected using <code>util.inspect()</code>\nwith options <code>{ depth: 0, colors: false, compact: 3 }</code>.</li>\n<li><code>%d</code>: <code>Number</code> will be used to convert all values except <code>BigInt</code> and\n<code>Symbol</code>.</li>\n<li><code>%i</code>: <code>parseInt(value, 10)</code> is used for all values except <code>BigInt</code> and\n<code>Symbol</code>.</li>\n<li><code>%f</code>: <code>parseFloat(value)</code> is used for all values expect <code>Symbol</code>.</li>\n<li><code>%j</code>: JSON. Replaced with the string <code>'[Circular]'</code> if the argument contains\ncircular references.</li>\n<li><code>%o</code>: <code>Object</code>. A string representation of an object with generic JavaScript\nobject formatting. Similar to <code>util.inspect()</code> with options\n<code>{ showHidden: true, showProxy: true }</code>. This will show the full object\nincluding non-enumerable properties and proxies.</li>\n<li><code>%O</code>: <code>Object</code>. A string representation of an object with generic JavaScript\nobject formatting. Similar to <code>util.inspect()</code> without options. This will show\nthe full object not including non-enumerable properties and proxies.</li>\n<li><code>%c</code>: <code>CSS</code>. This specifier is ignored and will skip any CSS passed in.</li>\n<li><code>%%</code>: single percent sign (<code>'%'</code>). This does not consume an argument.</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The formatted string</li>\n</ul>\n<p>If a specifier does not have a corresponding argument, it is not replaced:</p>\n<pre><code class=\"language-js\">util.format('%s:%s', 'foo');\n// Returns: 'foo:%s'\n</code></pre>\n<p>Values that are not part of the format string are formatted using\n<code>util.inspect()</code> if their type is not <code>string</code>.</p>\n<p>If there are more arguments passed to the <code>util.format()</code> method than the\nnumber of specifiers, the extra arguments are concatenated to the returned\nstring, separated by spaces:</p>\n<pre><code class=\"language-js\">util.format('%s:%s', 'foo', 'bar', 'baz');\n// Returns: 'foo:bar baz'\n</code></pre>\n<p>If the first argument does not contain a valid format specifier, <code>util.format()</code>\nreturns a string that is the concatenation of all arguments separated by spaces:</p>\n<pre><code class=\"language-js\">util.format(1, 2, 3);\n// Returns: '1 2 3'\n</code></pre>\n<p>If only one argument is passed to <code>util.format()</code>, it is returned as it is\nwithout any formatting:</p>\n<pre><code class=\"language-js\">util.format('%% %s');\n// Returns: '%% %s'\n</code></pre>\n<p><code>util.format()</code> is a synchronous method that is intended as a debugging tool.\nSome input values can have a significant performance overhead that can block the\nevent loop. Use this function with care and never in a hot code path.</p>"
        },
        {
          "textRaw": "`util.formatWithOptions(inspectOptions, format[, ...args])`",
          "name": "formatWithOptions",
          "type": "method",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`inspectOptions` {Object}",
                  "name": "inspectOptions",
                  "type": "Object"
                },
                {
                  "textRaw": "`format` {string}",
                  "name": "format",
                  "type": "string"
                },
                {
                  "name": "...args",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>This function is identical to <a href=\"#utilformatformat-args\"><code>util.format()</code></a>, except in that it takes\nan <code>inspectOptions</code> argument which specifies options that are passed along to\n<a href=\"#utilinspectobject-options\"><code>util.inspect()</code></a>.</p>\n<pre><code class=\"language-js\">util.formatWithOptions({ colors: true }, 'See object %O', { foo: 42 });\n// Returns 'See object { foo: 42 }', where `42` is colored as a number\n// when printed to a terminal.\n</code></pre>"
        },
        {
          "textRaw": "`util.getCallSites([frameCount][, options])`",
          "name": "getCallSites",
          "type": "method",
          "meta": {
            "added": [
              "v22.9.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.7.0",
                  "v22.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/56584",
                "description": "Property `column` is deprecated in favor of `columnNumber`."
              },
              {
                "version": [
                  "v23.7.0",
                  "v22.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/56551",
                "description": "Property `CallSite.scriptId` is exposed."
              },
              {
                "version": [
                  "v23.3.0",
                  "v22.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/55626",
                "description": "The API is renamed from `util.getCallSite` to `util.getCallSites()`."
              }
            ]
          },
          "stability": 1.1,
          "stabilityText": "Active development",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`frameCount` {integer} Optional number of frames to capture as call site objects. **Default:** `10`. Allowable range is between 1 and 200.",
                  "name": "frameCount",
                  "type": "integer",
                  "default": "`10`. Allowable range is between 1 and 200",
                  "desc": "Optional number of frames to capture as call site objects.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} Optional",
                  "name": "options",
                  "type": "Object",
                  "desc": "Optional",
                  "options": [
                    {
                      "textRaw": "`sourceMap` {boolean} Reconstruct the original location in the stacktrace from the source-map. Enabled by default with the flag `--enable-source-maps`.",
                      "name": "sourceMap",
                      "type": "boolean",
                      "desc": "Reconstruct the original location in the stacktrace from the source-map. Enabled by default with the flag `--enable-source-maps`."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object[]} An array of call site objects",
                "name": "return",
                "type": "Object[]",
                "desc": "An array of call site objects",
                "options": [
                  {
                    "textRaw": "`functionName` {string} Returns the name of the function associated with this call site.",
                    "name": "functionName",
                    "type": "string",
                    "desc": "Returns the name of the function associated with this call site."
                  },
                  {
                    "textRaw": "`scriptName` {string} Returns the name of the resource that contains the script for the function for this call site.",
                    "name": "scriptName",
                    "type": "string",
                    "desc": "Returns the name of the resource that contains the script for the function for this call site."
                  },
                  {
                    "textRaw": "`scriptId` {string} Returns the unique id of the script, as in Chrome DevTools protocol `Runtime.ScriptId`.",
                    "name": "scriptId",
                    "type": "string",
                    "desc": "Returns the unique id of the script, as in Chrome DevTools protocol `Runtime.ScriptId`."
                  },
                  {
                    "textRaw": "`lineNumber` {number} Returns the JavaScript script line number (1-based).",
                    "name": "lineNumber",
                    "type": "number",
                    "desc": "Returns the JavaScript script line number (1-based)."
                  },
                  {
                    "textRaw": "`columnNumber` {number} Returns the JavaScript script column number (1-based).",
                    "name": "columnNumber",
                    "type": "number",
                    "desc": "Returns the JavaScript script column number (1-based)."
                  }
                ]
              }
            }
          ],
          "desc": "<p>Returns an array of call site objects containing the stack of\nthe caller function.</p>\n<p>Unlike accessing an <code>error.stack</code>, the result returned from this API is not\ninterfered with <code>Error.prepareStackTrace</code>.</p>\n<pre><code class=\"language-mjs\">import { getCallSites } from 'node:util';\n\nfunction exampleFunction() {\n  const callSites = getCallSites();\n\n  console.log('Call Sites:');\n  callSites.forEach((callSite, index) => {\n    console.log(`CallSite ${index + 1}:`);\n    console.log(`Function Name: ${callSite.functionName}`);\n    console.log(`Script Name: ${callSite.scriptName}`);\n    console.log(`Line Number: ${callSite.lineNumber}`);\n    console.log(`Column Number: ${callSite.columnNumber}`);\n  });\n  // CallSite 1:\n  // Function Name: exampleFunction\n  // Script Name: /home/example.js\n  // Line Number: 5\n  // Column Number: 26\n\n  // CallSite 2:\n  // Function Name: anotherFunction\n  // Script Name: /home/example.js\n  // Line Number: 22\n  // Column Number: 3\n\n  // ...\n}\n\n// A function to simulate another stack layer\nfunction anotherFunction() {\n  exampleFunction();\n}\n\nanotherFunction();\n</code></pre>\n<pre><code class=\"language-cjs\">const { getCallSites } = require('node:util');\n\nfunction exampleFunction() {\n  const callSites = getCallSites();\n\n  console.log('Call Sites:');\n  callSites.forEach((callSite, index) => {\n    console.log(`CallSite ${index + 1}:`);\n    console.log(`Function Name: ${callSite.functionName}`);\n    console.log(`Script Name: ${callSite.scriptName}`);\n    console.log(`Line Number: ${callSite.lineNumber}`);\n    console.log(`Column Number: ${callSite.columnNumber}`);\n  });\n  // CallSite 1:\n  // Function Name: exampleFunction\n  // Script Name: /home/example.js\n  // Line Number: 5\n  // Column Number: 26\n\n  // CallSite 2:\n  // Function Name: anotherFunction\n  // Script Name: /home/example.js\n  // Line Number: 22\n  // Column Number: 3\n\n  // ...\n}\n\n// A function to simulate another stack layer\nfunction anotherFunction() {\n  exampleFunction();\n}\n\nanotherFunction();\n</code></pre>\n<p>It is possible to reconstruct the original locations by setting the option <code>sourceMap</code> to <code>true</code>.\nIf the source map is not available, the original location will be the same as the current location.\nWhen the <code>--enable-source-maps</code> flag is enabled,<code>sourceMap</code> will be true by default.</p>\n<pre><code class=\"language-ts\">import { getCallSites } from 'node:util';\n\ninterface Foo {\n  foo: string;\n}\n\nconst callSites = getCallSites({ sourceMap: true });\n\n// With sourceMap:\n// Function Name: ''\n// Script Name: example.js\n// Line Number: 7\n// Column Number: 26\n\n// Without sourceMap:\n// Function Name: ''\n// Script Name: example.js\n// Line Number: 2\n// Column Number: 26\n</code></pre>\n<pre><code class=\"language-cjs\">const { getCallSites } = require('node:util');\n\nconst callSites = getCallSites({ sourceMap: true });\n\n// With sourceMap:\n// Function Name: ''\n// Script Name: example.js\n// Line Number: 7\n// Column Number: 26\n\n// Without sourceMap:\n// Function Name: ''\n// Script Name: example.js\n// Line Number: 2\n// Column Number: 26\n</code></pre>"
        },
        {
          "textRaw": "`util.getSystemErrorName(err)`",
          "name": "getSystemErrorName",
          "type": "method",
          "meta": {
            "added": [
              "v9.7.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`err` {number}",
                  "name": "err",
                  "type": "number"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the string name for a numeric error code that comes from a Node.js API.\nThe mapping between error codes and error names is platform-dependent.\nSee <a href=\"errors.html#common-system-errors\">Common System Errors</a> for the names of common errors.</p>\n<pre><code class=\"language-js\">fs.access('file/that/does/not/exist', (err) => {\n  const name = util.getSystemErrorName(err.errno);\n  console.error(name);  // ENOENT\n});\n</code></pre>"
        },
        {
          "textRaw": "`util.getSystemErrorMap()`",
          "name": "getSystemErrorMap",
          "type": "method",
          "meta": {
            "added": [
              "v16.0.0",
              "v14.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Map}",
                "name": "return",
                "type": "Map"
              }
            }
          ],
          "desc": "<p>Returns a Map of all system error codes available from the Node.js API.\nThe mapping between error codes and error names is platform-dependent.\nSee <a href=\"errors.html#common-system-errors\">Common System Errors</a> for the names of common errors.</p>\n<pre><code class=\"language-js\">fs.access('file/that/does/not/exist', (err) => {\n  const errorMap = util.getSystemErrorMap();\n  const name = errorMap.get(err.errno);\n  console.error(name);  // ENOENT\n});\n</code></pre>"
        },
        {
          "textRaw": "`util.getSystemErrorMessage(err)`",
          "name": "getSystemErrorMessage",
          "type": "method",
          "meta": {
            "added": [
              "v23.1.0",
              "v22.12.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`err` {number}",
                  "name": "err",
                  "type": "number"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns the string message for a numeric error code that comes from a Node.js\nAPI.\nThe mapping between error codes and string messages is platform-dependent.</p>\n<pre><code class=\"language-js\">fs.access('file/that/does/not/exist', (err) => {\n  const message = util.getSystemErrorMessage(err.errno);\n  console.error(message);  // No such file or directory\n});\n</code></pre>"
        },
        {
          "textRaw": "`util.setTraceSigInt(enable)`",
          "name": "setTraceSigInt",
          "type": "method",
          "meta": {
            "added": [
              "v24.6.0",
              "v22.19.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`enable` {boolean}",
                  "name": "enable",
                  "type": "boolean"
                }
              ]
            }
          ],
          "desc": "<p>Enable or disable printing a stack trace on <code>SIGINT</code>. The API is only available on the main thread.</p>"
        },
        {
          "textRaw": "`util.inherits(constructor, superConstructor)`",
          "name": "inherits",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": [
              {
                "version": "v5.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/3455",
                "description": "The `constructor` parameter can refer to an ES6 class now."
              }
            ]
          },
          "stability": 3,
          "stabilityText": "Legacy: Use ES2015 class syntax and `extends` keyword instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`constructor` {Function}",
                  "name": "constructor",
                  "type": "Function"
                },
                {
                  "textRaw": "`superConstructor` {Function}",
                  "name": "superConstructor",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>Usage of <code>util.inherits()</code> is discouraged. Please use the ES6 <code>class</code> and\n<code>extends</code> keywords to get language level inheritance support. Also note\nthat the two styles are <a href=\"https://github.com/nodejs/node/issues/4179\">semantically incompatible</a>.</p>\n<p>Inherit the prototype methods from one <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor\">constructor</a> into another. The\nprototype of <code>constructor</code> will be set to a new object created from\n<code>superConstructor</code>.</p>\n<p>This mainly adds some input validation on top of\n<code>Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)</code>.\nAs an additional convenience, <code>superConstructor</code> will be accessible\nthrough the <code>constructor.super_</code> property.</p>\n<pre><code class=\"language-js\">const util = require('node:util');\nconst EventEmitter = require('node:events');\n\nfunction MyStream() {\n  EventEmitter.call(this);\n}\n\nutil.inherits(MyStream, EventEmitter);\n\nMyStream.prototype.write = function(data) {\n  this.emit('data', data);\n};\n\nconst stream = new MyStream();\n\nconsole.log(stream instanceof EventEmitter); // true\nconsole.log(MyStream.super_ === EventEmitter); // true\n\nstream.on('data', (data) => {\n  console.log(`Received data: \"${data}\"`);\n});\nstream.write('It works!'); // Received data: \"It works!\"\n</code></pre>\n<p>ES6 example using <code>class</code> and <code>extends</code>:</p>\n<pre><code class=\"language-mjs\">import EventEmitter from 'node:events';\n\nclass MyStream extends EventEmitter {\n  write(data) {\n    this.emit('data', data);\n  }\n}\n\nconst stream = new MyStream();\n\nstream.on('data', (data) => {\n  console.log(`Received data: \"${data}\"`);\n});\nstream.write('With ES6');\n</code></pre>\n<pre><code class=\"language-cjs\">const EventEmitter = require('node:events');\n\nclass MyStream extends EventEmitter {\n  write(data) {\n    this.emit('data', data);\n  }\n}\n\nconst stream = new MyStream();\n\nstream.on('data', (data) => {\n  console.log(`Received data: \"${data}\"`);\n});\nstream.write('With ES6');\n</code></pre>"
        },
        {
          "textRaw": "`util.inspect(object[, options])`",
          "name": "inspect",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "name": "object"
                },
                {
                  "name": "options",
                  "optional": true
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`util.inspect(object[, showHidden[, depth[, colors]]])`",
          "name": "inspect",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.0"
            ],
            "changes": [
              {
                "version": [
                  "v25.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59710",
                "description": "The util.inspect.styles.regexp style is now a method that is invoked for coloring the stringified regular expression."
              },
              {
                "version": [
                  "v17.3.0",
                  "v16.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41003",
                "description": "The `numericSeparator` option is supported now."
              },
              {
                "version": "v16.18.0",
                "pr-url": "https://github.com/nodejs/node/pull/43576",
                "description": "add support for `maxArrayLength` when inspecting `Set` and `Map`."
              },
              {
                "version": [
                  "v14.6.0",
                  "v12.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/33690",
                "description": "If `object` is from a different `vm.Context` now, a custom inspection function on it will not receive context-specific arguments anymore."
              },
              {
                "version": [
                  "v13.13.0",
                  "v12.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/32392",
                "description": "The `maxStringLength` option is supported now."
              },
              {
                "version": [
                  "v13.5.0",
                  "v12.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/30768",
                "description": "User defined prototype properties are inspected in case `showHidden` is `true`."
              },
              {
                "version": "v13.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/27685",
                "description": "Circular references now include a marker to the reference."
              },
              {
                "version": "v12.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/27109",
                "description": "The `compact` options default is changed to `3` and the `breakLength` options default is changed to `80`."
              },
              {
                "version": "v12.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/24971",
                "description": "Internal properties no longer appear in the context argument of a custom inspection function."
              },
              {
                "version": "v11.11.0",
                "pr-url": "https://github.com/nodejs/node/pull/26269",
                "description": "The `compact` option accepts numbers for a new output mode."
              },
              {
                "version": "v11.7.0",
                "pr-url": "https://github.com/nodejs/node/pull/25006",
                "description": "ArrayBuffers now also show their binary contents."
              },
              {
                "version": "v11.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/24852",
                "description": "The `getters` option is supported now."
              },
              {
                "version": "v11.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/24326",
                "description": "The `depth` default changed back to `2`."
              },
              {
                "version": "v11.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/22846",
                "description": "The `depth` default changed to `20`."
              },
              {
                "version": "v11.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/22756",
                "description": "The inspection output is now limited to about 128 MiB. Data above that size will not be fully inspected."
              },
              {
                "version": "v10.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/22788",
                "description": "The `sorted` option is supported now."
              },
              {
                "version": "v10.6.0",
                "pr-url": "https://github.com/nodejs/node/pull/20725",
                "description": "Inspecting linked lists and similar objects is now possible up to the maximum call stack size."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/19259",
                "description": "The `WeakMap` and `WeakSet` entries can now be inspected as well."
              },
              {
                "version": "v9.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/17576",
                "description": "The `compact` option is supported now."
              },
              {
                "version": "v6.6.0",
                "pr-url": "https://github.com/nodejs/node/pull/8174",
                "description": "Custom inspection functions can now return `this`."
              },
              {
                "version": "v6.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/7499",
                "description": "The `breakLength` option is supported now."
              },
              {
                "version": "v6.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/6334",
                "description": "The `maxArrayLength` option is supported now; in particular, long arrays are truncated by default."
              },
              {
                "version": "v6.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/6465",
                "description": "The `showProxy` option is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`object` {any} Any JavaScript primitive or `Object`.",
                  "name": "object",
                  "type": "any",
                  "desc": "Any JavaScript primitive or `Object`."
                },
                {
                  "textRaw": "`showHidden` {boolean} If `true`, `object`'s non-enumerable symbols and properties are included in the formatted result. {WeakMap} and {WeakSet} entries are also included as well as user defined prototype properties (excluding method properties). **Default:** `false`.",
                  "name": "showHidden",
                  "type": "boolean",
                  "default": "`false`",
                  "desc": "If `true`, `object`'s non-enumerable symbols and properties are included in the formatted result. {WeakMap} and {WeakSet} entries are also included as well as user defined prototype properties (excluding method properties).",
                  "optional": true
                },
                {
                  "textRaw": "`depth` {number} Specifies the number of times to recurse while formatting `object`. This is useful for inspecting large objects. To recurse up to the maximum call stack size pass `Infinity` or `null`. **Default:** `2`.",
                  "name": "depth",
                  "type": "number",
                  "default": "`2`",
                  "desc": "Specifies the number of times to recurse while formatting `object`. This is useful for inspecting large objects. To recurse up to the maximum call stack size pass `Infinity` or `null`.",
                  "optional": true
                },
                {
                  "textRaw": "`colors` {boolean} If `true`, the output is styled with ANSI color codes. Colors are customizable. See Customizing `util.inspect` colors. **Default:** `false`.",
                  "name": "colors",
                  "type": "boolean",
                  "default": "`false`",
                  "desc": "If `true`, the output is styled with ANSI color codes. Colors are customizable. See Customizing `util.inspect` colors.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string} The representation of `object`.",
                "name": "return",
                "type": "string",
                "desc": "The representation of `object`."
              }
            }
          ],
          "desc": "<p>The <code>util.inspect()</code> method returns a string representation of <code>object</code> that is\nintended for debugging. The output of <code>util.inspect</code> may change at any time\nand should not be depended upon programmatically. Additional <code>options</code> may be\npassed that alter the result.\n<code>util.inspect()</code> will use the constructor's name and/or <code>Symbol.toStringTag</code>\nproperty to make an identifiable tag for an inspected value.</p>\n<pre><code class=\"language-js\">class Foo {\n  get [Symbol.toStringTag]() {\n    return 'bar';\n  }\n}\n\nclass Bar {}\n\nconst baz = Object.create(null, { [Symbol.toStringTag]: { value: 'foo' } });\n\nutil.inspect(new Foo()); // 'Foo [bar] {}'\nutil.inspect(new Bar()); // 'Bar {}'\nutil.inspect(baz);       // '[foo] {}'\n</code></pre>\n<p>Circular references point to their anchor by using a reference index:</p>\n<pre><code class=\"language-mjs\">import { inspect } from 'node:util';\n\nconst obj = {};\nobj.a = [obj];\nobj.b = {};\nobj.b.inner = obj.b;\nobj.b.obj = obj;\n\nconsole.log(inspect(obj));\n// &#x3C;ref *1> {\n//   a: [ [Circular *1] ],\n//   b: &#x3C;ref *2> { inner: [Circular *2], obj: [Circular *1] }\n// }\n</code></pre>\n<pre><code class=\"language-cjs\">const { inspect } = require('node:util');\n\nconst obj = {};\nobj.a = [obj];\nobj.b = {};\nobj.b.inner = obj.b;\nobj.b.obj = obj;\n\nconsole.log(inspect(obj));\n// &#x3C;ref *1> {\n//   a: [ [Circular *1] ],\n//   b: &#x3C;ref *2> { inner: [Circular *2], obj: [Circular *1] }\n// }\n</code></pre>\n<p>The following example inspects all properties of the <code>util</code> object:</p>\n<pre><code class=\"language-mjs\">import util from 'node:util';\n\nconsole.log(util.inspect(util, { showHidden: true, depth: null }));\n</code></pre>\n<pre><code class=\"language-cjs\">const util = require('node:util');\n\nconsole.log(util.inspect(util, { showHidden: true, depth: null }));\n</code></pre>\n<p>The following example highlights the effect of the <code>compact</code> option:</p>\n<pre><code class=\"language-mjs\">import { inspect } from 'node:util';\n\nconst o = {\n  a: [1, 2, [[\n    'Lorem ipsum dolor sit amet,\\nconsectetur adipiscing elit, sed do ' +\n      'eiusmod \\ntempor incididunt ut labore et dolore magna aliqua.',\n    'test',\n    'foo']], 4],\n  b: new Map([['za', 1], ['zb', 'test']]),\n};\nconsole.log(inspect(o, { compact: true, depth: 5, breakLength: 80 }));\n\n// { a:\n//   [ 1,\n//     2,\n//     [ [ 'Lorem ipsum dolor sit amet,\\nconsectetur [...]', // A long line\n//           'test',\n//           'foo' ] ],\n//     4 ],\n//   b: Map(2) { 'za' => 1, 'zb' => 'test' } }\n\n// Setting `compact` to false or an integer creates more reader friendly output.\nconsole.log(inspect(o, { compact: false, depth: 5, breakLength: 80 }));\n\n// {\n//   a: [\n//     1,\n//     2,\n//     [\n//       [\n//         'Lorem ipsum dolor sit amet,\\n' +\n//           'consectetur adipiscing elit, sed do eiusmod \\n' +\n//           'tempor incididunt ut labore et dolore magna aliqua.',\n//         'test',\n//         'foo'\n//       ]\n//     ],\n//     4\n//   ],\n//   b: Map(2) {\n//     'za' => 1,\n//     'zb' => 'test'\n//   }\n// }\n\n// Setting `breakLength` to e.g. 150 will print the \"Lorem ipsum\" text in a\n// single line.\n</code></pre>\n<pre><code class=\"language-cjs\">const { inspect } = require('node:util');\n\nconst o = {\n  a: [1, 2, [[\n    'Lorem ipsum dolor sit amet,\\nconsectetur adipiscing elit, sed do ' +\n      'eiusmod \\ntempor incididunt ut labore et dolore magna aliqua.',\n    'test',\n    'foo']], 4],\n  b: new Map([['za', 1], ['zb', 'test']]),\n};\nconsole.log(inspect(o, { compact: true, depth: 5, breakLength: 80 }));\n\n// { a:\n//   [ 1,\n//     2,\n//     [ [ 'Lorem ipsum dolor sit amet,\\nconsectetur [...]', // A long line\n//           'test',\n//           'foo' ] ],\n//     4 ],\n//   b: Map(2) { 'za' => 1, 'zb' => 'test' } }\n\n// Setting `compact` to false or an integer creates more reader friendly output.\nconsole.log(inspect(o, { compact: false, depth: 5, breakLength: 80 }));\n\n// {\n//   a: [\n//     1,\n//     2,\n//     [\n//       [\n//         'Lorem ipsum dolor sit amet,\\n' +\n//           'consectetur adipiscing elit, sed do eiusmod \\n' +\n//           'tempor incididunt ut labore et dolore magna aliqua.',\n//         'test',\n//         'foo'\n//       ]\n//     ],\n//     4\n//   ],\n//   b: Map(2) {\n//     'za' => 1,\n//     'zb' => 'test'\n//   }\n// }\n\n// Setting `breakLength` to e.g. 150 will print the \"Lorem ipsum\" text in a\n// single line.\n</code></pre>\n<p>The <code>showHidden</code> option allows <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>&#x3C;WeakMap></code></a> and <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>&#x3C;WeakSet></code></a> entries to be\ninspected. If there are more entries than <code>maxArrayLength</code>, there is no\nguarantee which entries are displayed. That means retrieving the same\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>&#x3C;WeakSet></code></a> entries twice may result in different output. Furthermore, entries\nwith no remaining strong references may be garbage collected at any time.</p>\n<pre><code class=\"language-mjs\">import { inspect } from 'node:util';\n\nconst obj = { a: 1 };\nconst obj2 = { b: 2 };\nconst weakSet = new WeakSet([obj, obj2]);\n\nconsole.log(inspect(weakSet, { showHidden: true }));\n// WeakSet { { a: 1 }, { b: 2 } }\n</code></pre>\n<pre><code class=\"language-cjs\">const { inspect } = require('node:util');\n\nconst obj = { a: 1 };\nconst obj2 = { b: 2 };\nconst weakSet = new WeakSet([obj, obj2]);\n\nconsole.log(inspect(weakSet, { showHidden: true }));\n// WeakSet { { a: 1 }, { b: 2 } }\n</code></pre>\n<p>The <code>sorted</code> option ensures that an object's property insertion order does not\nimpact the result of <code>util.inspect()</code>.</p>\n<pre><code class=\"language-mjs\">import { inspect } from 'node:util';\nimport assert from 'node:assert';\n\nconst o1 = {\n  b: [2, 3, 1],\n  a: '`a` comes before `b`',\n  c: new Set([2, 3, 1]),\n};\nconsole.log(inspect(o1, { sorted: true }));\n// { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }\nconsole.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));\n// { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }\n\nconst o2 = {\n  c: new Set([2, 1, 3]),\n  a: '`a` comes before `b`',\n  b: [2, 3, 1],\n};\nassert.strict.equal(\n  inspect(o1, { sorted: true }),\n  inspect(o2, { sorted: true }),\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const { inspect } = require('node:util');\nconst assert = require('node:assert');\n\nconst o1 = {\n  b: [2, 3, 1],\n  a: '`a` comes before `b`',\n  c: new Set([2, 3, 1]),\n};\nconsole.log(inspect(o1, { sorted: true }));\n// { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }\nconsole.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));\n// { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }\n\nconst o2 = {\n  c: new Set([2, 1, 3]),\n  a: '`a` comes before `b`',\n  b: [2, 3, 1],\n};\nassert.strict.equal(\n  inspect(o1, { sorted: true }),\n  inspect(o2, { sorted: true }),\n);\n</code></pre>\n<p>The <code>numericSeparator</code> option adds an underscore every three digits to all\nnumbers.</p>\n<pre><code class=\"language-mjs\">import { inspect } from 'node:util';\n\nconst thousand = 1000;\nconst million = 1000000;\nconst bigNumber = 123456789n;\nconst bigDecimal = 1234.12345;\n\nconsole.log(inspect(thousand, { numericSeparator: true }));\n// 1_000\nconsole.log(inspect(million, { numericSeparator: true }));\n// 1_000_000\nconsole.log(inspect(bigNumber, { numericSeparator: true }));\n// 123_456_789n\nconsole.log(inspect(bigDecimal, { numericSeparator: true }));\n// 1_234.123_45\n</code></pre>\n<pre><code class=\"language-cjs\">const { inspect } = require('node:util');\n\nconst thousand = 1000;\nconst million = 1000000;\nconst bigNumber = 123456789n;\nconst bigDecimal = 1234.12345;\n\nconsole.log(inspect(thousand, { numericSeparator: true }));\n// 1_000\nconsole.log(inspect(million, { numericSeparator: true }));\n// 1_000_000\nconsole.log(inspect(bigNumber, { numericSeparator: true }));\n// 123_456_789n\nconsole.log(inspect(bigDecimal, { numericSeparator: true }));\n// 1_234.123_45\n</code></pre>\n<p><code>util.inspect()</code> is a synchronous method intended for debugging. Its maximum\noutput length is approximately 128 MiB. Inputs that result in longer output will\nbe truncated.</p>",
          "miscs": [
            {
              "textRaw": "Customizing `util.inspect` colors",
              "name": "Customizing `util.inspect` colors",
              "type": "misc",
              "desc": "<p>Color output (if enabled) of <code>util.inspect</code> is customizable globally\nvia the <code>util.inspect.styles</code> and <code>util.inspect.colors</code> properties.</p>\n<p><code>util.inspect.styles</code> is a map associating a style name to a color from\n<code>util.inspect.colors</code>.</p>\n<p>The default styles and associated colors are:</p>\n<ul>\n<li><code>bigint</code>: <code>yellow</code></li>\n<li><code>boolean</code>: <code>yellow</code></li>\n<li><code>date</code>: <code>magenta</code></li>\n<li><code>module</code>: <code>underline</code></li>\n<li><code>name</code>: (no styling)</li>\n<li><code>null</code>: <code>bold</code></li>\n<li><code>number</code>: <code>yellow</code></li>\n<li><code>regexp</code>: A method that colors character classes, groups, assertions, and\nother parts for improved readability. To customize the coloring, change the\n<code>colors</code> property. It is set to\n<code>['red', 'green', 'yellow', 'cyan', 'magenta']</code> by default and may be\nadjusted as needed. The array is repetitively iterated through depending on\nthe \"depth\".</li>\n<li><code>special</code>: <code>cyan</code> (e.g., <code>Proxies</code>)</li>\n<li><code>string</code>: <code>green</code></li>\n<li><code>symbol</code>: <code>green</code></li>\n<li><code>undefined</code>: <code>grey</code></li>\n</ul>\n<p>Color styling uses ANSI control codes that may not be supported on all\nterminals. To verify color support use <a href=\"tty.html#writestreamhascolorscount-env\"><code>tty.hasColors()</code></a>.</p>\n<p>Predefined control codes are listed below (grouped as \"Modifiers\", \"Foreground\ncolors\", and \"Background colors\").</p>",
              "miscs": [
                {
                  "textRaw": "Complex custom coloring",
                  "name": "complex_custom_coloring",
                  "type": "misc",
                  "desc": "<p>It is possible to define a method as style. It receives the stringified value\nof the input. It is invoked in case coloring is active and the type is\ninspected.</p>\n<p>Example: <code>util.inspect.styles.regexp(value)</code></p>\n<ul>\n<li><code>value</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The string representation of the input type.</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The adjusted representation of <code>object</code>.</li>\n</ul>",
                  "displayName": "Complex custom coloring"
                },
                {
                  "textRaw": "Modifiers",
                  "name": "modifiers",
                  "type": "misc",
                  "desc": "<p>Modifier support varies throughout different terminals. They will mostly be\nignored, if not supported.</p>\n<ul>\n<li><code>reset</code> - Resets all (color) modifiers to their defaults</li>\n<li><strong>bold</strong> - Make text bold</li>\n<li><em>italic</em> - Make text italic</li>\n<li><span style=\"border-bottom: 1px solid;\">underline</span> - Make text underlined</li>\n<li><del>strikethrough</del> - Puts a horizontal line through the center of the text\n(Alias: <code>strikeThrough</code>, <code>crossedout</code>, <code>crossedOut</code>)</li>\n<li><code>hidden</code> - Prints the text, but makes it invisible (Alias: conceal)</li>\n<li><span style=\"opacity: 0.5;\">dim</span> - Decreased color intensity (Alias:\n<code>faint</code>)</li>\n<li><span style=\"border-top: 1px solid;\">overlined</span> - Make text overlined</li>\n<li>blink - Hides and shows the text in an interval</li>\n<li><span style=\"filter: invert(100%);\">inverse</span> - Swap foreground and\nbackground colors (Alias: <code>swapcolors</code>, <code>swapColors</code>)</li>\n<li><span style=\"border-bottom: 1px double;\">doubleunderline</span> - Make text\ndouble underlined (Alias: <code>doubleUnderline</code>)</li>\n<li><span style=\"border: 1px solid;\">framed</span> - Draw a frame around the text</li>\n</ul>",
                  "displayName": "Modifiers"
                },
                {
                  "textRaw": "Foreground colors",
                  "name": "foreground_colors",
                  "type": "misc",
                  "desc": "<ul>\n<li><code>black</code></li>\n<li><code>red</code></li>\n<li><code>green</code></li>\n<li><code>yellow</code></li>\n<li><code>blue</code></li>\n<li><code>magenta</code></li>\n<li><code>cyan</code></li>\n<li><code>white</code></li>\n<li><code>gray</code> (alias: <code>grey</code>, <code>blackBright</code>)</li>\n<li><code>redBright</code></li>\n<li><code>greenBright</code></li>\n<li><code>yellowBright</code></li>\n<li><code>blueBright</code></li>\n<li><code>magentaBright</code></li>\n<li><code>cyanBright</code></li>\n<li><code>whiteBright</code></li>\n</ul>",
                  "displayName": "Foreground colors"
                },
                {
                  "textRaw": "Background colors",
                  "name": "background_colors",
                  "type": "misc",
                  "desc": "<ul>\n<li><code>bgBlack</code></li>\n<li><code>bgRed</code></li>\n<li><code>bgGreen</code></li>\n<li><code>bgYellow</code></li>\n<li><code>bgBlue</code></li>\n<li><code>bgMagenta</code></li>\n<li><code>bgCyan</code></li>\n<li><code>bgWhite</code></li>\n<li><code>bgGray</code> (alias: <code>bgGrey</code>, <code>bgBlackBright</code>)</li>\n<li><code>bgRedBright</code></li>\n<li><code>bgGreenBright</code></li>\n<li><code>bgYellowBright</code></li>\n<li><code>bgBlueBright</code></li>\n<li><code>bgMagentaBright</code></li>\n<li><code>bgCyanBright</code></li>\n<li><code>bgWhiteBright</code></li>\n</ul>",
                  "displayName": "Background colors"
                }
              ]
            },
            {
              "textRaw": "Custom inspection functions on objects",
              "name": "Custom inspection functions on objects",
              "type": "misc",
              "meta": {
                "added": [
                  "v0.1.97"
                ],
                "changes": [
                  {
                    "version": [
                      "v17.3.0",
                      "v16.14.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/41019",
                    "description": "The inspect argument is added for more interoperability."
                  }
                ]
              },
              "desc": "<p>Objects may also define their own\n<a href=\"#utilinspectcustom\"><code>[util.inspect.custom](depth, opts, inspect)</code></a> function,\nwhich <code>util.inspect()</code> will invoke and use the result of when inspecting\nthe object.</p>\n<pre><code class=\"language-mjs\">import { inspect } from 'node:util';\n\nclass Box {\n  constructor(value) {\n    this.value = value;\n  }\n\n  [inspect.custom](depth, options, inspect) {\n    if (depth &#x3C; 0) {\n      return options.stylize('[Box]', 'special');\n    }\n\n    const newOptions = Object.assign({}, options, {\n      depth: options.depth === null ? null : options.depth - 1,\n    });\n\n    // Five space padding because that's the size of \"Box&#x3C; \".\n    const padding = ' '.repeat(5);\n    const inner = inspect(this.value, newOptions)\n                  .replace(/\\n/g, `\\n${padding}`);\n    return `${options.stylize('Box', 'special')}&#x3C; ${inner} >`;\n  }\n}\n\nconst box = new Box(true);\n\nconsole.log(inspect(box));\n// \"Box&#x3C; true >\"\n</code></pre>\n<pre><code class=\"language-cjs\">const { inspect } = require('node:util');\n\nclass Box {\n  constructor(value) {\n    this.value = value;\n  }\n\n  [inspect.custom](depth, options, inspect) {\n    if (depth &#x3C; 0) {\n      return options.stylize('[Box]', 'special');\n    }\n\n    const newOptions = Object.assign({}, options, {\n      depth: options.depth === null ? null : options.depth - 1,\n    });\n\n    // Five space padding because that's the size of \"Box&#x3C; \".\n    const padding = ' '.repeat(5);\n    const inner = inspect(this.value, newOptions)\n                  .replace(/\\n/g, `\\n${padding}`);\n    return `${options.stylize('Box', 'special')}&#x3C; ${inner} >`;\n  }\n}\n\nconst box = new Box(true);\n\nconsole.log(inspect(box));\n// \"Box&#x3C; true >\"\n</code></pre>\n<p>Custom <code>[util.inspect.custom](depth, opts, inspect)</code> functions typically return\na string but may return a value of any type that will be formatted accordingly\nby <code>util.inspect()</code>.</p>\n<pre><code class=\"language-mjs\">import { inspect } from 'node:util';\n\nconst obj = { foo: 'this will not show up in the inspect() output' };\nobj[inspect.custom] = (depth) => {\n  return { bar: 'baz' };\n};\n\nconsole.log(inspect(obj));\n// \"{ bar: 'baz' }\"\n</code></pre>\n<pre><code class=\"language-cjs\">const { inspect } = require('node:util');\n\nconst obj = { foo: 'this will not show up in the inspect() output' };\nobj[inspect.custom] = (depth) => {\n  return { bar: 'baz' };\n};\n\nconsole.log(inspect(obj));\n// \"{ bar: 'baz' }\"\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {symbol} that can be used to declare custom inspect functions.",
              "name": "custom",
              "type": "symbol",
              "meta": {
                "added": [
                  "v6.6.0"
                ],
                "changes": [
                  {
                    "version": "v10.12.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20857",
                    "description": "This is now defined as a shared symbol."
                  }
                ]
              },
              "desc": "<p>In addition to being accessible through <code>util.inspect.custom</code>, this\nsymbol is <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/for\">registered globally</a> and can be\naccessed in any environment as <code>Symbol.for('nodejs.util.inspect.custom')</code>.</p>\n<p>Using this allows code to be written in a portable fashion, so that the custom\ninspect function is used in an Node.js environment and ignored in the browser.\nThe <code>util.inspect()</code> function itself is passed as third argument to the custom\ninspect function to allow further portability.</p>\n<pre><code class=\"language-js\">const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom');\n\nclass Password {\n  constructor(value) {\n    this.value = value;\n  }\n\n  toString() {\n    return 'xxxxxxxx';\n  }\n\n  [customInspectSymbol](depth, inspectOptions, inspect) {\n    return `Password &#x3C;${this.toString()}>`;\n  }\n}\n\nconst password = new Password('r0sebud');\nconsole.log(password);\n// Prints Password &#x3C;xxxxxxxx>\n</code></pre>\n<p>See <a href=\"#custom-inspection-functions-on-objects\">Custom inspection functions on Objects</a> for more details.</p>",
              "shortDesc": "that can be used to declare custom inspect functions."
            },
            {
              "textRaw": "`util.inspect.defaultOptions`",
              "name": "defaultOptions",
              "type": "property",
              "meta": {
                "added": [
                  "v6.4.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>defaultOptions</code> value allows customization of the default options used by\n<code>util.inspect</code>. This is useful for functions like <code>console.log</code> or\n<code>util.format</code> which implicitly call into <code>util.inspect</code>. It shall be set to an\nobject containing one or more valid <a href=\"#utilinspectobject-options\"><code>util.inspect()</code></a> options. Setting\noption properties directly is also supported.</p>\n<pre><code class=\"language-mjs\">import { inspect } from 'node:util';\nconst arr = Array(156).fill(0);\n\nconsole.log(arr); // Logs the truncated array\ninspect.defaultOptions.maxArrayLength = null;\nconsole.log(arr); // logs the full array\n</code></pre>\n<pre><code class=\"language-cjs\">const { inspect } = require('node:util');\nconst arr = Array(156).fill(0);\n\nconsole.log(arr); // Logs the truncated array\ninspect.defaultOptions.maxArrayLength = null;\nconsole.log(arr); // logs the full array\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "`util.isDeepStrictEqual(val1, val2[, options])`",
          "name": "isDeepStrictEqual",
          "type": "method",
          "meta": {
            "added": [
              "v9.0.0"
            ],
            "changes": [
              {
                "version": "v24.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/59762",
                "description": "Added `options` parameter to allow skipping prototype comparison."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`val1` {any}",
                  "name": "val1",
                  "type": "any"
                },
                {
                  "textRaw": "`val2` {any}",
                  "name": "val2",
                  "type": "any"
                },
                {
                  "name": "options",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>Returns <code>true</code> if there is deep strict equality between <code>val1</code> and <code>val2</code>.\nOtherwise, returns <code>false</code>.</p>\n<p>By default, deep strict equality includes comparison of object prototypes and\nconstructors. When <code>skipPrototype</code> is <code>true</code>, objects with\ndifferent prototypes or constructors can still be considered equal if their\nenumerable properties are deeply strictly equal.</p>\n<pre><code class=\"language-js\">const util = require('node:util');\n\nclass Foo {\n  constructor(a) {\n    this.a = a;\n  }\n}\n\nclass Bar {\n  constructor(a) {\n    this.a = a;\n  }\n}\n\nconst foo = new Foo(1);\nconst bar = new Bar(1);\n\n// Different constructors, same properties\nconsole.log(util.isDeepStrictEqual(foo, bar));\n// false\n\nconsole.log(util.isDeepStrictEqual(foo, bar, true));\n// true\n</code></pre>\n<p>See <a href=\"assert.html#assertdeepstrictequalactual-expected-message\"><code>assert.deepStrictEqual()</code></a> for more information about deep strict\nequality.</p>"
        },
        {
          "textRaw": "`util.parseArgs([config])`",
          "name": "parseArgs",
          "type": "method",
          "meta": {
            "added": [
              "v18.3.0",
              "v16.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v22.4.0",
                  "v20.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/53107",
                "description": "add support for allowing negative options in input `config`."
              },
              {
                "version": [
                  "v20.0.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46718",
                "description": "The API is no longer experimental."
              },
              {
                "version": [
                  "v18.11.0",
                  "v16.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/44631",
                "description": "Add support for default values in input `config`."
              },
              {
                "version": [
                  "v18.7.0",
                  "v16.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/43459",
                "description": "add support for returning detailed parse information using `tokens` in input `config` and returned properties."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`config` {Object} Used to provide arguments for parsing and to configure the parser. `config` supports the following properties:",
                  "name": "config",
                  "type": "Object",
                  "desc": "Used to provide arguments for parsing and to configure the parser. `config` supports the following properties:",
                  "options": [
                    {
                      "textRaw": "`args` {string[]} array of argument strings. **Default:** `process.argv` with `execPath` and `filename` removed.",
                      "name": "args",
                      "type": "string[]",
                      "default": "`process.argv` with `execPath` and `filename` removed",
                      "desc": "array of argument strings."
                    },
                    {
                      "textRaw": "`options` {Object} Used to describe arguments known to the parser. Keys of `options` are the long names of options and values are an {Object} accepting the following properties:",
                      "name": "options",
                      "type": "Object",
                      "desc": "Used to describe arguments known to the parser. Keys of `options` are the long names of options and values are an {Object} accepting the following properties:",
                      "options": [
                        {
                          "textRaw": "`type` {string} Type of argument, which must be either `boolean` or `string`.",
                          "name": "type",
                          "type": "string",
                          "desc": "Type of argument, which must be either `boolean` or `string`."
                        },
                        {
                          "textRaw": "`multiple` {boolean} Whether this option can be provided multiple times. If `true`, all values will be collected in an array. If `false`, values for the option are last-wins. **Default:** `false`.",
                          "name": "multiple",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Whether this option can be provided multiple times. If `true`, all values will be collected in an array. If `false`, values for the option are last-wins."
                        },
                        {
                          "textRaw": "`short` {string} A single character alias for the option.",
                          "name": "short",
                          "type": "string",
                          "desc": "A single character alias for the option."
                        },
                        {
                          "textRaw": "`default` {string|boolean|string[]|boolean[]} The value to assign to the option if it does not appear in the arguments to be parsed. The value must match the type specified by the `type` property. If `multiple` is `true`, it must be an array. No default value is applied when the option does appear in the arguments to be parsed, even if the provided value is falsy.",
                          "name": "default",
                          "type": "string|boolean|string[]|boolean[]",
                          "desc": "The value to assign to the option if it does not appear in the arguments to be parsed. The value must match the type specified by the `type` property. If `multiple` is `true`, it must be an array. No default value is applied when the option does appear in the arguments to be parsed, even if the provided value is falsy."
                        }
                      ]
                    },
                    {
                      "textRaw": "`strict` {boolean} Should an error be thrown when unknown arguments are encountered, or when arguments are passed that do not match the `type` configured in `options`. **Default:** `true`.",
                      "name": "strict",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "Should an error be thrown when unknown arguments are encountered, or when arguments are passed that do not match the `type` configured in `options`."
                    },
                    {
                      "textRaw": "`allowPositionals` {boolean} Whether this command accepts positional arguments. **Default:** `false` if `strict` is `true`, otherwise `true`.",
                      "name": "allowPositionals",
                      "type": "boolean",
                      "default": "`false` if `strict` is `true`, otherwise `true`",
                      "desc": "Whether this command accepts positional arguments."
                    },
                    {
                      "textRaw": "`allowNegative` {boolean} If `true`, allows explicitly setting boolean options to `false` by prefixing the option name with `--no-`. **Default:** `false`.",
                      "name": "allowNegative",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, allows explicitly setting boolean options to `false` by prefixing the option name with `--no-`."
                    },
                    {
                      "textRaw": "`tokens` {boolean} Return the parsed tokens. This is useful for extending the built-in behavior, from adding additional checks through to reprocessing the tokens in different ways. **Default:** `false`.",
                      "name": "tokens",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Return the parsed tokens. This is useful for extending the built-in behavior, from adding additional checks through to reprocessing the tokens in different ways."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object} The parsed command line arguments:",
                "name": "return",
                "type": "Object",
                "desc": "The parsed command line arguments:",
                "options": [
                  {
                    "textRaw": "`values` {Object} A mapping of parsed option names with their {string} or {boolean} values.",
                    "name": "values",
                    "type": "Object",
                    "desc": "A mapping of parsed option names with their {string} or {boolean} values."
                  },
                  {
                    "textRaw": "`positionals` {string[]} Positional arguments.",
                    "name": "positionals",
                    "type": "string[]",
                    "desc": "Positional arguments."
                  },
                  {
                    "textRaw": "`tokens` {Object[]|undefined} See parseArgs tokens section. Only returned if `config` includes `tokens: true`.",
                    "name": "tokens",
                    "type": "Object[]|undefined",
                    "desc": "See parseArgs tokens section. Only returned if `config` includes `tokens: true`."
                  }
                ]
              }
            }
          ],
          "desc": "<p>Provides a higher level API for command-line argument parsing than interacting\nwith <code>process.argv</code> directly. Takes a specification for the expected arguments\nand returns a structured object with the parsed options and positionals.</p>\n<pre><code class=\"language-mjs\">import { parseArgs } from 'node:util';\nconst args = ['-f', '--bar', 'b'];\nconst options = {\n  foo: {\n    type: 'boolean',\n    short: 'f',\n  },\n  bar: {\n    type: 'string',\n  },\n};\nconst {\n  values,\n  positionals,\n} = parseArgs({ args, options });\nconsole.log(values, positionals);\n// Prints: [Object: null prototype] { foo: true, bar: 'b' } []\n</code></pre>\n<pre><code class=\"language-cjs\">const { parseArgs } = require('node:util');\nconst args = ['-f', '--bar', 'b'];\nconst options = {\n  foo: {\n    type: 'boolean',\n    short: 'f',\n  },\n  bar: {\n    type: 'string',\n  },\n};\nconst {\n  values,\n  positionals,\n} = parseArgs({ args, options });\nconsole.log(values, positionals);\n// Prints: [Object: null prototype] { foo: true, bar: 'b' } []\n</code></pre>",
          "modules": [
            {
              "textRaw": "`parseArgs` `tokens`",
              "name": "`parseargs`_`tokens`",
              "type": "module",
              "desc": "<p>Detailed parse information is available for adding custom behaviors by\nspecifying <code>tokens: true</code> in the configuration.\nThe returned tokens have properties describing:</p>\n<ul>\n<li>all tokens\n<ul>\n<li><code>kind</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> One of 'option', 'positional', or 'option-terminator'.</li>\n<li><code>index</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> Index of element in <code>args</code> containing token. So the\nsource argument for a token is <code>args[token.index]</code>.</li>\n</ul>\n</li>\n<li>option tokens\n<ul>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> Long name of option.</li>\n<li><code>rawName</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> How option used in args, like <code>-f</code> of <code>--foo</code>.</li>\n<li><code>value</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> Option value specified in args.\nUndefined for boolean options.</li>\n<li><code>inlineValue</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> Whether option value specified inline,\nlike <code>--foo=bar</code>.</li>\n</ul>\n</li>\n<li>positional tokens\n<ul>\n<li><code>value</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The value of the positional argument in args (i.e. <code>args[index]</code>).</li>\n</ul>\n</li>\n<li>option-terminator token</li>\n</ul>\n<p>The returned tokens are in the order encountered in the input args. Options\nthat appear more than once in args produce a token for each use. Short option\ngroups like <code>-xy</code> expand to a token for each option. So <code>-xxx</code> produces\nthree tokens.</p>\n<p>For example, to add support for a negated option like <code>--no-color</code> (which\n<code>allowNegative</code> supports when the option is of <code>boolean</code> type), the returned\ntokens can be reprocessed to change the value stored for the negated option.</p>\n<pre><code class=\"language-mjs\">import { parseArgs } from 'node:util';\n\nconst options = {\n  'color': { type: 'boolean' },\n  'no-color': { type: 'boolean' },\n  'logfile': { type: 'string' },\n  'no-logfile': { type: 'boolean' },\n};\nconst { values, tokens } = parseArgs({ options, tokens: true });\n\n// Reprocess the option tokens and overwrite the returned values.\ntokens\n  .filter((token) => token.kind === 'option')\n  .forEach((token) => {\n    if (token.name.startsWith('no-')) {\n      // Store foo:false for --no-foo\n      const positiveName = token.name.slice(3);\n      values[positiveName] = false;\n      delete values[token.name];\n    } else {\n      // Resave value so last one wins if both --foo and --no-foo.\n      values[token.name] = token.value ?? true;\n    }\n  });\n\nconst color = values.color;\nconst logfile = values.logfile ?? 'default.log';\n\nconsole.log({ logfile, color });\n</code></pre>\n<pre><code class=\"language-cjs\">const { parseArgs } = require('node:util');\n\nconst options = {\n  'color': { type: 'boolean' },\n  'no-color': { type: 'boolean' },\n  'logfile': { type: 'string' },\n  'no-logfile': { type: 'boolean' },\n};\nconst { values, tokens } = parseArgs({ options, tokens: true });\n\n// Reprocess the option tokens and overwrite the returned values.\ntokens\n  .filter((token) => token.kind === 'option')\n  .forEach((token) => {\n    if (token.name.startsWith('no-')) {\n      // Store foo:false for --no-foo\n      const positiveName = token.name.slice(3);\n      values[positiveName] = false;\n      delete values[token.name];\n    } else {\n      // Resave value so last one wins if both --foo and --no-foo.\n      values[token.name] = token.value ?? true;\n    }\n  });\n\nconst color = values.color;\nconst logfile = values.logfile ?? 'default.log';\n\nconsole.log({ logfile, color });\n</code></pre>\n<p>Example usage showing negated options, and when an option is used\nmultiple ways then last one wins.</p>\n<pre><code class=\"language-console\">$ node negate.js\n{ logfile: 'default.log', color: undefined }\n$ node negate.js --no-logfile --no-color\n{ logfile: false, color: false }\n$ node negate.js --logfile=test.log --color\n{ logfile: 'test.log', color: true }\n$ node negate.js --no-logfile --logfile=test.log --color --no-color\n{ logfile: 'test.log', color: false }\n</code></pre>",
              "displayName": "`parseArgs` `tokens`"
            }
          ]
        },
        {
          "textRaw": "`util.parseEnv(content)`",
          "name": "parseEnv",
          "type": "method",
          "meta": {
            "added": [
              "v21.7.0",
              "v20.12.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.10.0",
                  "v22.21.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59925",
                "description": "This API is no longer experimental."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`content` {string}",
                  "name": "content",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The raw contents of a <code>.env</code> file.</p>\n<ul>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>Given an example <code>.env</code> file:</p>\n<pre><code class=\"language-cjs\">const { parseEnv } = require('node:util');\n\nparseEnv('HELLO=world\\nHELLO=oh my\\n');\n// Returns: { HELLO: 'oh my' }\n</code></pre>\n<pre><code class=\"language-mjs\">import { parseEnv } from 'node:util';\n\nparseEnv('HELLO=world\\nHELLO=oh my\\n');\n// Returns: { HELLO: 'oh my' }\n</code></pre>"
        },
        {
          "textRaw": "`util.promisify(original)`",
          "name": "promisify",
          "type": "method",
          "meta": {
            "added": [
              "v8.0.0"
            ],
            "changes": [
              {
                "version": "v20.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/49647",
                "description": "Calling `promisify` on a function that returns a `Promise` is deprecated."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`original` {Function}",
                  "name": "original",
                  "type": "Function"
                }
              ],
              "return": {
                "textRaw": "Returns: {Function}",
                "name": "return",
                "type": "Function"
              }
            }
          ],
          "desc": "<p>Takes a function following the common error-first callback style, i.e. taking\nan <code>(err, value) => ...</code> callback as the last argument, and returns a version\nthat returns promises.</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nimport { stat } from 'node:fs';\n\nconst promisifiedStat = promisify(stat);\npromisifiedStat('.').then((stats) => {\n  // Do something with `stats`\n}).catch((error) => {\n  // Handle the error.\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { promisify } = require('node:util');\nconst { stat } = require('node:fs');\n\nconst promisifiedStat = promisify(stat);\npromisifiedStat('.').then((stats) => {\n  // Do something with `stats`\n}).catch((error) => {\n  // Handle the error.\n});\n</code></pre>\n<p>Or, equivalently using <code>async function</code>s:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\nimport { stat } from 'node:fs';\n\nconst promisifiedStat = promisify(stat);\n\nasync function callStat() {\n  const stats = await promisifiedStat('.');\n  console.log(`This directory is owned by ${stats.uid}`);\n}\n\ncallStat();\n</code></pre>\n<pre><code class=\"language-cjs\">const { promisify } = require('node:util');\nconst { stat } = require('node:fs');\n\nconst promisifiedStat = promisify(stat);\n\nasync function callStat() {\n  const stats = await promisifiedStat('.');\n  console.log(`This directory is owned by ${stats.uid}`);\n}\n\ncallStat();\n</code></pre>\n<p>If there is an <code>original[util.promisify.custom]</code> property present, <code>promisify</code>\nwill return its value, see <a href=\"#custom-promisified-functions\">Custom promisified functions</a>.</p>\n<p><code>promisify()</code> assumes that <code>original</code> is a function taking a callback as its\nfinal argument in all cases. If <code>original</code> is not a function, <code>promisify()</code>\nwill throw an error. If <code>original</code> is a function but its last argument is not\nan error-first callback, it will still be passed an error-first\ncallback as its last argument.</p>\n<p>Using <code>promisify()</code> on class methods or other methods that use <code>this</code> may not\nwork as expected unless handled specially:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\n\nclass Foo {\n  constructor() {\n    this.a = 42;\n  }\n\n  bar(callback) {\n    callback(null, this.a);\n  }\n}\n\nconst foo = new Foo();\n\nconst naiveBar = promisify(foo.bar);\n// TypeError: Cannot read properties of undefined (reading 'a')\n// naiveBar().then(a => console.log(a));\n\nnaiveBar.call(foo).then((a) => console.log(a)); // '42'\n\nconst bindBar = naiveBar.bind(foo);\nbindBar().then((a) => console.log(a)); // '42'\n</code></pre>\n<pre><code class=\"language-cjs\">const { promisify } = require('node:util');\n\nclass Foo {\n  constructor() {\n    this.a = 42;\n  }\n\n  bar(callback) {\n    callback(null, this.a);\n  }\n}\n\nconst foo = new Foo();\n\nconst naiveBar = promisify(foo.bar);\n// TypeError: Cannot read properties of undefined (reading 'a')\n// naiveBar().then(a => console.log(a));\n\nnaiveBar.call(foo).then((a) => console.log(a)); // '42'\n\nconst bindBar = naiveBar.bind(foo);\nbindBar().then((a) => console.log(a)); // '42'\n</code></pre>",
          "modules": [
            {
              "textRaw": "Custom promisified functions",
              "name": "custom_promisified_functions",
              "type": "module",
              "desc": "<p>Using the <code>util.promisify.custom</code> symbol one can override the return value of\n<a href=\"#utilpromisifyoriginal\"><code>util.promisify()</code></a>:</p>\n<pre><code class=\"language-mjs\">import { promisify } from 'node:util';\n\nfunction doSomething(foo, callback) {\n  // ...\n}\n\ndoSomething[promisify.custom] = (foo) => {\n  return getPromiseSomehow();\n};\n\nconst promisified = promisify(doSomething);\nconsole.log(promisified === doSomething[promisify.custom]);\n// prints 'true'\n</code></pre>\n<pre><code class=\"language-cjs\">const { promisify } = require('node:util');\n\nfunction doSomething(foo, callback) {\n  // ...\n}\n\ndoSomething[promisify.custom] = (foo) => {\n  return getPromiseSomehow();\n};\n\nconst promisified = promisify(doSomething);\nconsole.log(promisified === doSomething[promisify.custom]);\n// prints 'true'\n</code></pre>\n<p>This can be useful for cases where the original function does not follow the\nstandard format of taking an error-first callback as the last argument.</p>\n<p>For example, with a function that takes in\n<code>(foo, onSuccessCallback, onErrorCallback)</code>:</p>\n<pre><code class=\"language-js\">doSomething[util.promisify.custom] = (foo) => {\n  return new Promise((resolve, reject) => {\n    doSomething(foo, resolve, reject);\n  });\n};\n</code></pre>\n<p>If <code>promisify.custom</code> is defined but is not a function, <code>promisify()</code> will\nthrow an error.</p>",
              "displayName": "Custom promisified functions"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {symbol} that can be used to declare custom promisified variants of functions, see Custom promisified functions.",
              "name": "custom",
              "type": "symbol",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.16.2"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31672",
                    "description": "This is now defined as a shared symbol."
                  }
                ]
              },
              "desc": "<p>In addition to being accessible through <code>util.promisify.custom</code>, this\nsymbol is <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/for\">registered globally</a> and can be\naccessed in any environment as <code>Symbol.for('nodejs.util.promisify.custom')</code>.</p>\n<p>For example, with a function that takes in\n<code>(foo, onSuccessCallback, onErrorCallback)</code>:</p>\n<pre><code class=\"language-js\">const kCustomPromisifiedSymbol = Symbol.for('nodejs.util.promisify.custom');\n\ndoSomething[kCustomPromisifiedSymbol] = (foo) => {\n  return new Promise((resolve, reject) => {\n    doSomething(foo, resolve, reject);\n  });\n};\n</code></pre>",
              "shortDesc": "that can be used to declare custom promisified variants of functions, see Custom promisified functions."
            }
          ]
        },
        {
          "textRaw": "`util.stripVTControlCharacters(str)`",
          "name": "stripVTControlCharacters",
          "type": "method",
          "meta": {
            "added": [
              "v16.11.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`str` {string}",
                  "name": "str",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>Returns <code>str</code> with any ANSI escape codes removed.</p>\n<pre><code class=\"language-js\">console.log(util.stripVTControlCharacters('\\u001B[4mvalue\\u001B[0m'));\n// Prints \"value\"\n</code></pre>"
        },
        {
          "textRaw": "`util.styleText(format, text[, options])`",
          "name": "styleText",
          "type": "method",
          "meta": {
            "added": [
              "v21.7.0",
              "v20.12.0"
            ],
            "changes": [
              {
                "version": "v26.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/61556",
                "description": "Add support for hexadecimal colors."
              },
              {
                "version": [
                  "v24.2.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/58437",
                "description": "Added the `'none'` format as a non-op format."
              },
              {
                "version": [
                  "v23.5.0",
                  "v22.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/56265",
                "description": "styleText is now stable."
              },
              {
                "version": [
                  "v22.8.0",
                  "v20.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/54389",
                "description": "Respect isTTY and environment variables such as NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`format` {string|Array} A text format or an Array of text formats defined in `util.inspect.colors`, or a hex color in `#RGB` or `#RRGGBB` form.",
                  "name": "format",
                  "type": "string|Array",
                  "desc": "A text format or an Array of text formats defined in `util.inspect.colors`, or a hex color in `#RGB` or `#RRGGBB` form."
                },
                {
                  "textRaw": "`text` {string} The text to be formatted.",
                  "name": "text",
                  "type": "string",
                  "desc": "The text to be formatted."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`validateStream` {boolean} When true, `stream` is checked to see if it can handle colors. **Default:** `true`.",
                      "name": "validateStream",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "When true, `stream` is checked to see if it can handle colors."
                    },
                    {
                      "textRaw": "`stream` {Stream} A stream that will be validated if it can be colored. **Default:** `process.stdout`.",
                      "name": "stream",
                      "type": "Stream",
                      "default": "`process.stdout`",
                      "desc": "A stream that will be validated if it can be colored."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>This function returns a formatted text considering the <code>format</code> passed\nfor printing in a terminal. It is aware of the terminal's capabilities\nand acts according to the configuration set via <code>NO_COLOR</code>,\n<code>NODE_DISABLE_COLORS</code> and <code>FORCE_COLOR</code> environment variables.</p>\n<pre><code class=\"language-mjs\">import { styleText } from 'node:util';\nimport { stderr } from 'node:process';\n\nconst successMessage = styleText('green', 'Success!');\nconsole.log(successMessage);\n\nconst errorMessage = styleText(\n  'red',\n  'Error! Error!',\n  // Validate if process.stderr has TTY\n  { stream: stderr },\n);\nconsole.error(errorMessage);\n</code></pre>\n<pre><code class=\"language-cjs\">const { styleText } = require('node:util');\nconst { stderr } = require('node:process');\n\nconst successMessage = styleText('green', 'Success!');\nconsole.log(successMessage);\n\nconst errorMessage = styleText(\n  'red',\n  'Error! Error!',\n  // Validate if process.stderr has TTY\n  { stream: stderr },\n);\nconsole.error(errorMessage);\n</code></pre>\n<p><code>util.inspect.colors</code> also provides text formats such as <code>italic</code>, and\n<code>underline</code> and you can combine both:</p>\n<pre><code class=\"language-cjs\">console.log(\n  util.styleText(['underline', 'italic'], 'My italic underlined message'),\n);\n</code></pre>\n<p>When passing an array of formats, the order of the format applied\nis left to right so the following style might overwrite the previous one.</p>\n<pre><code class=\"language-cjs\">console.log(\n  util.styleText(['red', 'green'], 'text'), // green\n);\n</code></pre>\n<p>The special format value <code>none</code> applies no additional styling to the text.</p>\n<p>In addition to predefined color names, <code>util.styleText()</code> supports hex color\nstrings using ANSI TrueColor (24-bit) escape sequences. Hex colors can be\nspecified in either 3-digit (<code>#RGB</code>) or 6-digit (<code>#RRGGBB</code>) format:</p>\n<pre><code class=\"language-mjs\">import { styleText } from 'node:util';\n\n// 6-digit hex color\nconsole.log(styleText('#ff5733', 'Orange text'));\n\n// 3-digit hex color (shorthand)\nconsole.log(styleText('#f00', 'Red text'));\n</code></pre>\n<pre><code class=\"language-cjs\">const { styleText } = require('node:util');\n\n// 6-digit hex color\nconsole.log(styleText('#ff5733', 'Orange text'));\n\n// 3-digit hex color (shorthand)\nconsole.log(styleText('#f00', 'Red text'));\n</code></pre>\n<p>The full list of formats can be found in <a href=\"#modifiers\">modifiers</a>.</p>"
        },
        {
          "textRaw": "`util.toUSVString(string)`",
          "name": "toUSVString",
          "type": "method",
          "meta": {
            "added": [
              "v16.8.0",
              "v14.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`string` {string}",
                  "name": "string",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>Returns the <code>string</code> after replacing any surrogate code points\n(or equivalently, any unpaired surrogate code units) with the\nUnicode \"replacement character\" U+FFFD.</p>"
        },
        {
          "textRaw": "`util.transferableAbortController()`",
          "name": "transferableAbortController",
          "type": "method",
          "meta": {
            "added": [
              "v18.11.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>Creates and returns an <a href=\"globals.html#class-abortcontroller\"><code>&#x3C;AbortController></code></a> instance whose <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> is marked\nas transferable and can be used with <code>structuredClone()</code> or <code>postMessage()</code>.</p>"
        },
        {
          "textRaw": "`util.transferableAbortSignal(signal)`",
          "name": "transferableAbortSignal",
          "type": "method",
          "meta": {
            "added": [
              "v18.11.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`signal` {AbortSignal}",
                  "name": "signal",
                  "type": "AbortSignal"
                }
              ],
              "return": {
                "textRaw": "Returns: {AbortSignal}",
                "name": "return",
                "type": "AbortSignal"
              }
            }
          ],
          "desc": "<p>Marks the given <a href=\"globals.html#class-abortsignal\"><code>&#x3C;AbortSignal></code></a> as transferable so that it can be used with <code>structuredClone()</code> and <code>postMessage()</code>.</p>\n<pre><code class=\"language-js\">const signal = transferableAbortSignal(AbortSignal.timeout(100));\nconst channel = new MessageChannel();\nchannel.port2.postMessage(signal, [signal]);\n</code></pre>"
        },
        {
          "textRaw": "`util.aborted(signal, resource)`",
          "name": "aborted",
          "type": "method",
          "meta": {
            "added": [
              "v19.7.0",
              "v18.16.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57765",
                "description": "Change stability index for this feature from Experimental to Stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`signal` {AbortSignal}",
                  "name": "signal",
                  "type": "AbortSignal"
                },
                {
                  "textRaw": "`resource` {Object} Any non-null object tied to the abortable operation and held weakly. If `resource` is garbage collected before the `signal` aborts, the promise remains pending, allowing Node.js to stop tracking it. This helps prevent memory leaks in long-running or non-cancelable operations.",
                  "name": "resource",
                  "type": "Object",
                  "desc": "Any non-null object tied to the abortable operation and held weakly. If `resource` is garbage collected before the `signal` aborts, the promise remains pending, allowing Node.js to stop tracking it. This helps prevent memory leaks in long-running or non-cancelable operations."
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise}",
                "name": "return",
                "type": "Promise"
              }
            }
          ],
          "desc": "<p>Listens to abort event on the provided <code>signal</code> and returns a promise that resolves when the <code>signal</code> is aborted.\nIf <code>resource</code> is provided, it weakly references the operation's associated object,\nso if <code>resource</code> is garbage collected before the <code>signal</code> aborts,\nthen returned promise shall remain pending.\nThis prevents memory leaks in long-running or non-cancelable operations.</p>\n<pre><code class=\"language-cjs\">const { aborted } = require('node:util');\n\n// Obtain an object with an abortable signal, like a custom resource or operation.\nconst dependent = obtainSomethingAbortable();\n\n// Pass `dependent` as the resource, indicating the promise should only resolve\n// if `dependent` is still in memory when the signal is aborted.\naborted(dependent.signal, dependent).then(() => {\n\n  // This code runs when `dependent` is aborted.\n  console.log('Dependent resource was aborted.');\n});\n\n// Simulate an event that triggers the abort.\ndependent.on('event', () => {\n  dependent.abort(); // This will cause the `aborted` promise to resolve.\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { aborted } from 'node:util';\n\n// Obtain an object with an abortable signal, like a custom resource or operation.\nconst dependent = obtainSomethingAbortable();\n\n// Pass `dependent` as the resource, indicating the promise should only resolve\n// if `dependent` is still in memory when the signal is aborted.\naborted(dependent.signal, dependent).then(() => {\n\n  // This code runs when `dependent` is aborted.\n  console.log('Dependent resource was aborted.');\n});\n\n// Simulate an event that triggers the abort.\ndependent.on('event', () => {\n  dependent.abort(); // This will cause the `aborted` promise to resolve.\n});\n</code></pre>"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `util.MIMEType`",
          "name": "util.MIMEType",
          "type": "class",
          "meta": {
            "added": [
              "v19.1.0",
              "v18.13.0"
            ],
            "changes": [
              {
                "version": [
                  "v23.11.0",
                  "v22.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57510",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>An implementation of <a href=\"https://bmeck.github.io/node-proposal-mime-api/\">the MIMEType class</a>.</p>\n<p>In accordance with browser conventions, all properties of <code>MIMEType</code> objects\nare implemented as getters and setters on the class prototype, rather than as\ndata properties on the object itself.</p>\n<p>A MIME string is a structured string containing multiple meaningful\ncomponents. When parsed, a <code>MIMEType</code> object is returned containing\nproperties for each of these components.</p>",
          "signatures": [
            {
              "textRaw": "`new MIMEType(input)`",
              "name": "MIMEType",
              "type": "ctor",
              "params": [
                {
                  "textRaw": "`input` {string} The input MIME to parse",
                  "name": "input",
                  "type": "string",
                  "desc": "The input MIME to parse"
                }
              ],
              "desc": "<p>Creates a new <code>MIMEType</code> object by parsing the <code>input</code>.</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\n\nconst myMIME = new MIMEType('text/plain');\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\n\nconst myMIME = new MIMEType('text/plain');\n</code></pre>\n<p>A <code>TypeError</code> will be thrown if the <code>input</code> is not a valid MIME. Note\nthat an effort will be made to coerce the given values into strings. For\ninstance:</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\nconst myMIME = new MIMEType({ toString: () => 'text/plain' });\nconsole.log(String(myMIME));\n// Prints: text/plain\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\nconst myMIME = new MIMEType({ toString: () => 'text/plain' });\nconsole.log(String(myMIME));\n// Prints: text/plain\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string}",
              "name": "type",
              "type": "string",
              "desc": "<p>Gets and sets the type portion of the MIME.</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\n\nconst myMIME = new MIMEType('text/javascript');\nconsole.log(myMIME.type);\n// Prints: text\nmyMIME.type = 'application';\nconsole.log(myMIME.type);\n// Prints: application\nconsole.log(String(myMIME));\n// Prints: application/javascript\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\n\nconst myMIME = new MIMEType('text/javascript');\nconsole.log(myMIME.type);\n// Prints: text\nmyMIME.type = 'application';\nconsole.log(myMIME.type);\n// Prints: application\nconsole.log(String(myMIME));\n// Prints: application/javascript\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "subtype",
              "type": "string",
              "desc": "<p>Gets and sets the subtype portion of the MIME.</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\n\nconst myMIME = new MIMEType('text/ecmascript');\nconsole.log(myMIME.subtype);\n// Prints: ecmascript\nmyMIME.subtype = 'javascript';\nconsole.log(myMIME.subtype);\n// Prints: javascript\nconsole.log(String(myMIME));\n// Prints: text/javascript\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\n\nconst myMIME = new MIMEType('text/ecmascript');\nconsole.log(myMIME.subtype);\n// Prints: ecmascript\nmyMIME.subtype = 'javascript';\nconsole.log(myMIME.subtype);\n// Prints: javascript\nconsole.log(String(myMIME));\n// Prints: text/javascript\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "essence",
              "type": "string",
              "desc": "<p>Gets the essence of the MIME. This property is read only.\nUse <code>mime.type</code> or <code>mime.subtype</code> to alter the MIME.</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\n\nconst myMIME = new MIMEType('text/javascript;key=value');\nconsole.log(myMIME.essence);\n// Prints: text/javascript\nmyMIME.type = 'application';\nconsole.log(myMIME.essence);\n// Prints: application/javascript\nconsole.log(String(myMIME));\n// Prints: application/javascript;key=value\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\n\nconst myMIME = new MIMEType('text/javascript;key=value');\nconsole.log(myMIME.essence);\n// Prints: text/javascript\nmyMIME.type = 'application';\nconsole.log(myMIME.essence);\n// Prints: application/javascript\nconsole.log(String(myMIME));\n// Prints: application/javascript;key=value\n</code></pre>"
            },
            {
              "textRaw": "Type: {MIMEParams}",
              "name": "params",
              "type": "MIMEParams",
              "desc": "<p>Gets the <a href=\"#class-utilmimeparams\"><code>MIMEParams</code></a> object representing the\nparameters of the MIME. This property is read-only. See\n<a href=\"#class-utilmimeparams\"><code>MIMEParams</code></a> documentation for details.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`mime.toString()`",
              "name": "toString",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>The <code>toString()</code> method on the <code>MIMEType</code> object returns the serialized MIME.</p>\n<p>Because of the need for standard compliance, this method does not allow users\nto customize the serialization process of the MIME.</p>"
            },
            {
              "textRaw": "`mime.toJSON()`",
              "name": "toJSON",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Alias for <a href=\"#mimetostring\"><code>mime.toString()</code></a>.</p>\n<p>This method is automatically called when an <code>MIMEType</code> object is serialized\nwith <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify\"><code>JSON.stringify()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\n\nconst myMIMES = [\n  new MIMEType('image/png'),\n  new MIMEType('image/gif'),\n];\nconsole.log(JSON.stringify(myMIMES));\n// Prints: [\"image/png\", \"image/gif\"]\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\n\nconst myMIMES = [\n  new MIMEType('image/png'),\n  new MIMEType('image/gif'),\n];\nconsole.log(JSON.stringify(myMIMES));\n// Prints: [\"image/png\", \"image/gif\"]\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `util.MIMEParams`",
          "name": "util.MIMEParams",
          "type": "class",
          "meta": {
            "added": [
              "v19.1.0",
              "v18.13.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>MIMEParams</code> API provides read and write access to the parameters of a\n<code>MIMEType</code>.</p>",
          "signatures": [
            {
              "textRaw": "`new MIMEParams()`",
              "name": "MIMEParams",
              "type": "ctor",
              "params": [],
              "desc": "<p>Creates a new <code>MIMEParams</code> object by with empty parameters</p>\n<pre><code class=\"language-mjs\">import { MIMEParams } from 'node:util';\n\nconst myParams = new MIMEParams();\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEParams } = require('node:util');\n\nconst myParams = new MIMEParams();\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`mimeParams.delete(name)`",
              "name": "delete",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Remove all name-value pairs whose name is <code>name</code>.</p>"
            },
            {
              "textRaw": "`mimeParams.entries()`",
              "name": "entries",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  }
                }
              ],
              "desc": "<p>Returns an iterator over each of the name-value pairs in the parameters.\nEach item of the iterator is a JavaScript <code>Array</code>. The first item of the array\nis the <code>name</code>, the second item of the array is the <code>value</code>.</p>"
            },
            {
              "textRaw": "`mimeParams.get(name)`",
              "name": "get",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string|null} A string or `null` if there is no name-value pair with the given `name`.",
                    "name": "return",
                    "type": "string|null",
                    "desc": "A string or `null` if there is no name-value pair with the given `name`."
                  }
                }
              ],
              "desc": "<p>Returns the value of the first name-value pair whose name is <code>name</code>. If there\nare no such pairs, <code>null</code> is returned.</p>"
            },
            {
              "textRaw": "`mimeParams.has(name)`",
              "name": "has",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if there is at least one name-value pair whose name is <code>name</code>.</p>"
            },
            {
              "textRaw": "`mimeParams.keys()`",
              "name": "keys",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  }
                }
              ],
              "desc": "<p>Returns an iterator over the names of each name-value pair.</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\n\nconst { params } = new MIMEType('text/plain;foo=0;bar=1');\nfor (const name of params.keys()) {\n  console.log(name);\n}\n// Prints:\n//   foo\n//   bar\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\n\nconst { params } = new MIMEType('text/plain;foo=0;bar=1');\nfor (const name of params.keys()) {\n  console.log(name);\n}\n// Prints:\n//   foo\n//   bar\n</code></pre>"
            },
            {
              "textRaw": "`mimeParams.set(name, value)`",
              "name": "set",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string}",
                      "name": "name",
                      "type": "string"
                    },
                    {
                      "textRaw": "`value` {string}",
                      "name": "value",
                      "type": "string"
                    }
                  ]
                }
              ],
              "desc": "<p>Sets the value in the <code>MIMEParams</code> object associated with <code>name</code> to\n<code>value</code>. If there are any pre-existing name-value pairs whose names are <code>name</code>,\nset the first such pair's value to <code>value</code>.</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\n\nconst { params } = new MIMEType('text/plain;foo=0;bar=1');\nparams.set('foo', 'def');\nparams.set('baz', 'xyz');\nconsole.log(params.toString());\n// Prints: foo=def;bar=1;baz=xyz\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\n\nconst { params } = new MIMEType('text/plain;foo=0;bar=1');\nparams.set('foo', 'def');\nparams.set('baz', 'xyz');\nconsole.log(params.toString());\n// Prints: foo=def;bar=1;baz=xyz\n</code></pre>"
            },
            {
              "textRaw": "`mimeParams.values()`",
              "name": "values",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  }
                }
              ],
              "desc": "<p>Returns an iterator over the values of each name-value pair.</p>"
            },
            {
              "textRaw": "`mimeParams[Symbol.iterator]()`",
              "name": "[Symbol.iterator]",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Iterator}",
                    "name": "return",
                    "type": "Iterator"
                  }
                }
              ],
              "desc": "<p>Alias for <a href=\"#mimeparamsentries\"><code>mimeParams.entries()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { MIMEType } from 'node:util';\n\nconst { params } = new MIMEType('text/plain;foo=bar;xyz=baz');\nfor (const [name, value] of params) {\n  console.log(name, value);\n}\n// Prints:\n//   foo bar\n//   xyz baz\n</code></pre>\n<pre><code class=\"language-cjs\">const { MIMEType } = require('node:util');\n\nconst { params } = new MIMEType('text/plain;foo=bar;xyz=baz');\nfor (const [name, value] of params) {\n  console.log(name, value);\n}\n// Prints:\n//   foo bar\n//   xyz baz\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `util.TextDecoder`",
          "name": "util.TextDecoder",
          "type": "class",
          "meta": {
            "added": [
              "v8.3.0"
            ],
            "changes": [
              {
                "version": "v11.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/22281",
                "description": "The class is now available on the global object."
              }
            ]
          },
          "desc": "<p>An implementation of the <a href=\"https://encoding.spec.whatwg.org/\">WHATWG Encoding Standard</a> <code>TextDecoder</code> API.</p>\n<pre><code class=\"language-js\">const decoder = new TextDecoder();\nconst u8arr = new Uint8Array([72, 101, 108, 108, 111]);\nconsole.log(decoder.decode(u8arr)); // Hello\n</code></pre>",
          "modules": [
            {
              "textRaw": "WHATWG supported encodings",
              "name": "whatwg_supported_encodings",
              "type": "module",
              "desc": "<p>Per the <a href=\"https://encoding.spec.whatwg.org/\">WHATWG Encoding Standard</a>, the encodings supported by the\n<code>TextDecoder</code> API are outlined in the tables below. For each encoding,\none or more aliases may be used.</p>\n<p>Different Node.js build configurations support different sets of encodings.\n(see <a href=\"intl.html\">Internationalization</a>)</p>",
              "modules": [
                {
                  "textRaw": "Encodings supported by default (with full ICU data)",
                  "name": "encodings_supported_by_default_(with_full_icu_data)",
                  "type": "module",
                  "desc": "<table>\n<thead>\n<tr>\n<th>Encoding</th>\n<th>Aliases</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'ibm866'</code></td>\n<td><code>'866'</code>, <code>'cp866'</code>, <code>'csibm866'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-2'</code></td>\n<td><code>'csisolatin2'</code>, <code>'iso-ir-101'</code>, <code>'iso8859-2'</code>, <code>'iso88592'</code>, <code>'iso_8859-2'</code>, <code>'iso_8859-2:1987'</code>, <code>'l2'</code>, <code>'latin2'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-3'</code></td>\n<td><code>'csisolatin3'</code>, <code>'iso-ir-109'</code>, <code>'iso8859-3'</code>, <code>'iso88593'</code>, <code>'iso_8859-3'</code>, <code>'iso_8859-3:1988'</code>, <code>'l3'</code>, <code>'latin3'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-4'</code></td>\n<td><code>'csisolatin4'</code>, <code>'iso-ir-110'</code>, <code>'iso8859-4'</code>, <code>'iso88594'</code>, <code>'iso_8859-4'</code>, <code>'iso_8859-4:1988'</code>, <code>'l4'</code>, <code>'latin4'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-5'</code></td>\n<td><code>'csisolatincyrillic'</code>, <code>'cyrillic'</code>, <code>'iso-ir-144'</code>, <code>'iso8859-5'</code>, <code>'iso88595'</code>, <code>'iso_8859-5'</code>, <code>'iso_8859-5:1988'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-6'</code></td>\n<td><code>'arabic'</code>, <code>'asmo-708'</code>, <code>'csiso88596e'</code>, <code>'csiso88596i'</code>, <code>'csisolatinarabic'</code>, <code>'ecma-114'</code>, <code>'iso-8859-6-e'</code>, <code>'iso-8859-6-i'</code>, <code>'iso-ir-127'</code>, <code>'iso8859-6'</code>, <code>'iso88596'</code>, <code>'iso_8859-6'</code>, <code>'iso_8859-6:1987'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-7'</code></td>\n<td><code>'csisolatingreek'</code>, <code>'ecma-118'</code>, <code>'elot_928'</code>, <code>'greek'</code>, <code>'greek8'</code>, <code>'iso-ir-126'</code>, <code>'iso8859-7'</code>, <code>'iso88597'</code>, <code>'iso_8859-7'</code>, <code>'iso_8859-7:1987'</code>, <code>'sun_eu_greek'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-8'</code></td>\n<td><code>'csiso88598e'</code>, <code>'csisolatinhebrew'</code>, <code>'hebrew'</code>, <code>'iso-8859-8-e'</code>, <code>'iso-ir-138'</code>, <code>'iso8859-8'</code>, <code>'iso88598'</code>, <code>'iso_8859-8'</code>, <code>'iso_8859-8:1988'</code>, <code>'visual'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-8-i'</code></td>\n<td><code>'csiso88598i'</code>, <code>'logical'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-10'</code></td>\n<td><code>'csisolatin6'</code>, <code>'iso-ir-157'</code>, <code>'iso8859-10'</code>, <code>'iso885910'</code>, <code>'l6'</code>, <code>'latin6'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-13'</code></td>\n<td><code>'iso8859-13'</code>, <code>'iso885913'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-14'</code></td>\n<td><code>'iso8859-14'</code>, <code>'iso885914'</code></td>\n</tr>\n<tr>\n<td><code>'iso-8859-15'</code></td>\n<td><code>'csisolatin9'</code>, <code>'iso8859-15'</code>, <code>'iso885915'</code>, <code>'iso_8859-15'</code>, <code>'l9'</code></td>\n</tr>\n<tr>\n<td><code>'koi8-r'</code></td>\n<td><code>'cskoi8r'</code>, <code>'koi'</code>, <code>'koi8'</code>, <code>'koi8_r'</code></td>\n</tr>\n<tr>\n<td><code>'koi8-u'</code></td>\n<td><code>'koi8-ru'</code></td>\n</tr>\n<tr>\n<td><code>'macintosh'</code></td>\n<td><code>'csmacintosh'</code>, <code>'mac'</code>, <code>'x-mac-roman'</code></td>\n</tr>\n<tr>\n<td><code>'windows-874'</code></td>\n<td><code>'dos-874'</code>, <code>'iso-8859-11'</code>, <code>'iso8859-11'</code>, <code>'iso885911'</code>, <code>'tis-620'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1250'</code></td>\n<td><code>'cp1250'</code>, <code>'x-cp1250'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1251'</code></td>\n<td><code>'cp1251'</code>, <code>'x-cp1251'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1252'</code></td>\n<td><code>'ansi_x3.4-1968'</code>, <code>'ascii'</code>, <code>'cp1252'</code>, <code>'cp819'</code>, <code>'csisolatin1'</code>, <code>'ibm819'</code>, <code>'iso-8859-1'</code>, <code>'iso-ir-100'</code>, <code>'iso8859-1'</code>, <code>'iso88591'</code>, <code>'iso_8859-1'</code>, <code>'iso_8859-1:1987'</code>, <code>'l1'</code>, <code>'latin1'</code>, <code>'us-ascii'</code>, <code>'x-cp1252'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1253'</code></td>\n<td><code>'cp1253'</code>, <code>'x-cp1253'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1254'</code></td>\n<td><code>'cp1254'</code>, <code>'csisolatin5'</code>, <code>'iso-8859-9'</code>, <code>'iso-ir-148'</code>, <code>'iso8859-9'</code>, <code>'iso88599'</code>, <code>'iso_8859-9'</code>, <code>'iso_8859-9:1989'</code>, <code>'l5'</code>, <code>'latin5'</code>, <code>'x-cp1254'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1255'</code></td>\n<td><code>'cp1255'</code>, <code>'x-cp1255'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1256'</code></td>\n<td><code>'cp1256'</code>, <code>'x-cp1256'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1257'</code></td>\n<td><code>'cp1257'</code>, <code>'x-cp1257'</code></td>\n</tr>\n<tr>\n<td><code>'windows-1258'</code></td>\n<td><code>'cp1258'</code>, <code>'x-cp1258'</code></td>\n</tr>\n<tr>\n<td><code>'x-mac-cyrillic'</code></td>\n<td><code>'x-mac-ukrainian'</code></td>\n</tr>\n<tr>\n<td><code>'gbk'</code></td>\n<td><code>'chinese'</code>, <code>'csgb2312'</code>, <code>'csiso58gb231280'</code>, <code>'gb2312'</code>, <code>'gb_2312'</code>, <code>'gb_2312-80'</code>, <code>'iso-ir-58'</code>, <code>'x-gbk'</code></td>\n</tr>\n<tr>\n<td><code>'gb18030'</code></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'big5'</code></td>\n<td><code>'big5-hkscs'</code>, <code>'cn-big5'</code>, <code>'csbig5'</code>, <code>'x-x-big5'</code></td>\n</tr>\n<tr>\n<td><code>'euc-jp'</code></td>\n<td><code>'cseucpkdfmtjapanese'</code>, <code>'x-euc-jp'</code></td>\n</tr>\n<tr>\n<td><code>'iso-2022-jp'</code></td>\n<td><code>'csiso2022jp'</code></td>\n</tr>\n<tr>\n<td><code>'shift_jis'</code></td>\n<td><code>'csshiftjis'</code>, <code>'ms932'</code>, <code>'ms_kanji'</code>, <code>'shift-jis'</code>, <code>'sjis'</code>, <code>'windows-31j'</code>, <code>'x-sjis'</code></td>\n</tr>\n<tr>\n<td><code>'euc-kr'</code></td>\n<td><code>'cseuckr'</code>, <code>'csksc56011987'</code>, <code>'iso-ir-149'</code>, <code>'korean'</code>, <code>'ks_c_5601-1987'</code>, <code>'ks_c_5601-1989'</code>, <code>'ksc5601'</code>, <code>'ksc_5601'</code>, <code>'windows-949'</code></td>\n</tr>\n</tbody>\n</table>",
                  "displayName": "Encodings supported by default (with full ICU data)"
                },
                {
                  "textRaw": "Encodings supported when Node.js is built with the `small-icu` option",
                  "name": "encodings_supported_when_node.js_is_built_with_the_`small-icu`_option",
                  "type": "module",
                  "desc": "<table>\n<thead>\n<tr>\n<th>Encoding</th>\n<th>Aliases</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'utf-8'</code></td>\n<td><code>'unicode-1-1-utf-8'</code>, <code>'utf8'</code></td>\n</tr>\n<tr>\n<td><code>'utf-16le'</code></td>\n<td><code>'utf-16'</code></td>\n</tr>\n<tr>\n<td><code>'utf-16be'</code></td>\n<td></td>\n</tr>\n</tbody>\n</table>",
                  "displayName": "Encodings supported when Node.js is built with the `small-icu` option"
                },
                {
                  "textRaw": "Encodings supported when ICU is disabled",
                  "name": "encodings_supported_when_icu_is_disabled",
                  "type": "module",
                  "desc": "<table>\n<thead>\n<tr>\n<th>Encoding</th>\n<th>Aliases</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'utf-8'</code></td>\n<td><code>'unicode-1-1-utf-8'</code>, <code>'utf8'</code></td>\n</tr>\n<tr>\n<td><code>'utf-16le'</code></td>\n<td><code>'utf-16'</code></td>\n</tr>\n</tbody>\n</table>\n<p>The <code>'iso-8859-16'</code> encoding listed in the <a href=\"https://encoding.spec.whatwg.org/\">WHATWG Encoding Standard</a>\nis not supported.</p>",
                  "displayName": "Encodings supported when ICU is disabled"
                }
              ],
              "displayName": "WHATWG supported encodings"
            }
          ],
          "signatures": [
            {
              "textRaw": "`new TextDecoder([encoding[, options]])`",
              "name": "TextDecoder",
              "type": "ctor",
              "params": [
                {
                  "textRaw": "`encoding` {string} Identifies the `encoding` that this `TextDecoder` instance supports. **Default:** `'utf-8'`.",
                  "name": "encoding",
                  "type": "string",
                  "default": "`'utf-8'`",
                  "desc": "Identifies the `encoding` that this `TextDecoder` instance supports.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`fatal` {boolean} `true` if decoding failures are fatal. This option is not supported when ICU is disabled (see Internationalization). **Default:** `false`.",
                      "name": "fatal",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "`true` if decoding failures are fatal. This option is not supported when ICU is disabled (see Internationalization)."
                    },
                    {
                      "textRaw": "`ignoreBOM` {boolean} When `true`, the `TextDecoder` will include the byte order mark in the decoded result. When `false`, the byte order mark will be removed from the output. This option is only used when `encoding` is `'utf-8'`, `'utf-16be'`, or `'utf-16le'`. **Default:** `false`.",
                      "name": "ignoreBOM",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "When `true`, the `TextDecoder` will include the byte order mark in the decoded result. When `false`, the byte order mark will be removed from the output. This option is only used when `encoding` is `'utf-8'`, `'utf-16be'`, or `'utf-16le'`."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new <code>TextDecoder</code> instance. The <code>encoding</code> may specify one of the\nsupported encodings or an alias.</p>\n<p>The <code>TextDecoder</code> class is also available on the global object.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`textDecoder.decode([input[, options]])`",
              "name": "decode",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {ArrayBuffer|DataView|TypedArray} An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data.",
                      "name": "input",
                      "type": "ArrayBuffer|DataView|TypedArray",
                      "desc": "An `ArrayBuffer`, `DataView`, or `TypedArray` instance containing the encoded data.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`stream` {boolean} `true` if additional chunks of data are expected. **Default:** `false`.",
                          "name": "stream",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "`true` if additional chunks of data are expected."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Decodes the <code>input</code> and returns a string. If <code>options.stream</code> is <code>true</code>, any\nincomplete byte sequences occurring at the end of the <code>input</code> are buffered\ninternally and emitted after the next call to <code>textDecoder.decode()</code>.</p>\n<p>If <code>textDecoder.fatal</code> is <code>true</code>, decoding errors that occur will result in a\n<code>TypeError</code> being thrown.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string}",
              "name": "encoding",
              "type": "string",
              "desc": "<p>The encoding supported by the <code>TextDecoder</code> instance.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "fatal",
              "type": "boolean",
              "desc": "<p>The value will be <code>true</code> if decoding errors result in a <code>TypeError</code> being\nthrown.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "ignoreBOM",
              "type": "boolean",
              "desc": "<p>The value will be <code>true</code> if the decoding result will include the byte order\nmark.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `util.TextEncoder`",
          "name": "util.TextEncoder",
          "type": "class",
          "meta": {
            "added": [
              "v8.3.0"
            ],
            "changes": [
              {
                "version": "v11.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/22281",
                "description": "The class is now available on the global object."
              }
            ]
          },
          "desc": "<p>An implementation of the <a href=\"https://encoding.spec.whatwg.org/\">WHATWG Encoding Standard</a> <code>TextEncoder</code> API. All\ninstances of <code>TextEncoder</code> only support UTF-8 encoding.</p>\n<pre><code class=\"language-js\">const encoder = new TextEncoder();\nconst uint8array = encoder.encode('this is some data');\n</code></pre>\n<p>The <code>TextEncoder</code> class is also available on the global object.</p>",
          "methods": [
            {
              "textRaw": "`textEncoder.encode([input])`",
              "name": "encode",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`input` {string} The text to encode. **Default:** an empty string.",
                      "name": "input",
                      "type": "string",
                      "default": "an empty string",
                      "desc": "The text to encode.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Uint8Array}",
                    "name": "return",
                    "type": "Uint8Array"
                  }
                }
              ],
              "desc": "<p>UTF-8 encodes the <code>input</code> string and returns a <code>Uint8Array</code> containing the\nencoded bytes.</p>"
            },
            {
              "textRaw": "`textEncoder.encodeInto(src, dest)`",
              "name": "encodeInto",
              "type": "method",
              "meta": {
                "added": [
                  "v12.11.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`src` {string} The text to encode.",
                      "name": "src",
                      "type": "string",
                      "desc": "The text to encode."
                    },
                    {
                      "textRaw": "`dest` {Uint8Array} The array to hold the encode result.",
                      "name": "dest",
                      "type": "Uint8Array",
                      "desc": "The array to hold the encode result."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object",
                    "options": [
                      {
                        "textRaw": "`read` {number} The read Unicode code units of src.",
                        "name": "read",
                        "type": "number",
                        "desc": "The read Unicode code units of src."
                      },
                      {
                        "textRaw": "`written` {number} The written UTF-8 bytes of dest.",
                        "name": "written",
                        "type": "number",
                        "desc": "The written UTF-8 bytes of dest."
                      }
                    ]
                  }
                }
              ],
              "desc": "<p>UTF-8 encodes the <code>src</code> string to the <code>dest</code> Uint8Array and returns an object\ncontaining the read Unicode code units and written UTF-8 bytes.</p>\n<pre><code class=\"language-js\">const encoder = new TextEncoder();\nconst src = 'this is some data';\nconst dest = new Uint8Array(10);\nconst { read, written } = encoder.encodeInto(src, dest);\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string}",
              "name": "encoding",
              "type": "string",
              "desc": "<p>The encoding supported by the <code>TextEncoder</code> instance. Always set to <code>'utf-8'</code>.</p>"
            }
          ]
        }
      ],
      "properties": [
        {
          "textRaw": "`util.types`",
          "name": "types",
          "type": "property",
          "meta": {
            "added": [
              "v10.0.0"
            ],
            "changes": [
              {
                "version": "v15.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/34055",
                "description": "Exposed as `require('util/types')`."
              }
            ]
          },
          "desc": "<p><code>util.types</code> provides type checks for different kinds of built-in objects.\nUnlike <code>instanceof</code> or <code>Object.prototype.toString.call(value)</code>, these checks do\nnot inspect properties of the object that are accessible from JavaScript (like\ntheir prototype), and usually have the overhead of calling into C++.</p>\n<p>The result generally does not make any guarantees about what kinds of\nproperties or behavior a value exposes in JavaScript. They are primarily\nuseful for addon developers who prefer to do type checking in JavaScript.</p>\n<p>The API is accessible via <code>require('node:util').types</code> or <code>require('node:util/types')</code>.</p>",
          "methods": [
            {
              "textRaw": "`util.types.isAnyArrayBuffer(value)`",
              "name": "isAnyArrayBuffer",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> or\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>&#x3C;SharedArrayBuffer></code></a> instance.</p>\n<p>See also <a href=\"#utiltypesisarraybuffervalue\"><code>util.types.isArrayBuffer()</code></a> and\n<a href=\"#utiltypesissharedarraybuffervalue\"><code>util.types.isSharedArrayBuffer()</code></a>.</p>\n<pre><code class=\"language-js\">util.types.isAnyArrayBuffer(new ArrayBuffer());  // Returns true\nutil.types.isAnyArrayBuffer(new SharedArrayBuffer());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isArrayBufferView(value)`",
              "name": "isArrayBufferView",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an instance of one of the <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>\nviews, such as typed array objects or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a>. Equivalent to <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView\"><code>ArrayBuffer.isView()</code></a>.</p>\n<pre><code class=\"language-js\">util.types.isArrayBufferView(new Int8Array());  // true\nutil.types.isArrayBufferView(Buffer.from('hello world')); // true\nutil.types.isArrayBufferView(new DataView(new ArrayBuffer(16)));  // true\nutil.types.isArrayBufferView(new ArrayBuffer());  // false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isArgumentsObject(value)`",
              "name": "isArgumentsObject",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an <code>arguments</code> object.</p>\n<pre><code class=\"language-js\">function foo() {\n  util.types.isArgumentsObject(arguments);  // Returns true\n}\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isArrayBuffer(value)`",
              "name": "isArrayBuffer",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> instance.\nThis does <em>not</em> include <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>&#x3C;SharedArrayBuffer></code></a> instances. Usually, it is\ndesirable to test for both; See <a href=\"#utiltypesisanyarraybuffervalue\"><code>util.types.isAnyArrayBuffer()</code></a> for that.</p>\n<pre><code class=\"language-js\">util.types.isArrayBuffer(new ArrayBuffer());  // Returns true\nutil.types.isArrayBuffer(new SharedArrayBuffer());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isAsyncFunction(value)`",
              "name": "isAsyncFunction",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function\">async function</a>.\nThis only reports back what the JavaScript engine is seeing;\nin particular, the return value may not match the original source code if\na transpilation tool was used.</p>\n<pre><code class=\"language-js\">util.types.isAsyncFunction(function foo() {});  // Returns false\nutil.types.isAsyncFunction(async function foo() {});  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isBigInt64Array(value)`",
              "name": "isBigInt64Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a <code>BigInt64Array</code> instance.</p>\n<pre><code class=\"language-js\">util.types.isBigInt64Array(new BigInt64Array());   // Returns true\nutil.types.isBigInt64Array(new BigUint64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isBigIntObject(value)`",
              "name": "isBigIntObject",
              "type": "method",
              "meta": {
                "added": [
                  "v10.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a BigInt object, e.g. created\nby <code>Object(BigInt(123))</code>.</p>\n<pre><code class=\"language-js\">util.types.isBigIntObject(Object(BigInt(123)));   // Returns true\nutil.types.isBigIntObject(BigInt(123));   // Returns false\nutil.types.isBigIntObject(123);  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isBigUint64Array(value)`",
              "name": "isBigUint64Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a <code>BigUint64Array</code> instance.</p>\n<pre><code class=\"language-js\">util.types.isBigUint64Array(new BigInt64Array());   // Returns false\nutil.types.isBigUint64Array(new BigUint64Array());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isBooleanObject(value)`",
              "name": "isBooleanObject",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a boolean object, e.g. created\nby <code>new Boolean()</code>.</p>\n<pre><code class=\"language-js\">util.types.isBooleanObject(false);  // Returns false\nutil.types.isBooleanObject(true);   // Returns false\nutil.types.isBooleanObject(new Boolean(false)); // Returns true\nutil.types.isBooleanObject(new Boolean(true));  // Returns true\nutil.types.isBooleanObject(Boolean(false)); // Returns false\nutil.types.isBooleanObject(Boolean(true));  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isBoxedPrimitive(value)`",
              "name": "isBoxedPrimitive",
              "type": "method",
              "meta": {
                "added": [
                  "v10.11.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is any boxed primitive object, e.g. created\nby <code>new Boolean()</code>, <code>new String()</code> or <code>Object(Symbol())</code>.</p>\n<p>For example:</p>\n<pre><code class=\"language-js\">util.types.isBoxedPrimitive(false); // Returns false\nutil.types.isBoxedPrimitive(new Boolean(false)); // Returns true\nutil.types.isBoxedPrimitive(Symbol('foo')); // Returns false\nutil.types.isBoxedPrimitive(Object(Symbol('foo'))); // Returns true\nutil.types.isBoxedPrimitive(Object(BigInt(5))); // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isCryptoKey(value)`",
              "name": "isCryptoKey",
              "type": "method",
              "meta": {
                "added": [
                  "v16.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {Object}",
                      "name": "value",
                      "type": "Object"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if <code>value</code> is a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>, <code>false</code> otherwise.</p>"
            },
            {
              "textRaw": "`util.types.isDataView(value)`",
              "name": "isDataView",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> instance.</p>\n<pre><code class=\"language-js\">const ab = new ArrayBuffer(20);\nutil.types.isDataView(new DataView(ab));  // Returns true\nutil.types.isDataView(new Float64Array());  // Returns false\n</code></pre>\n<p>See also <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView\"><code>ArrayBuffer.isView()</code></a>.</p>"
            },
            {
              "textRaw": "`util.types.isDate(value)`",
              "name": "isDate",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Date\"><code>&#x3C;Date></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isDate(new Date());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isExternal(value)`",
              "name": "isExternal",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a native <code>External</code> value.</p>\n<p>A native <code>External</code> value is a special type of object that contains a\nraw C++ pointer (<code>void*</code>) for access from native code, and has no other\nproperties. Such objects are created either by Node.js internals or native\naddons. In JavaScript, they are <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\">frozen</a> objects with a\n<code>null</code> prototype.</p>\n<pre><code class=\"language-c\">#include &#x3C;js_native_api.h>\n#include &#x3C;stdlib.h>\nnapi_value result;\nstatic napi_value MyNapi(napi_env env, napi_callback_info info) {\n  int* raw = (int*) malloc(1024);\n  napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &#x26;result);\n  if (status != napi_ok) {\n    napi_throw_error(env, NULL, \"napi_create_external failed\");\n    return NULL;\n  }\n  return result;\n}\n...\nDECLARE_NAPI_PROPERTY(\"myNapi\", MyNapi)\n...\n</code></pre>\n<pre><code class=\"language-mjs\">import native from 'napi_addon.node';\nimport { types } from 'node:util';\n\nconst data = native.myNapi();\ntypes.isExternal(data); // returns true\ntypes.isExternal(0); // returns false\ntypes.isExternal(new String('foo')); // returns false\n</code></pre>\n<pre><code class=\"language-cjs\">const native = require('napi_addon.node');\nconst { types } = require('node:util');\n\nconst data = native.myNapi();\ntypes.isExternal(data); // returns true\ntypes.isExternal(0); // returns false\ntypes.isExternal(new String('foo')); // returns false\n</code></pre>\n<p>For further information on <code>napi_create_external</code>, refer to\n<a href=\"n-api.html#napi_create_external\"><code>napi_create_external()</code></a>.</p>"
            },
            {
              "textRaw": "`util.types.isFloat16Array(value)`",
              "name": "isFloat16Array",
              "type": "method",
              "meta": {
                "added": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Float16Array\"><code>&#x3C;Float16Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isFloat16Array(new ArrayBuffer());  // Returns false\nutil.types.isFloat16Array(new Float16Array());  // Returns true\nutil.types.isFloat16Array(new Float32Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isFloat32Array(value)`",
              "name": "isFloat32Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Float32Array\"><code>&#x3C;Float32Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isFloat32Array(new ArrayBuffer());  // Returns false\nutil.types.isFloat32Array(new Float32Array());  // Returns true\nutil.types.isFloat32Array(new Float64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isFloat64Array(value)`",
              "name": "isFloat64Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Float64Array\"><code>&#x3C;Float64Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isFloat64Array(new ArrayBuffer());  // Returns false\nutil.types.isFloat64Array(new Uint8Array());  // Returns false\nutil.types.isFloat64Array(new Float64Array());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isGeneratorFunction(value)`",
              "name": "isGeneratorFunction",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a generator function.\nThis only reports back what the JavaScript engine is seeing;\nin particular, the return value may not match the original source code if\na transpilation tool was used.</p>\n<pre><code class=\"language-js\">util.types.isGeneratorFunction(function foo() {});  // Returns false\nutil.types.isGeneratorFunction(function* foo() {});  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isGeneratorObject(value)`",
              "name": "isGeneratorObject",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a generator object as returned from a\nbuilt-in generator function.\nThis only reports back what the JavaScript engine is seeing;\nin particular, the return value may not match the original source code if\na transpilation tool was used.</p>\n<pre><code class=\"language-js\">function* foo() {}\nconst generator = foo();\nutil.types.isGeneratorObject(generator);  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isInt8Array(value)`",
              "name": "isInt8Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Int8Array\"><code>&#x3C;Int8Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isInt8Array(new ArrayBuffer());  // Returns false\nutil.types.isInt8Array(new Int8Array());  // Returns true\nutil.types.isInt8Array(new Float64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isInt16Array(value)`",
              "name": "isInt16Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Int16Array\"><code>&#x3C;Int16Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isInt16Array(new ArrayBuffer());  // Returns false\nutil.types.isInt16Array(new Int16Array());  // Returns true\nutil.types.isInt16Array(new Float64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isInt32Array(value)`",
              "name": "isInt32Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Int32Array\"><code>&#x3C;Int32Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isInt32Array(new ArrayBuffer());  // Returns false\nutil.types.isInt32Array(new Int32Array());  // Returns true\nutil.types.isInt32Array(new Float64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isKeyObject(value)`",
              "name": "isKeyObject",
              "type": "method",
              "meta": {
                "added": [
                  "v16.2.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {Object}",
                      "name": "value",
                      "type": "Object"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if <code>value</code> is a <a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a>, <code>false</code> otherwise.</p>"
            },
            {
              "textRaw": "`util.types.isMap(value)`",
              "name": "isMap",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>&#x3C;Map></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isMap(new Map());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isMapIterator(value)`",
              "name": "isMapIterator",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an iterator returned for a built-in\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map\"><code>&#x3C;Map></code></a> instance.</p>\n<pre><code class=\"language-js\">const map = new Map();\nutil.types.isMapIterator(map.keys());  // Returns true\nutil.types.isMapIterator(map.values());  // Returns true\nutil.types.isMapIterator(map.entries());  // Returns true\nutil.types.isMapIterator(map[Symbol.iterator]());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isModuleNamespaceObject(value)`",
              "name": "isModuleNamespaceObject",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an instance of a <a href=\"https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects\">Module Namespace Object</a>.</p>\n<pre><code class=\"language-mjs\">import * as ns from './a.js';\n\nutil.types.isModuleNamespaceObject(ns);  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isNativeError(value)`",
              "name": "isNativeError",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": [],
                "deprecated": [
                  "v24.2.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `Error.isError` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p><strong>Note:</strong> As of Node.js 24, <code>Error.isError()</code> is currently slower than <code>util.types.isNativeError()</code>.\nIf performance is critical, consider benchmarking both in your environment.</p>\n<p>Returns <code>true</code> if the value was returned by the constructor of a\n<a href=\"https://tc39.es/ecma262/#sec-error-objects\">built-in <code>Error</code> type</a>.</p>\n<pre><code class=\"language-js\">console.log(util.types.isNativeError(new Error()));  // true\nconsole.log(util.types.isNativeError(new TypeError()));  // true\nconsole.log(util.types.isNativeError(new RangeError()));  // true\n</code></pre>\n<p>Subclasses of the native error types are also native errors:</p>\n<pre><code class=\"language-js\">class MyError extends Error {}\nconsole.log(util.types.isNativeError(new MyError()));  // true\n</code></pre>\n<p>A value being <code>instanceof</code> a native error class is not equivalent to <code>isNativeError()</code>\nreturning <code>true</code> for that value. <code>isNativeError()</code> returns <code>true</code> for errors\nwhich come from a different <a href=\"https://tc39.es/ecma262/#realm\">realm</a> while <code>instanceof Error</code> returns <code>false</code>\nfor these errors:</p>\n<pre><code class=\"language-mjs\">import { createContext, runInContext } from 'node:vm';\nimport { types } from 'node:util';\n\nconst context = createContext({});\nconst myError = runInContext('new Error()', context);\nconsole.log(types.isNativeError(myError)); // true\nconsole.log(myError instanceof Error); // false\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, runInContext } = require('node:vm');\nconst { types } = require('node:util');\n\nconst context = createContext({});\nconst myError = runInContext('new Error()', context);\nconsole.log(types.isNativeError(myError)); // true\nconsole.log(myError instanceof Error); // false\n</code></pre>\n<p>Conversely, <code>isNativeError()</code> returns <code>false</code> for all objects which were not\nreturned by the constructor of a native error. That includes values\nwhich are <code>instanceof</code> native errors:</p>\n<pre><code class=\"language-js\">const myError = { __proto__: Error.prototype };\nconsole.log(util.types.isNativeError(myError)); // false\nconsole.log(myError instanceof Error); // true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isNumberObject(value)`",
              "name": "isNumberObject",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a number object, e.g. created\nby <code>new Number()</code>.</p>\n<pre><code class=\"language-js\">util.types.isNumberObject(0);  // Returns false\nutil.types.isNumberObject(new Number(0));   // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isPromise(value)`",
              "name": "isPromise",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a>.</p>\n<pre><code class=\"language-js\">util.types.isPromise(Promise.resolve(42));  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isProxy(value)`",
              "name": "isProxy",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy\"><code>&#x3C;Proxy></code></a> instance.</p>\n<pre><code class=\"language-js\">const target = {};\nconst proxy = new Proxy(target, {});\nutil.types.isProxy(target);  // Returns false\nutil.types.isProxy(proxy);  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isRegExp(value)`",
              "name": "isRegExp",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a regular expression object.</p>\n<pre><code class=\"language-js\">util.types.isRegExp(/abc/);  // Returns true\nutil.types.isRegExp(new RegExp('abc'));  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isSet(value)`",
              "name": "isSet",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>&#x3C;Set></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isSet(new Set());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isSetIterator(value)`",
              "name": "isSetIterator",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is an iterator returned for a built-in\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Set\"><code>&#x3C;Set></code></a> instance.</p>\n<pre><code class=\"language-js\">const set = new Set();\nutil.types.isSetIterator(set.keys());  // Returns true\nutil.types.isSetIterator(set.values());  // Returns true\nutil.types.isSetIterator(set.entries());  // Returns true\nutil.types.isSetIterator(set[Symbol.iterator]());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isSharedArrayBuffer(value)`",
              "name": "isSharedArrayBuffer",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>&#x3C;SharedArrayBuffer></code></a> instance.\nThis does <em>not</em> include <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> instances. Usually, it is\ndesirable to test for both; See <a href=\"#utiltypesisanyarraybuffervalue\"><code>util.types.isAnyArrayBuffer()</code></a> for that.</p>\n<pre><code class=\"language-js\">util.types.isSharedArrayBuffer(new ArrayBuffer());  // Returns false\nutil.types.isSharedArrayBuffer(new SharedArrayBuffer());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isStringObject(value)`",
              "name": "isStringObject",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a string object, e.g. created\nby <code>new String()</code>.</p>\n<pre><code class=\"language-js\">util.types.isStringObject('foo');  // Returns false\nutil.types.isStringObject(new String('foo'));   // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isSymbolObject(value)`",
              "name": "isSymbolObject",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a symbol object, created\nby calling <code>Object()</code> on a <code>Symbol</code> primitive.</p>\n<pre><code class=\"language-js\">const symbol = Symbol('foo');\nutil.types.isSymbolObject(symbol);  // Returns false\nutil.types.isSymbolObject(Object(symbol));   // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isTypedArray(value)`",
              "name": "isTypedArray",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isTypedArray(new ArrayBuffer());  // Returns false\nutil.types.isTypedArray(new Uint8Array());  // Returns true\nutil.types.isTypedArray(new Float64Array());  // Returns true\n</code></pre>\n<p>See also <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView\"><code>ArrayBuffer.isView()</code></a>.</p>"
            },
            {
              "textRaw": "`util.types.isUint8Array(value)`",
              "name": "isUint8Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isUint8Array(new ArrayBuffer());  // Returns false\nutil.types.isUint8Array(new Uint8Array());  // Returns true\nutil.types.isUint8Array(new Float64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isUint8ClampedArray(value)`",
              "name": "isUint8ClampedArray",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray\"><code>&#x3C;Uint8ClampedArray></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isUint8ClampedArray(new ArrayBuffer());  // Returns false\nutil.types.isUint8ClampedArray(new Uint8ClampedArray());  // Returns true\nutil.types.isUint8ClampedArray(new Float64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isUint16Array(value)`",
              "name": "isUint16Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array\"><code>&#x3C;Uint16Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isUint16Array(new ArrayBuffer());  // Returns false\nutil.types.isUint16Array(new Uint16Array());  // Returns true\nutil.types.isUint16Array(new Float64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isUint32Array(value)`",
              "name": "isUint32Array",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array\"><code>&#x3C;Uint32Array></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isUint32Array(new ArrayBuffer());  // Returns false\nutil.types.isUint32Array(new Uint32Array());  // Returns true\nutil.types.isUint32Array(new Float64Array());  // Returns false\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isWeakMap(value)`",
              "name": "isWeakMap",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakMap\"><code>&#x3C;WeakMap></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isWeakMap(new WeakMap());  // Returns true\n</code></pre>"
            },
            {
              "textRaw": "`util.types.isWeakSet(value)`",
              "name": "isWeakSet",
              "type": "method",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns <code>true</code> if the value is a built-in <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/WeakSet\"><code>&#x3C;WeakSet></code></a> instance.</p>\n<pre><code class=\"language-js\">util.types.isWeakSet(new WeakSet());  // Returns true\n</code></pre>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Deprecated APIs",
          "name": "deprecated_apis",
          "type": "module",
          "desc": "<p>The following APIs are deprecated and should no longer be used. Existing\napplications and modules should be updated to find alternative approaches.</p>",
          "methods": [
            {
              "textRaw": "`util._extend(target, source)`",
              "name": "_extend",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.5"
                ],
                "changes": [],
                "deprecated": [
                  "v6.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `Object.assign()` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`target` {Object}",
                      "name": "target",
                      "type": "Object"
                    },
                    {
                      "textRaw": "`source` {Object}",
                      "name": "source",
                      "type": "Object"
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>util._extend()</code> method was never intended to be used outside of internal\nNode.js modules. The community found and used it anyway.</p>\n<p>It is deprecated and should not be used in new code. JavaScript comes with very\nsimilar built-in functionality through <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\"><code>Object.assign()</code></a>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-extend-to-object-assign\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-extend-to-object-assign\n</code></pre>"
            },
            {
              "textRaw": "`util.isArray(object)`",
              "name": "isArray",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": [],
                "deprecated": [
                  "v4.0.0"
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `Array.isArray()` instead.",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`object` {any}",
                      "name": "object",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Alias for <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray\"><code>Array.isArray()</code></a>.</p>\n<p>Returns <code>true</code> if the given <code>object</code> is an <code>Array</code>. Otherwise, returns <code>false</code>.</p>\n<pre><code class=\"language-js\">const util = require('node:util');\n\nutil.isArray([]);\n// Returns: true\nutil.isArray(new Array());\n// Returns: true\nutil.isArray({});\n// Returns: false\n</code></pre>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/util-is\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/util-is\n</code></pre>"
            }
          ],
          "displayName": "Deprecated APIs"
        }
      ],
      "displayName": "Util",
      "source": "doc/api/util.md"
    },
    {
      "textRaw": "V8",
      "name": "v8",
      "introduced_in": "v4.0.0",
      "type": "module",
      "desc": "<p>The <code>node:v8</code> module exposes APIs that are specific to the version of <a href=\"https://developers.google.com/v8/\">V8</a>\nbuilt into the Node.js binary. It can be accessed using:</p>\n<pre><code class=\"language-mjs\">import v8 from 'node:v8';\n</code></pre>\n<pre><code class=\"language-cjs\">const v8 = require('node:v8');\n</code></pre>",
      "methods": [
        {
          "textRaw": "`v8.cachedDataVersionTag()`",
          "name": "cachedDataVersionTag",
          "type": "method",
          "meta": {
            "added": [
              "v8.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>Returns an integer representing a version tag derived from the V8 version,\ncommand-line flags, and detected CPU features. This is useful for determining\nwhether a <a href=\"vm.html#new-vmscriptcode-options\"><code>vm.Script</code></a> <code>cachedData</code> buffer is compatible with this instance\nof V8.</p>\n<pre><code class=\"language-js\">console.log(v8.cachedDataVersionTag()); // 3947234607\n// The value returned by v8.cachedDataVersionTag() is derived from the V8\n// version, command-line flags, and detected CPU features. Test that the value\n// does indeed update when flags are toggled.\nv8.setFlagsFromString('--allow_natives_syntax');\nconsole.log(v8.cachedDataVersionTag()); // 183726201\n</code></pre>"
        },
        {
          "textRaw": "`v8.getHeapCodeStatistics()`",
          "name": "getHeapCodeStatistics",
          "type": "method",
          "meta": {
            "added": [
              "v12.8.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>Get statistics about code and its metadata in the heap, see V8\n<a href=\"https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#a6079122af17612ef54ef3348ce170866\"><code>GetHeapCodeAndMetadataStatistics</code></a> API. Returns an object with the\nfollowing properties:</p>\n<ul>\n<li><code>code_and_metadata_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>bytecode_and_metadata_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>external_script_source_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>cpu_profiler_metadata_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n</ul>\n<pre><code class=\"language-json\">{\n  \"code_and_metadata_size\": 212208,\n  \"bytecode_and_metadata_size\": 161368,\n  \"external_script_source_size\": 1410794,\n  \"cpu_profiler_metadata_size\": 0\n}\n</code></pre>"
        },
        {
          "textRaw": "`v8.getHeapSnapshot([options])`",
          "name": "getHeapSnapshot",
          "type": "method",
          "meta": {
            "added": [
              "v11.13.0"
            ],
            "changes": [
              {
                "version": "v19.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/44989",
                "description": "Support options to configure the heap snapshot."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`exposeInternals` {boolean} If true, expose internals in the heap snapshot. **Default:** `false`.",
                      "name": "exposeInternals",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If true, expose internals in the heap snapshot."
                    },
                    {
                      "textRaw": "`exposeNumericValues` {boolean} If true, expose numeric values in artificial fields. **Default:** `false`.",
                      "name": "exposeNumericValues",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If true, expose numeric values in artificial fields."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {stream.Readable} A Readable containing the V8 heap snapshot.",
                "name": "return",
                "type": "stream.Readable",
                "desc": "A Readable containing the V8 heap snapshot."
              }
            }
          ],
          "desc": "<p>Generates a snapshot of the current V8 heap and returns a Readable\nStream that may be used to read the JSON serialized representation.\nThis JSON stream format is intended to be used with tools such as\nChrome DevTools. The JSON schema is undocumented and specific to the\nV8 engine. Therefore, the schema may change from one version of V8 to the next.</p>\n<p>Creating a heap snapshot requires memory about twice the size of the heap at\nthe time the snapshot is created. This results in the risk of OOM killers\nterminating the process.</p>\n<p>Generating a snapshot is a synchronous operation which blocks the event loop\nfor a duration depending on the heap size.</p>\n<pre><code class=\"language-mjs\">// Print heap snapshot to the console\nimport { getHeapSnapshot } from 'node:v8';\nimport process from 'node:process';\nconst stream = getHeapSnapshot();\nstream.pipe(process.stdout);\n</code></pre>\n<pre><code class=\"language-js\">// Print heap snapshot to the console\nconst v8 = require('node:v8');\nconst stream = v8.getHeapSnapshot();\nstream.pipe(process.stdout);\n</code></pre>"
        },
        {
          "textRaw": "`v8.getHeapSpaceStatistics()`",
          "name": "getHeapSpaceStatistics",
          "type": "method",
          "meta": {
            "added": [
              "v6.0.0"
            ],
            "changes": [
              {
                "version": "v7.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/10186",
                "description": "Support values exceeding the 32-bit unsigned integer range."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object[]}",
                "name": "return",
                "type": "Object[]"
              }
            }
          ],
          "desc": "<p>Returns statistics about the V8 heap spaces, i.e. the segments which make up\nthe V8 heap. Neither the ordering of heap spaces, nor the availability of a\nheap space can be guaranteed as the statistics are provided via the V8\n<a href=\"https://v8docs.nodesource.com/node-13.2/d5/dda/classv8_1_1_isolate.html#ac673576f24fdc7a33378f8f57e1d13a4\"><code>GetHeapSpaceStatistics</code></a> function and may change from one V8 version to the\nnext.</p>\n<p>The value returned is an array of objects containing the following properties:</p>\n<ul>\n<li><code>space_name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a></li>\n<li><code>space_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>space_used_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>space_available_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>physical_space_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n</ul>\n<pre><code class=\"language-json\">[\n  {\n    \"space_name\": \"new_space\",\n    \"space_size\": 2063872,\n    \"space_used_size\": 951112,\n    \"space_available_size\": 80824,\n    \"physical_space_size\": 2063872\n  },\n  {\n    \"space_name\": \"old_space\",\n    \"space_size\": 3090560,\n    \"space_used_size\": 2493792,\n    \"space_available_size\": 0,\n    \"physical_space_size\": 3090560\n  },\n  {\n    \"space_name\": \"code_space\",\n    \"space_size\": 1260160,\n    \"space_used_size\": 644256,\n    \"space_available_size\": 960,\n    \"physical_space_size\": 1260160\n  },\n  {\n    \"space_name\": \"map_space\",\n    \"space_size\": 1094160,\n    \"space_used_size\": 201608,\n    \"space_available_size\": 0,\n    \"physical_space_size\": 1094160\n  },\n  {\n    \"space_name\": \"large_object_space\",\n    \"space_size\": 0,\n    \"space_used_size\": 0,\n    \"space_available_size\": 1490980608,\n    \"physical_space_size\": 0\n  }\n]\n</code></pre>"
        },
        {
          "textRaw": "`v8.getHeapStatistics()`",
          "name": "getHeapStatistics",
          "type": "method",
          "meta": {
            "added": [
              "v1.0.0"
            ],
            "changes": [
              {
                "version": "v7.5.0",
                "pr-url": "https://github.com/nodejs/node/pull/10186",
                "description": "Support values exceeding the 32-bit unsigned integer range."
              },
              {
                "version": "v7.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/8610",
                "description": "Added `malloced_memory`, `peak_malloced_memory`, and `does_zap_garbage`."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>Returns an object with the following properties:</p>\n<ul>\n<li><code>total_heap_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>total_heap_size_executable</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>total_physical_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>total_available_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>used_heap_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>heap_size_limit</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>malloced_memory</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>peak_malloced_memory</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>does_zap_garbage</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>number_of_native_contexts</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>number_of_detached_contexts</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>total_global_handles_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>used_global_handles_size</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>external_memory</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>total_allocated_bytes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n</ul>\n<p><code>total_heap_size</code> The value of total_heap_size is the number of bytes V8 has\nallocated for the heap. This can grow if used_heap needs more memory.</p>\n<p><code>total_heap_size_executable</code> The value of total_heap_size_executable is the\nportion of the heap that can contain executable code, in bytes. This includes\nmemory used by JIT-compiled code and any memory that must be kept executable.</p>\n<p><code>total_physical_size</code> The value of total_physical_size is the actual physical memory\nused by the V8 heap, in bytes. This is the amount of memory that is committed\n(or in use) rather than reserved.</p>\n<p><code>total_available_size</code> The value of total_available_size is the number of\nbytes of memory available to the V8 heap. This value represents how much\nmore memory V8 can use before it exceeds the heap limit.</p>\n<p><code>used_heap_size</code> The value of used_heap_size is number of bytes currently\nbeing used by V8’s JavaScript objects. This is the actual memory in use and\ndoes not include memory that has been allocated but not yet used.</p>\n<p><code>heap_size_limit</code> The value of heap_size_limit is the maximum size of the V8\nheap, in bytes (either the default limit, determined by system resources, or\nthe value passed to the <code>--max_old_space_size</code> option).</p>\n<p><code>malloced_memory</code> The value of malloced_memory is the number of bytes allocated\nthrough <code>malloc</code> by V8.</p>\n<p><code>peak_malloced_memory</code> The value of peak_malloced_memory is the peak number of\nbytes allocated through <code>malloc</code> by V8 during the lifetime of the process.</p>\n<p><code>does_zap_garbage</code> is a 0/1 boolean, which signifies whether the\n<code>--zap_code_space</code> option is enabled or not. This makes V8 overwrite heap\ngarbage with a bit pattern. The RSS footprint (resident set size) gets bigger\nbecause it continuously touches all heap pages and that makes them less likely\nto get swapped out by the operating system.</p>\n<p><code>number_of_native_contexts</code> The value of native_context is the number of the\ntop-level contexts currently active. Increase of this number over time indicates\na memory leak.</p>\n<p><code>number_of_detached_contexts</code> The value of detached_context is the number\nof contexts that were detached and not yet garbage collected. This number\nbeing non-zero indicates a potential memory leak.</p>\n<p><code>total_global_handles_size</code> The value of total_global_handles_size is the\ntotal memory size of V8 global handles.</p>\n<p><code>used_global_handles_size</code> The value of used_global_handles_size is the\nused memory size of V8 global handles.</p>\n<p><code>external_memory</code> The value of external_memory is the memory size of array\nbuffers and external strings.</p>\n<p><code>total_allocated_bytes</code> The value of total allocated bytes since the Isolate\ncreation</p>\n<pre><code class=\"language-json\">{\n  \"total_heap_size\": 7326976,\n  \"total_heap_size_executable\": 4194304,\n  \"total_physical_size\": 7326976,\n  \"total_available_size\": 1152656,\n  \"used_heap_size\": 3476208,\n  \"heap_size_limit\": 1535115264,\n  \"malloced_memory\": 16384,\n  \"peak_malloced_memory\": 1127496,\n  \"does_zap_garbage\": 0,\n  \"number_of_native_contexts\": 1,\n  \"number_of_detached_contexts\": 0,\n  \"total_global_handles_size\": 8192,\n  \"used_global_handles_size\": 3296,\n  \"external_memory\": 318824\n}\n</code></pre>"
        },
        {
          "textRaw": "`v8.getCppHeapStatistics([detailLevel])`",
          "name": "getCppHeapStatistics",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`detailLevel` {string|undefined}: **Default:** `'detailed'`. Specifies the level of detail in the returned statistics. Accepted values are:",
                  "name": "detailLevel",
                  "type": "string|undefined",
                  "default": "`'detailed'`. Specifies the level of detail in the returned statistics. Accepted values are:",
                  "desc": ":",
                  "options": [
                    {
                      "textRaw": "`'brief'`: Brief statistics contain only the top-level allocated and used memory statistics for the entire heap.",
                      "desc": "`'brief'`: Brief statistics contain only the top-level allocated and used memory statistics for the entire heap."
                    },
                    {
                      "textRaw": "`'detailed'`: Detailed statistics also contain a break down per space and page, as well as freelist statistics and object type histograms.",
                      "desc": "`'detailed'`: Detailed statistics also contain a break down per space and page, as well as freelist statistics and object type histograms."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Retrieves <a href=\"https://v8docs.nodesource.com/node-22.4/d9/dc4/classv8_1_1_cpp_heap.html\">CppHeap</a> statistics regarding memory consumption and\nutilization using the V8 <a href=\"https://v8docs.nodesource.com/node-22.4/d9/dc4/classv8_1_1_cpp_heap.html#a3a5d09567758e608fffde50eeabc2feb\"><code>CollectStatistics()</code></a> function which\nmay change from one V8 version to the\nnext.</p>\n<p>It returns an object with a structure similar to the\n<a href=\"https://v8docs.nodesource.com/node-22.4/d7/d51/heap-statistics_8h_source.html\"><code>cppgc::HeapStatistics</code></a> object. See the <a href=\"https://v8docs.nodesource.com/node-22.4/df/d2f/structcppgc_1_1_heap_statistics.html\">V8 documentation</a>\nfor more information about the properties of the object.</p>\n<pre><code class=\"language-js\">// Detailed\n({\n  committed_size_bytes: 131072,\n  resident_size_bytes: 131072,\n  used_size_bytes: 152,\n  space_statistics: [\n    {\n      name: 'NormalPageSpace0',\n      committed_size_bytes: 0,\n      resident_size_bytes: 0,\n      used_size_bytes: 0,\n      page_stats: [{}],\n      free_list_stats: {},\n    },\n    {\n      name: 'NormalPageSpace1',\n      committed_size_bytes: 131072,\n      resident_size_bytes: 131072,\n      used_size_bytes: 152,\n      page_stats: [{}],\n      free_list_stats: {},\n    },\n    {\n      name: 'NormalPageSpace2',\n      committed_size_bytes: 0,\n      resident_size_bytes: 0,\n      used_size_bytes: 0,\n      page_stats: [{}],\n      free_list_stats: {},\n    },\n    {\n      name: 'NormalPageSpace3',\n      committed_size_bytes: 0,\n      resident_size_bytes: 0,\n      used_size_bytes: 0,\n      page_stats: [{}],\n      free_list_stats: {},\n    },\n    {\n      name: 'LargePageSpace',\n      committed_size_bytes: 0,\n      resident_size_bytes: 0,\n      used_size_bytes: 0,\n      page_stats: [{}],\n      free_list_stats: {},\n    },\n  ],\n  type_names: [],\n  detail_level: 'detailed',\n});\n</code></pre>\n<pre><code class=\"language-js\">// Brief\n({\n  committed_size_bytes: 131072,\n  resident_size_bytes: 131072,\n  used_size_bytes: 128864,\n  space_statistics: [],\n  type_names: [],\n  detail_level: 'brief',\n});\n</code></pre>"
        },
        {
          "textRaw": "`v8.queryObjects(ctor[, options])`",
          "name": "queryObjects",
          "type": "method",
          "meta": {
            "added": [
              "v22.0.0",
              "v20.13.0"
            ],
            "changes": [
              {
                "version": [
                  "v25.4.0",
                  "v24.13.1"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/60957",
                "description": "This API is no longer experimental."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`ctor` {Function} The constructor that can be used to search on the prototype chain in order to filter target objects in the heap.",
                  "name": "ctor",
                  "type": "Function",
                  "desc": "The constructor that can be used to search on the prototype chain in order to filter target objects in the heap."
                },
                {
                  "textRaw": "`options` {undefined|Object}",
                  "name": "options",
                  "type": "undefined|Object",
                  "options": [
                    {
                      "textRaw": "`format` {string} If it's `'count'`, the count of matched objects is returned. If it's `'summary'`, an array with summary strings of the matched objects is returned.",
                      "name": "format",
                      "type": "string",
                      "desc": "If it's `'count'`, the count of matched objects is returned. If it's `'summary'`, an array with summary strings of the matched objects is returned."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {number|string[]}",
                "name": "return",
                "type": "number|string[]"
              }
            }
          ],
          "desc": "<p>This is similar to the <a href=\"https://developer.chrome.com/docs/devtools/console/utilities#queryObjects-function\"><code>queryObjects()</code> console API</a> provided by the\nChromium DevTools console. It can be used to search for objects that\nhave the matching constructor on its prototype chain in the heap after\na full garbage collection, which can be useful for memory leak\nregression tests. To avoid surprising results, users should avoid using\nthis API on constructors whose implementation they don't control, or on\nconstructors that can be invoked by other parties in the application.</p>\n<p>To avoid accidental leaks, this API does not return raw references to\nthe objects found. By default, it returns the count of the objects\nfound. If <code>options.format</code> is <code>'summary'</code>, it returns an array\ncontaining brief string representations for each object. The visibility\nprovided in this API is similar to what the heap snapshot provides,\nwhile users can save the cost of serialization and parsing and directly\nfilter the target objects during the search.</p>\n<p>Only objects created in the current execution context are included in the\nresults.</p>\n<pre><code class=\"language-cjs\">const { queryObjects } = require('node:v8');\nclass A { foo = 'bar'; }\nconsole.log(queryObjects(A)); // 0\nconst a = new A();\nconsole.log(queryObjects(A)); // 1\n// [ \"A { foo: 'bar' }\" ]\nconsole.log(queryObjects(A, { format: 'summary' }));\n\nclass B extends A { bar = 'qux'; }\nconst b = new B();\nconsole.log(queryObjects(B)); // 1\n// [ \"B { foo: 'bar', bar: 'qux' }\" ]\nconsole.log(queryObjects(B, { format: 'summary' }));\n\n// Note that, when there are child classes inheriting from a constructor,\n// the constructor also shows up in the prototype chain of the child\n// classes's prototype, so the child classes's prototype would also be\n// included in the result.\nconsole.log(queryObjects(A));  // 3\n// [ \"B { foo: 'bar', bar: 'qux' }\", 'A {}', \"A { foo: 'bar' }\" ]\nconsole.log(queryObjects(A, { format: 'summary' }));\n</code></pre>\n<pre><code class=\"language-mjs\">import { queryObjects } from 'node:v8';\nclass A { foo = 'bar'; }\nconsole.log(queryObjects(A)); // 0\nconst a = new A();\nconsole.log(queryObjects(A)); // 1\n// [ \"A { foo: 'bar' }\" ]\nconsole.log(queryObjects(A, { format: 'summary' }));\n\nclass B extends A { bar = 'qux'; }\nconst b = new B();\nconsole.log(queryObjects(B)); // 1\n// [ \"B { foo: 'bar', bar: 'qux' }\" ]\nconsole.log(queryObjects(B, { format: 'summary' }));\n\n// Note that, when there are child classes inheriting from a constructor,\n// the constructor also shows up in the prototype chain of the child\n// classes's prototype, so the child classes's prototype would also be\n// included in the result.\nconsole.log(queryObjects(A));  // 3\n// [ \"B { foo: 'bar', bar: 'qux' }\", 'A {}', \"A { foo: 'bar' }\" ]\nconsole.log(queryObjects(A, { format: 'summary' }));\n</code></pre>"
        },
        {
          "textRaw": "`v8.setFlagsFromString(flags)`",
          "name": "setFlagsFromString",
          "type": "method",
          "meta": {
            "added": [
              "v1.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`flags` {string}",
                  "name": "flags",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>v8.setFlagsFromString()</code> method can be used to programmatically set\nV8 command-line flags. This method should be used with care. Changing settings\nafter the VM has started may result in unpredictable behavior, including\ncrashes and data loss; or it may simply do nothing.</p>\n<p>The V8 options available for a version of Node.js may be determined by running\n<code>node --v8-options</code>.</p>\n<p>Usage:</p>\n<pre><code class=\"language-mjs\">import { setFlagsFromString } from 'node:v8';\nimport { setInterval } from 'node:timers';\n\n// setFlagsFromString to trace garbage collection events\nsetFlagsFromString('--trace-gc');\n\n// Trigger GC events by using some memory\nlet arrays = [];\nconst interval = setInterval(() => {\n  for (let i = 0; i &#x3C; 500; i++) {\n    arrays.push(new Array(10000).fill(Math.random()));\n  }\n\n  if (arrays.length > 5000) {\n    arrays = arrays.slice(-1000);\n  }\n\n  console.log(`\\n* Created ${arrays.length} arrays\\n`);\n}, 100);\n\n// setFlagsFromString to stop tracing GC events after 1.5 seconds\nsetTimeout(() => {\n  setFlagsFromString('--notrace-gc');\n  console.log('\\nStopped tracing!\\n');\n}, 1500);\n\n// Stop triggering GC events altogether after 2.5 seconds\nsetTimeout(() => {\n  clearInterval(interval);\n}, 2500);\n</code></pre>\n<pre><code class=\"language-cjs\">const { setFlagsFromString } = require('node:v8');\nconst { setInterval } = require('node:timers');\n\n// setFlagsFromString to trace garbage collection events\nsetFlagsFromString('--trace-gc');\n\n// Trigger GC events by using some memory\nlet arrays = [];\nconst interval = setInterval(() => {\n  for (let i = 0; i &#x3C; 500; i++) {\n    arrays.push(new Array(10000).fill(Math.random()));\n  }\n\n  if (arrays.length > 5000) {\n    arrays = arrays.slice(-1000);\n  }\n\n  console.log(`\\n* Created ${arrays.length} arrays\\n`);\n}, 100);\n\n// setFlagsFromString to stop tracing GC events after 1.5 seconds\nsetTimeout(() => {\n  console.log('\\nStopped tracing!\\n');\n  setFlagsFromString('--notrace-gc');\n}, 1500);\n\n// Stop triggering GC events altogether after 2.5 seconds\nsetTimeout(() => {\n  clearInterval(interval);\n}, 2500);\n</code></pre>"
        },
        {
          "textRaw": "`v8.stopCoverage()`",
          "name": "stopCoverage",
          "type": "method",
          "meta": {
            "added": [
              "v15.1.0",
              "v14.18.0",
              "v12.22.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>The <code>v8.stopCoverage()</code> method allows the user to stop the coverage collection\nstarted by <a href=\"cli.html#node_v8_coveragedir\"><code>NODE_V8_COVERAGE</code></a>, so that V8 can release the execution count\nrecords and optimize code. This can be used in conjunction with\n<a href=\"#v8takecoverage\"><code>v8.takeCoverage()</code></a> if the user wants to collect the coverage on demand.</p>"
        },
        {
          "textRaw": "`v8.takeCoverage()`",
          "name": "takeCoverage",
          "type": "method",
          "meta": {
            "added": [
              "v15.1.0",
              "v14.18.0",
              "v12.22.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>The <code>v8.takeCoverage()</code> method allows the user to write the coverage started by\n<a href=\"cli.html#node_v8_coveragedir\"><code>NODE_V8_COVERAGE</code></a> to disk on demand. This method can be invoked multiple\ntimes during the lifetime of the process. Each time the execution counter will\nbe reset and a new coverage report will be written to the directory specified\nby <a href=\"cli.html#node_v8_coveragedir\"><code>NODE_V8_COVERAGE</code></a>.</p>\n<p>When the process is about to exit, one last coverage will still be written to\ndisk unless <a href=\"#v8stopcoverage\"><code>v8.stopCoverage()</code></a> is invoked before the process exits.</p>"
        },
        {
          "textRaw": "`v8.writeHeapSnapshot([filename[,options]])`",
          "name": "writeHeapSnapshot",
          "type": "method",
          "meta": {
            "added": [
              "v11.13.0"
            ],
            "changes": [
              {
                "version": "v19.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/44989",
                "description": "Support options to configure the heap snapshot."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41373",
                "description": "An exception will now be thrown if the file could not be written."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/42577",
                "description": "Make the returned error codes consistent across all platforms."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`filename` {string} The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a worker thread.",
                  "name": "filename",
                  "type": "string",
                  "desc": "The file path where the V8 heap snapshot is to be saved. If not specified, a file name with the pattern `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be generated, where `{pid}` will be the PID of the Node.js process, `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from the main Node.js thread or the id of a worker thread.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`exposeInternals` {boolean} If true, expose internals in the heap snapshot. **Default:** `false`.",
                      "name": "exposeInternals",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If true, expose internals in the heap snapshot."
                    },
                    {
                      "textRaw": "`exposeNumericValues` {boolean} If true, expose numeric values in artificial fields. **Default:** `false`.",
                      "name": "exposeNumericValues",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If true, expose numeric values in artificial fields."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {string} The filename where the snapshot was saved.",
                "name": "return",
                "type": "string",
                "desc": "The filename where the snapshot was saved."
              }
            }
          ],
          "desc": "<p>Generates a snapshot of the current V8 heap and writes it to a JSON\nfile. This file is intended to be used with tools such as Chrome\nDevTools. The JSON schema is undocumented and specific to the V8\nengine, and may change from one version of V8 to the next.</p>\n<p>A heap snapshot is specific to a single V8 isolate. When using\n<a href=\"worker_threads.html\">worker threads</a>, a heap snapshot generated from the main thread will\nnot contain any information about the workers, and vice versa.</p>\n<p>Creating a heap snapshot requires memory about twice the size of the heap at\nthe time the snapshot is created. This results in the risk of OOM killers\nterminating the process.</p>\n<p>Generating a snapshot is a synchronous operation which blocks the event loop\nfor a duration depending on the heap size.</p>\n<pre><code class=\"language-mjs\">import { writeHeapSnapshot } from 'node:v8';\nimport { Worker, isMainThread, parentPort } from 'node:worker_threads';\nimport { fileURLToPath } from 'node:url';\n\nif (isMainThread) {\n  const __filename = fileURLToPath(import.meta.url);\n  const worker = new Worker(__filename);\n\n  worker.once('message', (filename) => {\n    console.log(`worker heapdump: ${filename}`);\n    // Now get a heapdump for the main thread.\n    console.log(`main thread heapdump: ${writeHeapSnapshot()}`);\n  });\n\n  // Tell the worker to create a heapdump.\n  worker.postMessage('heapdump');\n} else {\n  parentPort.once('message', (message) => {\n    if (message === 'heapdump') {\n      // Generate a heapdump for the worker\n      // and return the filename to the parent.\n      parentPort.postMessage(writeHeapSnapshot());\n    }\n  });\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { writeHeapSnapshot } = require('node:v8');\nconst { Worker, isMainThread, parentPort } = require('node:worker_threads');\n\nif (isMainThread) {\n  const worker = new Worker(__filename);\n\n  worker.once('message', (filename) => {\n    console.log(`worker heapdump: ${filename}`);\n    // Now get a heapdump for the main thread.\n    console.log(`main thread heapdump: ${writeHeapSnapshot()}`);\n  });\n\n  // Tell the worker to create a heapdump.\n  worker.postMessage('heapdump');\n} else {\n  parentPort.once('message', (message) => {\n    if (message === 'heapdump') {\n      // Generate a heapdump for the worker\n      // and return the filename to the parent.\n      parentPort.postMessage(writeHeapSnapshot());\n    }\n  });\n}\n</code></pre>"
        },
        {
          "textRaw": "`v8.setHeapSnapshotNearHeapLimit(limit)`",
          "name": "setHeapSnapshotNearHeapLimit",
          "type": "method",
          "meta": {
            "added": [
              "v18.10.0",
              "v16.18.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`limit` {integer}",
                  "name": "limit",
                  "type": "integer"
                }
              ]
            }
          ],
          "desc": "<p>The API is a no-op if <code>--heapsnapshot-near-heap-limit</code> is already set from the\ncommand line or the API is called more than once. <code>limit</code> must be a positive\ninteger. See <a href=\"cli.html#--heapsnapshot-near-heap-limitmax_count\"><code>--heapsnapshot-near-heap-limit</code></a> for more information.</p>"
        },
        {
          "textRaw": "`v8.isStringOneByteRepresentation(content)`",
          "name": "isStringOneByteRepresentation",
          "type": "method",
          "meta": {
            "added": [
              "v23.10.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`content` {string}",
                  "name": "content",
                  "type": "string"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>V8 only supports <code>Latin-1/ISO-8859-1</code> and <code>UTF16</code> as the underlying representation of a string.\nIf the <code>content</code> uses <code>Latin-1/ISO-8859-1</code> as the underlying representation, this function will return true;\notherwise, it returns false.</p>\n<p>If this method returns false, that does not mean that the string contains some characters not in <code>Latin-1/ISO-8859-1</code>.\nSometimes a <code>Latin-1</code> string may also be represented as <code>UTF16</code>.</p>\n<pre><code class=\"language-mjs\">import { isStringOneByteRepresentation } from 'node:v8';\nimport { Buffer } from 'node:buffer';\n\nconst Encoding = {\n  latin1: 1,\n  utf16le: 2,\n};\nconst buffer = Buffer.alloc(100);\nfunction writeString(input) {\n  if (isStringOneByteRepresentation(input)) {\n    console.log(`input: '${input}'`);\n    buffer.writeUint8(Encoding.latin1);\n    buffer.writeUint32LE(input.length, 1);\n    buffer.write(input, 5, 'latin1');\n    console.log(`decoded: '${buffer.toString('latin1', 5, 5 + input.length)}'\\n`);\n  } else {\n    console.log(`input: '${input}'`);\n    buffer.writeUint8(Encoding.utf16le);\n    buffer.writeUint32LE(input.length * 2, 1);\n    buffer.write(input, 5, 'utf16le');\n    console.log(`decoded: '${buffer.toString('utf16le', 5, 5 + input.length * 2)}'`);\n  }\n}\nwriteString('hello');\nwriteString('你好');\n</code></pre>\n<pre><code class=\"language-cjs\">const { isStringOneByteRepresentation } = require('node:v8');\nconst { Buffer } = require('node:buffer');\n\nconst Encoding = {\n  latin1: 1,\n  utf16le: 2,\n};\nconst buffer = Buffer.alloc(100);\nfunction writeString(input) {\n  if (isStringOneByteRepresentation(input)) {\n    console.log(`input: '${input}'`);\n    buffer.writeUint8(Encoding.latin1);\n    buffer.writeUint32LE(input.length, 1);\n    buffer.write(input, 5, 'latin1');\n    console.log(`decoded: '${buffer.toString('latin1', 5, 5 + input.length)}'\\n`);\n  } else {\n    console.log(`input: '${input}'`);\n    buffer.writeUint8(Encoding.utf16le);\n    buffer.writeUint32LE(input.length * 2, 1);\n    buffer.write(input, 5, 'utf16le');\n    console.log(`decoded: '${buffer.toString('utf16le', 5, 5 + input.length * 2)}'`);\n  }\n}\nwriteString('hello');\nwriteString('你好');\n</code></pre>"
        },
        {
          "textRaw": "`v8.startCpuProfile([options])`",
          "name": "startCpuProfile",
          "type": "method",
          "meta": {
            "added": [
              "v25.0.0",
              "v24.12.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`sampleInterval` {number} Requested sampling interval in milliseconds. **Default:** `0`.",
                      "name": "sampleInterval",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Requested sampling interval in milliseconds."
                    },
                    {
                      "textRaw": "`maxBufferSize` {integer} Maximum number of samples to keep before older entries are discarded. **Default:** `4294967295`.",
                      "name": "maxBufferSize",
                      "type": "integer",
                      "default": "`4294967295`",
                      "desc": "Maximum number of samples to keep before older entries are discarded."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {SyncCPUProfileHandle}",
                "name": "return",
                "type": "SyncCPUProfileHandle"
              }
            }
          ],
          "desc": "<p>Starting a CPU profile then return a <code>SyncCPUProfileHandle</code> object.\nThis API supports <code>using</code> syntax.</p>\n<pre><code class=\"language-cjs\">const handle = v8.startCpuProfile({ sampleInterval: 1, maxBufferSize: 10_000 });\nconst profile = handle.stop();\nconsole.log(profile);\n</code></pre>"
        },
        {
          "textRaw": "`v8.startHeapProfile([options])`",
          "name": "startHeapProfile",
          "type": "method",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`sampleInterval` {number} The average sampling interval in bytes. **Default:** `524288` (512 KiB).",
                      "name": "sampleInterval",
                      "type": "number",
                      "default": "`524288` (512 KiB)",
                      "desc": "The average sampling interval in bytes."
                    },
                    {
                      "textRaw": "`stackDepth` {integer} The maximum stack depth for samples. **Default:** `16`.",
                      "name": "stackDepth",
                      "type": "integer",
                      "default": "`16`",
                      "desc": "The maximum stack depth for samples."
                    },
                    {
                      "textRaw": "`forceGC` {boolean} Force garbage collection before taking the profile. **Default:** `false`.",
                      "name": "forceGC",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Force garbage collection before taking the profile."
                    },
                    {
                      "textRaw": "`includeObjectsCollectedByMajorGC` {boolean} Include objects collected by major GC. **Default:** `false`.",
                      "name": "includeObjectsCollectedByMajorGC",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Include objects collected by major GC."
                    },
                    {
                      "textRaw": "`includeObjectsCollectedByMinorGC` {boolean} Include objects collected by minor GC. **Default:** `false`.",
                      "name": "includeObjectsCollectedByMinorGC",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Include objects collected by minor GC."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {SyncHeapProfileHandle}",
                "name": "return",
                "type": "SyncHeapProfileHandle"
              }
            }
          ],
          "desc": "<p>Starting a heap profile then return a <code>SyncHeapProfileHandle</code> object.\nThis API supports <code>using</code> syntax.</p>\n<pre><code class=\"language-cjs\">const v8 = require('node:v8');\n\nconst handle = v8.startHeapProfile();\nconst profile = handle.stop();\nconsole.log(profile);\n</code></pre>\n<pre><code class=\"language-mjs\">import v8 from 'node:v8';\n\nconst handle = v8.startHeapProfile();\nconst profile = handle.stop();\nconsole.log(profile);\n</code></pre>\n<p>With custom parameters:</p>\n<pre><code class=\"language-cjs\">const v8 = require('node:v8');\n\nconst handle = v8.startHeapProfile({\n  sampleInterval: 1024,\n  stackDepth: 8,\n  forceGC: true,\n  includeObjectsCollectedByMajorGC: true,\n});\nconst profile = handle.stop();\nconsole.log(profile);\n</code></pre>\n<pre><code class=\"language-mjs\">import v8 from 'node:v8';\n\nconst handle = v8.startHeapProfile({\n  sampleInterval: 1024,\n  stackDepth: 8,\n  forceGC: true,\n  includeObjectsCollectedByMajorGC: true,\n});\nconst profile = handle.stop();\nconsole.log(profile);\n</code></pre>"
        }
      ],
      "modules": [
        {
          "textRaw": "Serialization API",
          "name": "serialization_api",
          "type": "module",
          "desc": "<p>The serialization API provides means of serializing JavaScript values in a way\nthat is compatible with the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\">HTML structured clone algorithm</a>.</p>\n<p>The format is backward-compatible (i.e. safe to store to disk).\nEqual JavaScript values may result in different serialized output.</p>",
          "methods": [
            {
              "textRaw": "`v8.serialize(value)`",
              "name": "serialize",
              "type": "method",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Uses a <a href=\"#class-v8defaultserializer\"><code>DefaultSerializer</code></a> to serialize <code>value</code> into a buffer.</p>\n<p><a href=\"errors.html#err_buffer_too_large\"><code>ERR_BUFFER_TOO_LARGE</code></a> will be thrown when trying to\nserialize a huge object which requires buffer\nlarger than <a href=\"buffer.html#bufferconstantsmax_length\"><code>buffer.constants.MAX_LENGTH</code></a>.</p>"
            },
            {
              "textRaw": "`v8.deserialize(buffer)`",
              "name": "deserialize",
              "type": "method",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} A buffer returned by `serialize()`.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "A buffer returned by `serialize()`."
                    }
                  ]
                }
              ],
              "desc": "<p>Uses a <a href=\"#class-v8defaultdeserializer\"><code>DefaultDeserializer</code></a> with default options to read a JS value\nfrom a buffer.</p>"
            }
          ],
          "classes": [
            {
              "textRaw": "Class: `v8.Serializer`",
              "name": "v8.Serializer",
              "type": "class",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "textRaw": "`new Serializer()`",
                  "name": "Serializer",
                  "type": "ctor",
                  "params": [],
                  "desc": "<p>Creates a new <code>Serializer</code> object.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`serializer.writeHeader()`",
                  "name": "writeHeader",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Writes out a header, which includes the serialization format version.</p>"
                },
                {
                  "textRaw": "`serializer.writeValue(value)`",
                  "name": "writeValue",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`value` {any}",
                          "name": "value",
                          "type": "any"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Serializes a JavaScript value and adds the serialized representation to the\ninternal buffer.</p>\n<p>This throws an error if <code>value</code> cannot be serialized.</p>"
                },
                {
                  "textRaw": "`serializer.releaseBuffer()`",
                  "name": "releaseBuffer",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Buffer}",
                        "name": "return",
                        "type": "Buffer"
                      }
                    }
                  ],
                  "desc": "<p>Returns the stored internal buffer. This serializer should not be used once\nthe buffer is released. Calling this method results in undefined behavior\nif a previous write has failed.</p>"
                },
                {
                  "textRaw": "`serializer.transferArrayBuffer(id, arrayBuffer)`",
                  "name": "transferArrayBuffer",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`id` {integer} A 32-bit unsigned integer.",
                          "name": "id",
                          "type": "integer",
                          "desc": "A 32-bit unsigned integer."
                        },
                        {
                          "textRaw": "`arrayBuffer` {ArrayBuffer} An `ArrayBuffer` instance.",
                          "name": "arrayBuffer",
                          "type": "ArrayBuffer",
                          "desc": "An `ArrayBuffer` instance."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Marks an <code>ArrayBuffer</code> as having its contents transferred out of band.\nPass the corresponding <code>ArrayBuffer</code> in the deserializing context to\n<a href=\"#deserializertransferarraybufferid-arraybuffer\"><code>deserializer.transferArrayBuffer()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer.writeUint32(value)`",
                  "name": "writeUint32",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`value` {integer}",
                          "name": "value",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Write a raw 32-bit unsigned integer.\nFor use inside of a custom <a href=\"#serializer_writehostobjectobject\"><code>serializer._writeHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer.writeUint64(hi, lo)`",
                  "name": "writeUint64",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`hi` {integer}",
                          "name": "hi",
                          "type": "integer"
                        },
                        {
                          "textRaw": "`lo` {integer}",
                          "name": "lo",
                          "type": "integer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.\nFor use inside of a custom <a href=\"#serializer_writehostobjectobject\"><code>serializer._writeHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer.writeDouble(value)`",
                  "name": "writeDouble",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`value` {number}",
                          "name": "value",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Write a JS <code>number</code> value.\nFor use inside of a custom <a href=\"#serializer_writehostobjectobject\"><code>serializer._writeHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer.writeRawBytes(buffer)`",
                  "name": "writeRawBytes",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`buffer` {Buffer|TypedArray|DataView}",
                          "name": "buffer",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Write raw bytes into the serializer's internal buffer. The deserializer\nwill require a way to compute the length of the buffer.\nFor use inside of a custom <a href=\"#serializer_writehostobjectobject\"><code>serializer._writeHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`serializer._writeHostObject(object)`",
                  "name": "_writeHostObject",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`object` {Object}",
                          "name": "object",
                          "type": "Object"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This method is called to write some kind of host object, i.e. an object created\nby native C++ bindings. If it is not possible to serialize <code>object</code>, a suitable\nexception should be thrown.</p>\n<p>This method is not present on the <code>Serializer</code> class itself but can be provided\nby subclasses.</p>"
                },
                {
                  "textRaw": "`serializer._getDataCloneError(message)`",
                  "name": "_getDataCloneError",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`message` {string}",
                          "name": "message",
                          "type": "string"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This method is called to generate error objects that will be thrown when an\nobject can not be cloned.</p>\n<p>This method defaults to the <a href=\"errors.html#class-error\"><code>Error</code></a> constructor and can be overridden on\nsubclasses.</p>"
                },
                {
                  "textRaw": "`serializer._getSharedArrayBufferId(sharedArrayBuffer)`",
                  "name": "_getSharedArrayBufferId",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`sharedArrayBuffer` {SharedArrayBuffer}",
                          "name": "sharedArrayBuffer",
                          "type": "SharedArrayBuffer"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>This method is called when the serializer is going to serialize a\n<code>SharedArrayBuffer</code> object. It must return an unsigned 32-bit integer ID for\nthe object, using the same ID if this <code>SharedArrayBuffer</code> has already been\nserialized. When deserializing, this ID will be passed to\n<a href=\"#deserializertransferarraybufferid-arraybuffer\"><code>deserializer.transferArrayBuffer()</code></a>.</p>\n<p>If the object cannot be serialized, an exception should be thrown.</p>\n<p>This method is not present on the <code>Serializer</code> class itself but can be provided\nby subclasses.</p>"
                },
                {
                  "textRaw": "`serializer._setTreatArrayBufferViewsAsHostObjects(flag)`",
                  "name": "_setTreatArrayBufferViewsAsHostObjects",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`flag` {boolean} **Default:** `false`",
                          "name": "flag",
                          "type": "boolean",
                          "default": "`false`"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Indicate whether to treat <code>TypedArray</code> and <code>DataView</code> objects as\nhost objects, i.e. pass them to <a href=\"#serializer_writehostobjectobject\"><code>serializer._writeHostObject()</code></a>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `v8.Deserializer`",
              "name": "v8.Deserializer",
              "type": "class",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "textRaw": "`new Deserializer(buffer)`",
                  "name": "Deserializer",
                  "type": "ctor",
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView} A buffer returned by `serializer.releaseBuffer()`.",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "A buffer returned by `serializer.releaseBuffer()`."
                    }
                  ],
                  "desc": "<p>Creates a new <code>Deserializer</code> object.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`deserializer.readHeader()`",
                  "name": "readHeader",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Reads and validates a header (including the format version).\nMay, for example, reject an invalid or unsupported wire format. In that case,\nan <code>Error</code> is thrown.</p>"
                },
                {
                  "textRaw": "`deserializer.readValue()`",
                  "name": "readValue",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Deserializes a JavaScript value from the buffer and returns it.</p>"
                },
                {
                  "textRaw": "`deserializer.transferArrayBuffer(id, arrayBuffer)`",
                  "name": "transferArrayBuffer",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`id` {integer} A 32-bit unsigned integer.",
                          "name": "id",
                          "type": "integer",
                          "desc": "A 32-bit unsigned integer."
                        },
                        {
                          "textRaw": "`arrayBuffer` {ArrayBuffer|SharedArrayBuffer} An `ArrayBuffer` instance.",
                          "name": "arrayBuffer",
                          "type": "ArrayBuffer|SharedArrayBuffer",
                          "desc": "An `ArrayBuffer` instance."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Marks an <code>ArrayBuffer</code> as having its contents transferred out of band.\nPass the corresponding <code>ArrayBuffer</code> in the serializing context to\n<a href=\"#serializertransferarraybufferid-arraybuffer\"><code>serializer.transferArrayBuffer()</code></a> (or return the <code>id</code> from\n<a href=\"#serializer_getsharedarraybufferidsharedarraybuffer\"><code>serializer._getSharedArrayBufferId()</code></a> in the case of <code>SharedArrayBuffer</code>s).</p>"
                },
                {
                  "textRaw": "`deserializer.getWireFormatVersion()`",
                  "name": "getWireFormatVersion",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {integer}",
                        "name": "return",
                        "type": "integer"
                      }
                    }
                  ],
                  "desc": "<p>Reads the underlying wire format version. Likely mostly to be useful to\nlegacy code reading old wire format versions. May not be called before\n<code>.readHeader()</code>.</p>"
                },
                {
                  "textRaw": "`deserializer.readUint32()`",
                  "name": "readUint32",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {integer}",
                        "name": "return",
                        "type": "integer"
                      }
                    }
                  ],
                  "desc": "<p>Read a raw 32-bit unsigned integer and return it.\nFor use inside of a custom <a href=\"#deserializer_readhostobject\"><code>deserializer._readHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`deserializer.readUint64()`",
                  "name": "readUint64",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {integer[]}",
                        "name": "return",
                        "type": "integer[]"
                      }
                    }
                  ],
                  "desc": "<p>Read a raw 64-bit unsigned integer and return it as an array <code>[hi, lo]</code>\nwith two 32-bit unsigned integer entries.\nFor use inside of a custom <a href=\"#deserializer_readhostobject\"><code>deserializer._readHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`deserializer.readDouble()`",
                  "name": "readDouble",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {number}",
                        "name": "return",
                        "type": "number"
                      }
                    }
                  ],
                  "desc": "<p>Read a JS <code>number</code> value.\nFor use inside of a custom <a href=\"#deserializer_readhostobject\"><code>deserializer._readHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`deserializer.readRawBytes(length)`",
                  "name": "readRawBytes",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`length` {integer}",
                          "name": "length",
                          "type": "integer"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Buffer}",
                        "name": "return",
                        "type": "Buffer"
                      }
                    }
                  ],
                  "desc": "<p>Read raw bytes from the deserializer's internal buffer. The <code>length</code> parameter\nmust correspond to the length of the buffer that was passed to\n<a href=\"#serializerwriterawbytesbuffer\"><code>serializer.writeRawBytes()</code></a>.\nFor use inside of a custom <a href=\"#deserializer_readhostobject\"><code>deserializer._readHostObject()</code></a>.</p>"
                },
                {
                  "textRaw": "`deserializer._readHostObject()`",
                  "name": "_readHostObject",
                  "type": "method",
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>This method is called to read some kind of host object, i.e. an object that is\ncreated by native C++ bindings. If it is not possible to deserialize the data,\na suitable exception should be thrown.</p>\n<p>This method is not present on the <code>Deserializer</code> class itself but can be\nprovided by subclasses.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `v8.DefaultSerializer`",
              "name": "v8.DefaultSerializer",
              "type": "class",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A subclass of <a href=\"#class-v8serializer\"><code>Serializer</code></a> that serializes <code>TypedArray</code>\n(in particular <a href=\"buffer.html\"><code>Buffer</code></a>) and <code>DataView</code> objects as host objects, and only\nstores the part of their underlying <code>ArrayBuffer</code>s that they are referring to.</p>"
            },
            {
              "textRaw": "Class: `v8.DefaultDeserializer`",
              "name": "v8.DefaultDeserializer",
              "type": "class",
              "meta": {
                "added": [
                  "v8.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A subclass of <a href=\"#class-v8deserializer\"><code>Deserializer</code></a> corresponding to the format written by\n<a href=\"#class-v8defaultserializer\"><code>DefaultSerializer</code></a>.</p>"
            }
          ],
          "displayName": "Serialization API"
        },
        {
          "textRaw": "Promise hooks",
          "name": "promise_hooks",
          "type": "module",
          "desc": "<p>The <code>promiseHooks</code> interface can be used to track promise lifecycle events.\nTo track <em>all</em> async activity, see <a href=\"async_hooks.html\"><code>async_hooks</code></a> which internally uses this\nmodule to produce promise lifecycle events in addition to events for other\nasync resources. For request context management, see <a href=\"async_context.html#class-asynclocalstorage\"><code>AsyncLocalStorage</code></a>.</p>\n<pre><code class=\"language-mjs\">import { promiseHooks } from 'node:v8';\n\n// There are four lifecycle events produced by promises:\n\n// The `init` event represents the creation of a promise. This could be a\n// direct creation such as with `new Promise(...)` or a continuation such\n// as `then()` or `catch()`. It also happens whenever an async function is\n// called or does an `await`. If a continuation promise is created, the\n// `parent` will be the promise it is a continuation from.\nfunction init(promise, parent) {\n  console.log('a promise was created', { promise, parent });\n}\n\n// The `settled` event happens when a promise receives a resolution or\n// rejection value. This may happen synchronously such as when using\n// `Promise.resolve()` on non-promise input.\nfunction settled(promise) {\n  console.log('a promise resolved or rejected', { promise });\n}\n\n// The `before` event runs immediately before a `then()` or `catch()` handler\n// runs or an `await` resumes execution.\nfunction before(promise) {\n  console.log('a promise is about to call a then handler', { promise });\n}\n\n// The `after` event runs immediately after a `then()` handler runs or when\n// an `await` begins after resuming from another.\nfunction after(promise) {\n  console.log('a promise is done calling a then handler', { promise });\n}\n\n// Lifecycle hooks may be started and stopped individually\nconst stopWatchingInits = promiseHooks.onInit(init);\nconst stopWatchingSettleds = promiseHooks.onSettled(settled);\nconst stopWatchingBefores = promiseHooks.onBefore(before);\nconst stopWatchingAfters = promiseHooks.onAfter(after);\n\n// Or they may be started and stopped in groups\nconst stopHookSet = promiseHooks.createHook({\n  init,\n  settled,\n  before,\n  after,\n});\n\n// Trigger the hooks by using promises\nconst promiseLog = (word) => Promise.resolve(word).then(console.log);\npromiseLog('Hello');\npromiseLog('World');\n\n// To stop a hook, call the function returned at its creation.\nstopWatchingInits();\nstopWatchingSettleds();\nstopWatchingBefores();\nstopWatchingAfters();\nstopHookSet();\n</code></pre>\n<pre><code class=\"language-cjs\">const { promiseHooks } = require('node:v8');\n\n// There are four lifecycle events produced by promises:\n\n// The `init` event represents the creation of a promise. This could be a\n// direct creation such as with `new Promise(...)` or a continuation such\n// as `then()` or `catch()`. It also happens whenever an async function is\n// called or does an `await`. If a continuation promise is created, the\n// `parent` will be the promise it is a continuation from.\nfunction init(promise, parent) {\n  console.log('a promise was created', { promise, parent });\n}\n\n// The `settled` event happens when a promise receives a resolution or\n// rejection value. This may happen synchronously such as when using\n// `Promise.resolve()` on non-promise input.\nfunction settled(promise) {\n  console.log('a promise resolved or rejected', { promise });\n}\n\n// The `before` event runs immediately before a `then()` or `catch()` handler\n// runs or an `await` resumes execution.\nfunction before(promise) {\n  console.log('a promise is about to call a then handler', { promise });\n}\n\n// The `after` event runs immediately after a `then()` handler runs or when\n// an `await` begins after resuming from another.\nfunction after(promise) {\n  console.log('a promise is done calling a then handler', { promise });\n}\n\n// Lifecycle hooks may be started and stopped individually\nconst stopWatchingInits = promiseHooks.onInit(init);\nconst stopWatchingSettleds = promiseHooks.onSettled(settled);\nconst stopWatchingBefores = promiseHooks.onBefore(before);\nconst stopWatchingAfters = promiseHooks.onAfter(after);\n\n// Or they may be started and stopped in groups\nconst stopHookSet = promiseHooks.createHook({\n  init,\n  settled,\n  before,\n  after,\n});\n\n// Trigger the hooks by using promises\nconst promisePrint = (word) => Promise.resolve(word).then(console.log);\npromisePrint('Hello');\npromisePrint('World');\n\n// To stop a hook, call the function returned at its creation.\nstopWatchingInits();\nstopWatchingSettleds();\nstopWatchingBefores();\nstopWatchingAfters();\nstopHookSet();\n</code></pre>",
          "methods": [
            {
              "textRaw": "`promiseHooks.onInit(init)`",
              "name": "onInit",
              "type": "method",
              "meta": {
                "added": [
                  "v17.1.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`init` {Function} The `init` callback to call when a promise is created.",
                      "name": "init",
                      "type": "Function",
                      "desc": "The `init` callback to call when a promise is created."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} Call to stop the hook.",
                    "name": "return",
                    "type": "Function",
                    "desc": "Call to stop the hook."
                  }
                }
              ],
              "desc": "<p><strong>The <code>init</code> hook must be a plain function. Providing an async function will\nthrow as it would produce an infinite microtask loop.</strong></p>\n<pre><code class=\"language-mjs\">import { promiseHooks } from 'node:v8';\n\nconst stop = promiseHooks.onInit((promise, parent) => {});\n</code></pre>\n<pre><code class=\"language-cjs\">const { promiseHooks } = require('node:v8');\n\nconst stop = promiseHooks.onInit((promise, parent) => {});\n</code></pre>"
            },
            {
              "textRaw": "`promiseHooks.onSettled(settled)`",
              "name": "onSettled",
              "type": "method",
              "meta": {
                "added": [
                  "v17.1.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`settled` {Function} The `settled` callback to call when a promise is resolved or rejected.",
                      "name": "settled",
                      "type": "Function",
                      "desc": "The `settled` callback to call when a promise is resolved or rejected."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} Call to stop the hook.",
                    "name": "return",
                    "type": "Function",
                    "desc": "Call to stop the hook."
                  }
                }
              ],
              "desc": "<p><strong>The <code>settled</code> hook must be a plain function. Providing an async function will\nthrow as it would produce an infinite microtask loop.</strong></p>\n<pre><code class=\"language-mjs\">import { promiseHooks } from 'node:v8';\n\nconst stop = promiseHooks.onSettled((promise) => {});\n</code></pre>\n<pre><code class=\"language-cjs\">const { promiseHooks } = require('node:v8');\n\nconst stop = promiseHooks.onSettled((promise) => {});\n</code></pre>"
            },
            {
              "textRaw": "`promiseHooks.onBefore(before)`",
              "name": "onBefore",
              "type": "method",
              "meta": {
                "added": [
                  "v17.1.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`before` {Function} The `before` callback to call before a promise continuation executes.",
                      "name": "before",
                      "type": "Function",
                      "desc": "The `before` callback to call before a promise continuation executes."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} Call to stop the hook.",
                    "name": "return",
                    "type": "Function",
                    "desc": "Call to stop the hook."
                  }
                }
              ],
              "desc": "<p><strong>The <code>before</code> hook must be a plain function. Providing an async function will\nthrow as it would produce an infinite microtask loop.</strong></p>\n<pre><code class=\"language-mjs\">import { promiseHooks } from 'node:v8';\n\nconst stop = promiseHooks.onBefore((promise) => {});\n</code></pre>\n<pre><code class=\"language-cjs\">const { promiseHooks } = require('node:v8');\n\nconst stop = promiseHooks.onBefore((promise) => {});\n</code></pre>"
            },
            {
              "textRaw": "`promiseHooks.onAfter(after)`",
              "name": "onAfter",
              "type": "method",
              "meta": {
                "added": [
                  "v17.1.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`after` {Function} The `after` callback to call after a promise continuation executes.",
                      "name": "after",
                      "type": "Function",
                      "desc": "The `after` callback to call after a promise continuation executes."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} Call to stop the hook.",
                    "name": "return",
                    "type": "Function",
                    "desc": "Call to stop the hook."
                  }
                }
              ],
              "desc": "<p><strong>The <code>after</code> hook must be a plain function. Providing an async function will\nthrow as it would produce an infinite microtask loop.</strong></p>\n<pre><code class=\"language-mjs\">import { promiseHooks } from 'node:v8';\n\nconst stop = promiseHooks.onAfter((promise) => {});\n</code></pre>\n<pre><code class=\"language-cjs\">const { promiseHooks } = require('node:v8');\n\nconst stop = promiseHooks.onAfter((promise) => {});\n</code></pre>"
            },
            {
              "textRaw": "`promiseHooks.createHook(callbacks)`",
              "name": "createHook",
              "type": "method",
              "meta": {
                "added": [
                  "v17.1.0",
                  "v16.14.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callbacks` {Object} The Hook Callbacks to register",
                      "name": "callbacks",
                      "type": "Object",
                      "desc": "The Hook Callbacks to register",
                      "options": [
                        {
                          "textRaw": "`init` {Function} The `init` callback.",
                          "name": "init",
                          "type": "Function",
                          "desc": "The `init` callback."
                        },
                        {
                          "textRaw": "`before` {Function} The `before` callback.",
                          "name": "before",
                          "type": "Function",
                          "desc": "The `before` callback."
                        },
                        {
                          "textRaw": "`after` {Function} The `after` callback.",
                          "name": "after",
                          "type": "Function",
                          "desc": "The `after` callback."
                        },
                        {
                          "textRaw": "`settled` {Function} The `settled` callback.",
                          "name": "settled",
                          "type": "Function",
                          "desc": "The `settled` callback."
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Function} Used for disabling hooks",
                    "name": "return",
                    "type": "Function",
                    "desc": "Used for disabling hooks"
                  }
                }
              ],
              "desc": "<p><strong>The hook callbacks must be plain functions. Providing async functions will\nthrow as it would produce an infinite microtask loop.</strong></p>\n<p>Registers functions to be called for different lifetime events of each promise.</p>\n<p>The callbacks <code>init()</code>/<code>before()</code>/<code>after()</code>/<code>settled()</code> are called for the\nrespective events during a promise's lifetime.</p>\n<p>All callbacks are optional. For example, if only promise creation needs to\nbe tracked, then only the <code>init</code> callback needs to be passed. The\nspecifics of all functions that can be passed to <code>callbacks</code> is in the\n<a href=\"#hook-callbacks\">Hook Callbacks</a> section.</p>\n<pre><code class=\"language-mjs\">import { promiseHooks } from 'node:v8';\n\nconst stopAll = promiseHooks.createHook({\n  init(promise, parent) {},\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { promiseHooks } = require('node:v8');\n\nconst stopAll = promiseHooks.createHook({\n  init(promise, parent) {},\n});\n</code></pre>"
            }
          ],
          "modules": [
            {
              "textRaw": "Hook callbacks",
              "name": "hook_callbacks",
              "type": "module",
              "desc": "<p>Key events in the lifetime of a promise have been categorized into four areas:\ncreation of a promise, before/after a continuation handler is called or around\nan await, and when the promise resolves or rejects.</p>\n<p>While these hooks are similar to those of <a href=\"async_hooks.html\"><code>async_hooks</code></a> they lack a\n<code>destroy</code> hook. Other types of async resources typically represent sockets or\nfile descriptors which have a distinct \"closed\" state to express the <code>destroy</code>\nlifecycle event while promises remain usable for as long as code can still\nreach them. Garbage collection tracking is used to make promises fit into the\n<code>async_hooks</code> event model, however this tracking is very expensive and they may\nnot necessarily ever even be garbage collected.</p>\n<p>Because promises are asynchronous resources whose lifecycle is tracked\nvia the promise hooks mechanism, the <code>init()</code>, <code>before()</code>, <code>after()</code>, and\n<code>settled()</code> callbacks <em>must not</em> be async functions as they create more\npromises which would produce an infinite loop.</p>\n<p>While this API is used to feed promise events into <a href=\"async_hooks.html\"><code>async_hooks</code></a>, the\nordering between the two is undefined. Both APIs are multi-tenant\nand therefore could produce events in any order relative to each other.</p>",
              "methods": [
                {
                  "textRaw": "`init(promise, parent)`",
                  "name": "init",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`promise` {Promise} The promise being created.",
                          "name": "promise",
                          "type": "Promise",
                          "desc": "The promise being created."
                        },
                        {
                          "textRaw": "`parent` {Promise} The promise continued from, if applicable.",
                          "name": "parent",
                          "type": "Promise",
                          "desc": "The promise continued from, if applicable."
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when a promise is constructed. This <em>does not</em> mean that corresponding\n<code>before</code>/<code>after</code> events will occur, only that the possibility exists. This will\nhappen if a promise is created without ever getting a continuation.</p>"
                },
                {
                  "textRaw": "`before(promise)`",
                  "name": "before",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`promise` {Promise}",
                          "name": "promise",
                          "type": "Promise"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called before a promise continuation executes. This can be in the form of\n<code>then()</code>, <code>catch()</code>, or <code>finally()</code> handlers or an <code>await</code> resuming.</p>\n<p>The <code>before</code> callback will be called 0 to N times. The <code>before</code> callback\nwill typically be called 0 times if no continuation was ever made for the\npromise. The <code>before</code> callback may be called many times in the case where\nmany continuations have been made from the same promise.</p>"
                },
                {
                  "textRaw": "`after(promise)`",
                  "name": "after",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`promise` {Promise}",
                          "name": "promise",
                          "type": "Promise"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called immediately after a promise continuation executes. This may be after a\n<code>then()</code>, <code>catch()</code>, or <code>finally()</code> handler or before an <code>await</code> after another\n<code>await</code>.</p>"
                },
                {
                  "textRaw": "`settled(promise)`",
                  "name": "settled",
                  "type": "method",
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`promise` {Promise}",
                          "name": "promise",
                          "type": "Promise"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called when the promise receives a resolution or rejection value. This may\noccur synchronously in the case of <code>Promise.resolve()</code> or <code>Promise.reject()</code>.</p>"
                }
              ],
              "displayName": "Hook callbacks"
            }
          ],
          "displayName": "Promise hooks"
        },
        {
          "textRaw": "Startup Snapshot API",
          "name": "startup_snapshot_api",
          "type": "module",
          "meta": {
            "added": [
              "v18.6.0",
              "v16.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57513",
                "description": "Marking the API stable."
              }
            ]
          },
          "desc": "<p>The <code>v8.startupSnapshot</code> interface can be used to add serialization and\ndeserialization hooks for custom startup snapshots.</p>\n<pre><code class=\"language-console\">$ node --snapshot-blob snapshot.blob --build-snapshot entry.js\n# This launches a process with the snapshot\n$ node --snapshot-blob snapshot.blob\n</code></pre>\n<p>In the example above, <code>entry.js</code> can use methods from the <code>v8.startupSnapshot</code>\ninterface to specify how to save information for custom objects in the snapshot\nduring serialization and how the information can be used to synchronize these\nobjects during deserialization of the snapshot. For example, if the <code>entry.js</code>\ncontains the following script:</p>\n<pre><code class=\"language-cjs\">const fs = require('node:fs');\nconst zlib = require('node:zlib');\nconst path = require('node:path');\nconst assert = require('node:assert');\n\nconst v8 = require('node:v8');\n\nclass BookShelf {\n  storage = new Map();\n\n  // Reading a series of files from directory and store them into storage.\n  constructor(directory, books) {\n    for (const book of books) {\n      this.storage.set(book, fs.readFileSync(path.join(directory, book)));\n    }\n  }\n\n  static compressAll(shelf) {\n    for (const [ book, content ] of shelf.storage) {\n      shelf.storage.set(book, zlib.gzipSync(content));\n    }\n  }\n\n  static decompressAll(shelf) {\n    for (const [ book, content ] of shelf.storage) {\n      shelf.storage.set(book, zlib.gunzipSync(content));\n    }\n  }\n}\n\n// __dirname here is where the snapshot script is placed\n// during snapshot building time.\nconst shelf = new BookShelf(__dirname, [\n  'book1.en_US.txt',\n  'book1.es_ES.txt',\n  'book2.zh_CN.txt',\n]);\n\nassert(v8.startupSnapshot.isBuildingSnapshot());\n// On snapshot serialization, compress the books to reduce size.\nv8.startupSnapshot.addSerializeCallback(BookShelf.compressAll, shelf);\n// On snapshot deserialization, decompress the books.\nv8.startupSnapshot.addDeserializeCallback(BookShelf.decompressAll, shelf);\nv8.startupSnapshot.setDeserializeMainFunction((shelf) => {\n  // process.env and process.argv are refreshed during snapshot\n  // deserialization.\n  const lang = process.env.BOOK_LANG || 'en_US';\n  const book = process.argv[1];\n  const name = `${book}.${lang}.txt`;\n  console.log(shelf.storage.get(name));\n}, shelf);\n</code></pre>\n<p>The resulted binary will get print the data deserialized from the snapshot\nduring start up, using the refreshed <code>process.env</code> and <code>process.argv</code> of\nthe launched process:</p>\n<pre><code class=\"language-console\">$ BOOK_LANG=es_ES node --snapshot-blob snapshot.blob book1\n# Prints content of book1.es_ES.txt deserialized from the snapshot.\n</code></pre>\n<p>Currently the application deserialized from a user-land snapshot cannot\nbe snapshotted again, so these APIs are only available to applications\nthat are not deserialized from a user-land snapshot.</p>",
          "methods": [
            {
              "textRaw": "`v8.startupSnapshot.addSerializeCallback(callback[, data])`",
              "name": "addSerializeCallback",
              "type": "method",
              "meta": {
                "added": [
                  "v18.6.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} Callback to be invoked before serialization.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Callback to be invoked before serialization."
                    },
                    {
                      "textRaw": "`data` {any} Optional data that will be passed to the `callback` when it gets called.",
                      "name": "data",
                      "type": "any",
                      "desc": "Optional data that will be passed to the `callback` when it gets called.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Add a callback that will be called when the Node.js instance is about to\nget serialized into a snapshot and exit. This can be used to release\nresources that should not or cannot be serialized or to convert user data\ninto a form more suitable for serialization.</p>\n<p>Callbacks are run in the order in which they are added.</p>"
            },
            {
              "textRaw": "`v8.startupSnapshot.addDeserializeCallback(callback[, data])`",
              "name": "addDeserializeCallback",
              "type": "method",
              "meta": {
                "added": [
                  "v18.6.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} Callback to be invoked after the snapshot is deserialized.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Callback to be invoked after the snapshot is deserialized."
                    },
                    {
                      "textRaw": "`data` {any} Optional data that will be passed to the `callback` when it gets called.",
                      "name": "data",
                      "type": "any",
                      "desc": "Optional data that will be passed to the `callback` when it gets called.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Add a callback that will be called when the Node.js instance is deserialized\nfrom a snapshot. The <code>callback</code> and the <code>data</code> (if provided) will be\nserialized into the snapshot, they can be used to re-initialize the state\nof the application or to re-acquire resources that the application needs\nwhen the application is restarted from the snapshot.</p>\n<p>Callbacks are run in the order in which they are added.</p>"
            },
            {
              "textRaw": "`v8.startupSnapshot.setDeserializeMainFunction(callback[, data])`",
              "name": "setDeserializeMainFunction",
              "type": "method",
              "meta": {
                "added": [
                  "v18.6.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function} Callback to be invoked as the entry point after the snapshot is deserialized.",
                      "name": "callback",
                      "type": "Function",
                      "desc": "Callback to be invoked as the entry point after the snapshot is deserialized."
                    },
                    {
                      "textRaw": "`data` {any} Optional data that will be passed to the `callback` when it gets called.",
                      "name": "data",
                      "type": "any",
                      "desc": "Optional data that will be passed to the `callback` when it gets called.",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>This sets the entry point of the Node.js application when it is deserialized\nfrom a snapshot. This can be called only once in the snapshot building\nscript. If called, the deserialized application no longer needs an additional\nentry point script to start up and will simply invoke the callback along with\nthe deserialized data (if provided), otherwise an entry point script still\nneeds to be provided to the deserialized application.</p>"
            },
            {
              "textRaw": "`v8.startupSnapshot.isBuildingSnapshot()`",
              "name": "isBuildingSnapshot",
              "type": "method",
              "meta": {
                "added": [
                  "v18.6.0",
                  "v16.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns true if the Node.js instance is run to build a snapshot.</p>"
            }
          ],
          "displayName": "Startup Snapshot API"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `v8.GCProfiler`",
          "name": "v8.GCProfiler",
          "type": "class",
          "meta": {
            "added": [
              "v19.6.0",
              "v18.15.0"
            ],
            "changes": []
          },
          "desc": "<p>This API collects GC data in current thread.</p>",
          "signatures": [
            {
              "textRaw": "`new v8.GCProfiler()`",
              "name": "v8.GCProfiler",
              "type": "ctor",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>Create a new instance of the <code>v8.GCProfiler</code> class.\nThis API supports <code>using</code> syntax.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`profiler.start()`",
              "name": "start",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Start collecting GC data.</p>"
            },
            {
              "textRaw": "`profiler.stop()`",
              "name": "stop",
              "type": "method",
              "meta": {
                "added": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Stop collecting GC data and return an object. The content of object\nis as follows.</p>\n<pre><code class=\"language-json\">{\n  \"version\": 1,\n  \"startTime\": 1674059033862,\n  \"statistics\": [\n    {\n      \"gcType\": \"Scavenge\",\n      \"beforeGC\": {\n        \"heapStatistics\": {\n          \"totalHeapSize\": 5005312,\n          \"totalHeapSizeExecutable\": 524288,\n          \"totalPhysicalSize\": 5226496,\n          \"totalAvailableSize\": 4341325216,\n          \"totalGlobalHandlesSize\": 8192,\n          \"usedGlobalHandlesSize\": 2112,\n          \"usedHeapSize\": 4883840,\n          \"heapSizeLimit\": 4345298944,\n          \"mallocedMemory\": 254128,\n          \"externalMemory\": 225138,\n          \"peakMallocedMemory\": 181760\n        },\n        \"heapSpaceStatistics\": [\n          {\n            \"spaceName\": \"read_only_space\",\n            \"spaceSize\": 0,\n            \"spaceUsedSize\": 0,\n            \"spaceAvailableSize\": 0,\n            \"physicalSpaceSize\": 0\n          }\n        ]\n      },\n      \"cost\": 1574.14,\n      \"afterGC\": {\n        \"heapStatistics\": {\n          \"totalHeapSize\": 6053888,\n          \"totalHeapSizeExecutable\": 524288,\n          \"totalPhysicalSize\": 5500928,\n          \"totalAvailableSize\": 4341101384,\n          \"totalGlobalHandlesSize\": 8192,\n          \"usedGlobalHandlesSize\": 2112,\n          \"usedHeapSize\": 4059096,\n          \"heapSizeLimit\": 4345298944,\n          \"mallocedMemory\": 254128,\n          \"externalMemory\": 225138,\n          \"peakMallocedMemory\": 181760\n        },\n        \"heapSpaceStatistics\": [\n          {\n            \"spaceName\": \"read_only_space\",\n            \"spaceSize\": 0,\n            \"spaceUsedSize\": 0,\n            \"spaceAvailableSize\": 0,\n            \"physicalSpaceSize\": 0\n          }\n        ]\n      }\n    }\n  ],\n  \"endTime\": 1674059036865\n}\n</code></pre>\n<p>Here's an example.</p>\n<pre><code class=\"language-mjs\">import { GCProfiler } from 'node:v8';\nconst profiler = new GCProfiler();\nprofiler.start();\nsetTimeout(() => {\n  console.log(profiler.stop());\n}, 1000);\n</code></pre>\n<pre><code class=\"language-cjs\">const { GCProfiler } = require('node:v8');\nconst profiler = new GCProfiler();\nprofiler.start();\nsetTimeout(() => {\n  console.log(profiler.stop());\n}, 1000);\n</code></pre>"
            },
            {
              "textRaw": "`profiler[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v25.5.0",
                  "v24.13.1"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Stop collecting GC data, and discard the profile.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `SyncCPUProfileHandle`",
          "name": "SyncCPUProfileHandle",
          "type": "class",
          "meta": {
            "added": [
              "v25.0.0",
              "v24.12.0"
            ],
            "changes": []
          },
          "methods": [
            {
              "textRaw": "`syncCpuProfileHandle.stop()`",
              "name": "stop",
              "type": "method",
              "meta": {
                "added": [
                  "v25.0.0",
                  "v24.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Stopping collecting the profile and return the profile data.</p>"
            },
            {
              "textRaw": "`syncCpuProfileHandle[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v25.0.0",
                  "v24.12.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Stopping collecting the profile and the profile will be discarded.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `SyncHeapProfileHandle`",
          "name": "SyncHeapProfileHandle",
          "type": "class",
          "meta": {
            "added": [
              "v26.1.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "methods": [
            {
              "textRaw": "`syncHeapProfileHandle.stop()`",
              "name": "stop",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Stopping collecting the profile and return the profile data.</p>"
            },
            {
              "textRaw": "`syncHeapProfileHandle[Symbol.dispose]()`",
              "name": "[Symbol.dispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v26.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Stopping collecting the profile and the profile will be discarded.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `CPUProfileHandle`",
          "name": "CPUProfileHandle",
          "type": "class",
          "meta": {
            "added": [
              "v24.8.0"
            ],
            "changes": []
          },
          "methods": [
            {
              "textRaw": "`cpuProfileHandle.stop()`",
              "name": "stop",
              "type": "method",
              "meta": {
                "added": [
                  "v24.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Stopping collecting the profile, then return a Promise that fulfills with an error or the\nprofile data.</p>"
            },
            {
              "textRaw": "`cpuProfileHandle[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v24.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Stopping collecting the profile and the profile will be discarded.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `HeapProfileHandle`",
          "name": "HeapProfileHandle",
          "type": "class",
          "meta": {
            "added": [
              "v24.9.0"
            ],
            "changes": []
          },
          "methods": [
            {
              "textRaw": "`heapProfileHandle.stop()`",
              "name": "stop",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Stopping collecting the profile, then return a Promise that fulfills with an error or the\nprofile data.</p>"
            },
            {
              "textRaw": "`heapProfileHandle[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Stopping collecting the profile and the profile will be discarded.</p>"
            }
          ]
        }
      ],
      "displayName": "V8",
      "source": "doc/api/v8.md"
    },
    {
      "textRaw": "VM (executing JavaScript)",
      "name": "vm_(executing_javascript)",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:vm</code> module enables compiling and running code within V8 Virtual\nMachine contexts.</p>\n<p><strong class=\"critical\">The <code>node:vm</code> module is not a security\nmechanism. Do not use it to run untrusted code.</strong></p>\n<p>JavaScript code can be compiled and run immediately or\ncompiled, saved, and run later.</p>\n<p>A common use case is to run the code in a different V8 Context. This means\ninvoked code has a different global object than the invoking code.</p>\n<p>One can provide the context by <a href=\"#what-does-it-mean-to-contextify-an-object\"><em>contextifying</em></a> an\nobject. The invoked code treats any property in the context like a\nglobal variable. Any changes to global variables caused by the invoked\ncode are reflected in the context object.</p>\n<pre><code class=\"language-mjs\">import { createContext, runInContext } from 'node:vm';\n\nconst x = 1;\n\nconst context = { x: 2 };\ncreateContext(context); // Contextify the object.\n\nconst code = 'x += 40; var y = 17;';\n// `x` and `y` are global variables in the context.\n// Initially, x has the value 2 because that is the value of context.x.\nrunInContext(code, context);\n\nconsole.log(context.x); // 42\nconsole.log(context.y); // 17\n\nconsole.log(x); // 1; y is not defined\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, runInContext } = require('node:vm');\n\nconst x = 1;\n\nconst context = { x: 2 };\ncreateContext(context); // Contextify the object.\n\nconst code = 'x += 40; var y = 17;';\n// `x` and `y` are global variables in the context.\n// Initially, x has the value 2 because that is the value of context.x.\nrunInContext(code, context);\n\nconsole.log(context.x); // 42\nconsole.log(context.y); // 17\n\nconsole.log(x); // 1; y is not defined\n</code></pre>",
      "classes": [
        {
          "textRaw": "Class: `vm.Script`",
          "name": "vm.Script",
          "type": "class",
          "meta": {
            "added": [
              "v0.3.1"
            ],
            "changes": []
          },
          "desc": "<p>Instances of the <code>vm.Script</code> class contain precompiled scripts that can be\nexecuted in specific contexts.</p>",
          "signatures": [
            {
              "textRaw": "`new vm.Script(code[, options])`",
              "name": "vm.Script",
              "type": "ctor",
              "meta": {
                "added": [
                  "v0.3.1"
                ],
                "changes": [
                  {
                    "version": [
                      "v21.7.0",
                      "v20.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/51244",
                    "description": "Added support for `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`."
                  },
                  {
                    "version": [
                      "v17.0.0",
                      "v16.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/40249",
                    "description": "Added support for import attributes to the `importModuleDynamically` parameter."
                  },
                  {
                    "version": "v10.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/20300",
                    "description": "The `produceCachedData` is deprecated in favour of `script.createCachedData()`."
                  },
                  {
                    "version": "v5.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/4777",
                    "description": "The `cachedData` and `produceCachedData` options are supported now."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`code` {string} The JavaScript code to compile.",
                  "name": "code",
                  "type": "string",
                  "desc": "The JavaScript code to compile."
                },
                {
                  "textRaw": "`options` {Object|string}",
                  "name": "options",
                  "type": "Object|string",
                  "options": [
                    {
                      "textRaw": "`filename` {string} Specifies the filename used in stack traces produced by this script. **Default:** `'evalmachine.<anonymous>'`.",
                      "name": "filename",
                      "type": "string",
                      "default": "`'evalmachine.<anonymous>'`",
                      "desc": "Specifies the filename used in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`lineOffset` {number} Specifies the line number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "lineOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the line number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`columnOffset` {number} Specifies the first-line column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the first-line column number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source. When supplied, the `cachedDataRejected` value will be set to either `true` or `false` depending on acceptance of the data by V8.",
                      "name": "cachedData",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source. When supplied, the `cachedDataRejected` value will be set to either `true` or `false` depending on acceptance of the data by V8."
                    },
                    {
                      "textRaw": "`produceCachedData` {boolean} When `true` and no `cachedData` is present, V8 will attempt to produce code cache data for `code`. Upon success, a `Buffer` with V8's code cache data will be produced and stored in the `cachedData` property of the returned `vm.Script` instance. The `cachedDataProduced` value will be set to either `true` or `false` depending on whether code cache data is produced successfully. This option is **deprecated** in favor of `script.createCachedData()`. **Default:** `false`.",
                      "name": "produceCachedData",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "When `true` and no `cachedData` is present, V8 will attempt to produce code cache data for `code`. Upon success, a `Buffer` with V8's code cache data will be produced and stored in the `cachedData` property of the returned `vm.Script` instance. The `cachedDataProduced` value will be set to either `true` or `false` depending on whether code cache data is produced successfully. This option is **deprecated** in favor of `script.createCachedData()`."
                    },
                    {
                      "textRaw": "`importModuleDynamically` {Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER} Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs.",
                      "name": "importModuleDynamically",
                      "type": "Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER",
                      "desc": "Used to specify how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>If <code>options</code> is a string, then it specifies the filename.</p>\n<p>Creating a new <code>vm.Script</code> object compiles <code>code</code> but does not run it. The\ncompiled <code>vm.Script</code> can be run later multiple times. The <code>code</code> is not bound to\nany global object; rather, it is bound before each run, just for that run.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {boolean|undefined}",
              "name": "cachedDataRejected",
              "type": "boolean|undefined",
              "meta": {
                "added": [
                  "v5.7.0"
                ],
                "changes": []
              },
              "desc": "<p>When <code>cachedData</code> is supplied to create the <code>vm.Script</code>, this value will be set\nto either <code>true</code> or <code>false</code> depending on acceptance of the data by V8.\nOtherwise the value is <code>undefined</code>.</p>"
            },
            {
              "textRaw": "Type: {string|undefined}",
              "name": "sourceMapURL",
              "type": "string|undefined",
              "meta": {
                "added": [
                  "v19.1.0",
                  "v18.13.0"
                ],
                "changes": []
              },
              "desc": "<p>When the script is compiled from a source that contains a source map magic\ncomment, this property will be set to the URL of the source map.</p>\n<pre><code class=\"language-mjs\">import vm from 'node:vm';\n\nconst script = new vm.Script(`\nfunction myFunc() {}\n//# sourceMappingURL=sourcemap.json\n`);\n\nconsole.log(script.sourceMapURL);\n// Prints: sourcemap.json\n</code></pre>\n<pre><code class=\"language-cjs\">const vm = require('node:vm');\n\nconst script = new vm.Script(`\nfunction myFunc() {}\n//# sourceMappingURL=sourcemap.json\n`);\n\nconsole.log(script.sourceMapURL);\n// Prints: sourcemap.json\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`script.createCachedData()`",
              "name": "createCachedData",
              "type": "method",
              "meta": {
                "added": [
                  "v10.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Creates a code cache that can be used with the <code>Script</code> constructor's\n<code>cachedData</code> option. Returns a <code>Buffer</code>. This method may be called at any\ntime and any number of times.</p>\n<p>The code cache of the <code>Script</code> doesn't contain any JavaScript observable\nstates. The code cache is safe to be saved along side the script source and\nused to construct new <code>Script</code> instances multiple times.</p>\n<p>Functions in the <code>Script</code> source can be marked as lazily compiled and they are\nnot compiled at construction of the <code>Script</code>. These functions are going to be\ncompiled when they are invoked the first time. The code cache serializes the\nmetadata that V8 currently knows about the <code>Script</code> that it can use to speed up\nfuture compilations.</p>\n<pre><code class=\"language-js\">const script = new vm.Script(`\nfunction add(a, b) {\n  return a + b;\n}\n\nconst x = add(1, 2);\n`);\n\nconst cacheWithoutAdd = script.createCachedData();\n// In `cacheWithoutAdd` the function `add()` is marked for full compilation\n// upon invocation.\n\nscript.runInThisContext();\n\nconst cacheWithAdd = script.createCachedData();\n// `cacheWithAdd` contains fully compiled function `add()`.\n</code></pre>"
            },
            {
              "textRaw": "`script.runInContext(contextifiedObject[, options])`",
              "name": "runInContext",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.1"
                ],
                "changes": [
                  {
                    "version": "v6.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6635",
                    "description": "The `breakOnSigint` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`contextifiedObject` {Object} A contextified object as returned by the `vm.createContext()` method.",
                      "name": "contextifiedObject",
                      "type": "Object",
                      "desc": "A contextified object as returned by the `vm.createContext()` method."
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`displayErrors` {boolean} When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. **Default:** `true`.",
                          "name": "displayErrors",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace."
                        },
                        {
                          "textRaw": "`timeout` {integer} Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.",
                          "name": "timeout",
                          "type": "integer",
                          "desc": "Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer."
                        },
                        {
                          "textRaw": "`breakOnSigint` {boolean} If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that. **Default:** `false`.",
                          "name": "breakOnSigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {any} the result of the very last statement executed in the script.",
                    "name": "return",
                    "type": "any",
                    "desc": "the result of the very last statement executed in the script."
                  }
                }
              ],
              "desc": "<p>Runs the compiled code contained by the <code>vm.Script</code> object within the given\n<code>contextifiedObject</code> and returns the result. Running code does not have access\nto local scope.</p>\n<p>The following example compiles code that increments a global variable, sets\nthe value of another global variable, then execute the code multiple times.\nThe globals are contained in the <code>context</code> object.</p>\n<pre><code class=\"language-mjs\">import { createContext, Script } from 'node:vm';\n\nconst context = {\n  animal: 'cat',\n  count: 2,\n};\n\nconst script = new Script('count += 1; name = \"kitty\";');\n\ncreateContext(context);\nfor (let i = 0; i &#x3C; 10; ++i) {\n  script.runInContext(context);\n}\n\nconsole.log(context);\n// Prints: { animal: 'cat', count: 12, name: 'kitty' }\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, Script } = require('node:vm');\n\nconst context = {\n  animal: 'cat',\n  count: 2,\n};\n\nconst script = new Script('count += 1; name = \"kitty\";');\n\ncreateContext(context);\nfor (let i = 0; i &#x3C; 10; ++i) {\n  script.runInContext(context);\n}\n\nconsole.log(context);\n// Prints: { animal: 'cat', count: 12, name: 'kitty' }\n</code></pre>\n<p>Using the <code>timeout</code> or <code>breakOnSigint</code> options will result in new event loops\nand corresponding threads being started, which have a non-zero performance\noverhead.</p>"
            },
            {
              "textRaw": "`script.runInNewContext([contextObject[, options]])`",
              "name": "runInNewContext",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.1"
                ],
                "changes": [
                  {
                    "version": [
                      "v22.8.0",
                      "v20.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/54394",
                    "description": "The `contextObject` argument now accepts `vm.constants.DONT_CONTEXTIFY`."
                  },
                  {
                    "version": "v14.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34023",
                    "description": "The `microtaskMode` option is supported now."
                  },
                  {
                    "version": "v10.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/19016",
                    "description": "The `contextCodeGeneration` option is supported now."
                  },
                  {
                    "version": "v6.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6635",
                    "description": "The `breakOnSigint` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`contextObject` {Object|vm.constants.DONT_CONTEXTIFY|undefined} Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified. If `undefined`, an empty contextified object will be created for backwards compatibility.",
                      "name": "contextObject",
                      "type": "Object|vm.constants.DONT_CONTEXTIFY|undefined",
                      "desc": "Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified. If `undefined`, an empty contextified object will be created for backwards compatibility.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`displayErrors` {boolean} When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. **Default:** `true`.",
                          "name": "displayErrors",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace."
                        },
                        {
                          "textRaw": "`timeout` {integer} Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.",
                          "name": "timeout",
                          "type": "integer",
                          "desc": "Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer."
                        },
                        {
                          "textRaw": "`breakOnSigint` {boolean} If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that. **Default:** `false`.",
                          "name": "breakOnSigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that."
                        },
                        {
                          "textRaw": "`contextName` {string} Human-readable name of the newly created context. **Default:** `'VM Context i'`, where `i` is an ascending numerical index of the created context.",
                          "name": "contextName",
                          "type": "string",
                          "default": "`'VM Context i'`, where `i` is an ascending numerical index of the created context",
                          "desc": "Human-readable name of the newly created context."
                        },
                        {
                          "textRaw": "`contextOrigin` {string} Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. Most notably, this string should omit the trailing slash, as that denotes a path. **Default:** `''`.",
                          "name": "contextOrigin",
                          "type": "string",
                          "default": "`''`",
                          "desc": "Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. Most notably, this string should omit the trailing slash, as that denotes a path."
                        },
                        {
                          "textRaw": "`contextCodeGeneration` {Object}",
                          "name": "contextCodeGeneration",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`strings` {boolean} If set to false any calls to `eval` or function constructors (`Function`, `GeneratorFunction`, etc) will throw an `EvalError`. **Default:** `true`.",
                              "name": "strings",
                              "type": "boolean",
                              "default": "`true`",
                              "desc": "If set to false any calls to `eval` or function constructors (`Function`, `GeneratorFunction`, etc) will throw an `EvalError`."
                            },
                            {
                              "textRaw": "`wasm` {boolean} If set to false any attempt to compile a WebAssembly module will throw a `WebAssembly.CompileError`. **Default:** `true`.",
                              "name": "wasm",
                              "type": "boolean",
                              "default": "`true`",
                              "desc": "If set to false any attempt to compile a WebAssembly module will throw a `WebAssembly.CompileError`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`microtaskMode` {string} If set to `afterEvaluate`, microtasks (tasks scheduled through `Promise`s and `async function`s) will be run immediately after the script has run. They are included in the `timeout` and `breakOnSigint` scopes in that case.",
                          "name": "microtaskMode",
                          "type": "string",
                          "desc": "If set to `afterEvaluate`, microtasks (tasks scheduled through `Promise`s and `async function`s) will be run immediately after the script has run. They are included in the `timeout` and `breakOnSigint` scopes in that case."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {any} the result of the very last statement executed in the script.",
                    "name": "return",
                    "type": "any",
                    "desc": "the result of the very last statement executed in the script."
                  }
                }
              ],
              "desc": "<p>This method is a shortcut to <code>script.runInContext(vm.createContext(options), options)</code>.\nIt does several things at once:</p>\n<ol>\n<li>Creates a new context.</li>\n<li>If <code>contextObject</code> is an object, <a href=\"#what-does-it-mean-to-contextify-an-object\">contextifies</a> it with the new context.\nIf  <code>contextObject</code> is undefined, creates a new object and <a href=\"#what-does-it-mean-to-contextify-an-object\">contextifies</a> it.\nIf <code>contextObject</code> is <a href=\"#vmconstantsdont_contextify\"><code>vm.constants.DONT_CONTEXTIFY</code></a>, don't <a href=\"#what-does-it-mean-to-contextify-an-object\">contextify</a> anything.</li>\n<li>Runs the compiled code contained by the <code>vm.Script</code> object within the created context. The code\ndoes not have access to the scope in which this method is called.</li>\n<li>Returns the result.</li>\n</ol>\n<p>The following example compiles code that sets a global variable, then executes\nthe code multiple times in different contexts. The globals are set on and\ncontained within each individual <code>context</code>.</p>\n<pre><code class=\"language-mjs\">import { constants, Script } from 'node:vm';\n\nconst script = new Script('globalVar = \"set\"');\n\nconst contexts = [{}, {}, {}];\ncontexts.forEach((context) => {\n  script.runInNewContext(context);\n});\n\nconsole.log(contexts);\n// Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]\n\n// This would throw if the context is created from a contextified object.\n// constants.DONT_CONTEXTIFY allows creating contexts with ordinary\n// global objects that can be frozen.\nconst freezeScript = new Script('Object.freeze(globalThis); globalThis;');\nconst frozenContext = freezeScript.runInNewContext(constants.DONT_CONTEXTIFY);\n</code></pre>\n<pre><code class=\"language-cjs\">const { constants, Script } = require('node:vm');\n\nconst script = new Script('globalVar = \"set\"');\n\nconst contexts = [{}, {}, {}];\ncontexts.forEach((context) => {\n  script.runInNewContext(context);\n});\n\nconsole.log(contexts);\n// Prints: [{ globalVar: 'set' }, { globalVar: 'set' }, { globalVar: 'set' }]\n\n// This would throw if the context is created from a contextified object.\n// constants.DONT_CONTEXTIFY allows creating contexts with ordinary\n// global objects that can be frozen.\nconst freezeScript = new Script('Object.freeze(globalThis); globalThis;');\nconst frozenContext = freezeScript.runInNewContext(constants.DONT_CONTEXTIFY);\n</code></pre>"
            },
            {
              "textRaw": "`script.runInThisContext([options])`",
              "name": "runInThisContext",
              "type": "method",
              "meta": {
                "added": [
                  "v0.3.1"
                ],
                "changes": [
                  {
                    "version": "v6.3.0",
                    "pr-url": "https://github.com/nodejs/node/pull/6635",
                    "description": "The `breakOnSigint` option is supported now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`displayErrors` {boolean} When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. **Default:** `true`.",
                          "name": "displayErrors",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace."
                        },
                        {
                          "textRaw": "`timeout` {integer} Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.",
                          "name": "timeout",
                          "type": "integer",
                          "desc": "Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer."
                        },
                        {
                          "textRaw": "`breakOnSigint` {boolean} If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that. **Default:** `false`.",
                          "name": "breakOnSigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {any} the result of the very last statement executed in the script.",
                    "name": "return",
                    "type": "any",
                    "desc": "the result of the very last statement executed in the script."
                  }
                }
              ],
              "desc": "<p>Runs the compiled code contained by the <code>vm.Script</code> within the context of the\ncurrent <code>global</code> object. Running code does not have access to local scope, but\n<em>does</em> have access to the current <code>global</code> object.</p>\n<p>The following example compiles code that increments a <code>global</code> variable then\nexecutes that code multiple times:</p>\n<pre><code class=\"language-mjs\">import { Script } from 'node:vm';\n\nglobal.globalVar = 0;\n\nconst script = new Script('globalVar += 1', { filename: 'myfile.vm' });\n\nfor (let i = 0; i &#x3C; 1000; ++i) {\n  script.runInThisContext();\n}\n\nconsole.log(globalVar);\n\n// 1000\n</code></pre>\n<pre><code class=\"language-cjs\">const { Script } = require('node:vm');\n\nglobal.globalVar = 0;\n\nconst script = new Script('globalVar += 1', { filename: 'myfile.vm' });\n\nfor (let i = 0; i &#x3C; 1000; ++i) {\n  script.runInThisContext();\n}\n\nconsole.log(globalVar);\n\n// 1000\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Class: `vm.Module`",
          "name": "vm.Module",
          "type": "class",
          "meta": {
            "added": [
              "v13.0.0",
              "v12.16.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>This feature is only available with the <code>--experimental-vm-modules</code> command\nflag enabled.</p>\n<p>The <code>vm.Module</code> class provides a low-level interface for using\nECMAScript modules in VM contexts. It is the counterpart of the <code>vm.Script</code>\nclass that closely mirrors <a href=\"https://tc39.es/ecma262/#sec-abstract-module-records\">Module Record</a>s as defined in the ECMAScript\nspecification.</p>\n<p>Unlike <code>vm.Script</code> however, every <code>vm.Module</code> object is bound to a context from\nits creation.</p>\n<p>Using a <code>vm.Module</code> object requires three distinct steps: creation/parsing,\nlinking, and evaluation. These three steps are illustrated in the following\nexample.</p>\n<p>This implementation lies at a lower level than the <a href=\"esm.html#modules-ecmascript-modules\">ECMAScript Module\nloader</a>. There is also no way to interact with the Loader yet, though\nsupport is planned.</p>\n<pre><code class=\"language-mjs\">import vm from 'node:vm';\n\nconst contextifiedObject = vm.createContext({\n  secret: 42,\n  print: console.log,\n});\n\n// Step 1\n//\n// Create a Module by constructing a new `vm.SourceTextModule` object. This\n// parses the provided source text, throwing a `SyntaxError` if anything goes\n// wrong. By default, a Module is created in the top context. But here, we\n// specify `contextifiedObject` as the context this Module belongs to.\n//\n// Here, we attempt to obtain the default export from the module \"foo\", and\n// put it into local binding \"secret\".\n\nconst rootModule = new vm.SourceTextModule(`\n  import s from 'foo';\n  s;\n  print(s);\n`, { context: contextifiedObject });\n\n// Step 2\n//\n// \"Link\" the imported dependencies of this Module to it.\n//\n// Obtain the requested dependencies of a SourceTextModule by\n// `sourceTextModule.moduleRequests` and resolve them.\n//\n// Even top-level Modules without dependencies must be explicitly linked. The\n// array passed to `sourceTextModule.linkRequests(modules)` can be\n// empty, however.\n//\n// Note: This is a contrived example in that the resolveAndLinkDependencies\n// creates a new \"foo\" module every time it is called. In a full-fledged\n// module system, a cache would probably be used to avoid duplicated modules.\n\nconst moduleMap = new Map([\n  ['root', rootModule],\n]);\n\nfunction resolveAndLinkDependencies(module) {\n  const requestedModules = module.moduleRequests.map((request) => {\n    // In a full-fledged module system, the resolveAndLinkDependencies would\n    // resolve the module with the module cache key `[specifier, attributes]`.\n    // In this example, we just use the specifier as the key.\n    const specifier = request.specifier;\n\n    let requestedModule = moduleMap.get(specifier);\n    if (requestedModule === undefined) {\n      requestedModule = new vm.SourceTextModule(`\n        // The \"secret\" variable refers to the global variable we added to\n        // \"contextifiedObject\" when creating the context.\n        export default secret;\n      `, { context: module.context });\n      moduleMap.set(specifier, requestedModule);\n      // Resolve the dependencies of the new module as well.\n      resolveAndLinkDependencies(requestedModule);\n    }\n\n    return requestedModule;\n  });\n\n  module.linkRequests(requestedModules);\n}\n\nresolveAndLinkDependencies(rootModule);\nrootModule.instantiate();\n\n// Step 3\n//\n// Evaluate the Module. The evaluate() method returns a promise which will\n// resolve after the module has finished evaluating.\n\n// Prints 42.\nawait rootModule.evaluate();\n</code></pre>\n<pre><code class=\"language-cjs\">const vm = require('node:vm');\n\nconst contextifiedObject = vm.createContext({\n  secret: 42,\n  print: console.log,\n});\n\n(async () => {\n  // Step 1\n  //\n  // Create a Module by constructing a new `vm.SourceTextModule` object. This\n  // parses the provided source text, throwing a `SyntaxError` if anything goes\n  // wrong. By default, a Module is created in the top context. But here, we\n  // specify `contextifiedObject` as the context this Module belongs to.\n  //\n  // Here, we attempt to obtain the default export from the module \"foo\", and\n  // put it into local binding \"secret\".\n\n  const rootModule = new vm.SourceTextModule(`\n    import s from 'foo';\n    s;\n    print(s);\n  `, { context: contextifiedObject });\n\n  // Step 2\n  //\n  // \"Link\" the imported dependencies of this Module to it.\n  //\n  // Obtain the requested dependencies of a SourceTextModule by\n  // `sourceTextModule.moduleRequests` and resolve them.\n  //\n  // Even top-level Modules without dependencies must be explicitly linked. The\n  // array passed to `sourceTextModule.linkRequests(modules)` can be\n  // empty, however.\n  //\n  // Note: This is a contrived example in that the resolveAndLinkDependencies\n  // creates a new \"foo\" module every time it is called. In a full-fledged\n  // module system, a cache would probably be used to avoid duplicated modules.\n\n  const moduleMap = new Map([\n    ['root', rootModule],\n  ]);\n\n  function resolveAndLinkDependencies(module) {\n    const requestedModules = module.moduleRequests.map((request) => {\n      // In a full-fledged module system, the resolveAndLinkDependencies would\n      // resolve the module with the module cache key `[specifier, attributes]`.\n      // In this example, we just use the specifier as the key.\n      const specifier = request.specifier;\n\n      let requestedModule = moduleMap.get(specifier);\n      if (requestedModule === undefined) {\n        requestedModule = new vm.SourceTextModule(`\n          // The \"secret\" variable refers to the global variable we added to\n          // \"contextifiedObject\" when creating the context.\n          export default secret;\n        `, { context: module.context });\n        moduleMap.set(specifier, requestedModule);\n        // Resolve the dependencies of the new module as well.\n        resolveAndLinkDependencies(requestedModule);\n      }\n\n      return requestedModule;\n    });\n\n    module.linkRequests(requestedModules);\n  }\n\n  resolveAndLinkDependencies(rootModule);\n  rootModule.instantiate();\n\n  // Step 3\n  //\n  // Evaluate the Module. The evaluate() method returns a promise which will\n  // resolve after the module has finished evaluating.\n\n  // Prints 42.\n  await rootModule.evaluate();\n})();\n</code></pre>",
          "properties": [
            {
              "textRaw": "Type: {any}",
              "name": "error",
              "type": "any",
              "desc": "<p>If the <code>module.status</code> is <code>'errored'</code>, this property contains the exception\nthrown by the module during evaluation. If the status is anything else,\naccessing this property will result in a thrown exception.</p>\n<p>The value <code>undefined</code> cannot be used for cases where there is not a thrown\nexception due to possible ambiguity with <code>throw undefined;</code>.</p>\n<p>Corresponds to the <code>[[EvaluationError]]</code> field of <a href=\"https://tc39.es/ecma262/#sec-cyclic-module-records\">Cyclic Module Record</a>s\nin the ECMAScript specification.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "identifier",
              "type": "string",
              "desc": "<p>The identifier of the current module, as set in the constructor.</p>"
            },
            {
              "textRaw": "Type: {Object}",
              "name": "namespace",
              "type": "Object",
              "desc": "<p>The namespace object of the module. This is only available after linking\n(<code>module.link()</code>) has completed.</p>\n<p>Corresponds to the <a href=\"https://tc39.es/ecma262/#sec-getmodulenamespace\">GetModuleNamespace</a> abstract operation in the ECMAScript\nspecification.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "status",
              "type": "string",
              "desc": "<p>The current status of the module. Will be one of:</p>\n<ul>\n<li>\n<p><code>'unlinked'</code>: <code>module.link()</code> has not yet been called.</p>\n</li>\n<li>\n<p><code>'linking'</code>: <code>module.link()</code> has been called, but not all Promises returned\nby the linker function have been resolved yet.</p>\n</li>\n<li>\n<p><code>'linked'</code>: The module has been linked successfully, and all of its\ndependencies are linked, but <code>module.evaluate()</code> has not yet been called.</p>\n</li>\n<li>\n<p><code>'evaluating'</code>: The module is being evaluated through a <code>module.evaluate()</code> on\nitself or a parent module.</p>\n</li>\n<li>\n<p><code>'evaluated'</code>: The module has been successfully evaluated.</p>\n</li>\n<li>\n<p><code>'errored'</code>: The module has been evaluated, but an exception was thrown.</p>\n</li>\n</ul>\n<p>Other than <code>'errored'</code>, this status string corresponds to the specification's\n<a href=\"https://tc39.es/ecma262/#sec-cyclic-module-records\">Cyclic Module Record</a>'s <code>[[Status]]</code> field. <code>'errored'</code> corresponds to\n<code>'evaluated'</code> in the specification, but with <code>[[EvaluationError]]</code> set to a\nvalue that is not <code>undefined</code>.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`module.evaluate([options])`",
              "name": "evaluate",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`timeout` {integer} Specifies the number of milliseconds to evaluate before terminating execution. If execution is interrupted, an `Error` will be thrown. This value must be a strictly positive integer.",
                          "name": "timeout",
                          "type": "integer",
                          "desc": "Specifies the number of milliseconds to evaluate before terminating execution. If execution is interrupted, an `Error` will be thrown. This value must be a strictly positive integer."
                        },
                        {
                          "textRaw": "`breakOnSigint` {boolean} If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that. **Default:** `false`.",
                          "name": "breakOnSigint",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with `undefined` upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with `undefined` upon success."
                  }
                }
              ],
              "desc": "<p>Evaluate the module and its depenendencies. Corresponds to the <a href=\"https://tc39.es/ecma262/#sec-moduleevaluation\">Evaluate() concrete method</a> field of\n<a href=\"https://tc39.es/ecma262/#sec-cyclic-module-records\">Cyclic Module Record</a>s in the ECMAScript specification.</p>\n<p>If the module is a <code>vm.SourceTextModule</code>, <code>evaluate()</code> must be called after the module has been instantiated;\notherwise <code>evaluate()</code> will return a rejected promise.</p>\n<p>For a <code>vm.SourceTextModule</code>, the promise returned by <code>evaluate()</code> may be fulfilled either\nsynchronously or asynchronously:</p>\n<ol>\n<li>If the <code>vm.SourceTextModule</code> has no top-level <code>await</code> in itself or any of its dependencies, the promise will be\nfulfilled <em>synchronously</em> after the module and all its dependencies have been evaluated.\n<ol>\n<li>If the evaluation succeeds, the promise will be <em>synchronously</em> resolved to <code>undefined</code>.</li>\n<li>If the evaluation results in an exception, the promise will be <em>synchronously</em> rejected with the exception\nthat causes the evaluation to fail, which is the same as <code>module.error</code>.</li>\n</ol>\n</li>\n<li>If the <code>vm.SourceTextModule</code> has top-level <code>await</code> in itself or any of its dependencies, the promise will be\nfulfilled <em>asynchronously</em> after the module and all its dependencies have been evaluated.\n<ol>\n<li>If the evaluation succeeds, the promise will be <em>asynchronously</em> resolved to <code>undefined</code>.</li>\n<li>If the evaluation results in an exception, the promise will be <em>asynchronously</em> rejected with the exception\nthat causes the evaluation to fail.</li>\n</ol>\n</li>\n</ol>\n<p>If the module is a <code>vm.SyntheticModule</code>, <code>evaluate()</code> always returns a promise that fulfills synchronously, see\nthe specification of <a href=\"https://tc39.es/ecma262/#sec-smr-Evaluate\">Evaluate() of a Synthetic Module Record</a>:</p>\n<ol>\n<li>If the <code>evaluateCallback</code> passed to its constructor throws an exception synchronously, <code>evaluate()</code> returns\na promise that will be synchronously rejected with that exception.</li>\n<li>If the <code>evaluateCallback</code> does not throw an exception, <code>evaluate()</code> returns a promise that will be\nsynchronously resolved to <code>undefined</code>.</li>\n</ol>\n<p>The <code>evaluateCallback</code> of a <code>vm.SyntheticModule</code> is executed synchronously within the <code>evaluate()</code> call, and its\nreturn value is discarded. This means if <code>evaluateCallback</code> is an asynchronous function, the promise returned by\n<code>evaluate()</code> will not reflect its asynchronous behavior, and any rejections from an asynchronous\n<code>evaluateCallback</code> will be lost.</p>\n<p><code>evaluate()</code> could also be called again after the module has already been evaluated, in which case:</p>\n<ol>\n<li>If the initial evaluation ended in success (<code>module.status</code> is <code>'evaluated'</code>), it will do nothing\nand return a promise that resolves to <code>undefined</code>.</li>\n<li>If the initial evaluation resulted in an exception (<code>module.status</code> is <code>'errored'</code>), it will re-reject\nthe exception that the initial evaluation resulted in.</li>\n</ol>\n<p>This method cannot be called while the module is being evaluated (<code>module.status</code> is <code>'evaluating'</code>).</p>"
            },
            {
              "textRaw": "`module.link(linker)`",
              "name": "link",
              "type": "method",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v21.1.0",
                      "v20.10.0",
                      "v18.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/50141",
                    "description": "The option `extra.assert` is renamed to `extra.attributes`. The former name is still provided for backward compatibility."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`linker` {Function}",
                      "name": "linker",
                      "type": "Function",
                      "options": [
                        {
                          "textRaw": "`specifier` {string} The specifier of the requested module:import foo from 'foo'; // ^^^^^ the module specifier",
                          "name": "specifier",
                          "type": "string",
                          "desc": "The specifier of the requested module:import foo from 'foo'; // ^^^^^ the module specifier"
                        },
                        {
                          "textRaw": "`referencingModule` {vm.Module} The `Module` object `link()` is called on.",
                          "name": "referencingModule",
                          "type": "vm.Module",
                          "desc": "The `Module` object `link()` is called on."
                        },
                        {
                          "textRaw": "`extra` {Object}",
                          "name": "extra",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`attributes` {Object} The data from the attribute:import foo from 'foo' with { name: 'value' }; // ^^^^^^^^^^^^^^^^^ the attributePer ECMA-262, hosts are expected to trigger an error if an unsupported attribute is present.",
                              "name": "attributes",
                              "type": "Object",
                              "desc": "The data from the attribute:import foo from 'foo' with { name: 'value' }; // ^^^^^^^^^^^^^^^^^ the attributePer ECMA-262, hosts are expected to trigger an error if an unsupported attribute is present."
                            },
                            {
                              "textRaw": "`assert` {Object} Alias for `extra.attributes`.",
                              "name": "assert",
                              "type": "Object",
                              "desc": "Alias for `extra.attributes`."
                            }
                          ]
                        },
                        {
                          "textRaw": "Returns: {vm.Module|Promise}",
                          "name": "return",
                          "type": "vm.Module|Promise"
                        }
                      ]
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Link module dependencies. This method must be called before evaluation, and\ncan only be called once per module.</p>\n<p>Use <a href=\"#sourcetextmodulelinkrequestsmodules\"><code>sourceTextModule.linkRequests(modules)</code></a> and\n<a href=\"#sourcetextmoduleinstantiate\"><code>sourceTextModule.instantiate()</code></a> to link modules either synchronously or\nasynchronously.</p>\n<p>The function is expected to return a <code>Module</code> object or a <code>Promise</code> that\neventually resolves to a <code>Module</code> object. The returned <code>Module</code> must satisfy the\nfollowing two invariants:</p>\n<ul>\n<li>It must belong to the same context as the parent <code>Module</code>.</li>\n<li>Its <code>status</code> must not be <code>'errored'</code>.</li>\n</ul>\n<p>If the returned <code>Module</code>'s <code>status</code> is <code>'unlinked'</code>, this method will be\nrecursively called on the returned <code>Module</code> with the same provided <code>linker</code>\nfunction.</p>\n<p><code>link()</code> returns a <code>Promise</code> that will either get resolved when all linking\ninstances resolve to a valid <code>Module</code>, or rejected if the linker function either\nthrows an exception or returns an invalid <code>Module</code>.</p>\n<p>The linker function roughly corresponds to the implementation-defined\n<a href=\"https://tc39.es/ecma262/#sec-hostresolveimportedmodule\">HostResolveImportedModule</a> abstract operation in the ECMAScript\nspecification, with a few key differences:</p>\n<ul>\n<li>The linker function is allowed to be asynchronous while\n<a href=\"https://tc39.es/ecma262/#sec-hostresolveimportedmodule\">HostResolveImportedModule</a> is synchronous.</li>\n</ul>\n<p>The actual <a href=\"https://tc39.es/ecma262/#sec-hostresolveimportedmodule\">HostResolveImportedModule</a> implementation used during module\nlinking is one that returns the modules linked during linking. Since at\nthat point all modules would have been fully linked already, the\n<a href=\"https://tc39.es/ecma262/#sec-hostresolveimportedmodule\">HostResolveImportedModule</a> implementation is fully synchronous per\nspecification.</p>\n<p>Corresponds to the <a href=\"https://tc39.es/ecma262/#sec-moduledeclarationlinking\">Link() concrete method</a> field of <a href=\"https://tc39.es/ecma262/#sec-cyclic-module-records\">Cyclic Module\nRecord</a>s in the ECMAScript specification.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `vm.SourceTextModule`",
          "name": "vm.SourceTextModule",
          "type": "class",
          "meta": {
            "added": [
              "v9.6.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>This feature is only available with the <code>--experimental-vm-modules</code> command\nflag enabled.</p>\n<ul>\n<li>Extends: <a href=\"vm.html#class-vmmodule\"><code>&#x3C;vm.Module></code></a></li>\n</ul>\n<p>The <code>vm.SourceTextModule</code> class provides the <a href=\"https://tc39.es/ecma262/#sec-source-text-module-records\">Source Text Module Record</a> as\ndefined in the ECMAScript specification.</p>",
          "signatures": [
            {
              "textRaw": "`new vm.SourceTextModule(code[, options])`",
              "name": "vm.SourceTextModule",
              "type": "ctor",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v17.0.0",
                      "v16.12.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/40249",
                    "description": "Added support for import attributes to the `importModuleDynamically` parameter."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`code` {string} JavaScript Module code to parse",
                  "name": "code",
                  "type": "string",
                  "desc": "JavaScript Module code to parse"
                },
                {
                  "textRaw": "`options`",
                  "name": "options",
                  "options": [
                    {
                      "textRaw": "`identifier` {string} String used in stack traces. **Default:** `'vm:module(i)'` where `i` is a context-specific ascending index.",
                      "name": "identifier",
                      "type": "string",
                      "default": "`'vm:module(i)'` where `i` is a context-specific ascending index",
                      "desc": "String used in stack traces."
                    },
                    {
                      "textRaw": "`cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source. The `code` must be the same as the module from which this `cachedData` was created.",
                      "name": "cachedData",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source. The `code` must be the same as the module from which this `cachedData` was created."
                    },
                    {
                      "textRaw": "`context` {Object} The contextified object as returned by the `vm.createContext()` method, to compile and evaluate this `Module` in. If no context is specified, the module is evaluated in the current execution context.",
                      "name": "context",
                      "type": "Object",
                      "desc": "The contextified object as returned by the `vm.createContext()` method, to compile and evaluate this `Module` in. If no context is specified, the module is evaluated in the current execution context."
                    },
                    {
                      "textRaw": "`lineOffset` {integer} Specifies the line number offset that is displayed in stack traces produced by this `Module`. **Default:** `0`.",
                      "name": "lineOffset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Specifies the line number offset that is displayed in stack traces produced by this `Module`."
                    },
                    {
                      "textRaw": "`columnOffset` {integer} Specifies the first-line column number offset that is displayed in stack traces produced by this `Module`. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "Specifies the first-line column number offset that is displayed in stack traces produced by this `Module`."
                    },
                    {
                      "textRaw": "`initializeImportMeta` {Function} Called during evaluation of this `Module` to initialize the `import.meta`.",
                      "name": "initializeImportMeta",
                      "type": "Function",
                      "desc": "Called during evaluation of this `Module` to initialize the `import.meta`.",
                      "options": [
                        {
                          "textRaw": "`meta` {import.meta}",
                          "name": "meta",
                          "type": "import.meta"
                        },
                        {
                          "textRaw": "`module` {vm.SourceTextModule}",
                          "name": "module",
                          "type": "vm.SourceTextModule"
                        }
                      ]
                    },
                    {
                      "textRaw": "`importModuleDynamically` {Function} Used to specify the how the modules should be loaded during the evaluation of this module when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs.",
                      "name": "importModuleDynamically",
                      "type": "Function",
                      "desc": "Used to specify the how the modules should be loaded during the evaluation of this module when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new <code>SourceTextModule</code> instance.</p>\n<p>Properties assigned to the <code>import.meta</code> object that are objects may\nallow the module to access information outside the specified <code>context</code>. Use\n<code>vm.runInContext()</code> to create objects in a specific context.</p>\n<pre><code class=\"language-mjs\">import vm from 'node:vm';\n\nconst contextifiedObject = vm.createContext({ secret: 42 });\n\nconst module = new vm.SourceTextModule(\n  'Object.getPrototypeOf(import.meta.prop).secret = secret;',\n  {\n    initializeImportMeta(meta) {\n      // Note: this object is created in the top context. As such,\n      // Object.getPrototypeOf(import.meta.prop) points to the\n      // Object.prototype in the top context rather than that in\n      // the contextified object.\n      meta.prop = {};\n    },\n  });\n// The module has an empty `moduleRequests` array.\nmodule.linkRequests([]);\nmodule.instantiate();\nawait module.evaluate();\n\n// Now, Object.prototype.secret will be equal to 42.\n//\n// To fix this problem, replace\n//     meta.prop = {};\n// above with\n//     meta.prop = vm.runInContext('{}', contextifiedObject);\n</code></pre>\n<pre><code class=\"language-cjs\">const vm = require('node:vm');\nconst contextifiedObject = vm.createContext({ secret: 42 });\n(async () => {\n  const module = new vm.SourceTextModule(\n    'Object.getPrototypeOf(import.meta.prop).secret = secret;',\n    {\n      initializeImportMeta(meta) {\n        // Note: this object is created in the top context. As such,\n        // Object.getPrototypeOf(import.meta.prop) points to the\n        // Object.prototype in the top context rather than that in\n        // the contextified object.\n        meta.prop = {};\n      },\n    });\n  // The module has an empty `moduleRequests` array.\n  module.linkRequests([]);\n  module.instantiate();\n  await module.evaluate();\n  // Now, Object.prototype.secret will be equal to 42.\n  //\n  // To fix this problem, replace\n  //     meta.prop = {};\n  // above with\n  //     meta.prop = vm.runInContext('{}', contextifiedObject);\n})();\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`sourceTextModule.createCachedData()`",
              "name": "createCachedData",
              "type": "method",
              "meta": {
                "added": [
                  "v13.7.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Creates a code cache that can be used with the <code>SourceTextModule</code> constructor's\n<code>cachedData</code> option. Returns a <code>Buffer</code>. This method may be called any number\nof times before the module has been evaluated.</p>\n<p>The code cache of the <code>SourceTextModule</code> doesn't contain any JavaScript\nobservable states. The code cache is safe to be saved along side the script\nsource and used to construct new <code>SourceTextModule</code> instances multiple times.</p>\n<p>Functions in the <code>SourceTextModule</code> source can be marked as lazily compiled\nand they are not compiled at construction of the <code>SourceTextModule</code>. These\nfunctions are going to be compiled when they are invoked the first time. The\ncode cache serializes the metadata that V8 currently knows about the\n<code>SourceTextModule</code> that it can use to speed up future compilations.</p>\n<pre><code class=\"language-js\">// Create an initial module\nconst module = new vm.SourceTextModule('const a = 1;');\n\n// Create cached data from this module\nconst cachedData = module.createCachedData();\n\n// Create a new module using the cached data. The code must be the same.\nconst module2 = new vm.SourceTextModule('const a = 1;', { cachedData });\n</code></pre>"
            },
            {
              "textRaw": "`sourceTextModule.hasAsyncGraph()`",
              "name": "hasAsyncGraph",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Iterates over the dependency graph and returns <code>true</code> if any module in its\ndependencies or this module itself contains top-level <code>await</code> expressions,\notherwise returns <code>false</code>.</p>\n<p>The search may be slow if the graph is big enough.</p>\n<p>This requires the module to be instantiated first. If the module is not\ninstantiated yet, an error will be thrown.</p>"
            },
            {
              "textRaw": "`sourceTextModule.hasTopLevelAwait()`",
              "name": "hasTopLevelAwait",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Returns whether the module itself contains any top-level <code>await</code> expressions.</p>\n<p>This corresponds to the field <code>[[HasTLA]]</code> in <a href=\"https://tc39.es/ecma262/#sec-cyclic-module-records\">Cyclic Module Record</a> in the\nECMAScript specification.</p>"
            },
            {
              "textRaw": "`sourceTextModule.instantiate()`",
              "name": "instantiate",
              "type": "method",
              "meta": {
                "added": [
                  "v24.8.0",
                  "v22.21.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {undefined}",
                    "name": "return",
                    "type": "undefined"
                  }
                }
              ],
              "desc": "<p>Instantiate the module with the linked requested modules.</p>\n<p>This resolves the imported bindings of the module, including re-exported\nbinding names. When there are any bindings that cannot be resolved,\nan error would be thrown synchronously.</p>\n<p>If the requested modules include cyclic dependencies, the\n<a href=\"#sourcetextmodulelinkrequestsmodules\"><code>sourceTextModule.linkRequests(modules)</code></a> method must be called on all\nmodules in the cycle before calling this method.</p>"
            },
            {
              "textRaw": "`sourceTextModule.linkRequests(modules)`",
              "name": "linkRequests",
              "type": "method",
              "meta": {
                "added": [
                  "v24.8.0",
                  "v22.21.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`modules` {vm.Module[]} Array of `vm.Module` objects that this module depends on. The order of the modules in the array is the order of `sourceTextModule.moduleRequests`.",
                      "name": "modules",
                      "type": "vm.Module[]",
                      "desc": "Array of `vm.Module` objects that this module depends on. The order of the modules in the array is the order of `sourceTextModule.moduleRequests`."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {undefined}",
                    "name": "return",
                    "type": "undefined"
                  }
                }
              ],
              "desc": "<p>Link module dependencies. This method must be called before evaluation, and\ncan only be called once per module.</p>\n<p>The order of the module instances in the <code>modules</code> array should correspond to the order of\n<a href=\"#sourcetextmodulemodulerequests\"><code>sourceTextModule.moduleRequests</code></a> being resolved. If two module requests have the same\nspecifier and import attributes, they must be resolved with the same module instance or an\n<code>ERR_MODULE_LINK_MISMATCH</code> would be thrown. For example, when linking requests for this\nmodule:</p>\n<pre><code class=\"language-mjs\">import foo from 'foo';\nimport source Foo from 'foo';\n</code></pre>\n<p>The <code>modules</code> array must contain two references to the same instance, because the two\nmodule requests are identical but in two phases.</p>\n<p>If the module has no dependencies, the <code>modules</code> array can be empty.</p>\n<p>Users can use <code>sourceTextModule.moduleRequests</code> to implement the host-defined\n<a href=\"https://tc39.es/ecma262/#sec-HostLoadImportedModule\">HostLoadImportedModule</a> abstract operation in the ECMAScript specification,\nand using <code>sourceTextModule.linkRequests()</code> to invoke specification defined\n<a href=\"https://tc39.es/ecma262/#sec-FinishLoadingImportedModule\">FinishLoadingImportedModule</a>, on the module with all dependencies in a batch.</p>\n<p>It's up to the creator of the <code>SourceTextModule</code> to determine if the resolution\nof the dependencies is synchronous or asynchronous.</p>\n<p>After each module in the <code>modules</code> array is linked, call\n<a href=\"#sourcetextmoduleinstantiate\"><code>sourceTextModule.instantiate()</code></a>.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {string[]}",
              "name": "dependencySpecifiers",
              "type": "string[]",
              "meta": {
                "changes": [
                  {
                    "version": [
                      "v24.4.0",
                      "v22.20.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/20300",
                    "description": "This is deprecated in favour of `sourceTextModule.moduleRequests`."
                  }
                ]
              },
              "stability": 0,
              "stabilityText": "Deprecated: Use `sourceTextModule.moduleRequests` instead.",
              "desc": "<p>The specifiers of all dependencies of this module. The returned array is frozen\nto disallow any changes to it.</p>\n<p>Corresponds to the <code>[[RequestedModules]]</code> field of <a href=\"https://tc39.es/ecma262/#sec-cyclic-module-records\">Cyclic Module Record</a>s in\nthe ECMAScript specification.</p>"
            },
            {
              "textRaw": "Type: {ModuleRequest[]} Dependencies of this module.",
              "name": "moduleRequests",
              "type": "ModuleRequest[]",
              "meta": {
                "added": [
                  "v24.4.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "desc": "<p>The requested import dependencies of this module. The returned array is frozen\nto disallow any changes to it.</p>\n<p>For example, given a source text:</p>\n<pre><code class=\"language-mjs\">import foo from 'foo';\nimport fooAlias from 'foo';\nimport bar from './bar.js';\nimport withAttrs from '../with-attrs.ts' with { arbitraryAttr: 'attr-val' };\nimport source Module from 'wasm-mod.wasm';\n</code></pre>\n<p>The value of the <code>sourceTextModule.moduleRequests</code> will be:</p>\n<pre><code class=\"language-js\">[\n  {\n    specifier: 'foo',\n    attributes: {},\n    phase: 'evaluation',\n  },\n  {\n    specifier: 'foo',\n    attributes: {},\n    phase: 'evaluation',\n  },\n  {\n    specifier: './bar.js',\n    attributes: {},\n    phase: 'evaluation',\n  },\n  {\n    specifier: '../with-attrs.ts',\n    attributes: { arbitraryAttr: 'attr-val' },\n    phase: 'evaluation',\n  },\n  {\n    specifier: 'wasm-mod.wasm',\n    attributes: {},\n    phase: 'source',\n  },\n];\n</code></pre>",
              "shortDesc": "Dependencies of this module."
            }
          ]
        },
        {
          "textRaw": "Class: `vm.SyntheticModule`",
          "name": "vm.SyntheticModule",
          "type": "class",
          "meta": {
            "added": [
              "v13.0.0",
              "v12.16.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>This feature is only available with the <code>--experimental-vm-modules</code> command\nflag enabled.</p>\n<ul>\n<li>Extends: <a href=\"vm.html#class-vmmodule\"><code>&#x3C;vm.Module></code></a></li>\n</ul>\n<p>The <code>vm.SyntheticModule</code> class provides the <a href=\"https://tc39.es/ecma262/#sec-synthetic-module-records\">Synthetic Module Record</a> as\ndefined in the WebIDL specification. The purpose of synthetic modules is to\nprovide a generic interface for exposing non-JavaScript sources to ECMAScript\nmodule graphs.</p>\n<pre><code class=\"language-mjs\">import { SyntheticModule } from 'node:vm';\n\nconst source = '{ \"a\": 1 }';\nconst syntheticModule = new SyntheticModule(['default'], function() {\n  const obj = JSON.parse(source);\n  this.setExport('default', obj);\n});\n\n// Use `syntheticModule` in linking\n(async () => {\n  await syntheticModule.link(() => {});\n  await syntheticModule.evaluate();\n\n  console.log('Default export:', syntheticModule.namespace.default);\n})();\n</code></pre>\n<pre><code class=\"language-cjs\">const { SyntheticModule } = require('node:vm');\n\nconst source = '{ \"a\": 1 }';\nconst syntheticModule = new SyntheticModule(['default'], function() {\n  const obj = JSON.parse(source);\n  this.setExport('default', obj);\n});\n\n// Use `syntheticModule` in linking\n(async () => {\n  await syntheticModule.link(() => {});\n  await syntheticModule.evaluate();\n\n  console.log('Default export:', syntheticModule.namespace.default);\n})();\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new vm.SyntheticModule(exportNames, evaluateCallback[, options])`",
              "name": "vm.SyntheticModule",
              "type": "ctor",
              "meta": {
                "added": [
                  "v13.0.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`exportNames` {string[]} Array of names that will be exported from the module.",
                  "name": "exportNames",
                  "type": "string[]",
                  "desc": "Array of names that will be exported from the module."
                },
                {
                  "textRaw": "`evaluateCallback` {Function} Called when the module is evaluated.",
                  "name": "evaluateCallback",
                  "type": "Function",
                  "desc": "Called when the module is evaluated."
                },
                {
                  "textRaw": "`options`",
                  "name": "options",
                  "options": [
                    {
                      "textRaw": "`identifier` {string} String used in stack traces. **Default:** `'vm:module(i)'` where `i` is a context-specific ascending index.",
                      "name": "identifier",
                      "type": "string",
                      "default": "`'vm:module(i)'` where `i` is a context-specific ascending index",
                      "desc": "String used in stack traces."
                    },
                    {
                      "textRaw": "`context` {Object} The contextified object as returned by the `vm.createContext()` method, to compile and evaluate this `Module` in.",
                      "name": "context",
                      "type": "Object",
                      "desc": "The contextified object as returned by the `vm.createContext()` method, to compile and evaluate this `Module` in."
                    }
                  ],
                  "optional": true
                }
              ],
              "desc": "<p>Creates a new <code>SyntheticModule</code> instance.</p>\n<p>Objects assigned to the exports of this instance may allow importers of\nthe module to access information outside the specified <code>context</code>. Use\n<code>vm.runInContext()</code> to create objects in a specific context.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`syntheticModule.setExport(name, value)`",
              "name": "setExport",
              "type": "method",
              "meta": {
                "added": [
                  "v13.0.0",
                  "v12.16.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.8.0",
                      "v22.21.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/59000",
                    "description": "No longer need to call `syntheticModule.link()` before calling this method."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`name` {string} Name of the export to set.",
                      "name": "name",
                      "type": "string",
                      "desc": "Name of the export to set."
                    },
                    {
                      "textRaw": "`value` {any} The value to set the export to.",
                      "name": "value",
                      "type": "any",
                      "desc": "The value to set the export to."
                    }
                  ]
                }
              ],
              "desc": "<p>This method sets the module export binding slots with the given value.</p>\n<pre><code class=\"language-mjs\">import vm from 'node:vm';\n\nconst m = new vm.SyntheticModule(['x'], () => {\n  m.setExport('x', 1);\n});\n\nawait m.evaluate();\n\nassert.strictEqual(m.namespace.x, 1);\n</code></pre>\n<pre><code class=\"language-cjs\">const vm = require('node:vm');\n(async () => {\n  const m = new vm.SyntheticModule(['x'], () => {\n    m.setExport('x', 1);\n  });\n  await m.evaluate();\n  assert.strictEqual(m.namespace.x, 1);\n})();\n</code></pre>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Type: `ModuleRequest`",
          "name": "type:_`modulerequest`",
          "type": "module",
          "meta": {
            "added": [
              "v24.4.0",
              "v22.20.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\n<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The specifier of the requested module.</li>\n<li><code>attributes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The <code>\"with\"</code> value passed to the\n<a href=\"https://tc39.es/ecma262/#prod-WithClause\">WithClause</a> in a <a href=\"https://tc39.es/ecma262/#prod-ImportDeclaration\">ImportDeclaration</a>, or an empty object if no value was\nprovided.</li>\n<li><code>phase</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The phase of the requested module (<code>\"source\"</code> or <code>\"evaluation\"</code>).</li>\n</ul>\n</li>\n</ul>\n<p>A <code>ModuleRequest</code> represents the request to import a module with given import attributes and phase.</p>",
          "displayName": "Type: `ModuleRequest`"
        },
        {
          "textRaw": "Example: Running an HTTP server within a VM",
          "name": "example:_running_an_http_server_within_a_vm",
          "type": "module",
          "desc": "<p>When using either <a href=\"#scriptruninthiscontextoptions\"><code>script.runInThisContext()</code></a> or\n<a href=\"#vmruninthiscontextcode-options\"><code>vm.runInThisContext()</code></a>, the code is executed within the current V8 global\ncontext. The code passed to this VM context will have its own isolated scope.</p>\n<p>In order to run a simple web server using the <code>node:http</code> module the code passed\nto the context must either call <code>require('node:http')</code> on its own, or have a\nreference to the <code>node:http</code> module passed to it. For instance:</p>\n<pre><code class=\"language-mjs\">import { runInThisContext } from 'node:vm';\nimport { createRequire } from 'node:module';\n\nconst require = createRequire(import.meta.url);\n\nconst code = `\n((require) => {\n  const { createServer } = require('node:http');\n\n  createServer((request, response) => {\n    response.writeHead(200, { 'Content-Type': 'text/plain' });\n    response.end('Hello World\\\\n');\n  }).listen(8124);\n\n  console.log('Server running at http://127.0.0.1:8124/');\n})`;\n\nrunInThisContext(code)(require);\n</code></pre>\n<pre><code class=\"language-cjs\">const { runInThisContext } = require('node:vm');\n\nconst code = `\n((require) => {\n  const { createServer } = require('node:http');\n\n  createServer((request, response) => {\n    response.writeHead(200, { 'Content-Type': 'text/plain' });\n    response.end('Hello World\\\\n');\n  }).listen(8124);\n\n  console.log('Server running at http://127.0.0.1:8124/');\n})`;\n\nrunInThisContext(code)(require);\n</code></pre>\n<p>The <code>require()</code> in the above case shares the state with the context it is\npassed from. This may introduce risks when untrusted code is executed, e.g.\naltering objects in the context in unwanted ways.</p>",
          "displayName": "Example: Running an HTTP server within a VM"
        },
        {
          "textRaw": "What does it mean to \"contextify\" an object?",
          "name": "what_does_it_mean_to_\"contextify\"_an_object?",
          "type": "module",
          "desc": "<p>All JavaScript executed within Node.js runs within the scope of a \"context\".\nAccording to the <a href=\"https://v8.dev/docs/embed#contexts\">V8 Embedder's Guide</a>:</p>\n<blockquote>\n<p>In V8, a context is an execution environment that allows separate, unrelated,\nJavaScript applications to run in a single instance of V8. You must explicitly\nspecify the context in which you want any JavaScript code to be run.</p>\n</blockquote>\n<p>When the method <code>vm.createContext()</code> is called with an object, the <code>contextObject</code> argument\nwill be used to wrap the global object of a new instance of a V8 Context\n(if <code>contextObject</code> is <code>undefined</code>, a new object will be created from the current context\nbefore its contextified). This V8 Context provides the <code>code</code> run using the <code>node:vm</code>\nmodule's methods with an isolated global environment within which it can operate.\nThe process of creating the V8 Context and associating it with the <code>contextObject</code>\nin the outer context is what this document refers to as \"contextifying\" the object.</p>\n<p>The contextifying would introduce some quirks to the <code>globalThis</code> value in the context.\nFor example, it cannot be frozen, and it is not reference equal to the <code>contextObject</code>\nin the outer context.</p>\n<pre><code class=\"language-mjs\">import { createContext, runInContext } from 'node:vm';\n\n// An undefined `contextObject` option makes the global object contextified.\nconst context = createContext();\nconsole.log(runInContext('globalThis', context) === context);  // false\n// A contextified global object cannot be frozen.\ntry {\n  runInContext('Object.freeze(globalThis);', context);\n} catch (e) {\n  console.log(`${e.constructor.name}: ${e.message}`); // TypeError: Cannot freeze\n}\nconsole.log(runInContext('globalThis.foo = 1; foo;', context));  // 1\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, runInContext } = require('node:vm');\n\n// An undefined `contextObject` option makes the global object contextified.\nconst context = createContext();\nconsole.log(runInContext('globalThis', context) === context);  // false\n// A contextified global object cannot be frozen.\ntry {\n  runInContext('Object.freeze(globalThis);', context);\n} catch (e) {\n  console.log(`${e.constructor.name}: ${e.message}`); // TypeError: Cannot freeze\n}\nconsole.log(runInContext('globalThis.foo = 1; foo;', context));  // 1\n</code></pre>\n<p>To create a context with an ordinary global object and get access to a global proxy in\nthe outer context with fewer quirks, specify <code>vm.constants.DONT_CONTEXTIFY</code> as the\n<code>contextObject</code> argument.</p>",
          "properties": [
            {
              "textRaw": "`vm.constants.DONT_CONTEXTIFY`",
              "name": "DONT_CONTEXTIFY",
              "type": "property",
              "desc": "<p>This constant, when used as the <code>contextObject</code> argument in vm APIs, instructs Node.js to create\na context without wrapping its global object with another object in a Node.js-specific manner.\nAs a result, the <code>globalThis</code> value inside the new context would behave more closely to an ordinary\none.</p>\n<pre><code class=\"language-mjs\">import { createContext, runInContext, constants } from 'node:vm';\n\n// Use vm.constants.DONT_CONTEXTIFY to freeze the global object.\nconst context = createContext(constants.DONT_CONTEXTIFY);\nrunInContext('Object.freeze(globalThis);', context);\ntry {\n  runInContext('bar = 1; bar;', context);\n} catch (e) {\n  console.log(`${e.constructor.name}: ${e.message}`); // ReferenceError: bar is not defined\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, runInContext, constants } = require('node:vm');\n\n// Use vm.constants.DONT_CONTEXTIFY to freeze the global object.\nconst context = createContext(constants.DONT_CONTEXTIFY);\nrunInContext('Object.freeze(globalThis);', context);\ntry {\n  runInContext('bar = 1; bar;', context);\n} catch (e) {\n  console.log(`${e.constructor.name}: ${e.message}`); // ReferenceError: bar is not defined\n}\n</code></pre>\n<p>When <code>vm.constants.DONT_CONTEXTIFY</code> is used as the <code>contextObject</code> argument to <a href=\"#vmcreatecontextcontextobject-options\"><code>vm.createContext()</code></a>,\nthe returned object is a proxy-like object to the global object in the newly created context with\nfewer Node.js-specific quirks. It is reference equal to the <code>globalThis</code> value in the new context,\ncan be modified from outside the context, and can be used to access built-ins in the new context directly.</p>\n<pre><code class=\"language-mjs\">import { createContext, runInContext, constants } from 'node:vm';\n\nconst context = createContext(constants.DONT_CONTEXTIFY);\n\n// Returned object is reference equal to globalThis in the new context.\nconsole.log(runInContext('globalThis', context) === context);  // true\n\n// Can be used to access globals in the new context directly.\nconsole.log(context.Array);  // [Function: Array]\nrunInContext('foo = 1;', context);\nconsole.log(context.foo);  // 1\ncontext.bar = 1;\nconsole.log(runInContext('bar;', context));  // 1\n\n// Can be frozen and it affects the inner context.\nObject.freeze(context);\ntry {\n  runInContext('baz = 1; baz;', context);\n} catch (e) {\n  console.log(`${e.constructor.name}: ${e.message}`); // ReferenceError: baz is not defined\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, runInContext, constants } = require('node:vm');\n\nconst context = createContext(constants.DONT_CONTEXTIFY);\n\n// Returned object is reference equal to globalThis in the new context.\nconsole.log(runInContext('globalThis', context) === context);  // true\n\n// Can be used to access globals in the new context directly.\nconsole.log(context.Array);  // [Function: Array]\nrunInContext('foo = 1;', context);\nconsole.log(context.foo);  // 1\ncontext.bar = 1;\nconsole.log(runInContext('bar;', context));  // 1\n\n// Can be frozen and it affects the inner context.\nObject.freeze(context);\ntry {\n  runInContext('baz = 1; baz;', context);\n} catch (e) {\n  console.log(`${e.constructor.name}: ${e.message}`); // ReferenceError: baz is not defined\n}\n</code></pre>"
            }
          ],
          "displayName": "What does it mean to \"contextify\" an object?"
        },
        {
          "textRaw": "Timeout interactions with asynchronous tasks and Promises",
          "name": "timeout_interactions_with_asynchronous_tasks_and_promises",
          "type": "module",
          "desc": "<p><code>Promise</code>s and <code>async function</code>s can schedule tasks run by the JavaScript\nengine asynchronously. By default, these tasks are run after all JavaScript\nfunctions on the current stack are done executing.\nThis allows escaping the functionality of the <code>timeout</code> and\n<code>breakOnSigint</code> options.</p>\n<p>For example, the following code executed by <code>vm.runInNewContext()</code> with a\ntimeout of 5 milliseconds schedules an infinite loop to run after a promise\nresolves. The scheduled loop is never interrupted by the timeout:</p>\n<pre><code class=\"language-mjs\">import { runInNewContext } from 'node:vm';\n\nfunction loop() {\n  console.log('entering loop');\n  while (1) console.log(Date.now());\n}\n\nrunInNewContext(\n  'Promise.resolve().then(() => loop());',\n  { loop, console },\n  { timeout: 5 },\n);\n// This is printed *before* 'entering infinite loop' (!)\nconsole.log('done executing');\n</code></pre>\n<pre><code class=\"language-cjs\">const { runInNewContext } = require('node:vm');\n\nfunction loop() {\n  console.log('entering loop');\n  while (1) console.log(Date.now());\n}\n\nrunInNewContext(\n  'Promise.resolve().then(() => loop());',\n  { loop, console },\n  { timeout: 5 },\n);\n// This is printed *before* 'entering infinite loop' (!)\nconsole.log('done executing');\n</code></pre>\n<p>This can be addressed by passing <code>microtaskMode: 'afterEvaluate'</code> to the code\nthat creates the <code>Context</code>:</p>\n<pre><code class=\"language-mjs\">import { runInNewContext } from 'node:vm';\n\nfunction loop() {\n  while (1) console.log(Date.now());\n}\n\nrunInNewContext(\n  'Promise.resolve().then(() => loop());',\n  { loop, console },\n  { timeout: 5, microtaskMode: 'afterEvaluate' },\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const { runInNewContext } = require('node:vm');\n\nfunction loop() {\n  while (1) console.log(Date.now());\n}\n\nrunInNewContext(\n  'Promise.resolve().then(() => loop());',\n  { loop, console },\n  { timeout: 5, microtaskMode: 'afterEvaluate' },\n);\n</code></pre>\n<p>In this case, the microtask scheduled through <code>promise.then()</code> will be run\nbefore returning from <code>vm.runInNewContext()</code>, and will be interrupted\nby the <code>timeout</code> functionality. This applies only to code running in a\n<code>vm.Context</code>, so e.g. <a href=\"#vmruninthiscontextcode-options\"><code>vm.runInThisContext()</code></a> does not take this option.</p>\n<p>Promise callbacks are entered into the microtask queue of the context in which\nthey were created. For example, if <code>() => loop()</code> is replaced with just <code>loop</code>\nin the above example, then <code>loop</code> will be pushed into the global microtask\nqueue, because it is a function from the outer (main) context, and thus will\nalso be able to escape the timeout.</p>\n<p>If asynchronous scheduling functions such as <code>process.nextTick()</code>,\n<code>queueMicrotask()</code>, <code>setTimeout()</code>, <code>setImmediate()</code>, etc. are made available\ninside a <code>vm.Context</code>, functions passed to them will be added to global queues,\nwhich are shared by all contexts. Therefore, callbacks passed to those functions\nare not controllable through the timeout either.</p>",
          "modules": [
            {
              "textRaw": "When `microtaskMode` is `'afterEvaluate'`, beware sharing Promises between Contexts",
              "name": "when_`microtaskmode`_is_`'afterevaluate'`,_beware_sharing_promises_between_contexts",
              "type": "module",
              "desc": "<p>In <code>'afterEvaluate'</code> mode, the <code>Context</code> has its own microtask queue, separate\nfrom the global microtask queue used by the outer (main) context. While this\nmode is necessary to enforce <code>timeout</code> and enable <code>breakOnSigint</code> with\nasynchronous tasks, it also makes sharing promises between contexts challenging.</p>\n<p>In the example below, a promise is created in the inner context and shared with\nthe outer context. When the outer context <code>await</code> on the promise, the execution\nflow of the outer context is disrupted in a surprising way: the log statement\nis never executed.</p>\n<pre><code class=\"language-mjs\">import { createContext, runInContext } from 'node:vm';\n\nconst inner_context = createContext({}, { microtaskMode: 'afterEvaluate' });\n\n// runInContext() returns a Promise created in the inner context.\nconst inner_promise = runInContext('Promise.resolve()', inner_context);\n\n// As part of performing `await`, the JavaScript runtime must enqueue a task\n// on the microtask queue of the context where `inner_promise` was created.\n// A task is added on the inner microtask queue, but **it will not be run\n// automatically**: this task will remain pending indefinitely.\n//\n// Since the outer microtask queue is empty, execution in the outer module\n// falls through, and the log statement below is never executed.\nawait inner_promise;\n\nconsole.log('this will NOT be printed');\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, runInContext } = require('node:vm');\n\n// runInContext() returns a Promise created in the inner context.\nconst inner_context = createContext({}, { microtaskMode: 'afterEvaluate' });\n\n(async () => {\n  const inner_promise = runInContext('Promise.resolve()', inner_context);\n\n  // As part of performing `await`, the JavaScript runtime must enqueue a task\n  // on the microtask queue of the context where `inner_promise` was created.\n  // A task is added on the inner microtask queue, but **it will not be run\n  // automatically**: this task will remain pending indefinitely.\n  //\n  // Since the outer microtask queue is empty, execution in the outer module\n  // falls through, and the log statement below is never executed.\n  await inner_promise;\n\n  console.log('this will NOT be printed');\n})();\n</code></pre>\n<p>To successfully share promises between contexts with different microtask queues,\nit is necessary to ensure that tasks on the inner microtask queue will be run\n<strong>whenever</strong> the outer context enqueues a task on the inner microtask queue.</p>\n<p>The tasks on the microtask queue of a given context are run whenever\n<code>runInContext()</code> or <code>SourceTextModule.evaluate()</code> are invoked on a script or\nmodule using this context. In our example, the normal execution flow can be\nrestored by scheduling a second call to <code>runInContext()</code> <em>before</em> <code>await inner_promise</code>.</p>\n<pre><code class=\"language-mjs\">// Schedule `runInContext()` to manually drain the inner context microtask\n// queue; it will run after the `await` statement below.\nsetImmediate(() => {\n  vm.runInContext('', context);\n});\n\nawait inner_promise;\n\nconsole.log('OK');\n</code></pre>\n<p><strong>Note:</strong> Strictly speaking, in this mode, <code>node:vm</code> departs from the letter of\nthe ECMAScript specification for <a href=\"https://tc39.es/ecma262/#sec-hostenqueuepromisejob\">enqueing jobs</a>, by allowing asynchronous\ntasks from different contexts to run in a different order than they were\nenqueued.</p>",
              "displayName": "When `microtaskMode` is `'afterEvaluate'`, beware sharing Promises between Contexts"
            }
          ],
          "displayName": "Timeout interactions with asynchronous tasks and Promises"
        },
        {
          "textRaw": "Support of dynamic `import()` in compilation APIs",
          "name": "support_of_dynamic_`import()`_in_compilation_apis",
          "type": "module",
          "desc": "<p>The following APIs support an <code>importModuleDynamically</code> option to enable dynamic\n<code>import()</code> in code compiled by the vm module.</p>\n<ul>\n<li><code>new vm.Script</code></li>\n<li><code>vm.compileFunction()</code></li>\n<li><code>new vm.SourceTextModule</code></li>\n<li><code>vm.runInThisContext()</code></li>\n<li><code>vm.runInContext()</code></li>\n<li><code>vm.runInNewContext()</code></li>\n<li><code>vm.createContext()</code></li>\n</ul>\n<p>This option is still part of the experimental modules API. We do not recommend\nusing it in a production environment.</p>",
          "modules": [
            {
              "textRaw": "When the `importModuleDynamically` option is not specified or undefined",
              "name": "when_the_`importmoduledynamically`_option_is_not_specified_or_undefined",
              "type": "module",
              "desc": "<p>If this option is not specified, or if it's <code>undefined</code>, code containing\n<code>import()</code> can still be compiled by the vm APIs, but when the compiled code is\nexecuted and it actually calls <code>import()</code>, the result will reject with\n<a href=\"errors.html#err_vm_dynamic_import_callback_missing\"><code>ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING</code></a>.</p>",
              "displayName": "When the `importModuleDynamically` option is not specified or undefined"
            },
            {
              "textRaw": "When `importModuleDynamically` is `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`",
              "name": "when_`importmoduledynamically`_is_`vm.constants.use_main_context_default_loader`",
              "type": "module",
              "desc": "<p>This option is currently not supported for <code>vm.SourceTextModule</code>.</p>\n<p>With this option, when an <code>import()</code> is initiated in the compiled code, Node.js\nwould use the default ESM loader from the main context to load the requested\nmodule and return it to the code being executed.</p>\n<p>This gives access to Node.js built-in modules such as <code>fs</code> or <code>http</code>\nto the code being compiled. If the code is executed in a different context,\nbe aware that the objects created by modules loaded from the main context\nare still from the main context and not <code>instanceof</code> built-in classes in the\nnew context.</p>\n<pre><code class=\"language-cjs\">const { Script, constants } = require('node:vm');\nconst script = new Script(\n  'import(\"node:fs\").then(({readFile}) => readFile instanceof Function)',\n  { importModuleDynamically: constants.USE_MAIN_CONTEXT_DEFAULT_LOADER });\n\n// false: URL loaded from the main context is not an instance of the Function\n// class in the new context.\nscript.runInNewContext().then(console.log);\n</code></pre>\n<pre><code class=\"language-mjs\">import { Script, constants } from 'node:vm';\n\nconst script = new Script(\n  'import(\"node:fs\").then(({readFile}) => readFile instanceof Function)',\n  { importModuleDynamically: constants.USE_MAIN_CONTEXT_DEFAULT_LOADER });\n\n// false: URL loaded from the main context is not an instance of the Function\n// class in the new context.\nscript.runInNewContext().then(console.log);\n</code></pre>\n<p>This option also allows the script or function to load user modules:</p>\n<pre><code class=\"language-mjs\">import { Script, constants } from 'node:vm';\nimport { resolve } from 'node:path';\nimport { writeFileSync } from 'node:fs';\n\n// Write test.js and test.txt to the directory where the current script\n// being run is located.\nwriteFileSync(resolve(import.meta.dirname, 'test.mjs'),\n              'export const filename = \"./test.json\";');\nwriteFileSync(resolve(import.meta.dirname, 'test.json'),\n              '{\"hello\": \"world\"}');\n\n// Compile a script that loads test.mjs and then test.json\n// as if the script is placed in the same directory.\nconst script = new Script(\n  `(async function() {\n    const { filename } = await import('./test.mjs');\n    return import(filename, { with: { type: 'json' } })\n  })();`,\n  {\n    filename: resolve(import.meta.dirname, 'test-with-default.js'),\n    importModuleDynamically: constants.USE_MAIN_CONTEXT_DEFAULT_LOADER,\n  });\n\n// { default: { hello: 'world' } }\nscript.runInThisContext().then(console.log);\n</code></pre>\n<pre><code class=\"language-cjs\">const { Script, constants } = require('node:vm');\nconst { resolve } = require('node:path');\nconst { writeFileSync } = require('node:fs');\n\n// Write test.js and test.txt to the directory where the current script\n// being run is located.\nwriteFileSync(resolve(__dirname, 'test.mjs'),\n              'export const filename = \"./test.json\";');\nwriteFileSync(resolve(__dirname, 'test.json'),\n              '{\"hello\": \"world\"}');\n\n// Compile a script that loads test.mjs and then test.json\n// as if the script is placed in the same directory.\nconst script = new Script(\n  `(async function() {\n    const { filename } = await import('./test.mjs');\n    return import(filename, { with: { type: 'json' } })\n  })();`,\n  {\n    filename: resolve(__dirname, 'test-with-default.js'),\n    importModuleDynamically: constants.USE_MAIN_CONTEXT_DEFAULT_LOADER,\n  });\n\n// { default: { hello: 'world' } }\nscript.runInThisContext().then(console.log);\n</code></pre>\n<p>There are a few caveats with loading user modules using the default loader\nfrom the main context:</p>\n<ol>\n<li>The module being resolved would be relative to the <code>filename</code> option passed\nto <code>vm.Script</code> or <code>vm.compileFunction()</code>. The resolution can work with a\n<code>filename</code> that's either an absolute path or a URL string.  If <code>filename</code> is\na string that's neither an absolute path or a URL, or if it's undefined,\nthe resolution will be relative to the current working directory\nof the process. In the case of <code>vm.createContext()</code>, the resolution is always\nrelative to the current working directory since this option is only used when\nthere isn't a referrer script or module.</li>\n<li>For any given <code>filename</code> that resolves to a specific path, once the process\nmanages to load a particular module from that path, the result may be cached,\nand subsequent load of the same module from the same path would return the\nsame thing. If the <code>filename</code> is a URL string, the cache would not be hit\nif it has different search parameters. For <code>filename</code>s that are not URL\nstrings, there is currently no way to bypass the caching behavior.</li>\n</ol>",
              "displayName": "When `importModuleDynamically` is `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`"
            },
            {
              "textRaw": "When `importModuleDynamically` is a function",
              "name": "when_`importmoduledynamically`_is_a_function",
              "type": "module",
              "desc": "<p>When <code>importModuleDynamically</code> is a function, it will be invoked when <code>import()</code>\nis called in the compiled code for users to customize how the requested module\nshould be compiled and evaluated. Currently, the Node.js instance must be\nlaunched with the <code>--experimental-vm-modules</code> flag for this option to work. If\nthe flag isn't set, this callback will be ignored. If the code evaluated\nactually calls to <code>import()</code>, the result will reject with\n<a href=\"errors.html#err_vm_dynamic_import_callback_missing_flag\"><code>ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING_FLAG</code></a>.</p>\n<p>The callback <code>importModuleDynamically(specifier, referrer, importAttributes)</code>\nhas the following signature:</p>\n<ul>\n<li><code>specifier</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> specifier passed to <code>import()</code></li>\n<li><code>referrer</code> <a href=\"vm.html#class-vmscript\"><code>&#x3C;vm.Script></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a> | <a href=\"vm.html#class-vmsourcetextmodule\"><code>&#x3C;vm.SourceTextModule></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>\nThe referrer is the compiled <code>vm.Script</code> for <code>new vm.Script</code>,\n<code>vm.runInThisContext</code>, <code>vm.runInContext</code> and <code>vm.runInNewContext</code>. It's the\ncompiled <code>Function</code> for <code>vm.compileFunction</code>, the compiled\n<code>vm.SourceTextModule</code> for <code>new vm.SourceTextModule</code>, and the context <code>Object</code>\nfor <code>vm.createContext()</code>.</li>\n<li><code>importAttributes</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> The <code>\"with\"</code> value passed to the\n<a href=\"https://tc39.es/proposal-import-attributes/#sec-evaluate-import-call\"><code>optionsExpression</code></a> optional parameter, or an empty object if no value was\nprovided.</li>\n<li><code>phase</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The phase of the dynamic import (<code>\"source\"</code> or <code>\"evaluation\"</code>).</li>\n<li>Returns: <a href=\"https://tc39.github.io/ecma262/#sec-module-namespace-exotic-objects\"><code>&#x3C;Module Namespace Object></code></a> | <a href=\"vm.html#class-vmmodule\"><code>&#x3C;vm.Module></code></a> Returning a <code>vm.Module</code> is\nrecommended in order to take advantage of error tracking, and to avoid issues\nwith namespaces that contain <code>then</code> function exports.</li>\n</ul>\n<pre><code class=\"language-mjs\">// This script must be run with --experimental-vm-modules.\nimport { Script, SyntheticModule } from 'node:vm';\n\nconst script = new Script('import(\"foo.json\", { with: { type: \"json\" } })', {\n  async importModuleDynamically(specifier, referrer, importAttributes) {\n    console.log(specifier);  // 'foo.json'\n    console.log(referrer);   // The compiled script\n    console.log(importAttributes);  // { type: 'json' }\n    const m = new SyntheticModule(['bar'], () => { });\n    await m.link(() => { });\n    m.setExport('bar', { hello: 'world' });\n    return m;\n  },\n});\nconst result = await script.runInThisContext();\nconsole.log(result);  //  { bar: { hello: 'world' } }\n</code></pre>\n<pre><code class=\"language-cjs\">// This script must be run with --experimental-vm-modules.\nconst { Script, SyntheticModule } = require('node:vm');\n\n(async function main() {\n  const script = new Script('import(\"foo.json\", { with: { type: \"json\" } })', {\n    async importModuleDynamically(specifier, referrer, importAttributes) {\n      console.log(specifier);  // 'foo.json'\n      console.log(referrer);   // The compiled script\n      console.log(importAttributes);  // { type: 'json' }\n      const m = new SyntheticModule(['bar'], () => { });\n      await m.link(() => { });\n      m.setExport('bar', { hello: 'world' });\n      return m;\n    },\n  });\n  const result = await script.runInThisContext();\n  console.log(result);  //  { bar: { hello: 'world' } }\n})();\n</code></pre>",
              "displayName": "When `importModuleDynamically` is a function"
            }
          ],
          "displayName": "Support of dynamic `import()` in compilation APIs"
        }
      ],
      "methods": [
        {
          "textRaw": "`vm.compileFunction(code[, params[, options]])`",
          "name": "compileFunction",
          "type": "method",
          "meta": {
            "added": [
              "v10.10.0"
            ],
            "changes": [
              {
                "version": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/51244",
                "description": "Added support for `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`."
              },
              {
                "version": [
                  "v19.6.0",
                  "v18.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/46320",
                "description": "The return value now includes `cachedDataRejected` with the same semantics as the `vm.Script` version if the `cachedData` option was passed."
              },
              {
                "version": [
                  "v17.0.0",
                  "v16.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/40249",
                "description": "Added support for import attributes to the `importModuleDynamically` parameter."
              },
              {
                "version": "v15.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/35431",
                "description": "Added `importModuleDynamically` option again."
              },
              {
                "version": "v14.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/33364",
                "description": "Removal of `importModuleDynamically` due to compatibility issues."
              },
              {
                "version": [
                  "v14.1.0",
                  "v13.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/32985",
                "description": "The `importModuleDynamically` option is now supported."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`code` {string} The body of the function to compile.",
                  "name": "code",
                  "type": "string",
                  "desc": "The body of the function to compile."
                },
                {
                  "textRaw": "`params` {string[]} An array of strings containing all parameters for the function.",
                  "name": "params",
                  "type": "string[]",
                  "desc": "An array of strings containing all parameters for the function.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`filename` {string} Specifies the filename used in stack traces produced by this script. **Default:** `''`.",
                      "name": "filename",
                      "type": "string",
                      "default": "`''`",
                      "desc": "Specifies the filename used in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`lineOffset` {number} Specifies the line number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "lineOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the line number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`columnOffset` {number} Specifies the first-line column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the first-line column number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source. This must be produced by a prior call to `vm.compileFunction()` with the same `code` and `params`.",
                      "name": "cachedData",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source. This must be produced by a prior call to `vm.compileFunction()` with the same `code` and `params`."
                    },
                    {
                      "textRaw": "`produceCachedData` {boolean} Specifies whether to produce new cache data. **Default:** `false`.",
                      "name": "produceCachedData",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Specifies whether to produce new cache data."
                    },
                    {
                      "textRaw": "`parsingContext` {Object} The contextified object in which the said function should be compiled in.",
                      "name": "parsingContext",
                      "type": "Object",
                      "desc": "The contextified object in which the said function should be compiled in."
                    },
                    {
                      "textRaw": "`contextExtensions` {Object[]} An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling. **Default:** `[]`.",
                      "name": "contextExtensions",
                      "type": "Object[]",
                      "default": "`[]`",
                      "desc": "An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling."
                    },
                    {
                      "textRaw": "`importModuleDynamically` {Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER} Used to specify the how the modules should be loaded during the evaluation of this function when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs.",
                      "name": "importModuleDynamically",
                      "type": "Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER",
                      "desc": "Used to specify the how the modules should be loaded during the evaluation of this function when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Function}",
                "name": "return",
                "type": "Function"
              }
            }
          ],
          "desc": "<p>Compiles the given code into the provided context (if no context is\nsupplied, the current context is used), and returns it wrapped inside a\nfunction with the given <code>params</code>.</p>"
        },
        {
          "textRaw": "`vm.createContext([contextObject[, options]])`",
          "name": "createContext",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.1"
            ],
            "changes": [
              {
                "version": [
                  "v22.8.0",
                  "v20.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/54394",
                "description": "The `contextObject` argument now accepts `vm.constants.DONT_CONTEXTIFY`."
              },
              {
                "version": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/51244",
                "description": "Added support for `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`."
              },
              {
                "version": [
                  "v21.2.0",
                  "v20.11.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/50360",
                "description": "The `importModuleDynamically` option is supported now."
              },
              {
                "version": "v14.6.0",
                "pr-url": "https://github.com/nodejs/node/pull/34023",
                "description": "The `microtaskMode` option is supported now."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/19398",
                "description": "The first argument can no longer be a function."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/19016",
                "description": "The `codeGeneration` option is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`contextObject` {Object|vm.constants.DONT_CONTEXTIFY|undefined} Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified. If `undefined`, an empty contextified object will be created for backwards compatibility.",
                  "name": "contextObject",
                  "type": "Object|vm.constants.DONT_CONTEXTIFY|undefined",
                  "desc": "Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified. If `undefined`, an empty contextified object will be created for backwards compatibility.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`name` {string} Human-readable name of the newly created context. **Default:** `'VM Context i'`, where `i` is an ascending numerical index of the created context.",
                      "name": "name",
                      "type": "string",
                      "default": "`'VM Context i'`, where `i` is an ascending numerical index of the created context",
                      "desc": "Human-readable name of the newly created context."
                    },
                    {
                      "textRaw": "`origin` {string} Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. Most notably, this string should omit the trailing slash, as that denotes a path. **Default:** `''`.",
                      "name": "origin",
                      "type": "string",
                      "default": "`''`",
                      "desc": "Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. Most notably, this string should omit the trailing slash, as that denotes a path."
                    },
                    {
                      "textRaw": "`codeGeneration` {Object}",
                      "name": "codeGeneration",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`strings` {boolean} If set to false any calls to `eval` or function constructors (`Function`, `GeneratorFunction`, etc) will throw an `EvalError`. **Default:** `true`.",
                          "name": "strings",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If set to false any calls to `eval` or function constructors (`Function`, `GeneratorFunction`, etc) will throw an `EvalError`."
                        },
                        {
                          "textRaw": "`wasm` {boolean} If set to false any attempt to compile a WebAssembly module will throw a `WebAssembly.CompileError`. **Default:** `true`.",
                          "name": "wasm",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If set to false any attempt to compile a WebAssembly module will throw a `WebAssembly.CompileError`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`microtaskMode` {string} If set to `afterEvaluate`, microtasks (tasks scheduled through `Promise`s and `async function`s) will be run immediately after a script has run through `script.runInContext()`. They are included in the `timeout` and `breakOnSigint` scopes in that case.",
                      "name": "microtaskMode",
                      "type": "string",
                      "desc": "If set to `afterEvaluate`, microtasks (tasks scheduled through `Promise`s and `async function`s) will be run immediately after a script has run through `script.runInContext()`. They are included in the `timeout` and `breakOnSigint` scopes in that case."
                    },
                    {
                      "textRaw": "`importModuleDynamically` {Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER} Used to specify the how the modules should be loaded when `import()` is called in this context without a referrer script or module. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs.",
                      "name": "importModuleDynamically",
                      "type": "Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER",
                      "desc": "Used to specify the how the modules should be loaded when `import()` is called in this context without a referrer script or module. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object} contextified object.",
                "name": "return",
                "type": "Object",
                "desc": "contextified object."
              }
            }
          ],
          "desc": "<p>If the given <code>contextObject</code> is an object, the <code>vm.createContext()</code> method will <a href=\"#what-does-it-mean-to-contextify-an-object\">prepare that\nobject</a> and return a reference to it so that it can be used in\ncalls to <a href=\"#vmrunincontextcode-contextifiedobject-options\"><code>vm.runInContext()</code></a> or <a href=\"#scriptrunincontextcontextifiedobject-options\"><code>script.runInContext()</code></a>. Inside such\nscripts, the global object will be wrapped by the <code>contextObject</code>, retaining all of its\nexisting properties but also having the built-in objects and functions any\nstandard <a href=\"https://tc39.es/ecma262/#sec-global-object\">global object</a> has. Outside of scripts run by the vm module, global\nvariables will remain unchanged.</p>\n<pre><code class=\"language-mjs\">import { createContext, runInContext } from 'node:vm';\n\nglobal.globalVar = 3;\n\nconst context = { globalVar: 1 };\ncreateContext(context);\n\nrunInContext('globalVar *= 2;', context);\n\nconsole.log(context);\n// Prints: { globalVar: 2 }\n\nconsole.log(global.globalVar);\n// Prints: 3\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, runInContext } = require('node:vm');\n\nglobal.globalVar = 3;\n\nconst context = { globalVar: 1 };\ncreateContext(context);\n\nrunInContext('globalVar *= 2;', context);\n\nconsole.log(context);\n// Prints: { globalVar: 2 }\n\nconsole.log(global.globalVar);\n// Prints: 3\n</code></pre>\n<p>If <code>contextObject</code> is omitted (or passed explicitly as <code>undefined</code>), a new,\nempty <a href=\"#what-does-it-mean-to-contextify-an-object\">contextified</a> object will be returned.</p>\n<p>When the global object in the newly created context is <a href=\"#what-does-it-mean-to-contextify-an-object\">contextified</a>, it has some quirks\ncompared to ordinary global objects. For example, it cannot be frozen. To create a context\nwithout the contextifying quirks, pass <a href=\"#vmconstantsdont_contextify\"><code>vm.constants.DONT_CONTEXTIFY</code></a> as the <code>contextObject</code>\nargument. See the documentation of <a href=\"#vmconstantsdont_contextify\"><code>vm.constants.DONT_CONTEXTIFY</code></a> for details.</p>\n<p>The <code>vm.createContext()</code> method is primarily useful for creating a single\ncontext that can be used to run multiple scripts. For instance, if emulating a\nweb browser, the method can be used to create a single context representing a\nwindow's global object, then run all <code>&#x3C;script></code> tags together within that\ncontext.</p>\n<p>The provided <code>name</code> and <code>origin</code> of the context are made visible through the\nInspector API.</p>"
        },
        {
          "textRaw": "`vm.isContext(object)`",
          "name": "isContext",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.7"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`object` {Object}",
                  "name": "object",
                  "type": "Object"
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>Returns <code>true</code> if the given <code>object</code> object has been <a href=\"#what-does-it-mean-to-contextify-an-object\">contextified</a> using\n<a href=\"#vmcreatecontextcontextobject-options\"><code>vm.createContext()</code></a>, or if it's the global object of a context created\nusing <a href=\"#vmconstantsdont_contextify\"><code>vm.constants.DONT_CONTEXTIFY</code></a>.</p>"
        },
        {
          "textRaw": "`vm.measureMemory([options])`",
          "name": "measureMemory",
          "type": "method",
          "meta": {
            "added": [
              "v13.10.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {Object} Optional.",
                  "name": "options",
                  "type": "Object",
                  "desc": "Optional.",
                  "options": [
                    {
                      "textRaw": "`mode` {string} Either `'summary'` or `'detailed'`. In summary mode, only the memory measured for the main context will be returned. In detailed mode, the memory measured for all contexts known to the current V8 isolate will be returned. **Default:** `'summary'`",
                      "name": "mode",
                      "type": "string",
                      "default": "`'summary'`",
                      "desc": "Either `'summary'` or `'detailed'`. In summary mode, only the memory measured for the main context will be returned. In detailed mode, the memory measured for all contexts known to the current V8 isolate will be returned."
                    },
                    {
                      "textRaw": "`execution` {string} Either `'default'` or `'eager'`. With default execution, the promise will not resolve until after the next scheduled garbage collection starts, which may take a while (or never if the program exits before the next GC). With eager execution, the GC will be started right away to measure the memory. **Default:** `'default'`",
                      "name": "execution",
                      "type": "string",
                      "default": "`'default'`",
                      "desc": "Either `'default'` or `'eager'`. With default execution, the promise will not resolve until after the next scheduled garbage collection starts, which may take a while (or never if the program exits before the next GC). With eager execution, the GC will be started right away to measure the memory."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise} If the memory is successfully measured, the promise will resolve with an object containing information about the memory usage. Otherwise it will be rejected with an `ERR_CONTEXT_NOT_INITIALIZED` error.",
                "name": "return",
                "type": "Promise",
                "desc": "If the memory is successfully measured, the promise will resolve with an object containing information about the memory usage. Otherwise it will be rejected with an `ERR_CONTEXT_NOT_INITIALIZED` error."
              }
            }
          ],
          "desc": "<p>Measure the memory known to V8 and used by all contexts known to the\ncurrent V8 isolate, or the main context.</p>\n<p>The format of the object that the returned Promise may resolve with is\nspecific to the V8 engine and may change from one version of V8 to the next.</p>\n<p>The returned result is different from the statistics returned by\n<code>v8.getHeapSpaceStatistics()</code> in that <code>vm.measureMemory()</code> measure the\nmemory reachable by each V8 specific contexts in the current instance of\nthe V8 engine, while the result of <code>v8.getHeapSpaceStatistics()</code> measure\nthe memory occupied by each heap space in the current V8 instance.</p>\n<pre><code class=\"language-mjs\">import { createContext, measureMemory } from 'node:vm';\n// Measure the memory used by the main context.\nmeasureMemory({ mode: 'summary' })\n  // This is the same as vm.measureMemory()\n  .then((result) => {\n    // The current format is:\n    // {\n    //   total: { jsMemoryEstimate: 1601828, jsMemoryRange: [1601828, 5275288] },\n    //   WebAssembly: { code: 0, metadata: 33962 },\n    // }\n    console.log(result);\n  });\n\nconst context = createContext({ a: 1 });\nmeasureMemory({ mode: 'detailed', execution: 'eager' }).then((result) => {\n  // Reference the context here so that it won't be GC'ed\n  // until the measurement is complete.\n  console.log('Context:', context.a);\n  // {\n  //   total: { jsMemoryEstimate: 1767100, jsMemoryRange: [1767100, 5440560] },\n  //   WebAssembly: { code: 0, metadata: 33962 },\n  //   current: { jsMemoryEstimate: 1601828, jsMemoryRange: [1601828, 5275288] },\n  //   other: [{ jsMemoryEstimate: 165272, jsMemoryRange: [Array] }],\n  // }\n  console.log(result);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, measureMemory } = require('node:vm');\n// Measure the memory used by the main context.\nmeasureMemory({ mode: 'summary' })\n  // This is the same as vm.measureMemory()\n  .then((result) => {\n    // The current format is:\n    // {\n    //   total: { jsMemoryEstimate: 1601828, jsMemoryRange: [1601828, 5275288] },\n    //   WebAssembly: { code: 0, metadata: 33962 },\n    // }\n    console.log(result);\n  });\n\nconst context = createContext({ a: 1 });\nmeasureMemory({ mode: 'detailed', execution: 'eager' }).then((result) => {\n  // Reference the context here so that it won't be GC'ed\n  // until the measurement is complete.\n  console.log('Context:', context.a);\n  // {\n  //   total: { jsMemoryEstimate: 1767100, jsMemoryRange: [1767100, 5440560] },\n  //   WebAssembly: { code: 0, metadata: 33962 },\n  //   current: { jsMemoryEstimate: 1601828, jsMemoryRange: [1601828, 5275288] },\n  //   other: [{ jsMemoryEstimate: 165272, jsMemoryRange: [Array] }],\n  // }\n  console.log(result);\n});\n</code></pre>"
        },
        {
          "textRaw": "`vm.runInContext(code, contextifiedObject[, options])`",
          "name": "runInContext",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.1"
            ],
            "changes": [
              {
                "version": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/51244",
                "description": "Added support for `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`."
              },
              {
                "version": [
                  "v17.0.0",
                  "v16.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/40249",
                "description": "Added support for import attributes to the `importModuleDynamically` parameter."
              },
              {
                "version": "v6.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/6635",
                "description": "The `breakOnSigint` option is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`code` {string} The JavaScript code to compile and run.",
                  "name": "code",
                  "type": "string",
                  "desc": "The JavaScript code to compile and run."
                },
                {
                  "textRaw": "`contextifiedObject` {Object} The contextified object that will be used as the `global` when the `code` is compiled and run.",
                  "name": "contextifiedObject",
                  "type": "Object",
                  "desc": "The contextified object that will be used as the `global` when the `code` is compiled and run."
                },
                {
                  "textRaw": "`options` {Object|string}",
                  "name": "options",
                  "type": "Object|string",
                  "options": [
                    {
                      "textRaw": "`filename` {string} Specifies the filename used in stack traces produced by this script. **Default:** `'evalmachine.<anonymous>'`.",
                      "name": "filename",
                      "type": "string",
                      "default": "`'evalmachine.<anonymous>'`",
                      "desc": "Specifies the filename used in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`lineOffset` {number} Specifies the line number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "lineOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the line number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`columnOffset` {number} Specifies the first-line column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the first-line column number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`displayErrors` {boolean} When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. **Default:** `true`.",
                      "name": "displayErrors",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace."
                    },
                    {
                      "textRaw": "`timeout` {integer} Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.",
                      "name": "timeout",
                      "type": "integer",
                      "desc": "Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer."
                    },
                    {
                      "textRaw": "`breakOnSigint` {boolean} If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that. **Default:** `false`.",
                      "name": "breakOnSigint",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that."
                    },
                    {
                      "textRaw": "`cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source.",
                      "name": "cachedData",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source."
                    },
                    {
                      "textRaw": "`importModuleDynamically` {Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER} Used to specify the how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs.",
                      "name": "importModuleDynamically",
                      "type": "Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER",
                      "desc": "Used to specify the how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>vm.runInContext()</code> method compiles <code>code</code>, runs it within the context of\nthe <code>contextifiedObject</code>, then returns the result. Running code does not have\naccess to the local scope. The <code>contextifiedObject</code> object <em>must</em> have been\npreviously <a href=\"#what-does-it-mean-to-contextify-an-object\">contextified</a> using the <a href=\"#vmcreatecontextcontextobject-options\"><code>vm.createContext()</code></a> method.</p>\n<p>If <code>options</code> is a string, then it specifies the filename.</p>\n<p>The following example compiles and executes different scripts using a single\n<a href=\"#what-does-it-mean-to-contextify-an-object\">contextified</a> object:</p>\n<pre><code class=\"language-mjs\">import { createContext, runInContext } from 'node:vm';\n\nconst contextObject = { globalVar: 1 };\ncreateContext(contextObject);\n\nfor (let i = 0; i &#x3C; 10; ++i) {\n  runInContext('globalVar *= 2;', contextObject);\n}\nconsole.log(contextObject);\n// Prints: { globalVar: 1024 }\n</code></pre>\n<pre><code class=\"language-cjs\">const { createContext, runInContext } = require('node:vm');\n\nconst contextObject = { globalVar: 1 };\ncreateContext(contextObject);\n\nfor (let i = 0; i &#x3C; 10; ++i) {\n  runInContext('globalVar *= 2;', contextObject);\n}\nconsole.log(contextObject);\n// Prints: { globalVar: 1024 }\n</code></pre>"
        },
        {
          "textRaw": "`vm.runInNewContext(code[, contextObject[, options]])`",
          "name": "runInNewContext",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.1"
            ],
            "changes": [
              {
                "version": [
                  "v22.8.0",
                  "v20.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/54394",
                "description": "The `contextObject` argument now accepts `vm.constants.DONT_CONTEXTIFY`."
              },
              {
                "version": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/51244",
                "description": "Added support for `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`."
              },
              {
                "version": [
                  "v17.0.0",
                  "v16.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/40249",
                "description": "Added support for import attributes to the `importModuleDynamically` parameter."
              },
              {
                "version": "v14.6.0",
                "pr-url": "https://github.com/nodejs/node/pull/34023",
                "description": "The `microtaskMode` option is supported now."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/19016",
                "description": "The `contextCodeGeneration` option is supported now."
              },
              {
                "version": "v6.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/6635",
                "description": "The `breakOnSigint` option is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`code` {string} The JavaScript code to compile and run.",
                  "name": "code",
                  "type": "string",
                  "desc": "The JavaScript code to compile and run."
                },
                {
                  "textRaw": "`contextObject` {Object|vm.constants.DONT_CONTEXTIFY|undefined} Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified. If `undefined`, an empty contextified object will be created for backwards compatibility.",
                  "name": "contextObject",
                  "type": "Object|vm.constants.DONT_CONTEXTIFY|undefined",
                  "desc": "Either `vm.constants.DONT_CONTEXTIFY` or an object that will be contextified. If `undefined`, an empty contextified object will be created for backwards compatibility.",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object|string}",
                  "name": "options",
                  "type": "Object|string",
                  "options": [
                    {
                      "textRaw": "`filename` {string} Specifies the filename used in stack traces produced by this script. **Default:** `'evalmachine.<anonymous>'`.",
                      "name": "filename",
                      "type": "string",
                      "default": "`'evalmachine.<anonymous>'`",
                      "desc": "Specifies the filename used in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`lineOffset` {number} Specifies the line number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "lineOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the line number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`columnOffset` {number} Specifies the first-line column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the first-line column number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`displayErrors` {boolean} When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. **Default:** `true`.",
                      "name": "displayErrors",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace."
                    },
                    {
                      "textRaw": "`timeout` {integer} Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.",
                      "name": "timeout",
                      "type": "integer",
                      "desc": "Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer."
                    },
                    {
                      "textRaw": "`breakOnSigint` {boolean} If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that. **Default:** `false`.",
                      "name": "breakOnSigint",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that."
                    },
                    {
                      "textRaw": "`contextName` {string} Human-readable name of the newly created context. **Default:** `'VM Context i'`, where `i` is an ascending numerical index of the created context.",
                      "name": "contextName",
                      "type": "string",
                      "default": "`'VM Context i'`, where `i` is an ascending numerical index of the created context",
                      "desc": "Human-readable name of the newly created context."
                    },
                    {
                      "textRaw": "`contextOrigin` {string} Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. Most notably, this string should omit the trailing slash, as that denotes a path. **Default:** `''`.",
                      "name": "contextOrigin",
                      "type": "string",
                      "default": "`''`",
                      "desc": "Origin corresponding to the newly created context for display purposes. The origin should be formatted like a URL, but with only the scheme, host, and port (if necessary), like the value of the `url.origin` property of a `URL` object. Most notably, this string should omit the trailing slash, as that denotes a path."
                    },
                    {
                      "textRaw": "`contextCodeGeneration` {Object}",
                      "name": "contextCodeGeneration",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`strings` {boolean} If set to false any calls to `eval` or function constructors (`Function`, `GeneratorFunction`, etc) will throw an `EvalError`. **Default:** `true`.",
                          "name": "strings",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If set to false any calls to `eval` or function constructors (`Function`, `GeneratorFunction`, etc) will throw an `EvalError`."
                        },
                        {
                          "textRaw": "`wasm` {boolean} If set to false any attempt to compile a WebAssembly module will throw a `WebAssembly.CompileError`. **Default:** `true`.",
                          "name": "wasm",
                          "type": "boolean",
                          "default": "`true`",
                          "desc": "If set to false any attempt to compile a WebAssembly module will throw a `WebAssembly.CompileError`."
                        }
                      ]
                    },
                    {
                      "textRaw": "`cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source.",
                      "name": "cachedData",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source."
                    },
                    {
                      "textRaw": "`importModuleDynamically` {Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER} Used to specify the how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs.",
                      "name": "importModuleDynamically",
                      "type": "Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER",
                      "desc": "Used to specify the how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs."
                    },
                    {
                      "textRaw": "`microtaskMode` {string} If set to `afterEvaluate`, microtasks (tasks scheduled through `Promise`s and `async function`s) will be run immediately after the script has run. They are included in the `timeout` and `breakOnSigint` scopes in that case.",
                      "name": "microtaskMode",
                      "type": "string",
                      "desc": "If set to `afterEvaluate`, microtasks (tasks scheduled through `Promise`s and `async function`s) will be run immediately after the script has run. They are included in the `timeout` and `breakOnSigint` scopes in that case."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {any} the result of the very last statement executed in the script.",
                "name": "return",
                "type": "any",
                "desc": "the result of the very last statement executed in the script."
              }
            }
          ],
          "desc": "<p>This method is a shortcut to\n<code>(new vm.Script(code, options)).runInContext(vm.createContext(options), options)</code>.\nIf <code>options</code> is a string, then it specifies the filename.</p>\n<p>It does several things at once:</p>\n<ol>\n<li>Creates a new context.</li>\n<li>If <code>contextObject</code> is an object, <a href=\"#what-does-it-mean-to-contextify-an-object\">contextifies</a> it with the new context.\nIf <code>contextObject</code> is undefined, creates a new object and <a href=\"#what-does-it-mean-to-contextify-an-object\">contextifies</a> it.\nIf <code>contextObject</code> is <a href=\"#vmconstantsdont_contextify\"><code>vm.constants.DONT_CONTEXTIFY</code></a>, don't <a href=\"#what-does-it-mean-to-contextify-an-object\">contextify</a> anything.</li>\n<li>Compiles the code as a <code>vm.Script</code></li>\n<li>Runs the compiled code within the created context. The code does not have access to the scope in\nwhich this method is called.</li>\n<li>Returns the result.</li>\n</ol>\n<p>The following example compiles and executes code that increments a global\nvariable and sets a new one. These globals are contained in the <code>contextObject</code>.</p>\n<pre><code class=\"language-mjs\">import { runInNewContext, constants } from 'node:vm';\n\nconst contextObject = {\n  animal: 'cat',\n  count: 2,\n};\n\nrunInNewContext('count += 1; name = \"kitty\"', contextObject);\nconsole.log(contextObject);\n// Prints: { animal: 'cat', count: 3, name: 'kitty' }\n\n// This would throw if the context is created from a contextified object.\n// vm.constants.DONT_CONTEXTIFY allows creating contexts with ordinary global objects that\n// can be frozen.\nconst frozenContext = runInNewContext(\n  'Object.freeze(globalThis); globalThis;',\n  constants.DONT_CONTEXTIFY,\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const { runInNewContext, constants } = require('node:vm');\n\nconst contextObject = {\n  animal: 'cat',\n  count: 2,\n};\n\nrunInNewContext('count += 1; name = \"kitty\"', contextObject);\nconsole.log(contextObject);\n// Prints: { animal: 'cat', count: 3, name: 'kitty' }\n\n// This would throw if the context is created from a contextified object.\n// vm.constants.DONT_CONTEXTIFY allows creating contexts with ordinary global objects that\n// can be frozen.\nconst frozenContext = runInNewContext(\n  'Object.freeze(globalThis); globalThis;',\n  constants.DONT_CONTEXTIFY,\n);\n</code></pre>"
        },
        {
          "textRaw": "`vm.runInThisContext(code[, options])`",
          "name": "runInThisContext",
          "type": "method",
          "meta": {
            "added": [
              "v0.3.1"
            ],
            "changes": [
              {
                "version": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/51244",
                "description": "Added support for `vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`."
              },
              {
                "version": [
                  "v17.0.0",
                  "v16.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/40249",
                "description": "Added support for import attributes to the `importModuleDynamically` parameter."
              },
              {
                "version": "v6.3.0",
                "pr-url": "https://github.com/nodejs/node/pull/6635",
                "description": "The `breakOnSigint` option is supported now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`code` {string} The JavaScript code to compile and run.",
                  "name": "code",
                  "type": "string",
                  "desc": "The JavaScript code to compile and run."
                },
                {
                  "textRaw": "`options` {Object|string}",
                  "name": "options",
                  "type": "Object|string",
                  "options": [
                    {
                      "textRaw": "`filename` {string} Specifies the filename used in stack traces produced by this script. **Default:** `'evalmachine.<anonymous>'`.",
                      "name": "filename",
                      "type": "string",
                      "default": "`'evalmachine.<anonymous>'`",
                      "desc": "Specifies the filename used in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`lineOffset` {number} Specifies the line number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "lineOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the line number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`columnOffset` {number} Specifies the first-line column number offset that is displayed in stack traces produced by this script. **Default:** `0`.",
                      "name": "columnOffset",
                      "type": "number",
                      "default": "`0`",
                      "desc": "Specifies the first-line column number offset that is displayed in stack traces produced by this script."
                    },
                    {
                      "textRaw": "`displayErrors` {boolean} When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace. **Default:** `true`.",
                      "name": "displayErrors",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace."
                    },
                    {
                      "textRaw": "`timeout` {integer} Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.",
                      "name": "timeout",
                      "type": "integer",
                      "desc": "Specifies the number of milliseconds to execute `code` before terminating execution. If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer."
                    },
                    {
                      "textRaw": "`breakOnSigint` {boolean} If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that. **Default:** `false`.",
                      "name": "breakOnSigint",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "If `true`, receiving `SIGINT` (<kbd>Ctrl</kbd>+<kbd>C</kbd>) will terminate execution and throw an `Error`. Existing handlers for the event that have been attached via `process.on('SIGINT')` are disabled during script execution, but continue to work after that."
                    },
                    {
                      "textRaw": "`cachedData` {Buffer|TypedArray|DataView} Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source.",
                      "name": "cachedData",
                      "type": "Buffer|TypedArray|DataView",
                      "desc": "Provides an optional `Buffer` or `TypedArray`, or `DataView` with V8's code cache data for the supplied source."
                    },
                    {
                      "textRaw": "`importModuleDynamically` {Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER} Used to specify the how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs.",
                      "name": "importModuleDynamically",
                      "type": "Function|vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER",
                      "desc": "Used to specify the how the modules should be loaded during the evaluation of this script when `import()` is called. This option is part of the experimental modules API. We do not recommend using it in a production environment. For detailed information, see Support of dynamic `import()` in compilation APIs."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {any} the result of the very last statement executed in the script.",
                "name": "return",
                "type": "any",
                "desc": "the result of the very last statement executed in the script."
              }
            }
          ],
          "desc": "<p><code>vm.runInThisContext()</code> compiles <code>code</code>, runs it within the context of the\ncurrent <code>global</code> and returns the result. Running code does not have access to\nlocal scope, but does have access to the current <code>global</code> object.</p>\n<p>If <code>options</code> is a string, then it specifies the filename.</p>\n<p>The following example illustrates using both <code>vm.runInThisContext()</code> and\nthe JavaScript <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval\"><code>eval()</code></a> function to run the same code:</p>\n<pre><code class=\"language-mjs\">import { runInThisContext } from 'node:vm';\nlet localVar = 'initial value';\n\nconst vmResult = runInThisContext('localVar = \"vm\";');\nconsole.log(`vmResult: '${vmResult}', localVar: '${localVar}'`);\n// Prints: vmResult: 'vm', localVar: 'initial value'\n\nconst evalResult = eval('localVar = \"eval\";');\nconsole.log(`evalResult: '${evalResult}', localVar: '${localVar}'`);\n// Prints: evalResult: 'eval', localVar: 'eval'\n</code></pre>\n<pre><code class=\"language-cjs\">const { runInThisContext } = require('node:vm');\nlet localVar = 'initial value';\n\nconst vmResult = runInThisContext('localVar = \"vm\";');\nconsole.log(`vmResult: '${vmResult}', localVar: '${localVar}'`);\n// Prints: vmResult: 'vm', localVar: 'initial value'\n\nconst evalResult = eval('localVar = \"eval\";');\nconsole.log(`evalResult: '${evalResult}', localVar: '${localVar}'`);\n// Prints: evalResult: 'eval', localVar: 'eval'\n</code></pre>\n<p>Because <code>vm.runInThisContext()</code> does not have access to the local scope,\n<code>localVar</code> is unchanged. In contrast, a direct <code>eval()</code> call <em>does</em> have access\nto the local scope, so the value <code>localVar</code> is changed. In this way\n<code>vm.runInThisContext()</code> is much like an <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#direct_and_indirect_eval\">indirect <code>eval()</code> call</a>, e.g.\n<code>(0,eval)('code')</code>.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {Object}",
          "name": "constants",
          "type": "Object",
          "meta": {
            "added": [
              "v21.7.0",
              "v20.12.0"
            ],
            "changes": []
          },
          "desc": "<p>Returns an object containing commonly used constants for VM operations.</p>",
          "properties": [
            {
              "textRaw": "`vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER`",
              "name": "USE_MAIN_CONTEXT_DEFAULT_LOADER",
              "type": "property",
              "meta": {
                "added": [
                  "v21.7.0",
                  "v20.12.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "desc": "<p>A constant that can be used as the <code>importModuleDynamically</code> option to\n<code>vm.Script</code> and <code>vm.compileFunction()</code> so that Node.js uses the default\nESM loader from the main context to load the requested module.</p>\n<p>For detailed information, see\n<a href=\"#support-of-dynamic-import-in-compilation-apis\">Support of dynamic <code>import()</code> in compilation APIs</a>.</p>"
            }
          ]
        }
      ],
      "displayName": "VM (executing JavaScript)",
      "source": "doc/api/vm.md"
    },
    {
      "textRaw": "WebAssembly System Interface (WASI)",
      "name": "webassembly_system_interface_(wasi)",
      "introduced_in": "v12.16.0",
      "type": "module",
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p><strong class=\"critical\">The <code>node:wasi</code> module does not currently provide the\ncomprehensive file system security properties provided by some WASI runtimes.\nFull support for secure file system sandboxing may or may not be implemented in\nfuture. In the mean time, do not rely on it to run untrusted code. </strong></p>\n<p>The WASI API provides an implementation of the <a href=\"https://wasi.dev/\">WebAssembly System Interface</a>\nspecification. WASI gives WebAssembly applications access to the underlying\noperating system via a collection of POSIX-like functions.</p>\n<pre><code class=\"language-mjs\">import { readFile } from 'node:fs/promises';\nimport { WASI } from 'node:wasi';\nimport { argv, env } from 'node:process';\n\nconst wasi = new WASI({\n  version: 'preview1',\n  args: argv,\n  env,\n  preopens: {\n    '/local': '/some/real/path/that/wasm/can/access',\n  },\n});\n\nconst wasm = await WebAssembly.compile(\n  await readFile(new URL('./demo.wasm', import.meta.url)),\n);\nconst instance = await WebAssembly.instantiate(wasm, wasi.getImportObject());\n\nwasi.start(instance);\n</code></pre>\n<pre><code class=\"language-cjs\">const { readFile } = require('node:fs/promises');\nconst { WASI } = require('node:wasi');\nconst { argv, env } = require('node:process');\nconst { join } = require('node:path');\n\nconst wasi = new WASI({\n  version: 'preview1',\n  args: argv,\n  env,\n  preopens: {\n    '/local': '/some/real/path/that/wasm/can/access',\n  },\n});\n\n(async () => {\n  const wasm = await WebAssembly.compile(\n    await readFile(join(__dirname, 'demo.wasm')),\n  );\n  const instance = await WebAssembly.instantiate(wasm, wasi.getImportObject());\n\n  wasi.start(instance);\n})();\n</code></pre>\n<p>To run the above example, create a new WebAssembly text format file named\n<code>demo.wat</code>:</p>\n<pre><code class=\"language-text\">(module\n    ;; Import the required fd_write WASI function which will write the given io vectors to stdout\n    ;; The function signature for fd_write is:\n    ;; (File Descriptor, *iovs, iovs_len, nwritten) -> Returns number of bytes written\n    (import \"wasi_snapshot_preview1\" \"fd_write\" (func $fd_write (param i32 i32 i32 i32) (result i32)))\n\n    (memory 1)\n    (export \"memory\" (memory 0))\n\n    ;; Write 'hello world\\n' to memory at an offset of 8 bytes\n    ;; Note the trailing newline which is required for the text to appear\n    (data (i32.const 8) \"hello world\\n\")\n\n    (func $main (export \"_start\")\n        ;; Creating a new io vector within linear memory\n        (i32.store (i32.const 0) (i32.const 8))  ;; iov.iov_base - This is a pointer to the start of the 'hello world\\n' string\n        (i32.store (i32.const 4) (i32.const 12))  ;; iov.iov_len - The length of the 'hello world\\n' string\n\n        (call $fd_write\n            (i32.const 1) ;; file_descriptor - 1 for stdout\n            (i32.const 0) ;; *iovs - The pointer to the iov array, which is stored at memory location 0\n            (i32.const 1) ;; iovs_len - We're printing 1 string stored in an iov - so one.\n            (i32.const 20) ;; nwritten - A place in memory to store the number of bytes written\n        )\n        drop ;; Discard the number of bytes written from the top of the stack\n    )\n)\n</code></pre>\n<p>Use <a href=\"https://github.com/WebAssembly/wabt\">wabt</a> to compile <code>.wat</code> to <code>.wasm</code></p>\n<pre><code class=\"language-bash\">wat2wasm demo.wat\n</code></pre>",
      "modules": [
        {
          "textRaw": "Security",
          "name": "security",
          "type": "module",
          "meta": {
            "added": [
              "v21.2.0",
              "v20.11.0"
            ],
            "changes": [
              {
                "version": [
                  "v21.2.0",
                  "v20.11.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/50396",
                "description": "Clarify WASI security properties."
              }
            ]
          },
          "desc": "<p>WASI provides a capabilities-based model through which applications are provided\ntheir own custom <code>env</code>, <code>preopens</code>, <code>stdin</code>, <code>stdout</code>, <code>stderr</code>, and <code>exit</code>\ncapabilities.</p>\n<p><strong>The current Node.js threat model does not provide secure sandboxing as is\npresent in some WASI runtimes.</strong></p>\n<p>While the capability features are supported, they do not form a security model\nin Node.js. For example, the file system sandboxing can be escaped with various\ntechniques. The project is exploring whether these security guarantees could be\nadded in future.</p>",
          "displayName": "Security"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `WASI`",
          "name": "WASI",
          "type": "class",
          "meta": {
            "added": [
              "v13.3.0",
              "v12.16.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>WASI</code> class provides the WASI system call API and additional convenience\nmethods for working with WASI-based applications. Each <code>WASI</code> instance\nrepresents a distinct environment.</p>",
          "signatures": [
            {
              "textRaw": "`new WASI([options])`",
              "name": "WASI",
              "type": "ctor",
              "meta": {
                "added": [
                  "v13.3.0",
                  "v12.16.0"
                ],
                "changes": [
                  {
                    "version": "v20.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/47390",
                    "description": "default value of returnOnExit changed to true."
                  },
                  {
                    "version": "v20.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/47391",
                    "description": "The version option is now required and has no default value."
                  },
                  {
                    "version": "v19.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/46469",
                    "description": "version field added to options."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`args` {Array} An array of strings that the WebAssembly application will see as command-line arguments. The first argument is the virtual path to the WASI command itself. **Default:** `[]`.",
                      "name": "args",
                      "type": "Array",
                      "default": "`[]`",
                      "desc": "An array of strings that the WebAssembly application will see as command-line arguments. The first argument is the virtual path to the WASI command itself."
                    },
                    {
                      "textRaw": "`env` {Object} An object similar to `process.env` that the WebAssembly application will see as its environment. **Default:** `{}`.",
                      "name": "env",
                      "type": "Object",
                      "default": "`{}`",
                      "desc": "An object similar to `process.env` that the WebAssembly application will see as its environment."
                    },
                    {
                      "textRaw": "`preopens` {Object} This object represents the WebAssembly application's local directory structure. The string keys of `preopens` are treated as directories within the file system. The corresponding values in `preopens` are the real paths to those directories on the host machine.",
                      "name": "preopens",
                      "type": "Object",
                      "desc": "This object represents the WebAssembly application's local directory structure. The string keys of `preopens` are treated as directories within the file system. The corresponding values in `preopens` are the real paths to those directories on the host machine."
                    },
                    {
                      "textRaw": "`returnOnExit` {boolean} By default, when WASI applications call `__wasi_proc_exit()` `wasi.start()` will return with the exit code specified rather than terminating the process. Setting this option to `false` will cause the Node.js process to exit with the specified exit code instead. **Default:** `true`.",
                      "name": "returnOnExit",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "By default, when WASI applications call `__wasi_proc_exit()` `wasi.start()` will return with the exit code specified rather than terminating the process. Setting this option to `false` will cause the Node.js process to exit with the specified exit code instead."
                    },
                    {
                      "textRaw": "`stdin` {integer} The file descriptor used as standard input in the WebAssembly application. **Default:** `0`.",
                      "name": "stdin",
                      "type": "integer",
                      "default": "`0`",
                      "desc": "The file descriptor used as standard input in the WebAssembly application."
                    },
                    {
                      "textRaw": "`stdout` {integer} The file descriptor used as standard output in the WebAssembly application. **Default:** `1`.",
                      "name": "stdout",
                      "type": "integer",
                      "default": "`1`",
                      "desc": "The file descriptor used as standard output in the WebAssembly application."
                    },
                    {
                      "textRaw": "`stderr` {integer} The file descriptor used as standard error in the WebAssembly application. **Default:** `2`.",
                      "name": "stderr",
                      "type": "integer",
                      "default": "`2`",
                      "desc": "The file descriptor used as standard error in the WebAssembly application."
                    },
                    {
                      "textRaw": "`version` {string} The version of WASI requested. Currently the only supported versions are `unstable` and `preview1`. This option is mandatory.",
                      "name": "version",
                      "type": "string",
                      "desc": "The version of WASI requested. Currently the only supported versions are `unstable` and `preview1`. This option is mandatory."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`wasi.getImportObject()`",
              "name": "getImportObject",
              "type": "method",
              "meta": {
                "added": [
                  "v19.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Return an import object that can be passed to <code>WebAssembly.instantiate()</code> if\nno other WASM imports are needed beyond those provided by WASI.</p>\n<p>If version <code>unstable</code> was passed into the constructor it will return:</p>\n<pre><code class=\"language-json\">{ wasi_unstable: wasi.wasiImport }\n</code></pre>\n<p>If version <code>preview1</code> was passed into the constructor or no version was\nspecified it will return:</p>\n<pre><code class=\"language-json\">{ wasi_snapshot_preview1: wasi.wasiImport }\n</code></pre>"
            },
            {
              "textRaw": "`wasi.start(instance)`",
              "name": "start",
              "type": "method",
              "meta": {
                "added": [
                  "v13.3.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`instance` {WebAssembly.Instance}",
                      "name": "instance",
                      "type": "WebAssembly.Instance"
                    }
                  ]
                }
              ],
              "desc": "<p>Attempt to begin execution of <code>instance</code> as a WASI command by invoking its\n<code>_start()</code> export. If <code>instance</code> does not contain a <code>_start()</code> export, or if\n<code>instance</code> contains an <code>_initialize()</code> export, then an exception is thrown.</p>\n<p><code>start()</code> requires that <code>instance</code> exports a <a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Memory\"><code>WebAssembly.Memory</code></a> named\n<code>memory</code>. If <code>instance</code> does not have a <code>memory</code> export an exception is thrown.</p>\n<p>If <code>start()</code> is called more than once, an exception is thrown.</p>"
            },
            {
              "textRaw": "`wasi.initialize(instance)`",
              "name": "initialize",
              "type": "method",
              "meta": {
                "added": [
                  "v14.6.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`instance` {WebAssembly.Instance}",
                      "name": "instance",
                      "type": "WebAssembly.Instance"
                    }
                  ]
                }
              ],
              "desc": "<p>Attempt to initialize <code>instance</code> as a WASI reactor by invoking its\n<code>_initialize()</code> export, if it is present. If <code>instance</code> contains a <code>_start()</code>\nexport, then an exception is thrown.</p>\n<p><code>initialize()</code> requires that <code>instance</code> exports a <a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Memory\"><code>WebAssembly.Memory</code></a> named\n<code>memory</code>. If <code>instance</code> does not have a <code>memory</code> export an exception is thrown.</p>\n<p>If <code>initialize()</code> is called more than once, an exception is thrown.</p>"
            },
            {
              "textRaw": "`wasi.finalizeBindings(instance[, options])`",
              "name": "finalizeBindings",
              "type": "method",
              "meta": {
                "added": [
                  "v24.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`instance` {WebAssembly.Instance}",
                      "name": "instance",
                      "type": "WebAssembly.Instance"
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`memory` {WebAssembly.Memory} **Default:** `instance.exports.memory`.",
                          "name": "memory",
                          "type": "WebAssembly.Memory",
                          "default": "`instance.exports.memory`"
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Set up WASI host bindings to <code>instance</code> without calling <code>initialize()</code>\nor <code>start()</code>. This method is useful when the WASI module is instantiated in\nchild threads for sharing the memory across threads.</p>\n<p><code>finalizeBindings()</code> requires that either <code>instance</code> exports a\n<a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Memory\"><code>WebAssembly.Memory</code></a> named <code>memory</code> or user specify a\n<a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Memory\"><code>WebAssembly.Memory</code></a> object in <code>options.memory</code>. If the <code>memory</code> is invalid\nan exception is thrown.</p>\n<p><code>start()</code> and <code>initialize()</code> will call <code>finalizeBindings()</code> internally.\nIf <code>finalizeBindings()</code> is called more than once, an exception is thrown.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Object}",
              "name": "wasiImport",
              "type": "Object",
              "meta": {
                "added": [
                  "v13.3.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p><code>wasiImport</code> is an object that implements the WASI system call API. This object\nshould be passed as the <code>wasi_snapshot_preview1</code> import during the instantiation\nof a <a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Instance\"><code>WebAssembly.Instance</code></a>.</p>"
            }
          ]
        }
      ],
      "displayName": "WebAssembly System Interface (WASI)",
      "source": "doc/api/wasi.md"
    },
    {
      "textRaw": "Web Crypto API",
      "name": "web_crypto_api",
      "introduced_in": "v15.0.0",
      "type": "module",
      "meta": {
        "changes": [
          {
            "version": "v25.9.0",
            "pr-url": "https://github.com/nodejs/node/pull/62183",
            "description": "TurboSHAKE and KangarooTwelve algorithms are now supported."
          },
          {
            "version": "v24.8.0",
            "pr-url": "https://github.com/nodejs/node/pull/59647",
            "description": "KMAC algorithms are now supported."
          },
          {
            "version": "v24.8.0",
            "pr-url": "https://github.com/nodejs/node/pull/59544",
            "description": "Argon2 algorithms are now supported."
          },
          {
            "version": "v24.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/59539",
            "description": "AES-OCB algorithm is now supported."
          },
          {
            "version": "v24.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/59569",
            "description": "ML-KEM algorithms are now supported."
          },
          {
            "version": "v24.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/59365",
            "description": "ChaCha20-Poly1305 algorithm is now supported."
          },
          {
            "version": "v24.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/59365",
            "description": "SHA-3 algorithms are now supported."
          },
          {
            "version": "v24.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/59365",
            "description": "SHAKE algorithms are now supported."
          },
          {
            "version": "v24.7.0",
            "pr-url": "https://github.com/nodejs/node/pull/59365",
            "description": "ML-DSA algorithms are now supported."
          },
          {
            "version": [
              "v23.5.0",
              "v22.13.0",
              "v20.19.3"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/56142",
            "description": "Algorithms `Ed25519` and `X25519` are now stable."
          },
          {
            "version": [
              "v20.0.0",
              "v18.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/46067",
            "description": "Arguments are now coerced and validated as per their WebIDL definitions like in other Web Crypto API implementations."
          },
          {
            "version": "v19.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/44897",
            "description": "No longer experimental except for the `Ed25519`, `Ed448`, `X25519`, and `X448` algorithms."
          },
          {
            "version": [
              "v18.4.0",
              "v16.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/43310",
            "description": "Removed proprietary `'node.keyObject'` import/export format."
          },
          {
            "version": [
              "v18.4.0",
              "v16.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/43310",
            "description": "Removed proprietary `'NODE-DSA'`, `'NODE-DH'`, and `'NODE-SCRYPT'` algorithms."
          },
          {
            "version": [
              "v18.4.0",
              "v16.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/42507",
            "description": "Added `'Ed25519'`, `'Ed448'`, `'X25519'`, and `'X448'` algorithms."
          },
          {
            "version": [
              "v18.4.0",
              "v16.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/42507",
            "description": "Removed proprietary `'NODE-ED25519'` and `'NODE-ED448'` algorithms."
          },
          {
            "version": [
              "v18.4.0",
              "v16.17.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/42507",
            "description": "Removed proprietary `'NODE-X25519'` and `'NODE-X448'` named curves from the `'ECDH'` algorithm."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>Node.js provides an implementation of the <a href=\"https://www.w3.org/TR/WebCryptoAPI/\">Web Crypto API</a> standard.</p>\n<p>Use <code>globalThis.crypto</code> or <code>require('node:crypto').webcrypto</code> to access this\nmodule.</p>\n<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\n(async function() {\n\n  const key = await subtle.generateKey({\n    name: 'HMAC',\n    hash: 'SHA-256',\n    length: 256,\n  }, true, ['sign', 'verify']);\n\n  const enc = new TextEncoder();\n  const message = enc.encode('I love cupcakes');\n\n  const digest = await subtle.sign({\n    name: 'HMAC',\n  }, key, message);\n\n})();\n</code></pre>",
      "modules": [
        {
          "textRaw": "Modern Algorithms in the Web Cryptography API",
          "name": "modern_algorithms_in_the_web_cryptography_api",
          "type": "module",
          "stability": 1.1,
          "stabilityText": "Active development",
          "desc": "<p>Node.js provides an implementation of the following features from the\n<a href=\"https://wicg.github.io/webcrypto-modern-algos/\">Modern Algorithms in the Web Cryptography API</a>\nWICG proposal:</p>\n<p>Algorithms:</p>\n<ul>\n<li><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-openssl30\" id=\"user-content-fnref-openssl30\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'Argon2d'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'Argon2i'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'Argon2id'</code><sup><a href=\"#user-content-fn-openssl32\" id=\"user-content-fnref-openssl32-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ChaCha20-Poly1305'</code></li>\n<li><code>'cSHAKE128'</code></li>\n<li><code>'cSHAKE256'</code></li>\n<li><code>'KMAC128'</code><sup><a href=\"#user-content-fn-openssl30\" id=\"user-content-fnref-openssl30-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'KMAC256'</code><sup><a href=\"#user-content-fn-openssl30\" id=\"user-content-fnref-openssl30-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'KT128'</code></li>\n<li><code>'KT256'</code></li>\n<li><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup></li>\n<li><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-2\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup></li>\n<li><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-3\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup></li>\n<li><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-4\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup></li>\n<li><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-5\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup></li>\n<li><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-openssl35\" id=\"user-content-fnref-openssl35-6\" data-footnote-ref aria-describedby=\"footnote-label\">3</a></sup></li>\n<li><code>'SHA3-256'</code></li>\n<li><code>'SHA3-384'</code></li>\n<li><code>'SHA3-512'</code></li>\n<li><code>'TurboSHAKE128'</code></li>\n<li><code>'TurboSHAKE256'</code></li>\n</ul>\n<p>Key Formats:</p>\n<ul>\n<li><code>'raw-public'</code></li>\n<li><code>'raw-secret'</code></li>\n<li><code>'raw-seed'</code></li>\n</ul>\n<p>Methods:</p>\n<ul>\n<li><a href=\"#subtledecapsulatebitsdecapsulationalgorithm-decapsulationkey-ciphertext\"><code>subtle.decapsulateBits()</code></a></li>\n<li><a href=\"#subtledecapsulatekeydecapsulationalgorithm-decapsulationkey-ciphertext-sharedkeyalgorithm-extractable-keyusages\"><code>subtle.decapsulateKey()</code></a></li>\n<li><a href=\"#subtleencapsulatebitsencapsulationalgorithm-encapsulationkey\"><code>subtle.encapsulateBits()</code></a></li>\n<li><a href=\"#subtleencapsulatekeyencapsulationalgorithm-encapsulationkey-sharedkeyalgorithm-extractable-keyusages\"><code>subtle.encapsulateKey()</code></a></li>\n<li><a href=\"#subtlegetpublickeykey-keyusages\"><code>subtle.getPublicKey()</code></a></li>\n<li><a href=\"#static-method-subtlecryptosupportsoperation-algorithm-lengthoradditionalalgorithm\"><code>SubtleCrypto.supports()</code></a></li>\n</ul>",
          "displayName": "Modern Algorithms in the Web Cryptography API"
        },
        {
          "textRaw": "Secure Curves in the Web Cryptography API",
          "name": "secure_curves_in_the_web_cryptography_api",
          "type": "module",
          "stability": 1.1,
          "stabilityText": "Active development",
          "desc": "<p>Node.js provides an implementation of the following features from the\n<a href=\"https://wicg.github.io/webcrypto-secure-curves/\">Secure Curves in the Web Cryptography API</a>\nWICG proposal:</p>\n<p>Algorithms:</p>\n<ul>\n<li><code>'Ed448'</code></li>\n<li><code>'X448'</code></li>\n</ul>",
          "displayName": "Secure Curves in the Web Cryptography API"
        },
        {
          "textRaw": "Examples",
          "name": "examples",
          "type": "module",
          "modules": [
            {
              "textRaw": "Generating keys",
              "name": "generating_keys",
              "type": "module",
              "desc": "<p>The <a href=\"webcrypto.html#class-subtlecrypto\"><code>&#x3C;SubtleCrypto></code></a> class can be used to generate symmetric (secret) keys\nor asymmetric key pairs (public key and private key).</p>",
              "modules": [
                {
                  "textRaw": "AES keys",
                  "name": "aes_keys",
                  "type": "module",
                  "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function generateAesKey(length = 256) {\n  const key = await subtle.generateKey({\n    name: 'AES-CBC',\n    length,\n  }, true, ['encrypt', 'decrypt']);\n\n  return key;\n}\n</code></pre>",
                  "displayName": "AES keys"
                },
                {
                  "textRaw": "ECDSA key pairs",
                  "name": "ecdsa_key_pairs",
                  "type": "module",
                  "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function generateEcKey(namedCurve = 'P-521') {\n  const {\n    publicKey,\n    privateKey,\n  } = await subtle.generateKey({\n    name: 'ECDSA',\n    namedCurve,\n  }, true, ['sign', 'verify']);\n\n  return { publicKey, privateKey };\n}\n</code></pre>",
                  "displayName": "ECDSA key pairs"
                },
                {
                  "textRaw": "Ed25519/X25519 key pairs",
                  "name": "ed25519/x25519_key_pairs",
                  "type": "module",
                  "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function generateEd25519Key() {\n  return subtle.generateKey({\n    name: 'Ed25519',\n  }, true, ['sign', 'verify']);\n}\n\nasync function generateX25519Key() {\n  return subtle.generateKey({\n    name: 'X25519',\n  }, true, ['deriveKey']);\n}\n</code></pre>",
                  "displayName": "Ed25519/X25519 key pairs"
                },
                {
                  "textRaw": "HMAC keys",
                  "name": "hmac_keys",
                  "type": "module",
                  "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function generateHmacKey(hash = 'SHA-256') {\n  const key = await subtle.generateKey({\n    name: 'HMAC',\n    hash,\n  }, true, ['sign', 'verify']);\n\n  return key;\n}\n</code></pre>",
                  "displayName": "HMAC keys"
                },
                {
                  "textRaw": "RSA key pairs",
                  "name": "rsa_key_pairs",
                  "type": "module",
                  "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\nconst publicExponent = new Uint8Array([1, 0, 1]);\n\nasync function generateRsaKey(modulusLength = 2048, hash = 'SHA-256') {\n  const {\n    publicKey,\n    privateKey,\n  } = await subtle.generateKey({\n    name: 'RSASSA-PKCS1-v1_5',\n    modulusLength,\n    publicExponent,\n    hash,\n  }, true, ['sign', 'verify']);\n\n  return { publicKey, privateKey };\n}\n</code></pre>",
                  "displayName": "RSA key pairs"
                }
              ],
              "displayName": "Generating keys"
            },
            {
              "textRaw": "Encryption and decryption",
              "name": "encryption_and_decryption",
              "type": "module",
              "desc": "<pre><code class=\"language-js\">const crypto = globalThis.crypto;\n\nasync function aesEncrypt(plaintext) {\n  const ec = new TextEncoder();\n  const key = await generateAesKey();\n  const iv = crypto.getRandomValues(new Uint8Array(16));\n\n  const ciphertext = await crypto.subtle.encrypt({\n    name: 'AES-CBC',\n    iv,\n  }, key, ec.encode(plaintext));\n\n  return {\n    key,\n    iv,\n    ciphertext,\n  };\n}\n\nasync function aesDecrypt(ciphertext, key, iv) {\n  const dec = new TextDecoder();\n  const plaintext = await crypto.subtle.decrypt({\n    name: 'AES-CBC',\n    iv,\n  }, key, ciphertext);\n\n  return dec.decode(plaintext);\n}\n</code></pre>",
              "displayName": "Encryption and decryption"
            },
            {
              "textRaw": "Exporting and importing keys",
              "name": "exporting_and_importing_keys",
              "type": "module",
              "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function generateAndExportHmacKey(format = 'jwk', hash = 'SHA-512') {\n  const key = await subtle.generateKey({\n    name: 'HMAC',\n    hash,\n  }, true, ['sign', 'verify']);\n\n  return subtle.exportKey(format, key);\n}\n\nasync function importHmacKey(keyData, format = 'jwk', hash = 'SHA-512') {\n  const key = await subtle.importKey(format, keyData, {\n    name: 'HMAC',\n    hash,\n  }, true, ['sign', 'verify']);\n\n  return key;\n}\n</code></pre>",
              "displayName": "Exporting and importing keys"
            },
            {
              "textRaw": "Wrapping and unwrapping keys",
              "name": "wrapping_and_unwrapping_keys",
              "type": "module",
              "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function generateAndWrapHmacKey(format = 'jwk', hash = 'SHA-512') {\n  const [\n    key,\n    wrappingKey,\n  ] = await Promise.all([\n    subtle.generateKey({\n      name: 'HMAC', hash,\n    }, true, ['sign', 'verify']),\n    subtle.generateKey({\n      name: 'AES-KW',\n      length: 256,\n    }, true, ['wrapKey', 'unwrapKey']),\n  ]);\n\n  const wrappedKey = await subtle.wrapKey(format, key, wrappingKey, 'AES-KW');\n\n  return { wrappedKey, wrappingKey };\n}\n\nasync function unwrapHmacKey(\n  wrappedKey,\n  wrappingKey,\n  format = 'jwk',\n  hash = 'SHA-512') {\n\n  const key = await subtle.unwrapKey(\n    format,\n    wrappedKey,\n    wrappingKey,\n    'AES-KW',\n    { name: 'HMAC', hash },\n    true,\n    ['sign', 'verify']);\n\n  return key;\n}\n</code></pre>",
              "displayName": "Wrapping and unwrapping keys"
            },
            {
              "textRaw": "Sign and verify",
              "name": "sign_and_verify",
              "type": "module",
              "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function sign(key, data) {\n  const ec = new TextEncoder();\n  const signature =\n    await subtle.sign('RSASSA-PKCS1-v1_5', key, ec.encode(data));\n  return signature;\n}\n\nasync function verify(key, signature, data) {\n  const ec = new TextEncoder();\n  const verified =\n    await subtle.verify(\n      'RSASSA-PKCS1-v1_5',\n      key,\n      signature,\n      ec.encode(data));\n  return verified;\n}\n</code></pre>",
              "displayName": "Sign and verify"
            },
            {
              "textRaw": "Deriving bits and keys",
              "name": "deriving_bits_and_keys",
              "type": "module",
              "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function pbkdf2(pass, salt, iterations = 1000, length = 256) {\n  const ec = new TextEncoder();\n  const key = await subtle.importKey(\n    'raw',\n    ec.encode(pass),\n    'PBKDF2',\n    false,\n    ['deriveBits']);\n  const bits = await subtle.deriveBits({\n    name: 'PBKDF2',\n    hash: 'SHA-512',\n    salt: ec.encode(salt),\n    iterations,\n  }, key, length);\n  return bits;\n}\n\nasync function pbkdf2Key(pass, salt, iterations = 1000, length = 256) {\n  const ec = new TextEncoder();\n  const keyMaterial = await subtle.importKey(\n    'raw',\n    ec.encode(pass),\n    'PBKDF2',\n    false,\n    ['deriveKey']);\n  const key = await subtle.deriveKey({\n    name: 'PBKDF2',\n    hash: 'SHA-512',\n    salt: ec.encode(salt),\n    iterations,\n  }, keyMaterial, {\n    name: 'AES-GCM',\n    length,\n  }, true, ['encrypt', 'decrypt']);\n  return key;\n}\n</code></pre>",
              "displayName": "Deriving bits and keys"
            },
            {
              "textRaw": "Digest",
              "name": "digest",
              "type": "module",
              "desc": "<pre><code class=\"language-js\">const { subtle } = globalThis.crypto;\n\nasync function digest(data, algorithm = 'SHA-512') {\n  const ec = new TextEncoder();\n  const digest = await subtle.digest(algorithm, ec.encode(data));\n  return digest;\n}\n</code></pre>",
              "displayName": "Digest"
            },
            {
              "textRaw": "Checking for runtime algorithm support",
              "name": "checking_for_runtime_algorithm_support",
              "type": "module",
              "desc": "<p><a href=\"#static-method-subtlecryptosupportsoperation-algorithm-lengthoradditionalalgorithm\"><code>SubtleCrypto.supports()</code></a> allows feature detection in Web Crypto API,\nwhich can be used to detect whether a given algorithm identifier\n(including its parameters) is supported for the given operation.</p>\n<p>This example derives a key from a password using Argon2, if available,\nor PBKDF2, otherwise; and then encrypts and decrypts some text with it\nusing AES-OCB, if available, and AES-GCM, otherwise.</p>\n<pre><code class=\"language-mjs\">const { SubtleCrypto, crypto } = globalThis;\n\nconst password = 'correct horse battery staple';\nconst derivationAlg =\n  SubtleCrypto.supports?.('importKey', 'Argon2id') ?\n    'Argon2id' :\n    'PBKDF2';\nconst encryptionAlg =\n  SubtleCrypto.supports?.('importKey', 'AES-OCB') ?\n    'AES-OCB' :\n    'AES-GCM';\nconst passwordKey = await crypto.subtle.importKey(\n  derivationAlg === 'Argon2id' ? 'raw-secret' : 'raw',\n  new TextEncoder().encode(password),\n  derivationAlg,\n  false,\n  ['deriveKey'],\n);\nconst nonce = crypto.getRandomValues(new Uint8Array(16));\nconst derivationParams =\n  derivationAlg === 'Argon2id' ?\n    {\n      nonce,\n      parallelism: 4,\n      memory: 2 ** 21,\n      passes: 1,\n    } :\n    {\n      salt: nonce,\n      iterations: 100_000,\n      hash: 'SHA-256',\n    };\nconst key = await crypto.subtle.deriveKey(\n  {\n    name: derivationAlg,\n    ...derivationParams,\n  },\n  passwordKey,\n  {\n    name: encryptionAlg,\n    length: 256,\n  },\n  false,\n  ['encrypt', 'decrypt'],\n);\nconst plaintext = 'Hello, world!';\nconst iv = crypto.getRandomValues(new Uint8Array(16));\nconst encrypted = await crypto.subtle.encrypt(\n  { name: encryptionAlg, iv },\n  key,\n  new TextEncoder().encode(plaintext),\n);\nconst decrypted = new TextDecoder().decode(await crypto.subtle.decrypt(\n  { name: encryptionAlg, iv },\n  key,\n  encrypted,\n));\n</code></pre>",
              "displayName": "Checking for runtime algorithm support"
            }
          ],
          "displayName": "Examples"
        },
        {
          "textRaw": "Algorithm matrix",
          "name": "algorithm_matrix",
          "type": "module",
          "desc": "<p>The following tables detail the algorithms supported by the Node.js Web\nCrypto API implementation and the APIs supported for each:</p>",
          "modules": [
            {
              "textRaw": "Key Management APIs",
              "name": "key_management_apis",
              "type": "module",
              "desc": "<table>\n<thead>\n<tr>\n<th>Algorithm</th>\n<th><a href=\"#subtlegeneratekeyalgorithm-extractable-keyusages\"><code>subtle.generateKey()</code></a></th>\n<th><a href=\"#subtleexportkeyformat-key\"><code>subtle.exportKey()</code></a></th>\n<th><a href=\"#subtleimportkeyformat-keydata-algorithm-extractable-keyusages\"><code>subtle.importKey()</code></a></th>\n<th><a href=\"#subtlegetpublickeykey-keyusages\"><code>subtle.getPublicKey()</code></a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'AES-CBC'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-CTR'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-GCM'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-KW'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-OCB'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2d'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2i'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2id'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ECDH'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ECDSA'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'Ed25519'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'HKDF'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'HMAC'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'PBKDF2'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSA-OAEP'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'RSA-PSS'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'RSASSA-PKCS1-v1_5'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'X25519'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n</tbody>\n</table>",
              "displayName": "Key Management APIs"
            },
            {
              "textRaw": "Crypto Operation APIs",
              "name": "crypto_operation_apis",
              "type": "module",
              "desc": "<p><strong>Column Legend:</strong></p>\n<ul>\n<li><strong>Encryption</strong>: <a href=\"#subtleencryptalgorithm-key-data\"><code>subtle.encrypt()</code></a> / <a href=\"#subtledecryptalgorithm-key-data\"><code>subtle.decrypt()</code></a></li>\n<li><strong>Signatures and MAC</strong>: <a href=\"#subtlesignalgorithm-key-data\"><code>subtle.sign()</code></a> / <a href=\"#subtleverifyalgorithm-key-signature-data\"><code>subtle.verify()</code></a></li>\n<li><strong>Key or Bits Derivation</strong>: <a href=\"#subtlederivebitsalgorithm-basekey-length\"><code>subtle.deriveBits()</code></a> / <a href=\"#subtlederivekeyalgorithm-basekey-derivedkeytype-extractable-keyusages\"><code>subtle.deriveKey()</code></a></li>\n<li><strong>Key Wrapping</strong>: <a href=\"#subtlewrapkeyformat-key-wrappingkey-wrapalgorithm\"><code>subtle.wrapKey()</code></a> / <a href=\"#subtleunwrapkeyformat-wrappedkey-unwrappingkey-unwrapalgorithm-unwrappedkeyalgorithm-extractable-keyusages\"><code>subtle.unwrapKey()</code></a></li>\n<li><strong>Key Encapsulation</strong>: <a href=\"#subtleencapsulatebitsencapsulationalgorithm-encapsulationkey\"><code>subtle.encapsulateBits()</code></a> / <a href=\"#subtledecapsulatebitsdecapsulationalgorithm-decapsulationkey-ciphertext\"><code>subtle.decapsulateBits()</code></a> /\n<a href=\"#subtleencapsulatekeyencapsulationalgorithm-encapsulationkey-sharedkeyalgorithm-extractable-keyusages\"><code>subtle.encapsulateKey()</code></a> / <a href=\"#subtledecapsulatekeydecapsulationalgorithm-decapsulationkey-ciphertext-sharedkeyalgorithm-extractable-keyusages\"><code>subtle.decapsulateKey()</code></a></li>\n<li><strong>Digest</strong>: <a href=\"#subtledigestalgorithm-data\"><code>subtle.digest()</code></a></li>\n</ul>\n<table>\n<thead>\n<tr>\n<th>Algorithm</th>\n<th>Encryption</th>\n<th>Signatures and MAC</th>\n<th>Key or Bits Derivation</th>\n<th>Key Wrapping</th>\n<th>Key Encapsulation</th>\n<th>Digest</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'AES-CBC'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-CTR'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-GCM'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-KW'</code></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-OCB'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2d'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2i'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2id'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'cSHAKE128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'cSHAKE256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ECDH'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ECDSA'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Ed25519'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'HKDF'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'HMAC'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KT128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'KT256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-10\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-11\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-12\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-13\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'PBKDF2'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSA-OAEP'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSA-PSS'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSASSA-PKCS1-v1_5'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'SHA-1'</code></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'SHA-256'</code></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'SHA-384'</code></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'SHA-512'</code></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-14\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-15\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-16\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'TurboSHAKE128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-17\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'TurboSHAKE256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-18\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'X25519'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>",
              "displayName": "Crypto Operation APIs"
            }
          ],
          "displayName": "Algorithm matrix"
        },
        {
          "textRaw": "Algorithm parameters",
          "name": "algorithm_parameters",
          "type": "module",
          "desc": "<p>The algorithm parameter objects define the methods and parameters used by\nthe various <a href=\"webcrypto.html#class-subtlecrypto\"><code>&#x3C;SubtleCrypto></code></a> methods. While described here as \"classes\", they\nare simple JavaScript dictionary objects.</p>",
          "classes": [
            {
              "textRaw": "Class: `Algorithm`",
              "name": "Algorithm",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `AeadParams`",
              "name": "AeadParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined}",
                  "name": "additionalData",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer|undefined",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Extra input that is not encrypted but is included in the authentication\nof the data. The use of <code>additionalData</code> is optional.</p>"
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "iv",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The initialization vector must be unique for every encryption operation using a\ngiven key.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'AES-GCM'`, `'AES-OCB'`, or `'ChaCha20-Poly1305'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'AES-GCM'`, `'AES-OCB'`, or `'ChaCha20-Poly1305'`."
                },
                {
                  "textRaw": "Type: {number} The size in bits of the generated authentication tag.",
                  "name": "tagLength",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "The size in bits of the generated authentication tag."
                }
              ]
            },
            {
              "textRaw": "Class: `AesDerivedKeyParams`",
              "name": "AesDerivedKeyParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string} Must be one of `'AES-CBC'`, `'AES-CTR'`, `'AES-GCM'`, `'AES-OCB'`, or `'AES-KW'`",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'AES-CBC'`, `'AES-CTR'`, `'AES-GCM'`, `'AES-OCB'`, or `'AES-KW'`"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length of the AES key to be derived. This must be either <code>128</code>, <code>192</code>,\nor <code>256</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `AesCbcParams`",
              "name": "AesCbcParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "iv",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Provides the initialization vector. It must be exactly 16-bytes in length\nand should be unpredictable and cryptographically random.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'AES-CBC'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'AES-CBC'`."
                }
              ]
            },
            {
              "textRaw": "Class: `AesCtrParams`",
              "name": "AesCtrParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "counter",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The initial value of the counter block. This must be exactly 16 bytes long.</p>\n<p>The <code>AES-CTR</code> method uses the rightmost <code>length</code> bits of the block as the\ncounter and the remaining bits as the nonce.</p>"
                },
                {
                  "textRaw": "Type: {number} The number of bits in the `aesCtrParams.counter` that are to be used as the counter.",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "The number of bits in the `aesCtrParams.counter` that are to be used as the counter."
                },
                {
                  "textRaw": "Type: {string} Must be `'AES-CTR'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'AES-CTR'`."
                }
              ]
            },
            {
              "textRaw": "Class: `AesKeyAlgorithm`",
              "name": "AesKeyAlgorithm",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length of the AES key in bits.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `AesKeyGenParams`",
              "name": "AesKeyGenParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length of the AES key to be generated. This must be either <code>128</code>, <code>192</code>,\nor <code>256</code>.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be one of `'AES-CBC'`, `'AES-CTR'`, `'AES-GCM'`, or `'AES-KW'`",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'AES-CBC'`, `'AES-CTR'`, `'AES-GCM'`, or `'AES-KW'`"
                }
              ]
            },
            {
              "textRaw": "Class: `Argon2Params`",
              "name": "Argon2Params",
              "type": "class",
              "meta": {
                "added": [
                  "v24.8.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "associatedData",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Represents the optional associated data.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "memory",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Represents the memory size in kibibytes. It must be at least 8 times the degree of parallelism.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be one of `'Argon2d'`, `'Argon2i'`, or `'Argon2id'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'Argon2d'`, `'Argon2i'`, or `'Argon2id'`."
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "nonce",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Represents the nonce, which is a salt for password hashing applications.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "parallelism",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Represents the degree of parallelism.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "passes",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Represents the number of passes.</p>"
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "secretValue",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Represents the optional secret value.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "version",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Represents the Argon2 version number. The default and currently only defined version is <code>19</code> (<code>0x13</code>).</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `ContextParams`",
              "name": "ContextParams",
              "type": "class",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string} Must be `'Ed448'`, `'ML-DSA-44'`, `'ML-DSA-65'`, or `'ML-DSA-87'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'Ed448'`, `'ML-DSA-44'`, `'ML-DSA-65'`, or `'ML-DSA-87'`."
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined}",
                  "name": "context",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer|undefined",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.8.0",
                        "pr-url": "https://github.com/nodejs/node/pull/59570",
                        "description": "Non-empty context is now supported."
                      }
                    ]
                  },
                  "desc": "<p>The <code>context</code> member represents the optional context data to associate with\nthe message.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `CShakeParams`",
              "name": "CShakeParams",
              "type": "class",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": [
                  {
                    "version": "v25.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61875",
                    "description": "Renamed `cShakeParams.length` to `cShakeParams.outputLength`."
                  }
                ]
              },
              "properties": [
                {
                  "textRaw": "Type: {string} Must be `'cSHAKE128'` or `'cSHAKE256'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'cSHAKE128'` or `'cSHAKE256'`."
                },
                {
                  "textRaw": "Type: {number} represents the requested output length in bits.",
                  "name": "outputLength",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "represents the requested output length in bits."
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined}",
                  "name": "functionName",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer|undefined",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>functionName</code> member represents the function name, used by NIST to define\nfunctions based on cSHAKE.\nThe Node.js Web Crypto API implementation only supports zero-length functionName\nwhich is equivalent to not providing functionName at all.</p>"
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined}",
                  "name": "customization",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer|undefined",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>customization</code> member represents the customization string.\nThe Node.js Web Crypto API implementation only supports zero-length customization\nwhich is equivalent to not providing customization at all.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `EcdhKeyDeriveParams`",
              "name": "EcdhKeyDeriveParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string} Must be `'ECDH'`, `'X25519'`, or `'X448'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'ECDH'`, `'X25519'`, or `'X448'`."
                },
                {
                  "textRaw": "Type: {CryptoKey}",
                  "name": "public",
                  "type": "CryptoKey",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>ECDH key derivation operates by taking as input one party's private key and\nanother party's public key -- using both to generate a common shared secret.\nThe <code>ecdhKeyDeriveParams.public</code> property is set to the other party's public\nkey.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `EcdsaParams`",
              "name": "EcdsaParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string|Algorithm}",
                  "name": "hash",
                  "type": "string|Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.7.0",
                        "pr-url": "https://github.com/nodejs/node/pull/59365",
                        "description": "SHA-3 algorithms are now supported."
                      }
                    ]
                  },
                  "desc": "<p>If represented as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, the value must be one of:</p>\n<ul>\n<li><code>'SHA-1'</code></li>\n<li><code>'SHA-256'</code></li>\n<li><code>'SHA-384'</code></li>\n<li><code>'SHA-512'</code></li>\n<li><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>If represented as an <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a>, the object's <code>name</code> property\nmust be one of the above listed values.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'ECDSA'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'ECDSA'`."
                }
              ]
            },
            {
              "textRaw": "Class: `EcKeyAlgorithm`",
              "name": "EcKeyAlgorithm",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "namedCurve",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `EcKeyGenParams`",
              "name": "EcKeyGenParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string} Must be one of `'ECDSA'` or `'ECDH'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'ECDSA'` or `'ECDH'`."
                },
                {
                  "textRaw": "Type: {string} Must be one of `'P-256'`, `'P-384'`, `'P-521'`.",
                  "name": "namedCurve",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'P-256'`, `'P-384'`, `'P-521'`."
                }
              ]
            },
            {
              "textRaw": "Class: `EcKeyImportParams`",
              "name": "EcKeyImportParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string} Must be one of `'ECDSA'` or `'ECDH'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'ECDSA'` or `'ECDH'`."
                },
                {
                  "textRaw": "Type: {string} Must be one of `'P-256'`, `'P-384'`, `'P-521'`.",
                  "name": "namedCurve",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'P-256'`, `'P-384'`, `'P-521'`."
                }
              ]
            },
            {
              "textRaw": "Class: `EncapsulatedBits`",
              "name": "EncapsulatedBits",
              "type": "class",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "desc": "<p>A temporary symmetric secret key (represented as <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>) for message encryption\nand the ciphertext (that can be transmitted to the message recipient along with the\nmessage) encrypted by this shared key. The recipient uses their private key to determine\nwhat the shared key is which then allows them to decrypt the message.</p>",
              "properties": [
                {
                  "textRaw": "Type: {ArrayBuffer}",
                  "name": "ciphertext",
                  "type": "ArrayBuffer",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {ArrayBuffer}",
                  "name": "sharedKey",
                  "type": "ArrayBuffer",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `EncapsulatedKey`",
              "name": "EncapsulatedKey",
              "type": "class",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "desc": "<p>A temporary symmetric secret key (represented as <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>) for message encryption\nand the ciphertext (that can be transmitted to the message recipient along with the\nmessage) encrypted by this shared key. The recipient uses their private key to determine\nwhat the shared key is which then allows them to decrypt the message.</p>",
              "properties": [
                {
                  "textRaw": "Type: {ArrayBuffer}",
                  "name": "ciphertext",
                  "type": "ArrayBuffer",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {CryptoKey}",
                  "name": "sharedKey",
                  "type": "CryptoKey",
                  "meta": {
                    "added": [
                      "v24.7.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `HkdfParams`",
              "name": "HkdfParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string|Algorithm}",
                  "name": "hash",
                  "type": "string|Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.7.0",
                        "pr-url": "https://github.com/nodejs/node/pull/59365",
                        "description": "SHA-3 algorithms are now supported."
                      }
                    ]
                  },
                  "desc": "<p>If represented as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, the value must be one of:</p>\n<ul>\n<li><code>'SHA-1'</code></li>\n<li><code>'SHA-256'</code></li>\n<li><code>'SHA-384'</code></li>\n<li><code>'SHA-512'</code></li>\n<li><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>If represented as an <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a>, the object's <code>name</code> property\nmust be one of the above listed values.</p>"
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "info",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Provides application-specific contextual input to the HKDF algorithm.\nThis can be zero-length but must be provided.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'HKDF'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'HKDF'`."
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "salt",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The salt value significantly improves the strength of the HKDF algorithm.\nIt should be random or pseudorandom and should be the same length as the\noutput of the digest function (for instance, if using <code>'SHA-256'</code> as the\ndigest, the salt should be 256-bits of random data).</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `HmacImportParams`",
              "name": "HmacImportParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string|Algorithm}",
                  "name": "hash",
                  "type": "string|Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.7.0",
                        "pr-url": "https://github.com/nodejs/node/pull/59365",
                        "description": "SHA-3 algorithms are now supported."
                      }
                    ]
                  },
                  "desc": "<p>If represented as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, the value must be one of:</p>\n<ul>\n<li><code>'SHA-1'</code></li>\n<li><code>'SHA-256'</code></li>\n<li><code>'SHA-384'</code></li>\n<li><code>'SHA-512'</code></li>\n<li><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>If represented as an <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a>, the object's <code>name</code> property\nmust be one of the above listed values.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The optional number of bits in the HMAC key. This is optional and should\nbe omitted for most cases.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'HMAC'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'HMAC'`."
                }
              ]
            },
            {
              "textRaw": "Class: `HmacKeyAlgorithm`",
              "name": "HmacKeyAlgorithm",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {Algorithm}",
                  "name": "hash",
                  "type": "Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length of the HMAC key in bits.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `HmacKeyGenParams`",
              "name": "HmacKeyGenParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string|Algorithm}",
                  "name": "hash",
                  "type": "string|Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.7.0",
                        "pr-url": "https://github.com/nodejs/node/pull/59365",
                        "description": "SHA-3 algorithms are now supported."
                      }
                    ]
                  },
                  "desc": "<p>If represented as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, the value must be one of:</p>\n<ul>\n<li><code>'SHA-1'</code></li>\n<li><code>'SHA-256'</code></li>\n<li><code>'SHA-384'</code></li>\n<li><code>'SHA-512'</code></li>\n<li><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>If represented as an <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a>, the object's <code>name</code> property\nmust be one of the above listed values.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The number of bits to generate for the HMAC key. If omitted,\nthe length will be determined by the hash algorithm used.\nThis is optional and should be omitted for most cases.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'HMAC'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'HMAC'`."
                }
              ]
            },
            {
              "textRaw": "Class: `KeyAlgorithm`",
              "name": "KeyAlgorithm",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `KangarooTwelveParams`",
              "name": "KangarooTwelveParams",
              "type": "class",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined}",
                  "name": "customization",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer|undefined",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The optional customization string for KangarooTwelve.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'KT128'` or `'KT256'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'KT128'` or `'KT256'`."
                },
                {
                  "textRaw": "Type: {number} represents the requested output length in bits.",
                  "name": "outputLength",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "represents the requested output length in bits."
                }
              ]
            },
            {
              "textRaw": "Class: `KmacImportParams`",
              "name": "KmacImportParams",
              "type": "class",
              "meta": {
                "added": [
                  "v24.8.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The optional number of bits in the KMAC key. This is optional and should\nbe omitted for most cases.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'KMAC128'` or `'KMAC256'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'KMAC128'` or `'KMAC256'`."
                }
              ]
            },
            {
              "textRaw": "Class: `KmacKeyAlgorithm`",
              "name": "KmacKeyAlgorithm",
              "type": "class",
              "meta": {
                "added": [
                  "v24.8.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length of the KMAC key in bits.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `KmacKeyGenParams`",
              "name": "KmacKeyGenParams",
              "type": "class",
              "meta": {
                "added": [
                  "v24.8.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "length",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The number of bits to generate for the KMAC key. If omitted,\nthe length will be determined by the KMAC algorithm used.\nThis is optional and should be omitted for most cases.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'KMAC128'` or `'KMAC256'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'KMAC128'` or `'KMAC256'`."
                }
              ]
            },
            {
              "textRaw": "Class: `KmacParams`",
              "name": "KmacParams",
              "type": "class",
              "meta": {
                "added": [
                  "v24.8.0"
                ],
                "changes": [
                  {
                    "version": "v25.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/61875",
                    "description": "Renamed `kmacParams.length` to `kmacParams.outputLength`."
                  }
                ]
              },
              "properties": [
                {
                  "textRaw": "Type: {string} Must be `'KMAC128'` or `'KMAC256'`.",
                  "name": "algorithm",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'KMAC128'` or `'KMAC256'`."
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "outputLength",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length of the output in bytes. This must be a positive integer.</p>"
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined}",
                  "name": "customization",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer|undefined",
                  "meta": {
                    "added": [
                      "v24.8.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>customization</code> member represents the optional customization string.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `Pbkdf2Params`",
              "name": "Pbkdf2Params",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string|Algorithm}",
                  "name": "hash",
                  "type": "string|Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.7.0",
                        "pr-url": "https://github.com/nodejs/node/pull/59365",
                        "description": "SHA-3 algorithms are now supported."
                      }
                    ]
                  },
                  "desc": "<p>If represented as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, the value must be one of:</p>\n<ul>\n<li><code>'SHA-1'</code></li>\n<li><code>'SHA-256'</code></li>\n<li><code>'SHA-384'</code></li>\n<li><code>'SHA-512'</code></li>\n<li><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>If represented as an <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a>, the object's <code>name</code> property\nmust be one of the above listed values.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "iterations",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The number of iterations the PBKDF2 algorithm should make when deriving bits.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'PBKDF2'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'PBKDF2'`."
                },
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "salt",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Should be at least 16 random or pseudorandom bytes.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `RsaHashedImportParams`",
              "name": "RsaHashedImportParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string|Algorithm}",
                  "name": "hash",
                  "type": "string|Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.7.0",
                        "pr-url": "https://github.com/nodejs/node/pull/59365",
                        "description": "SHA-3 algorithms are now supported."
                      }
                    ]
                  },
                  "desc": "<p>If represented as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, the value must be one of:</p>\n<ul>\n<li><code>'SHA-1'</code></li>\n<li><code>'SHA-256'</code></li>\n<li><code>'SHA-384'</code></li>\n<li><code>'SHA-512'</code></li>\n<li><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>If represented as an <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a>, the object's <code>name</code> property\nmust be one of the above listed values.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be one of `'RSASSA-PKCS1-v1_5'`, `'RSA-PSS'`, or `'RSA-OAEP'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'RSASSA-PKCS1-v1_5'`, `'RSA-PSS'`, or `'RSA-OAEP'`."
                }
              ]
            },
            {
              "textRaw": "Class: `RsaHashedKeyAlgorithm`",
              "name": "RsaHashedKeyAlgorithm",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {Algorithm}",
                  "name": "hash",
                  "type": "Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "modulusLength",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length in bits of the RSA modulus.</p>"
                },
                {
                  "textRaw": "Type: {string}",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {Uint8Array}",
                  "name": "publicExponent",
                  "type": "Uint8Array",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The RSA public exponent.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `RsaHashedKeyGenParams`",
              "name": "RsaHashedKeyGenParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string|Algorithm}",
                  "name": "hash",
                  "type": "string|Algorithm",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": [
                      {
                        "version": "v24.7.0",
                        "pr-url": "https://github.com/nodejs/node/pull/59365",
                        "description": "SHA-3 algorithms are now supported."
                      }
                    ]
                  },
                  "desc": "<p>If represented as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, the value must be one of:</p>\n<ul>\n<li><code>'SHA-1'</code></li>\n<li><code>'SHA-256'</code></li>\n<li><code>'SHA-384'</code></li>\n<li><code>'SHA-512'</code></li>\n<li><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>If represented as an <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a>, the object's <code>name</code> property\nmust be one of the above listed values.</p>"
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "modulusLength",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length in bits of the RSA modulus. As a best practice, this should be\nat least <code>2048</code>.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be one of `'RSASSA-PKCS1-v1_5'`, `'RSA-PSS'`, or `'RSA-OAEP'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be one of `'RSASSA-PKCS1-v1_5'`, `'RSA-PSS'`, or `'RSA-OAEP'`."
                },
                {
                  "textRaw": "Type: {Uint8Array}",
                  "name": "publicExponent",
                  "type": "Uint8Array",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The RSA public exponent. This must be a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a> containing a big-endian,\nunsigned integer that must fit within 32-bits. The <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a> may contain an\narbitrary number of leading zero-bits. The value must be a prime number. Unless\nthere is reason to use a different value, use <code>new Uint8Array([1, 0, 1])</code>\n(65537) as the public exponent.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `RsaOaepParams`",
              "name": "RsaOaepParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {ArrayBuffer|TypedArray|DataView|Buffer}",
                  "name": "label",
                  "type": "ArrayBuffer|TypedArray|DataView|Buffer",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>An additional collection of bytes that will not be encrypted, but will be bound\nto the generated ciphertext.</p>\n<p>The <code>rsaOaepParams.label</code> parameter is optional.</p>"
                },
                {
                  "textRaw": "Type: {string} must be `'RSA-OAEP'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "must be `'RSA-OAEP'`."
                }
              ]
            },
            {
              "textRaw": "Class: `RsaPssParams`",
              "name": "RsaPssParams",
              "type": "class",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {string} Must be `'RSA-PSS'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'RSA-PSS'`."
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "saltLength",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v15.0.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The length (in bytes) of the random salt to use.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `TurboShakeParams`",
              "name": "TurboShakeParams",
              "type": "class",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "properties": [
                {
                  "textRaw": "Type: {number|undefined}",
                  "name": "domainSeparation",
                  "type": "number|undefined",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The optional domain separation byte (0x01-0x7f). Defaults to <code>0x1f</code>.</p>"
                },
                {
                  "textRaw": "Type: {string} Must be `'TurboSHAKE128'` or `'TurboSHAKE256'`.",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "desc": "Must be `'TurboSHAKE128'` or `'TurboSHAKE256'`."
                },
                {
                  "textRaw": "Type: {number} represents the requested output length in bits.",
                  "name": "outputLength",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v25.9.0"
                    ],
                    "changes": []
                  },
                  "shortDesc": "represents the requested output length in bits."
                }
              ]
            }
          ],
          "displayName": "Algorithm parameters"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `Crypto`",
          "name": "Crypto",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": []
          },
          "desc": "<p><code>globalThis.crypto</code> is an instance of the <code>Crypto</code>\nclass. <code>Crypto</code> is a singleton that provides access to the remainder of the\ncrypto API.</p>",
          "properties": [
            {
              "textRaw": "Type: {SubtleCrypto}",
              "name": "subtle",
              "type": "SubtleCrypto",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>Provides access to the <code>SubtleCrypto</code> API.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`crypto.getRandomValues(typedArray)`",
              "name": "getRandomValues",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`typedArray` {Buffer|TypedArray}",
                      "name": "typedArray",
                      "type": "Buffer|TypedArray"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer|TypedArray}",
                    "name": "return",
                    "type": "Buffer|TypedArray"
                  }
                }
              ],
              "desc": "<p>Generates cryptographically strong random values. The given <code>typedArray</code> is\nfilled with random values, and a reference to <code>typedArray</code> is returned.</p>\n<p>The given <code>typedArray</code> must be an integer-based instance of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>,\ni.e. <code>Float32Array</code> and <code>Float64Array</code> are not accepted.</p>\n<p>An error will be thrown if the given <code>typedArray</code> is larger than 65,536 bytes.</p>"
            },
            {
              "textRaw": "`crypto.randomUUID()`",
              "name": "randomUUID",
              "type": "method",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {string}",
                    "name": "return",
                    "type": "string"
                  }
                }
              ],
              "desc": "<p>Generates a random <a href=\"https://www.rfc-editor.org/rfc/rfc4122.txt\">RFC 4122</a> version 4 UUID. The UUID is generated using a\ncryptographic pseudorandom number generator.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `CryptoKey`",
          "name": "CryptoKey",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": []
          },
          "properties": [
            {
              "textRaw": "Type: {KeyAlgorithm|RsaHashedKeyAlgorithm|EcKeyAlgorithm|AesKeyAlgorithm|HmacKeyAlgorithm}",
              "name": "algorithm",
              "type": "KeyAlgorithm|RsaHashedKeyAlgorithm|EcKeyAlgorithm|AesKeyAlgorithm|HmacKeyAlgorithm",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An object detailing the algorithm for which the key can be used along with\nadditional algorithm-specific parameters.</p>\n<p>Read-only.</p>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "extractable",
              "type": "boolean",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>When <code>true</code>, the <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> can be extracted using either <a href=\"#subtleexportkeyformat-key\"><code>subtle.exportKey()</code></a> or <a href=\"#subtlewrapkeyformat-key-wrappingkey-wrapalgorithm\"><code>subtle.wrapKey()</code></a>.</p>\n<p>Read-only.</p>"
            },
            {
              "textRaw": "Type: {string} One of `'secret'`, `'private'`, or `'public'`.",
              "name": "type",
              "type": "string",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>A string identifying whether the key is a symmetric (<code>'secret'</code>) or\nasymmetric (<code>'private'</code> or <code>'public'</code>) key.</p>",
              "shortDesc": "One of `'secret'`, `'private'`, or `'public'`."
            },
            {
              "textRaw": "Type: {string[]}",
              "name": "usages",
              "type": "string[]",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "<p>An array of strings identifying the operations for which the\nkey may be used.</p>\n<p>The possible usages are:</p>\n<ul>\n<li><code>'encrypt'</code> - Enable using the key with <a href=\"#subtleencryptalgorithm-key-data\"><code>subtle.encrypt()</code></a></li>\n<li><code>'decrypt'</code> - Enable using the key with <a href=\"#subtledecryptalgorithm-key-data\"><code>subtle.decrypt()</code></a></li>\n<li><code>'sign'</code> - Enable using the key with <a href=\"#subtlesignalgorithm-key-data\"><code>subtle.sign()</code></a></li>\n<li><code>'verify'</code> - Enable using the key with <a href=\"#subtleverifyalgorithm-key-signature-data\"><code>subtle.verify()</code></a></li>\n<li><code>'deriveKey'</code> - Enable using the key with <a href=\"#subtlederivekeyalgorithm-basekey-derivedkeytype-extractable-keyusages\"><code>subtle.deriveKey()</code></a></li>\n<li><code>'deriveBits'</code> - Enable using the key with <a href=\"#subtlederivebitsalgorithm-basekey-length\"><code>subtle.deriveBits()</code></a></li>\n<li><code>'encapsulateBits'</code> - Enable using the key with <a href=\"#subtleencapsulatebitsencapsulationalgorithm-encapsulationkey\"><code>subtle.encapsulateBits()</code></a></li>\n<li><code>'decapsulateBits'</code> - Enable using the key with <a href=\"#subtledecapsulatebitsdecapsulationalgorithm-decapsulationkey-ciphertext\"><code>subtle.decapsulateBits()</code></a></li>\n<li><code>'encapsulateKey'</code> - Enable using the key with <a href=\"#subtleencapsulatekeyencapsulationalgorithm-encapsulationkey-sharedkeyalgorithm-extractable-keyusages\"><code>subtle.encapsulateKey()</code></a></li>\n<li><code>'decapsulateKey'</code> - Enable using the key with <a href=\"#subtledecapsulatekeydecapsulationalgorithm-decapsulationkey-ciphertext-sharedkeyalgorithm-extractable-keyusages\"><code>subtle.decapsulateKey()</code></a></li>\n<li><code>'wrapKey'</code> - Enable using the key with <a href=\"#subtlewrapkeyformat-key-wrappingkey-wrapalgorithm\"><code>subtle.wrapKey()</code></a></li>\n<li><code>'unwrapKey'</code> - Enable using the key with <a href=\"#subtleunwrapkeyformat-wrappedkey-unwrappingkey-unwrapalgorithm-unwrappedkeyalgorithm-extractable-keyusages\"><code>subtle.unwrapKey()</code></a></li>\n</ul>\n<p>Valid key usages depend on the key algorithm (identified by\n<code>cryptokey.algorithm.name</code>).</p>\n<p><strong>Column Legend:</strong></p>\n<ul>\n<li><strong>Encryption</strong>: <a href=\"#subtleencryptalgorithm-key-data\"><code>subtle.encrypt()</code></a> / <a href=\"#subtledecryptalgorithm-key-data\"><code>subtle.decrypt()</code></a></li>\n<li><strong>Signatures and MAC</strong>: <a href=\"#subtlesignalgorithm-key-data\"><code>subtle.sign()</code></a> / <a href=\"#subtleverifyalgorithm-key-signature-data\"><code>subtle.verify()</code></a></li>\n<li><strong>Key or Bits Derivation</strong>: <a href=\"#subtlederivebitsalgorithm-basekey-length\"><code>subtle.deriveBits()</code></a> / <a href=\"#subtlederivekeyalgorithm-basekey-derivedkeytype-extractable-keyusages\"><code>subtle.deriveKey()</code></a></li>\n<li><strong>Key Wrapping</strong>: <a href=\"#subtlewrapkeyformat-key-wrappingkey-wrapalgorithm\"><code>subtle.wrapKey()</code></a> / <a href=\"#subtleunwrapkeyformat-wrappedkey-unwrappingkey-unwrapalgorithm-unwrappedkeyalgorithm-extractable-keyusages\"><code>subtle.unwrapKey()</code></a></li>\n<li><strong>Key Encapsulation</strong>: <a href=\"#subtleencapsulatebitsencapsulationalgorithm-encapsulationkey\"><code>subtle.encapsulateBits()</code></a> / <a href=\"#subtledecapsulatebitsdecapsulationalgorithm-decapsulationkey-ciphertext\"><code>subtle.decapsulateBits()</code></a> /\n<a href=\"#subtleencapsulatekeyencapsulationalgorithm-encapsulationkey-sharedkeyalgorithm-extractable-keyusages\"><code>subtle.encapsulateKey()</code></a> / <a href=\"#subtledecapsulatekeydecapsulationalgorithm-decapsulationkey-ciphertext-sharedkeyalgorithm-extractable-keyusages\"><code>subtle.decapsulateKey()</code></a></li>\n</ul>\n<table>\n<thead>\n<tr>\n<th>Supported Key Algorithm</th>\n<th>Encryption</th>\n<th>Signatures and MAC</th>\n<th>Key or Bits Derivation</th>\n<th>Key Wrapping</th>\n<th>Key Encapsulation</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'AES-CBC'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-CTR'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-GCM'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-KW'</code></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-OCB'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2d'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2i'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2id'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ECDH'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ECDSA'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Ed25519'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'HKDF'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'HMAC'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'PBKDF2'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSA-OAEP'</code></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSA-PSS'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSASSA-PKCS1-v1_5'</code></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'X25519'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>"
            }
          ]
        },
        {
          "textRaw": "Class: `CryptoKeyPair`",
          "name": "CryptoKeyPair",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>CryptoKeyPair</code> is a simple dictionary object with <code>publicKey</code> and\n<code>privateKey</code> properties, representing an asymmetric key pair.</p>",
          "properties": [
            {
              "textRaw": "Type: {CryptoKey} A {CryptoKey} whose `type` will be `'private'`.",
              "name": "privateKey",
              "type": "CryptoKey",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "A {CryptoKey} whose `type` will be `'private'`."
            },
            {
              "textRaw": "Type: {CryptoKey} A {CryptoKey} whose `type` will be `'public'`.",
              "name": "publicKey",
              "type": "CryptoKey",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": []
              },
              "desc": "A {CryptoKey} whose `type` will be `'public'`."
            }
          ]
        },
        {
          "textRaw": "Class: `SubtleCrypto`",
          "name": "SubtleCrypto",
          "type": "class",
          "meta": {
            "added": [
              "v15.0.0"
            ],
            "changes": []
          },
          "classMethods": [
            {
              "textRaw": "Static method: `SubtleCrypto.supports(operation, algorithm[, lengthOrAdditionalAlgorithm])`",
              "name": "supports",
              "type": "classMethod",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`operation` {string} \"encrypt\", \"decrypt\", \"sign\", \"verify\", \"digest\", \"generateKey\", \"deriveKey\", \"deriveBits\", \"importKey\", \"exportKey\", \"getPublicKey\", \"wrapKey\", \"unwrapKey\", \"encapsulateBits\", \"encapsulateKey\", \"decapsulateBits\", or \"decapsulateKey\"",
                      "name": "operation",
                      "type": "string",
                      "desc": "\"encrypt\", \"decrypt\", \"sign\", \"verify\", \"digest\", \"generateKey\", \"deriveKey\", \"deriveBits\", \"importKey\", \"exportKey\", \"getPublicKey\", \"wrapKey\", \"unwrapKey\", \"encapsulateBits\", \"encapsulateKey\", \"decapsulateBits\", or \"decapsulateKey\""
                    },
                    {
                      "textRaw": "`algorithm` {string|Algorithm}",
                      "name": "algorithm",
                      "type": "string|Algorithm"
                    },
                    {
                      "textRaw": "`lengthOrAdditionalAlgorithm` {null|number|string|Algorithm|undefined} Depending on the operation this is either ignored, the value of the length argument when operation is \"deriveBits\", the algorithm of key to be derived when operation is \"deriveKey\", the algorithm of key to be exported before wrapping when operation is \"wrapKey\", the algorithm of key to be imported after unwrapping when operation is \"unwrapKey\", or the algorithm of key to be imported after en/decapsulating a key when operation is \"encapsulateKey\" or \"decapsulateKey\". **Default:** `null` when operation is \"deriveBits\", `undefined` otherwise.",
                      "name": "lengthOrAdditionalAlgorithm",
                      "type": "null|number|string|Algorithm|undefined",
                      "default": "`null` when operation is \"deriveBits\", `undefined` otherwise",
                      "desc": "Depending on the operation this is either ignored, the value of the length argument when operation is \"deriveBits\", the algorithm of key to be derived when operation is \"deriveKey\", the algorithm of key to be exported before wrapping when operation is \"wrapKey\", the algorithm of key to be imported after unwrapping when operation is \"unwrapKey\", or the algorithm of key to be imported after en/decapsulating a key when operation is \"encapsulateKey\" or \"decapsulateKey\".",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean} Indicating whether the implementation supports the given operation",
                    "name": "return",
                    "type": "boolean",
                    "desc": "Indicating whether the implementation supports the given operation"
                  }
                }
              ],
              "desc": "<p>Allows feature detection in Web Crypto API,\nwhich can be used to detect whether a given algorithm identifier\n(including its parameters) is supported for the given operation.</p>\n<p>See <a href=\"#checking-for-runtime-algorithm-support\">Checking for runtime algorithm support</a> for an example use of this method.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`subtle.decapsulateBits(decapsulationAlgorithm, decapsulationKey, ciphertext)`",
              "name": "decapsulateBits",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`decapsulationAlgorithm` {string|Algorithm}",
                      "name": "decapsulationAlgorithm",
                      "type": "string|Algorithm"
                    },
                    {
                      "textRaw": "`decapsulationKey` {CryptoKey}",
                      "name": "decapsulationKey",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`ciphertext` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "ciphertext",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with {ArrayBuffer} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with {ArrayBuffer} upon success."
                  }
                }
              ],
              "desc": "<p>A message recipient uses their asymmetric private key to decrypt an\n\"encapsulated key\" (ciphertext), thereby recovering a temporary symmetric\nkey (represented as <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>) which is then used to decrypt a message.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.decapsulateKey(decapsulationAlgorithm, decapsulationKey, ciphertext, sharedKeyAlgorithm, extractable, keyUsages)`",
              "name": "decapsulateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`decapsulationAlgorithm` {string|Algorithm}",
                      "name": "decapsulationAlgorithm",
                      "type": "string|Algorithm"
                    },
                    {
                      "textRaw": "`decapsulationKey` {CryptoKey}",
                      "name": "decapsulationKey",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`ciphertext` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "ciphertext",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    },
                    {
                      "textRaw": "`sharedKeyAlgorithm` {string|Algorithm|HmacImportParams|AesDerivedKeyParams}",
                      "name": "sharedKeyAlgorithm",
                      "type": "string|Algorithm|HmacImportParams|AesDerivedKeyParams"
                    },
                    {
                      "textRaw": "`extractable` {boolean}",
                      "name": "extractable",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`keyUsages` {string[]} See Key usages.",
                      "name": "keyUsages",
                      "type": "string[]",
                      "desc": "See Key usages."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with {CryptoKey} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with {CryptoKey} upon success."
                  }
                }
              ],
              "desc": "<p>A message recipient uses their asymmetric private key to decrypt an\n\"encapsulated key\" (ciphertext), thereby recovering a temporary symmetric\nkey (represented as <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>) which is then used to decrypt a message.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.decrypt(algorithm, key, data)`",
              "name": "decrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59539",
                    "description": "AES-OCB algorithm is now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ChaCha20-Poly1305 algorithm is now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {RsaOaepParams|AesCtrParams|AesCbcParams}",
                      "name": "algorithm",
                      "type": "RsaOaepParams|AesCtrParams|AesCbcParams"
                    },
                    {
                      "textRaw": "`key` {CryptoKey}",
                      "name": "key",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "data",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {ArrayBuffer} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {ArrayBuffer} upon success."
                  }
                }
              ],
              "desc": "<p>Using the method and parameters specified in <code>algorithm</code> and the keying\nmaterial provided by <code>key</code>, this method attempts to decipher the\nprovided <code>data</code>. If successful, the returned promise will be resolved with\nan <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> containing the plaintext result.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'AES-CBC'</code></li>\n<li><code>'AES-CTR'</code></li>\n<li><code>'AES-GCM'</code></li>\n<li><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'RSA-OAEP'</code></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.deriveBits(algorithm, baseKey[, length])`",
              "name": "deriveBits",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59544",
                    "description": "Argon2 algorithms are now supported."
                  },
                  {
                    "version": [
                      "v22.5.0",
                      "v20.17.0",
                      "v18.20.5"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/53601",
                    "description": "The length parameter is now optional for `'ECDH'`, `'X25519'`, and `'X448'`."
                  },
                  {
                    "version": [
                      "v18.4.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42507",
                    "description": "Added `'X25519'`, and `'X448'` algorithms."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params}",
                      "name": "algorithm",
                      "type": "EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params"
                    },
                    {
                      "textRaw": "`baseKey` {CryptoKey}",
                      "name": "baseKey",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`length` {number|null} **Default:** `null`",
                      "name": "length",
                      "type": "number|null",
                      "default": "`null`",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {ArrayBuffer} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {ArrayBuffer} upon success."
                  }
                }
              ],
              "desc": "<p>Using the method and parameters specified in <code>algorithm</code> and the keying\nmaterial provided by <code>baseKey</code>, this method attempts to generate\n<code>length</code> bits.</p>\n<p>When <code>length</code> is not provided or <code>null</code> the maximum number of bits for a given\nalgorithm is generated. This is allowed for the <code>'ECDH'</code>, <code>'X25519'</code>, and <code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup>\nalgorithms, for other algorithms <code>length</code> is required to be a number.</p>\n<p>If successful, the returned promise will be resolved with an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>\ncontaining the generated data.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'Argon2d'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'Argon2i'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'Argon2id'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ECDH'</code></li>\n<li><code>'HKDF'</code></li>\n<li><code>'PBKDF2'</code></li>\n<li><code>'X25519'</code></li>\n<li><code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.deriveKey(algorithm, baseKey, derivedKeyType, extractable, keyUsages)`",
              "name": "deriveKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59544",
                    "description": "Argon2 algorithms are now supported."
                  },
                  {
                    "version": [
                      "v18.4.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42507",
                    "description": "Added `'X25519'`, and `'X448'` algorithms."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params}",
                      "name": "algorithm",
                      "type": "EcdhKeyDeriveParams|HkdfParams|Pbkdf2Params"
                    },
                    {
                      "textRaw": "`baseKey` {CryptoKey}",
                      "name": "baseKey",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`derivedKeyType` {string|Algorithm|HmacImportParams|AesDerivedKeyParams}",
                      "name": "derivedKeyType",
                      "type": "string|Algorithm|HmacImportParams|AesDerivedKeyParams"
                    },
                    {
                      "textRaw": "`extractable` {boolean}",
                      "name": "extractable",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`keyUsages` {string[]} See Key usages.",
                      "name": "keyUsages",
                      "type": "string[]",
                      "desc": "See Key usages."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {CryptoKey} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {CryptoKey} upon success."
                  }
                }
              ],
              "desc": "<p>Using the method and parameters specified in <code>algorithm</code>, and the keying\nmaterial provided by <code>baseKey</code>, this method attempts to generate\na new <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> based on the method and parameters in <code>derivedKeyType</code>.</p>\n<p>Calling this method is equivalent to calling <a href=\"#subtlederivebitsalgorithm-basekey-length\"><code>subtle.deriveBits()</code></a> to\ngenerate raw keying material, then passing the result into the\n<a href=\"#subtleimportkeyformat-keydata-algorithm-extractable-keyusages\"><code>subtle.importKey()</code></a> method using the <code>derivedKeyType</code>, <code>extractable</code>, and\n<code>keyUsages</code> parameters as input.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'Argon2d'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'Argon2i'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'Argon2id'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ECDH'</code></li>\n<li><code>'HKDF'</code></li>\n<li><code>'PBKDF2'</code></li>\n<li><code>'X25519'</code></li>\n<li><code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.digest(algorithm, data)`",
              "name": "digest",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v25.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62183",
                    "description": "TurboSHAKE and KangarooTwelve algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "SHA-3 algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "SHAKE algorithms are now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|Algorithm}",
                      "name": "algorithm",
                      "type": "string|Algorithm"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "data",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {ArrayBuffer} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {ArrayBuffer} upon success."
                  }
                }
              ],
              "desc": "<p>Using the method identified by <code>algorithm</code>, this method attempts to\ngenerate a digest of <code>data</code>. If successful, the returned promise is resolved\nwith an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> containing the computed digest.</p>\n<p>If <code>algorithm</code> is provided as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a>, it must be one of:</p>\n<ul>\n<li><code>'cSHAKE128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'cSHAKE256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'KT128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'KT256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA-1'</code></li>\n<li><code>'SHA-256'</code></li>\n<li><code>'SHA-384'</code></li>\n<li><code>'SHA-512'</code></li>\n<li><code>'SHA3-256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-384'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'SHA3-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'TurboSHAKE128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'TurboSHAKE256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>If <code>algorithm</code> is provided as an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a>, it must have a <code>name</code> property\nwhose value is one of the above.</p>"
            },
            {
              "textRaw": "`subtle.encapsulateBits(encapsulationAlgorithm, encapsulationKey)`",
              "name": "encapsulateBits",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encapsulationAlgorithm` {string|Algorithm}",
                      "name": "encapsulationAlgorithm",
                      "type": "string|Algorithm"
                    },
                    {
                      "textRaw": "`encapsulationKey` {CryptoKey}",
                      "name": "encapsulationKey",
                      "type": "CryptoKey"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with {EncapsulatedBits} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with {EncapsulatedBits} upon success."
                  }
                }
              ],
              "desc": "<p>Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.\nThis encrypted key is the \"encapsulated key\" represented as {EncapsulatedBits}.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.encapsulateKey(encapsulationAlgorithm, encapsulationKey, sharedKeyAlgorithm, extractable, keyUsages)`",
              "name": "encapsulateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`encapsulationAlgorithm` {string|Algorithm}",
                      "name": "encapsulationAlgorithm",
                      "type": "string|Algorithm"
                    },
                    {
                      "textRaw": "`encapsulationKey` {CryptoKey}",
                      "name": "encapsulationKey",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`sharedKeyAlgorithm` {string|Algorithm|HmacImportParams|AesDerivedKeyParams}",
                      "name": "sharedKeyAlgorithm",
                      "type": "string|Algorithm|HmacImportParams|AesDerivedKeyParams"
                    },
                    {
                      "textRaw": "`extractable` {boolean}",
                      "name": "extractable",
                      "type": "boolean"
                    },
                    {
                      "textRaw": "`keyUsages` {string[]} See Key usages.",
                      "name": "keyUsages",
                      "type": "string[]",
                      "desc": "See Key usages."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with {EncapsulatedKey} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with {EncapsulatedKey} upon success."
                  }
                }
              ],
              "desc": "<p>Uses a message recipient's asymmetric public key to encrypt a temporary symmetric key.\nThis encrypted key is the \"encapsulated key\" represented as {EncapsulatedKey}.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.encrypt(algorithm, key, data)`",
              "name": "encrypt",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59539",
                    "description": "AES-OCB algorithm is now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ChaCha20-Poly1305 algorithm is now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {RsaOaepParams|AesCtrParams|AesCbcParams}",
                      "name": "algorithm",
                      "type": "RsaOaepParams|AesCtrParams|AesCbcParams"
                    },
                    {
                      "textRaw": "`key` {CryptoKey}",
                      "name": "key",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "data",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {ArrayBuffer} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {ArrayBuffer} upon success."
                  }
                }
              ],
              "desc": "<p>Using the method and parameters specified by <code>algorithm</code> and the keying\nmaterial provided by <code>key</code>, this method attempts to encipher <code>data</code>.\nIf successful, the returned promise is resolved with an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>\ncontaining the encrypted result.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'AES-CBC'</code></li>\n<li><code>'AES-CTR'</code></li>\n<li><code>'AES-GCM'</code></li>\n<li><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'RSA-OAEP'</code></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.exportKey(format, key)`",
              "name": "exportKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62706",
                    "description": "Added JWK format support for ML-KEM key types."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59647",
                    "description": "KMAC algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59569",
                    "description": "ML-KEM algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ChaCha20-Poly1305 algorithm is now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ML-DSA algorithms are now supported."
                  },
                  {
                    "version": [
                      "v18.4.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42507",
                    "description": "Added `'Ed25519'`, `'Ed448'`, `'X25519'`, and `'X448'` algorithms."
                  },
                  {
                    "version": "v15.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37203",
                    "description": "Removed `'NODE-DSA'` JWK export."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`format` {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, `'raw-public'`, or `'raw-seed'`.",
                      "name": "format",
                      "type": "string",
                      "desc": "Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, `'raw-public'`, or `'raw-seed'`."
                    },
                    {
                      "textRaw": "`key` {CryptoKey}",
                      "name": "key",
                      "type": "CryptoKey"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {ArrayBuffer|Object} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {ArrayBuffer|Object} upon success."
                  }
                }
              ],
              "desc": "<p>Exports the given key into the specified format, if supported.</p>\n<p>If the <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> is not extractable, the returned promise will reject.</p>\n<p>When <code>format</code> is either <code>'pkcs8'</code> or <code>'spki'</code> and the export is successful,\nthe returned promise will be resolved with an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> containing the\nexported key data.</p>\n<p>When <code>format</code> is <code>'jwk'</code> and the export is successful, the returned promise\nwill be resolved with a JavaScript object conforming to the <a href=\"https://tools.ietf.org/html/rfc7517\">JSON Web Key</a>\nspecification.</p>\n<table>\n<thead>\n<tr>\n<th>Supported Key Algorithm</th>\n<th><code>'spki'</code></th>\n<th><code>'pkcs8'</code></th>\n<th><code>'jwk'</code></th>\n<th><code>'raw'</code></th>\n<th><code>'raw-secret'</code></th>\n<th><code>'raw-public'</code></th>\n<th><code>'raw-seed'</code></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'AES-CBC'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-CTR'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-GCM'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-KW'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ECDH'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ECDSA'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Ed25519'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'HMAC'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-10\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'RSA-OAEP'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSA-PSS'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSASSA-PKCS1-v1_5'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>"
            },
            {
              "textRaw": "`subtle.getPublicKey(key, keyUsages)`",
              "name": "getPublicKey",
              "type": "method",
              "meta": {
                "added": [
                  "v24.7.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`key` {CryptoKey} A private key from which to derive the corresponding public key.",
                      "name": "key",
                      "type": "CryptoKey",
                      "desc": "A private key from which to derive the corresponding public key."
                    },
                    {
                      "textRaw": "`keyUsages` {string[]} See Key usages.",
                      "name": "keyUsages",
                      "type": "string[]",
                      "desc": "See Key usages."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {CryptoKey} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {CryptoKey} upon success."
                  }
                }
              ],
              "desc": "<p>Derives the public key from a given private key.</p>"
            },
            {
              "textRaw": "`subtle.generateKey(algorithm, extractable, keyUsages)`",
              "name": "generateKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59647",
                    "description": "KMAC algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59569",
                    "description": "ML-KEM algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ChaCha20-Poly1305 algorithm is now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ML-DSA algorithms are now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|Algorithm|RsaHashedKeyGenParams|EcKeyGenParams|HmacKeyGenParams|AesKeyGenParams}",
                      "name": "algorithm",
                      "type": "string|Algorithm|RsaHashedKeyGenParams|EcKeyGenParams|HmacKeyGenParams|AesKeyGenParams"
                    },
                    {
                      "name": "extractable"
                    },
                    {
                      "name": "keyUsages"
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>extractable</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>keyUsages</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> See <a href=\"#cryptokeyusages\">Key usages</a>.</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> Fulfills with a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> | <a href=\"webcrypto.html#class-cryptokeypair\"><code>&#x3C;CryptoKeyPair></code></a> upon success.</li>\n</ul>\n<p>Using the parameters provided in <code>algorithm</code>, this method\nattempts to generate new keying material. Depending on the algorithm used\neither a single <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> or a <a href=\"webcrypto.html#class-cryptokeypair\"><code>&#x3C;CryptoKeyPair></code></a> is generated.</p>\n<p>The <a href=\"webcrypto.html#class-cryptokeypair\"><code>&#x3C;CryptoKeyPair></code></a> (public and private key) generating algorithms supported\ninclude:</p>\n<ul>\n<li><code>'ECDH'</code></li>\n<li><code>'ECDSA'</code></li>\n<li><code>'Ed25519'</code></li>\n<li><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-6\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'RSA-OAEP'</code></li>\n<li><code>'RSA-PSS'</code></li>\n<li><code>'RSASSA-PKCS1-v1_5'</code></li>\n<li><code>'X25519'</code></li>\n<li><code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n</ul>\n<p>The <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> (secret key) generating algorithms supported include:</p>\n<ul>\n<li><code>'AES-CBC'</code></li>\n<li><code>'AES-CTR'</code></li>\n<li><code>'AES-GCM'</code></li>\n<li><code>'AES-KW'</code></li>\n<li><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-7\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-8\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'HMAC'</code></li>\n<li><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-9\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-10\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.importKey(format, keyData, algorithm, extractable, keyUsages)`",
              "name": "importKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v26.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62706",
                    "description": "Added JWK format support for ML-KEM key types."
                  },
                  {
                    "version": "v25.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/62218",
                    "description": "Importing ML-DSA and ML-KEM PKCS#8 keys without a seed is no longer supported."
                  },
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59647",
                    "description": "KMAC algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59569",
                    "description": "ML-KEM algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ChaCha20-Poly1305 algorithm is now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ML-DSA algorithms are now supported."
                  },
                  {
                    "version": [
                      "v18.4.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42507",
                    "description": "Added `'Ed25519'`, `'Ed448'`, `'X25519'`, and `'X448'` algorithms."
                  },
                  {
                    "version": "v15.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/37203",
                    "description": "Removed `'NODE-DSA'` JWK import."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`format` {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, `'raw-public'`, or `'raw-seed'`.",
                      "name": "format",
                      "type": "string",
                      "desc": "Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, `'raw-public'`, or `'raw-seed'`."
                    },
                    {
                      "textRaw": "`keyData` {ArrayBuffer|TypedArray|DataView|Buffer|Object}",
                      "name": "keyData",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer|Object"
                    },
                    {
                      "name": "algorithm"
                    },
                    {
                      "name": "extractable"
                    },
                    {
                      "name": "keyUsages"
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>algorithm</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a> | <a href=\"webcrypto.html#class-rsahashedimportparams\"><code>&#x3C;RsaHashedImportParams></code></a> | <a href=\"webcrypto.html#class-eckeyimportparams\"><code>&#x3C;EcKeyImportParams></code></a> | <a href=\"webcrypto.html#class-hmacimportparams\"><code>&#x3C;HmacImportParams></code></a></li>\n</ul>\n<ul>\n<li><code>extractable</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>keyUsages</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> See <a href=\"#cryptokeyusages\">Key usages</a>.</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> Fulfills with a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> upon success.</li>\n</ul>\n<p>This method attempts to interpret the provided <code>keyData</code>\nas the given <code>format</code> to create a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> instance using the provided <code>algorithm</code>, <code>extractable</code>, and <code>keyUsages</code> arguments. If the import is\nsuccessful, the returned promise will be resolved with a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>\nrepresentation of the key material.</p>\n<p>If importing KDF algorithm keys, <code>extractable</code> must be <code>false</code>.</p>\n<p>The algorithms currently supported include:</p>\n<table>\n<thead>\n<tr>\n<th>Supported Key Algorithm</th>\n<th><code>'spki'</code></th>\n<th><code>'pkcs8'</code></th>\n<th><code>'jwk'</code></th>\n<th><code>'raw'</code></th>\n<th><code>'raw-secret'</code></th>\n<th><code>'raw-public'</code></th>\n<th><code>'raw-seed'</code></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>'AES-CBC'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-CTR'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-GCM'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-KW'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2d'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2i'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Argon2id'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ECDH'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ECDSA'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Ed25519'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'HKDF'</code></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'HMAC'</code></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-10\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-11\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-12\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-13\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n</tr>\n<tr>\n<td><code>'PBKDF2'</code></td>\n<td></td>\n<td></td>\n<td></td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSA-OAEP'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSA-PSS'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'RSASSA-PKCS1-v1_5'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td></td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td><code>'X25519'</code></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n<tr>\n<td><code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td>✔</td>\n<td></td>\n<td>✔</td>\n<td></td>\n</tr>\n</tbody>\n</table>"
            },
            {
              "textRaw": "`subtle.sign(algorithm, key, data)`",
              "name": "sign",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59647",
                    "description": "KMAC algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ML-DSA algorithms are now supported."
                  },
                  {
                    "version": [
                      "v18.4.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42507",
                    "description": "Added `'Ed25519'`, and `'Ed448'` algorithms."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|Algorithm|RsaPssParams|EcdsaParams}",
                      "name": "algorithm",
                      "type": "string|Algorithm|RsaPssParams|EcdsaParams"
                    },
                    {
                      "textRaw": "`key` {CryptoKey}",
                      "name": "key",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "data",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {ArrayBuffer} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {ArrayBuffer} upon success."
                  }
                }
              ],
              "desc": "<p>Using the method and parameters given by <code>algorithm</code> and the keying material\nprovided by <code>key</code>, this method attempts to generate a cryptographic\nsignature of <code>data</code>. If successful, the returned promise is resolved with\nan <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> containing the generated signature.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'ECDSA'</code></li>\n<li><code>'Ed25519'</code></li>\n<li><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'HMAC'</code></li>\n<li><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'RSA-PSS'</code></li>\n<li><code>'RSASSA-PKCS1-v1_5'</code></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgorithm, unwrappedKeyAlgorithm, extractable, keyUsages)`",
              "name": "unwrapKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59539",
                    "description": "AES-OCB algorithm is now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ChaCha20-Poly1305 algorithm is now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`format` {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, `'raw-public'`, or `'raw-seed'`.",
                      "name": "format",
                      "type": "string",
                      "desc": "Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, `'raw-public'`, or `'raw-seed'`."
                    },
                    {
                      "textRaw": "`wrappedKey` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "wrappedKey",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    },
                    {
                      "textRaw": "`unwrappingKey` {CryptoKey}",
                      "name": "unwrappingKey",
                      "type": "CryptoKey"
                    },
                    {
                      "name": "unwrapAlgorithm"
                    },
                    {
                      "name": "unwrappedKeyAlgorithm"
                    },
                    {
                      "name": "extractable"
                    },
                    {
                      "name": "keyUsages"
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>unwrapAlgorithm</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a> | <a href=\"webcrypto.html#class-rsaoaepparams\"><code>&#x3C;RsaOaepParams></code></a> | <a href=\"webcrypto.html#class-aesctrparams\"><code>&#x3C;AesCtrParams></code></a> | <a href=\"webcrypto.html#class-aescbcparams\"><code>&#x3C;AesCbcParams></code></a></li>\n<li><code>unwrappedKeyAlgorithm</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"webcrypto.html#class-algorithm\"><code>&#x3C;Algorithm></code></a> | <a href=\"webcrypto.html#class-rsahashedimportparams\"><code>&#x3C;RsaHashedImportParams></code></a> | <a href=\"webcrypto.html#class-eckeyimportparams\"><code>&#x3C;EcKeyImportParams></code></a> | <a href=\"webcrypto.html#class-hmacimportparams\"><code>&#x3C;HmacImportParams></code></a></li>\n</ul>\n<ul>\n<li><code>extractable</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>keyUsages</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string[]></code></a> See <a href=\"#cryptokeyusages\">Key usages</a>.</li>\n<li>Returns: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise\"><code>&#x3C;Promise></code></a> Fulfills with a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> upon success.</li>\n</ul>\n<p>In cryptography, \"wrapping a key\" refers to exporting and then encrypting the\nkeying material. This method attempts to decrypt a wrapped\nkey and create a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> instance. It is equivalent to calling <a href=\"#subtledecryptalgorithm-key-data\"><code>subtle.decrypt()</code></a> first on the encrypted key data (using the <code>wrappedKey</code>,\n<code>unwrapAlgorithm</code>, and <code>unwrappingKey</code> arguments as input) then passing the results\nto the <a href=\"#subtleimportkeyformat-keydata-algorithm-extractable-keyusages\"><code>subtle.importKey()</code></a> method using the <code>unwrappedKeyAlgorithm</code>,\n<code>extractable</code>, and <code>keyUsages</code> arguments as inputs. If successful, the returned\npromise is resolved with a <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a> object.</p>\n<p>The wrapping algorithms currently supported include:</p>\n<ul>\n<li><code>'AES-CBC'</code></li>\n<li><code>'AES-CTR'</code></li>\n<li><code>'AES-GCM'</code></li>\n<li><code>'AES-KW'</code></li>\n<li><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'RSA-OAEP'</code></li>\n</ul>\n<p>The unwrapped key algorithms supported include:</p>\n<ul>\n<li><code>'AES-CBC'</code></li>\n<li><code>'AES-CTR'</code></li>\n<li><code>'AES-GCM'</code></li>\n<li><code>'AES-KW'</code></li>\n<li><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ECDH'</code></li>\n<li><code>'ECDSA'</code></li>\n<li><code>'Ed25519'</code></li>\n<li><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'HMAC'</code></li>\n<li><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-6\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-7\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-8\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-9\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-512'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-10\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-768'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-11\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ML-KEM-1024'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-12\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'RSA-OAEP'</code></li>\n<li><code>'RSA-PSS'</code></li>\n<li><code>'RSASSA-PKCS1-v1_5'</code></li>\n<li><code>'X25519'</code></li>\n<li><code>'X448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.verify(algorithm, key, signature, data)`",
              "name": "verify",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.8.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59647",
                    "description": "KMAC algorithms are now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ML-DSA algorithms are now supported."
                  },
                  {
                    "version": [
                      "v18.4.0",
                      "v16.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/42507",
                    "description": "Added `'Ed25519'`, and `'Ed448'` algorithms."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`algorithm` {string|Algorithm|RsaPssParams|EcdsaParams}",
                      "name": "algorithm",
                      "type": "string|Algorithm|RsaPssParams|EcdsaParams"
                    },
                    {
                      "textRaw": "`key` {CryptoKey}",
                      "name": "key",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`signature` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "signature",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    },
                    {
                      "textRaw": "`data` {ArrayBuffer|TypedArray|DataView|Buffer}",
                      "name": "data",
                      "type": "ArrayBuffer|TypedArray|DataView|Buffer"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with a {boolean} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with a {boolean} upon success."
                  }
                }
              ],
              "desc": "<p>Using the method and parameters given in <code>algorithm</code> and the keying material\nprovided by <code>key</code>, this method attempts to verify that <code>signature</code> is\na valid cryptographic signature of <code>data</code>. The returned promise is resolved\nwith either <code>true</code> or <code>false</code>.</p>\n<p>The algorithms currently supported include:</p>\n<ul>\n<li><code>'ECDSA'</code></li>\n<li><code>'Ed25519'</code></li>\n<li><code>'Ed448'</code><sup><a href=\"#user-content-fn-secure-curves\" id=\"user-content-fnref-secure-curves\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'HMAC'</code></li>\n<li><code>'KMAC128'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'KMAC256'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-DSA-44'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-3\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-DSA-65'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-4\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'ML-DSA-87'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-5\" data-footnote-ref aria-describedby=\"footnote-label\">2</a></sup></li>\n<li><code>'RSA-PSS'</code></li>\n<li><code>'RSASSA-PKCS1-v1_5'</code></li>\n</ul>"
            },
            {
              "textRaw": "`subtle.wrapKey(format, key, wrappingKey, wrapAlgorithm)`",
              "name": "wrapKey",
              "type": "method",
              "meta": {
                "added": [
                  "v15.0.0"
                ],
                "changes": [
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59539",
                    "description": "AES-OCB algorithm is now supported."
                  },
                  {
                    "version": "v24.7.0",
                    "pr-url": "https://github.com/nodejs/node/pull/59365",
                    "description": "ChaCha20-Poly1305 algorithm is now supported."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`format` {string} Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, `'raw-public'`, or `'raw-seed'`.",
                      "name": "format",
                      "type": "string",
                      "desc": "Must be one of `'raw'`, `'pkcs8'`, `'spki'`, `'jwk'`, `'raw-secret'`, `'raw-public'`, or `'raw-seed'`."
                    },
                    {
                      "textRaw": "`key` {CryptoKey}",
                      "name": "key",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`wrappingKey` {CryptoKey}",
                      "name": "wrappingKey",
                      "type": "CryptoKey"
                    },
                    {
                      "textRaw": "`wrapAlgorithm` {string|Algorithm|RsaOaepParams|AesCtrParams|AesCbcParams}",
                      "name": "wrapAlgorithm",
                      "type": "string|Algorithm|RsaOaepParams|AesCtrParams|AesCbcParams"
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} Fulfills with an {ArrayBuffer} upon success.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Fulfills with an {ArrayBuffer} upon success."
                  }
                }
              ],
              "desc": "<p>In cryptography, \"wrapping a key\" refers to exporting and then encrypting the\nkeying material. This method exports the keying material into\nthe format identified by <code>format</code>, then encrypts it using the method and\nparameters specified by <code>wrapAlgorithm</code> and the keying material provided by\n<code>wrappingKey</code>. It is the equivalent to calling <a href=\"#subtleexportkeyformat-key\"><code>subtle.exportKey()</code></a> using\n<code>format</code> and <code>key</code> as the arguments, then passing the result to the\n<a href=\"#subtleencryptalgorithm-key-data\"><code>subtle.encrypt()</code></a> method using <code>wrappingKey</code> and <code>wrapAlgorithm</code> as inputs. If\nsuccessful, the returned promise will be resolved with an <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>\ncontaining the encrypted key data.</p>\n<p>The wrapping algorithms currently supported include:</p>\n<ul>\n<li><code>'AES-CBC'</code></li>\n<li><code>'AES-CTR'</code></li>\n<li><code>'AES-GCM'</code></li>\n<li><code>'AES-KW'</code></li>\n<li><code>'AES-OCB'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'ChaCha20-Poly1305'</code><sup><a href=\"#user-content-fn-modern-algos\" id=\"user-content-fnref-modern-algos-2\" data-footnote-ref aria-describedby=\"footnote-label\">1</a></sup></li>\n<li><code>'RSA-OAEP'</code></li>\n</ul>"
            }
          ]
        }
      ],
      "displayName": "Web Crypto API",
      "source": "doc/api/webcrypto.md"
    },
    {
      "textRaw": "Web Streams API",
      "name": "web_streams_api",
      "introduced_in": "v16.5.0",
      "type": "module",
      "meta": {
        "added": [
          "v16.5.0"
        ],
        "changes": [
          {
            "version": [
              "v21.0.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/45684",
            "description": "No longer experimental."
          },
          {
            "version": "v18.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/42225",
            "description": "Use of this API no longer emit a runtime warning."
          }
        ]
      },
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>An implementation of the <a href=\"https://streams.spec.whatwg.org/\">WHATWG Streams Standard</a>.</p>",
      "modules": [
        {
          "textRaw": "Overview",
          "name": "overview",
          "type": "module",
          "desc": "<p>The <a href=\"https://streams.spec.whatwg.org/\">WHATWG Streams Standard</a> (or \"web streams\") defines an API for handling\nstreaming data. It is similar to the Node.js <a href=\"stream.html\">Streams</a> API but emerged later\nand has become the \"standard\" API for streaming data across many JavaScript\nenvironments.</p>\n<p>There are three primary types of objects:</p>\n<ul>\n<li><code>ReadableStream</code> - Represents a source of streaming data.</li>\n<li><code>WritableStream</code> - Represents a destination for streaming data.</li>\n<li><code>TransformStream</code> - Represents an algorithm for transforming streaming data.</li>\n</ul>",
          "modules": [
            {
              "textRaw": "Example `ReadableStream`",
              "name": "example_`readablestream`",
              "type": "module",
              "desc": "<p>This example creates a simple <code>ReadableStream</code> that pushes the current\n<code>performance.now()</code> timestamp once every second forever. An async iterable\nis used to read the data from the stream.</p>\n<pre><code class=\"language-mjs\">import {\n  ReadableStream,\n} from 'node:stream/web';\n\nimport {\n  setInterval as every,\n} from 'node:timers/promises';\n\nimport {\n  performance,\n} from 'node:perf_hooks';\n\nconst SECOND = 1000;\n\nconst stream = new ReadableStream({\n  async start(controller) {\n    for await (const _ of every(SECOND))\n      controller.enqueue(performance.now());\n  },\n});\n\nfor await (const value of stream)\n  console.log(value);\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  ReadableStream,\n} = require('node:stream/web');\n\nconst {\n  setInterval: every,\n} = require('node:timers/promises');\n\nconst {\n  performance,\n} = require('node:perf_hooks');\n\nconst SECOND = 1000;\n\nconst stream = new ReadableStream({\n  async start(controller) {\n    for await (const _ of every(SECOND))\n      controller.enqueue(performance.now());\n  },\n});\n\n(async () => {\n  for await (const value of stream)\n    console.log(value);\n})();\n</code></pre>",
              "displayName": "Example `ReadableStream`"
            },
            {
              "textRaw": "Node.js streams interoperability",
              "name": "node.js_streams_interoperability",
              "type": "module",
              "desc": "<p>Node.js streams can be converted to web streams and vice versa via the <code>toWeb</code> and <code>fromWeb</code> methods present on <a href=\"stream.html#class-streamreadable\"><code>stream.Readable</code></a>, <a href=\"stream.html#class-streamwritable\"><code>stream.Writable</code></a> and <a href=\"stream.html#class-streamduplex\"><code>stream.Duplex</code></a> objects.</p>\n<p>For more details refer to the relevant documentation:</p>\n<ul>\n<li><a href=\"stream.html#streamreadabletowebstreamreadable-options\"><code>stream.Readable.toWeb</code></a></li>\n<li><a href=\"stream.html#streamreadablefromwebreadablestream-options\"><code>stream.Readable.fromWeb</code></a></li>\n<li><a href=\"stream.html#streamwritabletowebstreamwritable\"><code>stream.Writable.toWeb</code></a></li>\n<li><a href=\"stream.html#streamwritablefromwebwritablestream-options\"><code>stream.Writable.fromWeb</code></a></li>\n<li><a href=\"stream.html#streamduplextowebstreamduplex-options\"><code>stream.Duplex.toWeb</code></a></li>\n<li><a href=\"stream.html#streamduplexfromwebpair-options\"><code>stream.Duplex.fromWeb</code></a></li>\n</ul>",
              "displayName": "Node.js streams interoperability"
            }
          ],
          "displayName": "Overview"
        },
        {
          "textRaw": "API",
          "name": "api",
          "type": "module",
          "classes": [
            {
              "textRaw": "Class: `ReadableStream`",
              "name": "ReadableStream",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "signatures": [
                {
                  "textRaw": "`new ReadableStream([underlyingSource [, strategy]])`",
                  "name": "ReadableStream",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "name": "underlyingSource ",
                      "optional": true
                    },
                    {
                      "textRaw": "`strategy` {Object}",
                      "name": "strategy",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} The maximum internal queue size before backpressure is applied.",
                          "name": "highWaterMark",
                          "type": "number",
                          "desc": "The maximum internal queue size before backpressure is applied."
                        },
                        {
                          "textRaw": "`size` {Function} A user-defined function used to identify the size of each chunk of data.",
                          "name": "size",
                          "type": "Function",
                          "desc": "A user-defined function used to identify the size of each chunk of data.",
                          "options": [
                            {
                              "textRaw": "`chunk` {any}",
                              "name": "chunk",
                              "type": "any"
                            },
                            {
                              "textRaw": "Returns: {number}",
                              "name": "return",
                              "type": "number"
                            }
                          ]
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {boolean} Set to `true` if there is an active reader for this {ReadableStream}.",
                  "name": "locked",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>readableStream.locked</code> property is <code>false</code> by default, and is\nswitched to <code>true</code> while there is an active reader consuming the\nstream's data.</p>",
                  "shortDesc": "Set to `true` if there is an active reader for this {ReadableStream}."
                }
              ],
              "methods": [
                {
                  "textRaw": "`readableStream.cancel([reason])`",
                  "name": "cancel",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {any}",
                          "name": "reason",
                          "type": "any",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined` once cancelation has been completed.",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined` once cancelation has been completed."
                      }
                    }
                  ]
                },
                {
                  "textRaw": "`readableStream.getReader([options])`",
                  "name": "getReader",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`mode` {string} `'byob'` or `undefined`",
                              "name": "mode",
                              "type": "string",
                              "desc": "`'byob'` or `undefined`"
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {ReadableStreamDefaultReader|ReadableStreamBYOBReader}",
                        "name": "return",
                        "type": "ReadableStreamDefaultReader|ReadableStreamBYOBReader"
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { ReadableStream } from 'node:stream/web';\n\nconst stream = new ReadableStream();\n\nconst reader = stream.getReader();\n\nconsole.log(await reader.read());\n</code></pre>\n<pre><code class=\"language-cjs\">const { ReadableStream } = require('node:stream/web');\n\nconst stream = new ReadableStream();\n\nconst reader = stream.getReader();\n\nreader.read().then(console.log);\n</code></pre>\n<p>Causes the <code>readableStream.locked</code> to be <code>true</code>.</p>"
                },
                {
                  "textRaw": "`readableStream.pipeThrough(transform[, options])`",
                  "name": "pipeThrough",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`transform` {Object}",
                          "name": "transform",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`readable` {ReadableStream} The `ReadableStream` to which `transform.writable` will push the potentially modified data it receives from this `ReadableStream`.",
                              "name": "readable",
                              "type": "ReadableStream",
                              "desc": "The `ReadableStream` to which `transform.writable` will push the potentially modified data it receives from this `ReadableStream`."
                            },
                            {
                              "textRaw": "`writable` {WritableStream} The `WritableStream` to which this `ReadableStream`'s data will be written.",
                              "name": "writable",
                              "type": "WritableStream",
                              "desc": "The `WritableStream` to which this `ReadableStream`'s data will be written."
                            }
                          ]
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`preventAbort` {boolean} When `true`, errors in this `ReadableStream` will not cause `transform.writable` to be aborted.",
                              "name": "preventAbort",
                              "type": "boolean",
                              "desc": "When `true`, errors in this `ReadableStream` will not cause `transform.writable` to be aborted."
                            },
                            {
                              "textRaw": "`preventCancel` {boolean} When `true`, errors in the destination `transform.writable` do not cause this `ReadableStream` to be canceled.",
                              "name": "preventCancel",
                              "type": "boolean",
                              "desc": "When `true`, errors in the destination `transform.writable` do not cause this `ReadableStream` to be canceled."
                            },
                            {
                              "textRaw": "`preventClose` {boolean} When `true`, closing this `ReadableStream` does not cause `transform.writable` to be closed.",
                              "name": "preventClose",
                              "type": "boolean",
                              "desc": "When `true`, closing this `ReadableStream` does not cause `transform.writable` to be closed."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} Allows the transfer of data to be canceled using an {AbortController}.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "Allows the transfer of data to be canceled using an {AbortController}."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {ReadableStream} From `transform.readable`.",
                        "name": "return",
                        "type": "ReadableStream",
                        "desc": "From `transform.readable`."
                      }
                    }
                  ],
                  "desc": "<p>Connects this <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> to the pair of <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> and\n<a href=\"webstreams.html#class-writablestream\"><code>&#x3C;WritableStream></code></a> provided in the <code>transform</code> argument such that the\ndata from this <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> is written in to <code>transform.writable</code>,\npossibly transformed, then pushed to <code>transform.readable</code>. Once the\npipeline is configured, <code>transform.readable</code> is returned.</p>\n<p>Causes the <code>readableStream.locked</code> to be <code>true</code> while the pipe operation\nis active.</p>\n<pre><code class=\"language-mjs\">import {\n  ReadableStream,\n  TransformStream,\n} from 'node:stream/web';\n\nconst stream = new ReadableStream({\n  start(controller) {\n    controller.enqueue('a');\n  },\n});\n\nconst transform = new TransformStream({\n  transform(chunk, controller) {\n    controller.enqueue(chunk.toUpperCase());\n  },\n});\n\nconst transformedStream = stream.pipeThrough(transform);\n\nfor await (const chunk of transformedStream)\n  console.log(chunk);\n  // Prints: A\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  ReadableStream,\n  TransformStream,\n} = require('node:stream/web');\n\nconst stream = new ReadableStream({\n  start(controller) {\n    controller.enqueue('a');\n  },\n});\n\nconst transform = new TransformStream({\n  transform(chunk, controller) {\n    controller.enqueue(chunk.toUpperCase());\n  },\n});\n\nconst transformedStream = stream.pipeThrough(transform);\n\n(async () => {\n  for await (const chunk of transformedStream)\n    console.log(chunk);\n    // Prints: A\n})();\n</code></pre>"
                },
                {
                  "textRaw": "`readableStream.pipeTo(destination[, options])`",
                  "name": "pipeTo",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`destination` {WritableStream} A {WritableStream} to which this `ReadableStream`'s data will be written.",
                          "name": "destination",
                          "type": "WritableStream",
                          "desc": "A {WritableStream} to which this `ReadableStream`'s data will be written."
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`preventAbort` {boolean} When `true`, errors in this `ReadableStream` will not cause `destination` to be aborted.",
                              "name": "preventAbort",
                              "type": "boolean",
                              "desc": "When `true`, errors in this `ReadableStream` will not cause `destination` to be aborted."
                            },
                            {
                              "textRaw": "`preventCancel` {boolean} When `true`, errors in the `destination` will not cause this `ReadableStream` to be canceled.",
                              "name": "preventCancel",
                              "type": "boolean",
                              "desc": "When `true`, errors in the `destination` will not cause this `ReadableStream` to be canceled."
                            },
                            {
                              "textRaw": "`preventClose` {boolean} When `true`, closing this `ReadableStream` does not cause `destination` to be closed.",
                              "name": "preventClose",
                              "type": "boolean",
                              "desc": "When `true`, closing this `ReadableStream` does not cause `destination` to be closed."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} Allows the transfer of data to be canceled using an {AbortController}.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "Allows the transfer of data to be canceled using an {AbortController}."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined`",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined`"
                      }
                    }
                  ],
                  "desc": "<p>Causes the <code>readableStream.locked</code> to be <code>true</code> while the pipe operation\nis active.</p>"
                },
                {
                  "textRaw": "`readableStream.tee()`",
                  "name": "tee",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v18.10.0",
                          "v16.18.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/44505",
                        "description": "Support teeing a readable byte stream."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {ReadableStream[]}",
                        "name": "return",
                        "type": "ReadableStream[]"
                      }
                    }
                  ],
                  "desc": "<p>Returns a pair of new <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> instances to which this <code>ReadableStream</code>'s data will be forwarded. Each will receive the\nsame data.</p>\n<p>Causes the <code>readableStream.locked</code> to be <code>true</code>.</p>"
                },
                {
                  "textRaw": "`readableStream.values([options])`",
                  "name": "values",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`preventCancel` {boolean} When `true`, prevents the {ReadableStream} from being closed when the async iterator abruptly terminates. **Default**: `false`.",
                              "name": "preventCancel",
                              "type": "boolean",
                              "desc": "When `true`, prevents the {ReadableStream} from being closed when the async iterator abruptly terminates. **Default**: `false`."
                            }
                          ],
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Creates and returns an async iterator usable for consuming this\n<code>ReadableStream</code>'s data.</p>\n<p>Causes the <code>readableStream.locked</code> to be <code>true</code> while the async iterator\nis active.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst stream = new ReadableStream(getSomeSource());\n\nfor await (const chunk of stream.values({ preventCancel: true }))\n  console.log(Buffer.from(chunk).toString());\n</code></pre>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Async Iteration",
                  "name": "async_iteration",
                  "type": "module",
                  "desc": "<p>The <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> object supports the async iterator protocol using <code>for await</code> syntax.</p>\n<pre><code class=\"language-mjs\">import { Buffer } from 'node:buffer';\n\nconst stream = new ReadableStream(getSomeSource());\n\nfor await (const chunk of stream)\n  console.log(Buffer.from(chunk).toString());\n</code></pre>\n<p>The async iterator will consume the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> until it terminates.</p>\n<p>By default, if the async iterator exits early (via either a <code>break</code>,\n<code>return</code>, or a <code>throw</code>), the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> will be closed. To prevent\nautomatic closing of the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>, use the <code>readableStream.values()</code>\nmethod to acquire the async iterator and set the <code>preventCancel</code> option to\n<code>true</code>.</p>\n<p>The <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> must not be locked (that is, it must not have an existing\nactive reader). During the async iteration, the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> will be locked.</p>",
                  "displayName": "Async Iteration"
                },
                {
                  "textRaw": "Transferring with `postMessage()`",
                  "name": "transferring_with_`postmessage()`",
                  "type": "module",
                  "desc": "<p>A <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> instance can be transferred using a <a href=\"worker_threads.html#class-messageport\"><code>&#x3C;MessagePort></code></a>.</p>\n<pre><code class=\"language-js\">const stream = new ReadableStream(getReadableSourceSomehow());\n\nconst { port1, port2 } = new MessageChannel();\n\nport1.onmessage = ({ data }) => {\n  data.getReader().read().then((chunk) => {\n    console.log(chunk);\n  });\n};\n\nport2.postMessage(stream, [stream]);\n</code></pre>",
                  "displayName": "Transferring with `postMessage()`"
                }
              ]
            },
            {
              "textRaw": "Class: `ReadableStreamDefaultReader`",
              "name": "ReadableStreamDefaultReader",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "desc": "<p>By default, calling <code>readableStream.getReader()</code> with no arguments\nwill return an instance of <code>ReadableStreamDefaultReader</code>. The default\nreader treats the chunks of data passed through the stream as opaque\nvalues, which allows the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> to work with generally any\nJavaScript value.</p>",
              "signatures": [
                {
                  "textRaw": "`new ReadableStreamDefaultReader(stream)`",
                  "name": "ReadableStreamDefaultReader",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`stream` {ReadableStream}",
                      "name": "stream",
                      "type": "ReadableStream"
                    }
                  ],
                  "desc": "<p>Creates a new <a href=\"webstreams.html#class-readablestreamdefaultreader\"><code>&#x3C;ReadableStreamDefaultReader></code></a> that is locked to the\ngiven <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`readableStreamDefaultReader.cancel([reason])`",
                  "name": "cancel",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {any}",
                          "name": "reason",
                          "type": "any",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined`.",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined`."
                      }
                    }
                  ],
                  "desc": "<p>Cancels the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> and returns a promise that is fulfilled\nwhen the underlying stream has been canceled.</p>"
                },
                {
                  "textRaw": "`readableStreamDefaultReader.read()`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with an object:",
                        "name": "return",
                        "desc": "A promise fulfilled with an object:",
                        "options": [
                          {
                            "textRaw": "`value` {any}",
                            "name": "value",
                            "type": "any"
                          },
                          {
                            "textRaw": "`done` {boolean}",
                            "name": "done",
                            "type": "boolean"
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Requests the next chunk of data from the underlying <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>\nand returns a promise that is fulfilled with the data once it is\navailable.</p>"
                },
                {
                  "textRaw": "`readableStreamDefaultReader.releaseLock()`",
                  "name": "releaseLock",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Releases this reader's lock on the underlying <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {Promise} Fulfilled with `undefined` when the associated {ReadableStream} is closed or rejected if the stream errors or the reader's lock is released before the stream finishes closing.",
                  "name": "closed",
                  "type": "Promise",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "Fulfilled with `undefined` when the associated {ReadableStream} is closed or rejected if the stream errors or the reader's lock is released before the stream finishes closing."
                }
              ]
            },
            {
              "textRaw": "Class: `ReadableStreamBYOBReader`",
              "name": "ReadableStreamBYOBReader",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "desc": "<p>The <code>ReadableStreamBYOBReader</code> is an alternative consumer for\nbyte-oriented <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>s (those that are created with <code>underlyingSource.type</code> set equal to <code>'bytes'</code> when the\n<code>ReadableStream</code> was created).</p>\n<p>The <code>BYOB</code> is short for \"bring your own buffer\". This is a\npattern that allows for more efficient reading of byte-oriented\ndata that avoids extraneous copying.</p>\n<pre><code class=\"language-mjs\">import {\n  open,\n} from 'node:fs/promises';\n\nimport {\n  ReadableStream,\n} from 'node:stream/web';\n\nimport { Buffer } from 'node:buffer';\n\nclass Source {\n  type = 'bytes';\n  autoAllocateChunkSize = 1024;\n\n  async start(controller) {\n    this.file = await open(new URL(import.meta.url));\n    this.controller = controller;\n  }\n\n  async pull(controller) {\n    const view = controller.byobRequest?.view;\n    const {\n      bytesRead,\n    } = await this.file.read({\n      buffer: view,\n      offset: view.byteOffset,\n      length: view.byteLength,\n    });\n\n    if (bytesRead === 0) {\n      await this.file.close();\n      this.controller.close();\n    }\n    controller.byobRequest.respond(bytesRead);\n  }\n}\n\nconst stream = new ReadableStream(new Source());\n\nasync function read(stream) {\n  const reader = stream.getReader({ mode: 'byob' });\n\n  const chunks = [];\n  let result;\n  do {\n    result = await reader.read(Buffer.alloc(100));\n    if (result.value !== undefined)\n      chunks.push(Buffer.from(result.value));\n  } while (!result.done);\n\n  return Buffer.concat(chunks);\n}\n\nconst data = await read(stream);\nconsole.log(Buffer.from(data).toString());\n</code></pre>",
              "signatures": [
                {
                  "textRaw": "`new ReadableStreamBYOBReader(stream)`",
                  "name": "ReadableStreamBYOBReader",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`stream` {ReadableStream}",
                      "name": "stream",
                      "type": "ReadableStream"
                    }
                  ],
                  "desc": "<p>Creates a new <code>ReadableStreamBYOBReader</code> that is locked to the\ngiven <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`readableStreamBYOBReader.cancel([reason])`",
                  "name": "cancel",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {any}",
                          "name": "reason",
                          "type": "any",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined`.",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined`."
                      }
                    }
                  ],
                  "desc": "<p>Cancels the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> and returns a promise that is fulfilled\nwhen the underlying stream has been canceled.</p>"
                },
                {
                  "textRaw": "`readableStreamBYOBReader.read(view[, options])`",
                  "name": "read",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v21.7.0",
                          "v20.17.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50888",
                        "description": "Added `min` option."
                      }
                    ]
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`view` {Buffer|TypedArray|DataView}",
                          "name": "view",
                          "type": "Buffer|TypedArray|DataView"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`min` {number} When set, the returned promise will only be fulfilled as soon as `min` number of elements are available. When not set, the promise fulfills when at least one element is available.",
                              "name": "min",
                              "type": "number",
                              "desc": "When set, the returned promise will only be fulfilled as soon as `min` number of elements are available. When not set, the promise fulfills when at least one element is available."
                            }
                          ],
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with an object:",
                        "name": "return",
                        "desc": "A promise fulfilled with an object:",
                        "options": [
                          {
                            "textRaw": "`value` {TypedArray|DataView}",
                            "name": "value",
                            "type": "TypedArray|DataView"
                          },
                          {
                            "textRaw": "`done` {boolean}",
                            "name": "done",
                            "type": "boolean"
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>Requests the next chunk of data from the underlying <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>\nand returns a promise that is fulfilled with the data once it is\navailable.</p>\n<p>Do not pass a pooled <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> object instance in to this method.\nPooled <code>Buffer</code> objects are created using <code>Buffer.allocUnsafe()</code>,\nor <code>Buffer.from()</code>, or are often returned by various <code>node:fs</code> module\ncallbacks. These types of <code>Buffer</code>s use a shared underlying\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> object that contains all of the data from all of\nthe pooled <code>Buffer</code> instances. When a <code>Buffer</code>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>,\nor <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> is passed in to <code>readableStreamBYOBReader.read()</code>,\nthe view's underlying <code>ArrayBuffer</code> is <em>detached</em>, invalidating\nall existing views that may exist on that <code>ArrayBuffer</code>. This\ncan have disastrous consequences for your application.</p>"
                },
                {
                  "textRaw": "`readableStreamBYOBReader.releaseLock()`",
                  "name": "releaseLock",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Releases this reader's lock on the underlying <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {Promise} Fulfilled with `undefined` when the associated {ReadableStream} is closed or rejected if the stream errors or the reader's lock is released before the stream finishes closing.",
                  "name": "closed",
                  "type": "Promise",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "Fulfilled with `undefined` when the associated {ReadableStream} is closed or rejected if the stream errors or the reader's lock is released before the stream finishes closing."
                }
              ]
            },
            {
              "textRaw": "Class: `ReadableStreamDefaultController`",
              "name": "ReadableStreamDefaultController",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": []
              },
              "desc": "<p>Every <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> has a controller that is responsible for\nthe internal state and management of the stream's queue. The <code>ReadableStreamDefaultController</code> is the default controller\nimplementation for <code>ReadableStream</code>s that are not byte-oriented.</p>",
              "methods": [
                {
                  "textRaw": "`readableStreamDefaultController.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Closes the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> to which this controller is associated.</p>"
                },
                {
                  "textRaw": "`readableStreamDefaultController.enqueue([chunk])`",
                  "name": "enqueue",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {any}",
                          "name": "chunk",
                          "type": "any",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Appends a new chunk of data to the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>'s queue.</p>"
                },
                {
                  "textRaw": "`readableStreamDefaultController.error([error])`",
                  "name": "error",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`error` {any}",
                          "name": "error",
                          "type": "any",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Signals an error that causes the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> to error and close.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "desiredSize",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Returns the amount of data remaining to fill the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>'s\nqueue.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `ReadableByteStreamController`",
              "name": "ReadableByteStreamController",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.10.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44702",
                    "description": "Support handling a BYOB pull request from a released reader."
                  }
                ]
              },
              "desc": "<p>Every <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> has a controller that is responsible for\nthe internal state and management of the stream's queue. The <code>ReadableByteStreamController</code> is for byte-oriented <code>ReadableStream</code>s.</p>",
              "properties": [
                {
                  "textRaw": "Type: {ReadableStreamBYOBRequest}",
                  "name": "byobRequest",
                  "type": "ReadableStreamBYOBRequest",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "desiredSize",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>Returns the amount of data remaining to fill the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>'s\nqueue.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`readableByteStreamController.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Closes the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> to which this controller is associated.</p>"
                },
                {
                  "textRaw": "`readableByteStreamController.enqueue(chunk)`",
                  "name": "enqueue",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {Buffer|TypedArray|DataView}",
                          "name": "chunk",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Appends a new chunk of data to the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>'s queue.</p>"
                },
                {
                  "textRaw": "`readableByteStreamController.error([error])`",
                  "name": "error",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`error` {any}",
                          "name": "error",
                          "type": "any",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Signals an error that causes the <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> to error and close.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `ReadableStreamBYOBRequest`",
              "name": "ReadableStreamBYOBRequest",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "desc": "<p>When using <code>ReadableByteStreamController</code> in byte-oriented\nstreams, and when using the <code>ReadableStreamBYOBReader</code>,\nthe <code>readableByteStreamController.byobRequest</code> property\nprovides access to a <code>ReadableStreamBYOBRequest</code> instance\nthat represents the current read request. The object\nis used to gain access to the <code>ArrayBuffer</code>/<code>TypedArray</code>\nthat has been provided for the read request to fill,\nand provides methods for signaling that the data has\nbeen provided.</p>",
              "methods": [
                {
                  "textRaw": "`readableStreamBYOBRequest.respond(bytesWritten)`",
                  "name": "respond",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`bytesWritten` {number}",
                          "name": "bytesWritten",
                          "type": "number"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Signals that a <code>bytesWritten</code> number of bytes have been written\nto <code>readableStreamBYOBRequest.view</code>.</p>"
                },
                {
                  "textRaw": "`readableStreamBYOBRequest.respondWithNewView(view)`",
                  "name": "respondWithNewView",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`view` {Buffer|TypedArray|DataView}",
                          "name": "view",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Signals that the request has been fulfilled with bytes written\nto a new <code>Buffer</code>, <code>TypedArray</code>, or <code>DataView</code>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {Buffer|TypedArray|DataView}",
                  "name": "view",
                  "type": "Buffer|TypedArray|DataView",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `WritableStream`",
              "name": "WritableStream",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "desc": "<p>The <code>WritableStream</code> is a destination to which stream data is sent.</p>\n<pre><code class=\"language-mjs\">import {\n  WritableStream,\n} from 'node:stream/web';\n\nconst stream = new WritableStream({\n  write(chunk) {\n    console.log(chunk);\n  },\n});\n\nawait stream.getWriter().write('Hello World');\n</code></pre>",
              "signatures": [
                {
                  "textRaw": "`new WritableStream([underlyingSink[, strategy]])`",
                  "name": "WritableStream",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`underlyingSink` {Object}",
                      "name": "underlyingSink",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`start` {Function} A user-defined function that is invoked immediately when the `WritableStream` is created.",
                          "name": "start",
                          "type": "Function",
                          "desc": "A user-defined function that is invoked immediately when the `WritableStream` is created.",
                          "options": [
                            {
                              "textRaw": "`controller` {WritableStreamDefaultController}",
                              "name": "controller",
                              "type": "WritableStreamDefaultController"
                            },
                            {
                              "textRaw": "Returns: `undefined` or a promise fulfilled with `undefined`.",
                              "name": "return",
                              "desc": "`undefined` or a promise fulfilled with `undefined`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`write` {Function} A user-defined function that is invoked when a chunk of data has been written to the `WritableStream`.",
                          "name": "write",
                          "type": "Function",
                          "desc": "A user-defined function that is invoked when a chunk of data has been written to the `WritableStream`.",
                          "options": [
                            {
                              "textRaw": "`chunk` {any}",
                              "name": "chunk",
                              "type": "any"
                            },
                            {
                              "textRaw": "`controller` {WritableStreamDefaultController}",
                              "name": "controller",
                              "type": "WritableStreamDefaultController"
                            },
                            {
                              "textRaw": "Returns: A promise fulfilled with `undefined`.",
                              "name": "return",
                              "desc": "A promise fulfilled with `undefined`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`close` {Function} A user-defined function that is called when the `WritableStream` is closed.",
                          "name": "close",
                          "type": "Function",
                          "desc": "A user-defined function that is called when the `WritableStream` is closed.",
                          "options": [
                            {
                              "textRaw": "Returns: A promise fulfilled with `undefined`.",
                              "name": "return",
                              "desc": "A promise fulfilled with `undefined`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`abort` {Function} A user-defined function that is called to abruptly close the `WritableStream`.",
                          "name": "abort",
                          "type": "Function",
                          "desc": "A user-defined function that is called to abruptly close the `WritableStream`.",
                          "options": [
                            {
                              "textRaw": "`reason` {any}",
                              "name": "reason",
                              "type": "any"
                            },
                            {
                              "textRaw": "Returns: A promise fulfilled with `undefined`.",
                              "name": "return",
                              "desc": "A promise fulfilled with `undefined`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`type` {any} The `type` option is reserved for future use and _must_ be undefined.",
                          "name": "type",
                          "type": "any",
                          "desc": "The `type` option is reserved for future use and _must_ be undefined."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`strategy` {Object}",
                      "name": "strategy",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} The maximum internal queue size before backpressure is applied.",
                          "name": "highWaterMark",
                          "type": "number",
                          "desc": "The maximum internal queue size before backpressure is applied."
                        },
                        {
                          "textRaw": "`size` {Function} A user-defined function used to identify the size of each chunk of data.",
                          "name": "size",
                          "type": "Function",
                          "desc": "A user-defined function used to identify the size of each chunk of data.",
                          "options": [
                            {
                              "textRaw": "`chunk` {any}",
                              "name": "chunk",
                              "type": "any"
                            },
                            {
                              "textRaw": "Returns: {number}",
                              "name": "return",
                              "type": "number"
                            }
                          ]
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "methods": [
                {
                  "textRaw": "`writableStream.abort([reason])`",
                  "name": "abort",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {any}",
                          "name": "reason",
                          "type": "any",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined`.",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined`."
                      }
                    }
                  ],
                  "desc": "<p>Abruptly terminates the <code>WritableStream</code>. All queued writes will be\ncanceled with their associated promises rejected.</p>"
                },
                {
                  "textRaw": "`writableStream.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined`.",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined`."
                      }
                    }
                  ],
                  "desc": "<p>Closes the <code>WritableStream</code> when no additional writes are expected.</p>"
                },
                {
                  "textRaw": "`writableStream.getWriter()`",
                  "name": "getWriter",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {WritableStreamDefaultWriter}",
                        "name": "return",
                        "type": "WritableStreamDefaultWriter"
                      }
                    }
                  ],
                  "desc": "<p>Creates and returns a new writer instance that can be used to write\ndata into the <code>WritableStream</code>.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {boolean}",
                  "name": "locked",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The <code>writableStream.locked</code> property is <code>false</code> by default, and is\nswitched to <code>true</code> while there is an active writer attached to this\n<code>WritableStream</code>.</p>"
                }
              ],
              "modules": [
                {
                  "textRaw": "Transferring with postMessage()",
                  "name": "transferring_with_postmessage()",
                  "type": "module",
                  "desc": "<p>A <a href=\"webstreams.html#class-writablestream\"><code>&#x3C;WritableStream></code></a> instance can be transferred using a <a href=\"worker_threads.html#class-messageport\"><code>&#x3C;MessagePort></code></a>.</p>\n<pre><code class=\"language-js\">const stream = new WritableStream(getWritableSinkSomehow());\n\nconst { port1, port2 } = new MessageChannel();\n\nport1.onmessage = ({ data }) => {\n  data.getWriter().write('hello');\n};\n\nport2.postMessage(stream, [stream]);\n</code></pre>",
                  "displayName": "Transferring with postMessage()"
                }
              ]
            },
            {
              "textRaw": "Class: `WritableStreamDefaultWriter`",
              "name": "WritableStreamDefaultWriter",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "signatures": [
                {
                  "textRaw": "`new WritableStreamDefaultWriter(stream)`",
                  "name": "WritableStreamDefaultWriter",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`stream` {WritableStream}",
                      "name": "stream",
                      "type": "WritableStream"
                    }
                  ],
                  "desc": "<p>Creates a new <code>WritableStreamDefaultWriter</code> that is locked to the given\n<code>WritableStream</code>.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`writableStreamDefaultWriter.abort([reason])`",
                  "name": "abort",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {any}",
                          "name": "reason",
                          "type": "any",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined`.",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined`."
                      }
                    }
                  ],
                  "desc": "<p>Abruptly terminates the <code>WritableStream</code>. All queued writes will be\ncanceled with their associated promises rejected.</p>"
                },
                {
                  "textRaw": "`writableStreamDefaultWriter.close()`",
                  "name": "close",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined`.",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined`."
                      }
                    }
                  ],
                  "desc": "<p>Closes the <code>WritableStream</code> when no additional writes are expected.</p>"
                },
                {
                  "textRaw": "`writableStreamDefaultWriter.releaseLock()`",
                  "name": "releaseLock",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Releases this writer's lock on the underlying <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a>.</p>"
                },
                {
                  "textRaw": "`writableStreamDefaultWriter.write([chunk])`",
                  "name": "write",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {any}",
                          "name": "chunk",
                          "type": "any",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: A promise fulfilled with `undefined`.",
                        "name": "return",
                        "desc": "A promise fulfilled with `undefined`."
                      }
                    }
                  ],
                  "desc": "<p>Appends a new chunk of data to the <a href=\"webstreams.html#class-writablestream\"><code>&#x3C;WritableStream></code></a>'s queue.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {Promise} Fulfilled with `undefined` when the associated {WritableStream} is closed or rejected if the stream errors or the writer's lock is released before the stream finishes closing.",
                  "name": "closed",
                  "type": "Promise",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "Fulfilled with `undefined` when the associated {WritableStream} is closed or rejected if the stream errors or the writer's lock is released before the stream finishes closing."
                },
                {
                  "textRaw": "Type: {number}",
                  "name": "desiredSize",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The amount of data required to fill the <a href=\"webstreams.html#class-writablestream\"><code>&#x3C;WritableStream></code></a>'s queue.</p>"
                },
                {
                  "textRaw": "Type: {Promise} Fulfilled with `undefined` when the writer is ready to be used.",
                  "name": "ready",
                  "type": "Promise",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "Fulfilled with `undefined` when the writer is ready to be used."
                }
              ]
            },
            {
              "textRaw": "Class: `WritableStreamDefaultController`",
              "name": "WritableStreamDefaultController",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "desc": "<p>The <code>WritableStreamDefaultController</code> manages the <a href=\"webstreams.html#class-writablestream\"><code>&#x3C;WritableStream></code></a>'s\ninternal state.</p>",
              "methods": [
                {
                  "textRaw": "`writableStreamDefaultController.error([error])`",
                  "name": "error",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`error` {any}",
                          "name": "error",
                          "type": "any",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Called by user-code to signal that an error has occurred while processing\nthe <code>WritableStream</code> data. When called, the <a href=\"webstreams.html#class-writablestream\"><code>&#x3C;WritableStream></code></a> will be aborted,\nwith currently pending writes canceled.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {AbortSignal} An `AbortSignal` that can be used to cancel pending write or close operations when a {WritableStream} is aborted.",
                  "name": "signal",
                  "type": "AbortSignal",
                  "desc": "An `AbortSignal` that can be used to cancel pending write or close operations when a {WritableStream} is aborted."
                }
              ]
            },
            {
              "textRaw": "Class: `TransformStream`",
              "name": "TransformStream",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "desc": "<p>A <code>TransformStream</code> consists of a <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> and a <a href=\"webstreams.html#class-writablestream\"><code>&#x3C;WritableStream></code></a> that\nare connected such that the data written to the <code>WritableStream</code> is received,\nand potentially transformed, before being pushed into the <code>ReadableStream</code>'s\nqueue.</p>\n<pre><code class=\"language-mjs\">import {\n  TransformStream,\n} from 'node:stream/web';\n\nconst transform = new TransformStream({\n  transform(chunk, controller) {\n    controller.enqueue(chunk.toUpperCase());\n  },\n});\n\nawait Promise.all([\n  transform.writable.getWriter().write('A'),\n  transform.readable.getReader().read(),\n]);\n</code></pre>",
              "signatures": [
                {
                  "textRaw": "`new TransformStream([transformer[, writableStrategy[, readableStrategy]]])`",
                  "name": "TransformStream",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v21.5.0",
                          "v20.14.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50126",
                        "description": "Supports the `cancel` transformer callback."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`transformer` {Object}",
                      "name": "transformer",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`start` {Function} A user-defined function that is invoked immediately when the `TransformStream` is created.",
                          "name": "start",
                          "type": "Function",
                          "desc": "A user-defined function that is invoked immediately when the `TransformStream` is created.",
                          "options": [
                            {
                              "textRaw": "`controller` {TransformStreamDefaultController}",
                              "name": "controller",
                              "type": "TransformStreamDefaultController"
                            },
                            {
                              "textRaw": "Returns: `undefined` or a promise fulfilled with `undefined`",
                              "name": "return",
                              "desc": "`undefined` or a promise fulfilled with `undefined`"
                            }
                          ]
                        },
                        {
                          "textRaw": "`transform` {Function} A user-defined function that receives, and potentially modifies, a chunk of data written to `transformStream.writable`, before forwarding that on to `transformStream.readable`.",
                          "name": "transform",
                          "type": "Function",
                          "desc": "A user-defined function that receives, and potentially modifies, a chunk of data written to `transformStream.writable`, before forwarding that on to `transformStream.readable`.",
                          "options": [
                            {
                              "textRaw": "`chunk` {any}",
                              "name": "chunk",
                              "type": "any"
                            },
                            {
                              "textRaw": "`controller` {TransformStreamDefaultController}",
                              "name": "controller",
                              "type": "TransformStreamDefaultController"
                            },
                            {
                              "textRaw": "Returns: A promise fulfilled with `undefined`.",
                              "name": "return",
                              "desc": "A promise fulfilled with `undefined`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`flush` {Function} A user-defined function that is called immediately before the writable side of the `TransformStream` is closed, signaling the end of the transformation process.",
                          "name": "flush",
                          "type": "Function",
                          "desc": "A user-defined function that is called immediately before the writable side of the `TransformStream` is closed, signaling the end of the transformation process.",
                          "options": [
                            {
                              "textRaw": "`controller` {TransformStreamDefaultController}",
                              "name": "controller",
                              "type": "TransformStreamDefaultController"
                            },
                            {
                              "textRaw": "Returns: A promise fulfilled with `undefined`.",
                              "name": "return",
                              "desc": "A promise fulfilled with `undefined`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`cancel` {Function} A user-defined function that is called when either the readable side of the `TransformStream` is canceled or the writable side is aborted.",
                          "name": "cancel",
                          "type": "Function",
                          "desc": "A user-defined function that is called when either the readable side of the `TransformStream` is canceled or the writable side is aborted.",
                          "options": [
                            {
                              "textRaw": "`reason` {any}",
                              "name": "reason",
                              "type": "any"
                            },
                            {
                              "textRaw": "Returns: A promise fulfilled with `undefined`.",
                              "name": "return",
                              "desc": "A promise fulfilled with `undefined`."
                            }
                          ]
                        },
                        {
                          "textRaw": "`readableType` {any} the `readableType` option is reserved for future use and _must_ be `undefined`.",
                          "name": "readableType",
                          "type": "any",
                          "desc": "the `readableType` option is reserved for future use and _must_ be `undefined`."
                        },
                        {
                          "textRaw": "`writableType` {any} the `writableType` option is reserved for future use and _must_ be `undefined`.",
                          "name": "writableType",
                          "type": "any",
                          "desc": "the `writableType` option is reserved for future use and _must_ be `undefined`."
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`writableStrategy` {Object}",
                      "name": "writableStrategy",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} The maximum internal queue size before backpressure is applied.",
                          "name": "highWaterMark",
                          "type": "number",
                          "desc": "The maximum internal queue size before backpressure is applied."
                        },
                        {
                          "textRaw": "`size` {Function} A user-defined function used to identify the size of each chunk of data.",
                          "name": "size",
                          "type": "Function",
                          "desc": "A user-defined function used to identify the size of each chunk of data.",
                          "options": [
                            {
                              "textRaw": "`chunk` {any}",
                              "name": "chunk",
                              "type": "any"
                            },
                            {
                              "textRaw": "Returns: {number}",
                              "name": "return",
                              "type": "number"
                            }
                          ]
                        }
                      ],
                      "optional": true
                    },
                    {
                      "textRaw": "`readableStrategy` {Object}",
                      "name": "readableStrategy",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number} The maximum internal queue size before backpressure is applied.",
                          "name": "highWaterMark",
                          "type": "number",
                          "desc": "The maximum internal queue size before backpressure is applied."
                        },
                        {
                          "textRaw": "`size` {Function} A user-defined function used to identify the size of each chunk of data.",
                          "name": "size",
                          "type": "Function",
                          "desc": "A user-defined function used to identify the size of each chunk of data.",
                          "options": [
                            {
                              "textRaw": "`chunk` {any}",
                              "name": "chunk",
                              "type": "any"
                            },
                            {
                              "textRaw": "Returns: {number}",
                              "name": "return",
                              "type": "number"
                            }
                          ]
                        }
                      ],
                      "optional": true
                    }
                  ]
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {ReadableStream}",
                  "name": "readable",
                  "type": "ReadableStream",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {WritableStream}",
                  "name": "writable",
                  "type": "WritableStream",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  }
                }
              ],
              "modules": [
                {
                  "textRaw": "Transferring with postMessage()",
                  "name": "transferring_with_postmessage()",
                  "type": "module",
                  "desc": "<p>A <a href=\"webstreams.html#class-transformstream\"><code>&#x3C;TransformStream></code></a> instance can be transferred using a <a href=\"worker_threads.html#class-messageport\"><code>&#x3C;MessagePort></code></a>.</p>\n<pre><code class=\"language-js\">const stream = new TransformStream();\n\nconst { port1, port2 } = new MessageChannel();\n\nport1.onmessage = ({ data }) => {\n  const { writable, readable } = data;\n  // ...\n};\n\nport2.postMessage(stream, [stream]);\n</code></pre>",
                  "displayName": "Transferring with postMessage()"
                }
              ]
            },
            {
              "textRaw": "Class: `TransformStreamDefaultController`",
              "name": "TransformStreamDefaultController",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "desc": "<p>The <code>TransformStreamDefaultController</code> manages the internal state\nof the <code>TransformStream</code>.</p>",
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "desiredSize",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The amount of data required to fill the readable side's queue.</p>"
                }
              ],
              "methods": [
                {
                  "textRaw": "`transformStreamDefaultController.enqueue([chunk])`",
                  "name": "enqueue",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`chunk` {any}",
                          "name": "chunk",
                          "type": "any",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Appends a chunk of data to the readable side's queue.</p>"
                },
                {
                  "textRaw": "`transformStreamDefaultController.error([reason])`",
                  "name": "error",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`reason` {any}",
                          "name": "reason",
                          "type": "any",
                          "optional": true
                        }
                      ]
                    }
                  ],
                  "desc": "<p>Signals to both the readable and writable side that an error has occurred\nwhile processing the transform data, causing both sides to be abruptly\nclosed.</p>"
                },
                {
                  "textRaw": "`transformStreamDefaultController.terminate()`",
                  "name": "terminate",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": []
                    }
                  ],
                  "desc": "<p>Closes the readable side of the transport and causes the writable side\nto be abruptly closed with an error.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `ByteLengthQueuingStrategy`",
              "name": "ByteLengthQueuingStrategy",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "signatures": [
                {
                  "textRaw": "`new ByteLengthQueuingStrategy(init)`",
                  "name": "ByteLengthQueuingStrategy",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`init` {Object}",
                      "name": "init",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number}",
                          "name": "highWaterMark",
                          "type": "number"
                        }
                      ]
                    }
                  ]
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "highWaterMark",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {Function}",
                  "name": "size",
                  "type": "Function",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "options": [
                    {
                      "textRaw": "`chunk` {any}",
                      "name": "chunk",
                      "type": "any"
                    },
                    {
                      "textRaw": "Returns: {number}",
                      "name": "return",
                      "type": "number"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "Class: `CountQueuingStrategy`",
              "name": "CountQueuingStrategy",
              "type": "class",
              "meta": {
                "added": [
                  "v16.5.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "signatures": [
                {
                  "textRaw": "`new CountQueuingStrategy(init)`",
                  "name": "CountQueuingStrategy",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`init` {Object}",
                      "name": "init",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`highWaterMark` {number}",
                          "name": "highWaterMark",
                          "type": "number"
                        }
                      ]
                    }
                  ]
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {number}",
                  "name": "highWaterMark",
                  "type": "number",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {Function}",
                  "name": "size",
                  "type": "Function",
                  "meta": {
                    "added": [
                      "v16.5.0"
                    ],
                    "changes": []
                  },
                  "options": [
                    {
                      "textRaw": "`chunk` {any}",
                      "name": "chunk",
                      "type": "any"
                    },
                    {
                      "textRaw": "Returns: {number}",
                      "name": "return",
                      "type": "number"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "Class: `TextEncoderStream`",
              "name": "TextEncoderStream",
              "type": "class",
              "meta": {
                "added": [
                  "v16.6.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "signatures": [
                {
                  "textRaw": "`new TextEncoderStream()`",
                  "name": "TextEncoderStream",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  },
                  "params": [],
                  "desc": "<p>Creates a new <code>TextEncoderStream</code> instance.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "encoding",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The encoding supported by the <code>TextEncoderStream</code> instance.</p>"
                },
                {
                  "textRaw": "Type: {ReadableStream}",
                  "name": "readable",
                  "type": "ReadableStream",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {WritableStream}",
                  "name": "writable",
                  "type": "WritableStream",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `TextDecoderStream`",
              "name": "TextDecoderStream",
              "type": "class",
              "meta": {
                "added": [
                  "v16.6.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "signatures": [
                {
                  "textRaw": "`new TextDecoderStream([encoding[, options]])`",
                  "name": "TextDecoderStream",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  },
                  "params": [
                    {
                      "textRaw": "`encoding` {string} Identifies the `encoding` that this `TextDecoder` instance supports. **Default:** `'utf-8'`.",
                      "name": "encoding",
                      "type": "string",
                      "default": "`'utf-8'`",
                      "desc": "Identifies the `encoding` that this `TextDecoder` instance supports.",
                      "optional": true
                    },
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`fatal` {boolean} `true` if decoding failures are fatal.",
                          "name": "fatal",
                          "type": "boolean",
                          "desc": "`true` if decoding failures are fatal."
                        },
                        {
                          "textRaw": "`ignoreBOM` {boolean} When `true`, the `TextDecoderStream` will include the byte order mark in the decoded result. When `false`, the byte order mark will be removed from the output. This option is only used when `encoding` is `'utf-8'`, `'utf-16be'`, or `'utf-16le'`. **Default:** `false`.",
                          "name": "ignoreBOM",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "When `true`, the `TextDecoderStream` will include the byte order mark in the decoded result. When `false`, the byte order mark will be removed from the output. This option is only used when `encoding` is `'utf-8'`, `'utf-16be'`, or `'utf-16le'`."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "desc": "<p>Creates a new <code>TextDecoderStream</code> instance.</p>"
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {string}",
                  "name": "encoding",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The encoding supported by the <code>TextDecoderStream</code> instance.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "fatal",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The value will be <code>true</code> if decoding errors result in a <code>TypeError</code> being\nthrown.</p>"
                },
                {
                  "textRaw": "Type: {boolean}",
                  "name": "ignoreBOM",
                  "type": "boolean",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The value will be <code>true</code> if the decoding result will include the byte order\nmark.</p>"
                },
                {
                  "textRaw": "Type: {ReadableStream}",
                  "name": "readable",
                  "type": "ReadableStream",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {WritableStream}",
                  "name": "writable",
                  "type": "WritableStream",
                  "meta": {
                    "added": [
                      "v16.6.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `CompressionStream`",
              "name": "CompressionStream",
              "type": "class",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "signatures": [
                {
                  "textRaw": "`new CompressionStream(format)`",
                  "name": "CompressionStream",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.7.0",
                          "v22.20.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/59464",
                        "description": "format now accepts `brotli` value."
                      },
                      {
                        "version": [
                          "v21.2.0",
                          "v20.12.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50097",
                        "description": "format now accepts `deflate-raw` value."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`format` {string} One of `'deflate'`, `'deflate-raw'`, `'gzip'`, or `'brotli'`.",
                      "name": "format",
                      "type": "string",
                      "desc": "One of `'deflate'`, `'deflate-raw'`, `'gzip'`, or `'brotli'`."
                    }
                  ]
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {ReadableStream}",
                  "name": "readable",
                  "type": "ReadableStream",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {WritableStream}",
                  "name": "writable",
                  "type": "WritableStream",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  }
                }
              ]
            },
            {
              "textRaw": "Class: `DecompressionStream`",
              "name": "DecompressionStream",
              "type": "class",
              "meta": {
                "added": [
                  "v17.0.0"
                ],
                "changes": [
                  {
                    "version": "v18.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/42225",
                    "description": "This class is now exposed on the global object."
                  }
                ]
              },
              "signatures": [
                {
                  "textRaw": "`new DecompressionStream(format)`",
                  "name": "DecompressionStream",
                  "type": "ctor",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": [
                      {
                        "version": [
                          "v24.7.0",
                          "v22.20.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/59464",
                        "description": "format now accepts `brotli` value."
                      },
                      {
                        "version": [
                          "v21.2.0",
                          "v20.12.0"
                        ],
                        "pr-url": "https://github.com/nodejs/node/pull/50097",
                        "description": "format now accepts `deflate-raw` value."
                      }
                    ]
                  },
                  "params": [
                    {
                      "textRaw": "`format` {string} One of `'deflate'`, `'deflate-raw'`, `'gzip'`, or `'brotli'`.",
                      "name": "format",
                      "type": "string",
                      "desc": "One of `'deflate'`, `'deflate-raw'`, `'gzip'`, or `'brotli'`."
                    }
                  ]
                }
              ],
              "properties": [
                {
                  "textRaw": "Type: {ReadableStream}",
                  "name": "readable",
                  "type": "ReadableStream",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  }
                },
                {
                  "textRaw": "Type: {WritableStream}",
                  "name": "writable",
                  "type": "WritableStream",
                  "meta": {
                    "added": [
                      "v17.0.0"
                    ],
                    "changes": []
                  }
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`ReadableStream.from(iterable)`",
              "name": "from",
              "type": "method",
              "meta": {
                "added": [
                  "v20.6.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "iterable"
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>iterable</code> {Iterable} Object implementing the <code>Symbol.asyncIterator</code> or\n<code>Symbol.iterator</code> iterable protocol.</li>\n</ul>\n<p>A utility method that creates a new <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> from an iterable.</p>\n<pre><code class=\"language-mjs\">import { ReadableStream } from 'node:stream/web';\n\nasync function* asyncIterableGenerator() {\n  yield 'a';\n  yield 'b';\n  yield 'c';\n}\n\nconst stream = ReadableStream.from(asyncIterableGenerator());\n\nfor await (const chunk of stream)\n  console.log(chunk); // Prints: 'a', 'b', 'c'\n</code></pre>\n<pre><code class=\"language-cjs\">const { ReadableStream } = require('node:stream/web');\n\nasync function* asyncIterableGenerator() {\n  yield 'a';\n  yield 'b';\n  yield 'c';\n}\n\n(async () => {\n  const stream = ReadableStream.from(asyncIterableGenerator());\n\n  for await (const chunk of stream)\n    console.log(chunk); // Prints: 'a', 'b', 'c'\n})();\n</code></pre>\n<p>To pipe the resulting <a href=\"webstreams.html#class-readablestream\"><code>&#x3C;ReadableStream></code></a> into a <a href=\"webstreams.html#class-writablestream\"><code>&#x3C;WritableStream></code></a> the {Iterable}\nshould yield a sequence of <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>, or <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> objects.</p>\n<pre><code class=\"language-mjs\">import { ReadableStream } from 'node:stream/web';\nimport { Buffer } from 'node:buffer';\n\nasync function* asyncIterableGenerator() {\n  yield Buffer.from('a');\n  yield Buffer.from('b');\n  yield Buffer.from('c');\n}\n\nconst stream = ReadableStream.from(asyncIterableGenerator());\n\nawait stream.pipeTo(createWritableStreamSomehow());\n</code></pre>\n<pre><code class=\"language-cjs\">const { ReadableStream } = require('node:stream/web');\nconst { Buffer } = require('node:buffer');\n\nasync function* asyncIterableGenerator() {\n  yield Buffer.from('a');\n  yield Buffer.from('b');\n  yield Buffer.from('c');\n}\n\nconst stream = ReadableStream.from(asyncIterableGenerator());\n\n(async () => {\n  await stream.pipeTo(createWritableStreamSomehow());\n})();\n</code></pre>"
            }
          ],
          "modules": [
            {
              "textRaw": "Utility Consumers",
              "name": "utility_consumers",
              "type": "module",
              "meta": {
                "added": [
                  "v16.7.0"
                ],
                "changes": []
              },
              "desc": "<p>The utility consumer functions provide common options for consuming\nstreams.</p>\n<p>They are accessed using:</p>\n<pre><code class=\"language-mjs\">import {\n  arrayBuffer,\n  blob,\n  buffer,\n  json,\n  text,\n} from 'node:stream/consumers';\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  arrayBuffer,\n  blob,\n  buffer,\n  json,\n  text,\n} = require('node:stream/consumers');\n</code></pre>",
              "methods": [
                {
                  "textRaw": "`streamConsumers.arrayBuffer(stream)`",
                  "name": "arrayBuffer",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.7.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`stream` {ReadableStream|stream.Readable|AsyncIterator}",
                          "name": "stream",
                          "type": "ReadableStream|stream.Readable|AsyncIterator"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with an `ArrayBuffer` containing the full contents of the stream.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with an `ArrayBuffer` containing the full contents of the stream."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { arrayBuffer } from 'node:stream/consumers';\nimport { Readable } from 'node:stream';\nimport { TextEncoder } from 'node:util';\n\nconst encoder = new TextEncoder();\nconst dataArray = encoder.encode('hello world from consumers!');\n\nconst readable = Readable.from(dataArray);\nconst data = await arrayBuffer(readable);\nconsole.log(`from readable: ${data.byteLength}`);\n// Prints: from readable: 76\n</code></pre>\n<pre><code class=\"language-cjs\">const { arrayBuffer } = require('node:stream/consumers');\nconst { Readable } = require('node:stream');\nconst { TextEncoder } = require('node:util');\n\nconst encoder = new TextEncoder();\nconst dataArray = encoder.encode('hello world from consumers!');\nconst readable = Readable.from(dataArray);\narrayBuffer(readable).then((data) => {\n  console.log(`from readable: ${data.byteLength}`);\n  // Prints: from readable: 76\n});\n</code></pre>"
                },
                {
                  "textRaw": "`streamConsumers.blob(stream)`",
                  "name": "blob",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.7.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`stream` {ReadableStream|stream.Readable|AsyncIterator}",
                          "name": "stream",
                          "type": "ReadableStream|stream.Readable|AsyncIterator"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with a {Blob} containing the full contents of the stream.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with a {Blob} containing the full contents of the stream."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { blob } from 'node:stream/consumers';\n\nconst dataBlob = new Blob(['hello world from consumers!']);\n\nconst readable = dataBlob.stream();\nconst data = await blob(readable);\nconsole.log(`from readable: ${data.size}`);\n// Prints: from readable: 27\n</code></pre>\n<pre><code class=\"language-cjs\">const { blob } = require('node:stream/consumers');\n\nconst dataBlob = new Blob(['hello world from consumers!']);\n\nconst readable = dataBlob.stream();\nblob(readable).then((data) => {\n  console.log(`from readable: ${data.size}`);\n  // Prints: from readable: 27\n});\n</code></pre>"
                },
                {
                  "textRaw": "`streamConsumers.buffer(stream)`",
                  "name": "buffer",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.7.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`stream` {ReadableStream|stream.Readable|AsyncIterator}",
                          "name": "stream",
                          "type": "ReadableStream|stream.Readable|AsyncIterator"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with a {Buffer} containing the full contents of the stream.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with a {Buffer} containing the full contents of the stream."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { buffer } from 'node:stream/consumers';\nimport { Readable } from 'node:stream';\nimport { Buffer } from 'node:buffer';\n\nconst dataBuffer = Buffer.from('hello world from consumers!');\n\nconst readable = Readable.from(dataBuffer);\nconst data = await buffer(readable);\nconsole.log(`from readable: ${data.length}`);\n// Prints: from readable: 27\n</code></pre>\n<pre><code class=\"language-cjs\">const { buffer } = require('node:stream/consumers');\nconst { Readable } = require('node:stream');\nconst { Buffer } = require('node:buffer');\n\nconst dataBuffer = Buffer.from('hello world from consumers!');\n\nconst readable = Readable.from(dataBuffer);\nbuffer(readable).then((data) => {\n  console.log(`from readable: ${data.length}`);\n  // Prints: from readable: 27\n});\n</code></pre>"
                },
                {
                  "textRaw": "`streamConsumers.bytes(stream)`",
                  "name": "bytes",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v25.6.0",
                      "v24.14.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`stream` {ReadableStream|stream.Readable|AsyncIterator}",
                          "name": "stream",
                          "type": "ReadableStream|stream.Readable|AsyncIterator"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with a {Uint8Array} containing the full contents of the stream.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with a {Uint8Array} containing the full contents of the stream."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { bytes } from 'node:stream/consumers';\nimport { Readable } from 'node:stream';\nimport { Buffer } from 'node:buffer';\n\nconst dataBuffer = Buffer.from('hello world from consumers!');\n\nconst readable = Readable.from(dataBuffer);\nconst data = await bytes(readable);\nconsole.log(`from readable: ${data.length}`);\n// Prints: from readable: 27\n</code></pre>\n<pre><code class=\"language-cjs\">const { bytes } = require('node:stream/consumers');\nconst { Readable } = require('node:stream');\nconst { Buffer } = require('node:buffer');\n\nconst dataBuffer = Buffer.from('hello world from consumers!');\n\nconst readable = Readable.from(dataBuffer);\nbytes(readable).then((data) => {\n  console.log(`from readable: ${data.length}`);\n  // Prints: from readable: 27\n});\n</code></pre>"
                },
                {
                  "textRaw": "`streamConsumers.json(stream)`",
                  "name": "json",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.7.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`stream` {ReadableStream|stream.Readable|AsyncIterator}",
                          "name": "stream",
                          "type": "ReadableStream|stream.Readable|AsyncIterator"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with the contents of the stream parsed as a UTF-8 encoded string that is then passed through `JSON.parse()`.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with the contents of the stream parsed as a UTF-8 encoded string that is then passed through `JSON.parse()`."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { json } from 'node:stream/consumers';\nimport { Readable } from 'node:stream';\n\nconst items = Array.from(\n  {\n    length: 100,\n  },\n  () => ({\n    message: 'hello world from consumers!',\n  }),\n);\n\nconst readable = Readable.from(JSON.stringify(items));\nconst data = await json(readable);\nconsole.log(`from readable: ${data.length}`);\n// Prints: from readable: 100\n</code></pre>\n<pre><code class=\"language-cjs\">const { json } = require('node:stream/consumers');\nconst { Readable } = require('node:stream');\n\nconst items = Array.from(\n  {\n    length: 100,\n  },\n  () => ({\n    message: 'hello world from consumers!',\n  }),\n);\n\nconst readable = Readable.from(JSON.stringify(items));\njson(readable).then((data) => {\n  console.log(`from readable: ${data.length}`);\n  // Prints: from readable: 100\n});\n</code></pre>"
                },
                {
                  "textRaw": "`streamConsumers.text(stream)`",
                  "name": "text",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v16.7.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`stream` {ReadableStream|stream.Readable|AsyncIterator}",
                          "name": "stream",
                          "type": "ReadableStream|stream.Readable|AsyncIterator"
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Fulfills with the contents of the stream parsed as a UTF-8 encoded string.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Fulfills with the contents of the stream parsed as a UTF-8 encoded string."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { text } from 'node:stream/consumers';\nimport { Readable } from 'node:stream';\n\nconst readable = Readable.from('Hello world from consumers!');\nconst data = await text(readable);\nconsole.log(`from readable: ${data.length}`);\n// Prints: from readable: 27\n</code></pre>\n<pre><code class=\"language-cjs\">const { text } = require('node:stream/consumers');\nconst { Readable } = require('node:stream');\n\nconst readable = Readable.from('Hello world from consumers!');\ntext(readable).then((data) => {\n  console.log(`from readable: ${data.length}`);\n  // Prints: from readable: 27\n});\n</code></pre>"
                }
              ],
              "displayName": "Utility Consumers"
            }
          ],
          "displayName": "API"
        }
      ],
      "displayName": "Web Streams API",
      "source": "doc/api/webstreams.md"
    },
    {
      "textRaw": "Worker threads",
      "name": "worker_threads",
      "introduced_in": "v10.5.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:worker_threads</code> module enables the use of threads that execute\nJavaScript in parallel. To access it:</p>\n<pre><code class=\"language-mjs\">import worker_threads from 'node:worker_threads';\n</code></pre>\n<pre><code class=\"language-cjs\">const worker_threads = require('node:worker_threads');\n</code></pre>\n<p>Workers (threads) are useful for performing CPU-intensive JavaScript operations.\nThey do not help much with I/O-intensive work. The Node.js built-in\nasynchronous I/O operations are more efficient than Workers can be.</p>\n<p>Unlike <code>child_process</code> or <code>cluster</code>, <code>worker_threads</code> can share memory. They do\nso by transferring <code>ArrayBuffer</code> instances or sharing <code>SharedArrayBuffer</code>\ninstances.</p>\n<pre><code class=\"language-mjs\">import {\n  Worker,\n  isMainThread,\n  parentPort,\n  workerData,\n} from 'node:worker_threads';\n\nif (!isMainThread) {\n  const { parse } = await import('some-js-parsing-library');\n  const script = workerData;\n  parentPort.postMessage(parse(script));\n}\n\nexport default function parseJSAsync(script) {\n  return new Promise((resolve, reject) => {\n    const worker = new Worker(new URL(import.meta.url), {\n      workerData: script,\n    });\n    worker.on('message', resolve);\n    worker.once('error', reject);\n    worker.once('exit', (code) => {\n      if (code !== 0)\n        reject(new Error(`Worker stopped with exit code ${code}`));\n    });\n  });\n};\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  Worker,\n  isMainThread,\n  parentPort,\n  workerData,\n} = require('node:worker_threads');\n\nif (isMainThread) {\n  module.exports = function parseJSAsync(script) {\n    return new Promise((resolve, reject) => {\n      const worker = new Worker(__filename, {\n        workerData: script,\n      });\n      worker.on('message', resolve);\n      worker.once('error', reject);\n      worker.once('exit', (code) => {\n        if (code !== 0)\n          reject(new Error(`Worker stopped with exit code ${code}`));\n      });\n    });\n  };\n} else {\n  const { parse } = require('some-js-parsing-library');\n  const script = workerData;\n  parentPort.postMessage(parse(script));\n}\n</code></pre>\n<p>The above example spawns a Worker thread for each <code>parseJSAsync()</code> call. In\npractice, use a pool of Workers for these kinds of tasks. Otherwise, the\noverhead of creating Workers would likely exceed their benefit.</p>\n<p>When implementing a worker pool, use the <a href=\"async_hooks.html#class-asyncresource\"><code>AsyncResource</code></a> API to inform\ndiagnostic tools (e.g. to provide asynchronous stack traces) about the\ncorrelation between tasks and their outcomes. See\n<a href=\"async_context.html#using-asyncresource-for-a-worker-thread-pool\">\"Using <code>AsyncResource</code> for a <code>Worker</code> thread pool\"</a>\nin the <code>async_hooks</code> documentation for an example implementation.</p>\n<p>Worker threads inherit non-process-specific options by default. Refer to\n<a href=\"#new-workerfilename-options\"><code>Worker constructor options</code></a> to know how to customize worker thread options,\nspecifically <code>argv</code> and <code>execArgv</code> options.</p>",
      "methods": [
        {
          "textRaw": "`worker_threads.getEnvironmentData(key)`",
          "name": "getEnvironmentData",
          "type": "method",
          "meta": {
            "added": [
              "v15.12.0",
              "v14.18.0"
            ],
            "changes": [
              {
                "version": [
                  "v17.5.0",
                  "v16.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41272",
                "description": "No longer experimental."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`key` {any} Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.",
                  "name": "key",
                  "type": "any",
                  "desc": "Any arbitrary, cloneable JavaScript value that can be used as a {Map} key."
                }
              ],
              "return": {
                "textRaw": "Returns: {any}",
                "name": "return",
                "type": "any"
              }
            }
          ],
          "desc": "<p>Within a worker thread, <code>worker.getEnvironmentData()</code> returns a clone\nof data passed to the spawning thread's <code>worker.setEnvironmentData()</code>.\nEvery new <code>Worker</code> receives its own copy of the environment data\nautomatically.</p>\n<pre><code class=\"language-mjs\">import {\n  Worker,\n  isMainThread,\n  setEnvironmentData,\n  getEnvironmentData,\n} from 'node:worker_threads';\n\nif (isMainThread) {\n  setEnvironmentData('Hello', 'World!');\n  const worker = new Worker(new URL(import.meta.url));\n} else {\n  console.log(getEnvironmentData('Hello'));  // Prints 'World!'.\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  Worker,\n  isMainThread,\n  setEnvironmentData,\n  getEnvironmentData,\n} = require('node:worker_threads');\n\nif (isMainThread) {\n  setEnvironmentData('Hello', 'World!');\n  const worker = new Worker(__filename);\n} else {\n  console.log(getEnvironmentData('Hello'));  // Prints 'World!'.\n}\n</code></pre>"
        },
        {
          "textRaw": "`worker_threads.markAsUntransferable(object)`",
          "name": "markAsUntransferable",
          "type": "method",
          "meta": {
            "added": [
              "v14.5.0",
              "v12.19.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`object` {any} Any arbitrary JavaScript value.",
                  "name": "object",
                  "type": "any",
                  "desc": "Any arbitrary JavaScript value."
                }
              ]
            }
          ],
          "desc": "<p>Mark an object as not transferable. If <code>object</code> occurs in the transfer list of\na <a href=\"#portpostmessagevalue-transferlist\"><code>port.postMessage()</code></a> call, an error is thrown. This is a no-op if\n<code>object</code> is a primitive value.</p>\n<p>In particular, this makes sense for objects that can be cloned, rather than\ntransferred, and which are used by other objects on the sending side.\nFor example, Node.js marks the <code>ArrayBuffer</code>s it uses for its\n<a href=\"buffer.html#static-method-bufferallocunsafesize\"><code>Buffer</code> pool</a> with this.\n<code>ArrayBuffer.prototype.transfer()</code> is disallowed on such array buffer\ninstances.</p>\n<p>This operation cannot be undone.</p>\n<pre><code class=\"language-mjs\">import { MessageChannel, markAsUntransferable } from 'node:worker_threads';\n\nconst pooledBuffer = new ArrayBuffer(8);\nconst typedArray1 = new Uint8Array(pooledBuffer);\nconst typedArray2 = new Float64Array(pooledBuffer);\n\nmarkAsUntransferable(pooledBuffer);\n\nconst { port1 } = new MessageChannel();\ntry {\n  // This will throw an error, because pooledBuffer is not transferable.\n  port1.postMessage(typedArray1, [ typedArray1.buffer ]);\n} catch (error) {\n  // error.name === 'DataCloneError'\n}\n\n// The following line prints the contents of typedArray1 -- it still owns\n// its memory and has not been transferred. Without\n// `markAsUntransferable()`, this would print an empty Uint8Array and the\n// postMessage call would have succeeded.\n// typedArray2 is intact as well.\nconsole.log(typedArray1);\nconsole.log(typedArray2);\n</code></pre>\n<pre><code class=\"language-cjs\">const { MessageChannel, markAsUntransferable } = require('node:worker_threads');\n\nconst pooledBuffer = new ArrayBuffer(8);\nconst typedArray1 = new Uint8Array(pooledBuffer);\nconst typedArray2 = new Float64Array(pooledBuffer);\n\nmarkAsUntransferable(pooledBuffer);\n\nconst { port1 } = new MessageChannel();\ntry {\n  // This will throw an error, because pooledBuffer is not transferable.\n  port1.postMessage(typedArray1, [ typedArray1.buffer ]);\n} catch (error) {\n  // error.name === 'DataCloneError'\n}\n\n// The following line prints the contents of typedArray1 -- it still owns\n// its memory and has not been transferred. Without\n// `markAsUntransferable()`, this would print an empty Uint8Array and the\n// postMessage call would have succeeded.\n// typedArray2 is intact as well.\nconsole.log(typedArray1);\nconsole.log(typedArray2);\n</code></pre>\n<p>There is no equivalent to this API in browsers.</p>"
        },
        {
          "textRaw": "`worker_threads.isMarkedAsUntransferable(object)`",
          "name": "isMarkedAsUntransferable",
          "type": "method",
          "meta": {
            "added": [
              "v21.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`object` {any} Any JavaScript value.",
                  "name": "object",
                  "type": "any",
                  "desc": "Any JavaScript value."
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>Check if an object is marked as not transferable with\n<a href=\"#worker_threadsmarkasuntransferableobject\"><code>markAsUntransferable()</code></a>.</p>\n<pre><code class=\"language-mjs\">import { markAsUntransferable, isMarkedAsUntransferable } from 'node:worker_threads';\n\nconst pooledBuffer = new ArrayBuffer(8);\nmarkAsUntransferable(pooledBuffer);\n\nisMarkedAsUntransferable(pooledBuffer);  // Returns true.\n</code></pre>\n<pre><code class=\"language-cjs\">const { markAsUntransferable, isMarkedAsUntransferable } = require('node:worker_threads');\n\nconst pooledBuffer = new ArrayBuffer(8);\nmarkAsUntransferable(pooledBuffer);\n\nisMarkedAsUntransferable(pooledBuffer);  // Returns true.\n</code></pre>\n<p>There is no equivalent to this API in browsers.</p>"
        },
        {
          "textRaw": "`worker_threads.markAsUncloneable(object)`",
          "name": "markAsUncloneable",
          "type": "method",
          "meta": {
            "added": [
              "v23.0.0",
              "v22.10.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`object` {any} Any arbitrary JavaScript value.",
                  "name": "object",
                  "type": "any",
                  "desc": "Any arbitrary JavaScript value."
                }
              ]
            }
          ],
          "desc": "<p>Mark an object as not cloneable. If <code>object</code> is used as <a href=\"#event-message\"><code>message</code></a> in\na <a href=\"#portpostmessagevalue-transferlist\"><code>port.postMessage()</code></a> call, an error is thrown. This is a no-op if <code>object</code> is a\nprimitive value.</p>\n<p>This has no effect on <code>ArrayBuffer</code>, or any <code>Buffer</code> like objects.</p>\n<p>This operation cannot be undone.</p>\n<pre><code class=\"language-mjs\">import { markAsUncloneable } from 'node:worker_threads';\n\nconst anyObject = { foo: 'bar' };\nmarkAsUncloneable(anyObject);\nconst { port1 } = new MessageChannel();\ntry {\n  // This will throw an error, because anyObject is not cloneable.\n  port1.postMessage(anyObject);\n} catch (error) {\n  // error.name === 'DataCloneError'\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { markAsUncloneable } = require('node:worker_threads');\n\nconst anyObject = { foo: 'bar' };\nmarkAsUncloneable(anyObject);\nconst { port1 } = new MessageChannel();\ntry {\n  // This will throw an error, because anyObject is not cloneable.\n  port1.postMessage(anyObject);\n} catch (error) {\n  // error.name === 'DataCloneError'\n}\n</code></pre>\n<p>There is no equivalent to this API in browsers.</p>"
        },
        {
          "textRaw": "`worker_threads.moveMessagePortToContext(port, contextifiedSandbox)`",
          "name": "moveMessagePortToContext",
          "type": "method",
          "meta": {
            "added": [
              "v11.13.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`port` {MessagePort} The message port to transfer.",
                  "name": "port",
                  "type": "MessagePort",
                  "desc": "The message port to transfer."
                },
                {
                  "textRaw": "`contextifiedSandbox` {Object} A contextified object as returned by the `vm.createContext()` method.",
                  "name": "contextifiedSandbox",
                  "type": "Object",
                  "desc": "A contextified object as returned by the `vm.createContext()` method."
                }
              ],
              "return": {
                "textRaw": "Returns: {MessagePort}",
                "name": "return",
                "type": "MessagePort"
              }
            }
          ],
          "desc": "<p>Transfer a <code>MessagePort</code> to a different <a href=\"vm.html\"><code>vm</code></a> Context. The original <code>port</code>\nobject is rendered unusable, and the returned <code>MessagePort</code> instance\ntakes its place.</p>\n<p>The returned <code>MessagePort</code> is an object in the target context and\ninherits from its global <code>Object</code> class. Objects passed to the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/message_event\"><code>port.onmessage()</code></a> listener are also created in the target context\nand inherit from its global <code>Object</code> class.</p>\n<p>However, the created <code>MessagePort</code> no longer inherits from\n<a href=\"events.html#class-eventtarget\"><code>&#x3C;EventTarget></code></a>, and only <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessagePort/message_event\"><code>port.onmessage()</code></a> can be used to receive\nevents using it.</p>"
        },
        {
          "textRaw": "`worker_threads.postMessageToThread(threadId, value[, transferList][, timeout])`",
          "name": "postMessageToThread",
          "type": "method",
          "meta": {
            "added": [
              "v22.5.0",
              "v20.19.0"
            ],
            "changes": []
          },
          "stability": 1.1,
          "stabilityText": "Active development",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`threadId` {number} The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown. If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown.",
                  "name": "threadId",
                  "type": "number",
                  "desc": "The target thread ID. If the thread ID is invalid, a `ERR_WORKER_MESSAGING_FAILED` error will be thrown. If the target thread ID is the current thread ID, a `ERR_WORKER_MESSAGING_SAME_THREAD` error will be thrown."
                },
                {
                  "textRaw": "`value` {any} The value to send.",
                  "name": "value",
                  "type": "any",
                  "desc": "The value to send."
                },
                {
                  "textRaw": "`transferList` {Object[]} If one or more `MessagePort`-like objects are passed in `value`, a `transferList` is required for those items or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.",
                  "name": "transferList",
                  "type": "Object[]",
                  "desc": "If one or more `MessagePort`-like objects are passed in `value`, a `transferList` is required for those items or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.",
                  "optional": true
                },
                {
                  "textRaw": "`timeout` {number} Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever. If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.",
                  "name": "timeout",
                  "type": "number",
                  "desc": "Time to wait for the message to be delivered in milliseconds. By default it's `undefined`, which means wait forever. If the operation times out, a `ERR_WORKER_MESSAGING_TIMEOUT` error is thrown.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Promise} A promise which is fulfilled if the message was successfully processed by destination thread.",
                "name": "return",
                "type": "Promise",
                "desc": "A promise which is fulfilled if the message was successfully processed by destination thread."
              }
            }
          ],
          "desc": "<p>Sends a value to another worker, identified by its thread ID.</p>\n<p>If the target thread has no listener for the <code>workerMessage</code> event, then the operation will throw\na <a href=\"errors.html#err_worker_messaging_failed\"><code>ERR_WORKER_MESSAGING_FAILED</code></a> error.</p>\n<p>If the target thread threw an error while processing the <code>workerMessage</code> event, then the operation will throw\na <a href=\"errors.html#err_worker_messaging_errored\"><code>ERR_WORKER_MESSAGING_ERRORED</code></a> error.</p>\n<p>This method should be used when the target thread is not the direct\nparent or child of the current thread.\nIf the two threads are parent-children, use the <a href=\"#workerpostmessagevalue-transferlist\"><code>require('node:worker_threads').parentPort.postMessage()</code></a>\nand the <a href=\"#workerpostmessagevalue-transferlist\"><code>worker.postMessage()</code></a> to let the threads communicate.</p>\n<p>The example below shows the use of <code>postMessageToThread</code>: it creates 10 nested threads,\nthe last one will try to communicate with the main thread.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\nimport {\n  postMessageToThread,\n  threadId,\n  workerData,\n  Worker,\n} from 'node:worker_threads';\n\nconst channel = new BroadcastChannel('sync');\nconst level = workerData?.level ?? 0;\n\nif (level &#x3C; 10) {\n  const worker = new Worker(new URL(import.meta.url), {\n    workerData: { level: level + 1 },\n  });\n}\n\nif (level === 0) {\n  process.on('workerMessage', (value, source) => {\n    console.log(`${source} -> ${threadId}:`, value);\n    postMessageToThread(source, { message: 'pong' });\n  });\n} else if (level === 10) {\n  process.on('workerMessage', (value, source) => {\n    console.log(`${source} -> ${threadId}:`, value);\n    channel.postMessage('done');\n    channel.close();\n  });\n\n  await postMessageToThread(0, { message: 'ping' });\n}\n\nchannel.onmessage = channel.close;\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  postMessageToThread,\n  threadId,\n  workerData,\n  Worker,\n} = require('node:worker_threads');\n\nconst channel = new BroadcastChannel('sync');\nconst level = workerData?.level ?? 0;\n\nif (level &#x3C; 10) {\n  const worker = new Worker(__filename, {\n    workerData: { level: level + 1 },\n  });\n}\n\nif (level === 0) {\n  process.on('workerMessage', (value, source) => {\n    console.log(`${source} -> ${threadId}:`, value);\n    postMessageToThread(source, { message: 'pong' });\n  });\n} else if (level === 10) {\n  process.on('workerMessage', (value, source) => {\n    console.log(`${source} -> ${threadId}:`, value);\n    channel.postMessage('done');\n    channel.close();\n  });\n\n  postMessageToThread(0, { message: 'ping' });\n}\n\nchannel.onmessage = channel.close;\n</code></pre>"
        },
        {
          "textRaw": "`worker_threads.receiveMessageOnPort(port)`",
          "name": "receiveMessageOnPort",
          "type": "method",
          "meta": {
            "added": [
              "v12.3.0"
            ],
            "changes": [
              {
                "version": "v15.12.0",
                "pr-url": "https://github.com/nodejs/node/pull/37535",
                "description": "The port argument can also refer to a `BroadcastChannel` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`port` {MessagePort|BroadcastChannel}",
                  "name": "port",
                  "type": "MessagePort|BroadcastChannel"
                }
              ],
              "return": {
                "textRaw": "Returns: {Object|undefined}",
                "name": "return",
                "type": "Object|undefined"
              }
            }
          ],
          "desc": "<p>Receive a single message from a given <code>MessagePort</code>. If no message is available,\n<code>undefined</code> is returned, otherwise an object with a single <code>message</code> property\nthat contains the message payload, corresponding to the oldest message in the\n<code>MessagePort</code>'s queue.</p>\n<pre><code class=\"language-mjs\">import { MessageChannel, receiveMessageOnPort } from 'node:worker_threads';\nconst { port1, port2 } = new MessageChannel();\nport1.postMessage({ hello: 'world' });\n\nconsole.log(receiveMessageOnPort(port2));\n// Prints: { message: { hello: 'world' } }\nconsole.log(receiveMessageOnPort(port2));\n// Prints: undefined\n</code></pre>\n<pre><code class=\"language-cjs\">const { MessageChannel, receiveMessageOnPort } = require('node:worker_threads');\nconst { port1, port2 } = new MessageChannel();\nport1.postMessage({ hello: 'world' });\n\nconsole.log(receiveMessageOnPort(port2));\n// Prints: { message: { hello: 'world' } }\nconsole.log(receiveMessageOnPort(port2));\n// Prints: undefined\n</code></pre>\n<p>When this function is used, no <code>'message'</code> event is emitted and the\n<code>onmessage</code> listener is not invoked.</p>"
        },
        {
          "textRaw": "`worker_threads.setEnvironmentData(key[, value])`",
          "name": "setEnvironmentData",
          "type": "method",
          "meta": {
            "added": [
              "v15.12.0",
              "v14.18.0"
            ],
            "changes": [
              {
                "version": [
                  "v17.5.0",
                  "v16.15.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/41272",
                "description": "No longer experimental."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`key` {any} Any arbitrary, cloneable JavaScript value that can be used as a {Map} key.",
                  "name": "key",
                  "type": "any",
                  "desc": "Any arbitrary, cloneable JavaScript value that can be used as a {Map} key."
                },
                {
                  "textRaw": "`value` {any} Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value for the `key` will be deleted.",
                  "name": "value",
                  "type": "any",
                  "desc": "Any arbitrary, cloneable JavaScript value that will be cloned and passed automatically to all new `Worker` instances. If `value` is passed as `undefined`, any previously set value for the `key` will be deleted.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>worker.setEnvironmentData()</code> API sets the content of\n<code>worker.getEnvironmentData()</code> in the current thread and all new <code>Worker</code>\ninstances spawned from the current context.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {boolean}",
          "name": "isInternalThread",
          "type": "boolean",
          "meta": {
            "added": [
              "v23.7.0",
              "v22.14.0"
            ],
            "changes": []
          },
          "desc": "<p>Is <code>true</code> if this code is running inside of an internal <a href=\"#class-worker\"><code>Worker</code></a> thread (e.g the loader thread).</p>\n<pre><code class=\"language-bash\">node --experimental-loader ./loader.js main.js\n</code></pre>\n<pre><code class=\"language-mjs\">// loader.js\nimport { isInternalThread } from 'node:worker_threads';\nconsole.log(isInternalThread);  // true\n</code></pre>\n<pre><code class=\"language-cjs\">// loader.js\nconst { isInternalThread } = require('node:worker_threads');\nconsole.log(isInternalThread);  // true\n</code></pre>\n<pre><code class=\"language-mjs\">// main.js\nimport { isInternalThread } from 'node:worker_threads';\nconsole.log(isInternalThread);  // false\n</code></pre>\n<pre><code class=\"language-cjs\">// main.js\nconst { isInternalThread } = require('node:worker_threads');\nconsole.log(isInternalThread);  // false\n</code></pre>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "isMainThread",
          "type": "boolean",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<p>Is <code>true</code> if this code is not running inside of a <a href=\"#class-worker\"><code>Worker</code></a> thread.</p>\n<pre><code class=\"language-mjs\">import { Worker, isMainThread } from 'node:worker_threads';\n\nif (isMainThread) {\n  // This re-loads the current file inside a Worker instance.\n  new Worker(new URL(import.meta.url));\n} else {\n  console.log('Inside Worker!');\n  console.log(isMainThread);  // Prints 'false'.\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { Worker, isMainThread } = require('node:worker_threads');\n\nif (isMainThread) {\n  // This re-loads the current file inside a Worker instance.\n  new Worker(__filename);\n} else {\n  console.log('Inside Worker!');\n  console.log(isMainThread);  // Prints 'false'.\n}\n</code></pre>"
        },
        {
          "textRaw": "Type: {null|MessagePort}",
          "name": "parentPort",
          "type": "null|MessagePort",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<p>If this thread is a <a href=\"#class-worker\"><code>Worker</code></a>, this is a <a href=\"#class-messageport\"><code>MessagePort</code></a>\nallowing communication with the parent thread. Messages sent using\n<code>parentPort.postMessage()</code> are available in the parent thread\nusing <code>worker.on('message')</code>, and messages sent from the parent thread\nusing <code>worker.postMessage()</code> are available in this thread using\n<code>parentPort.on('message')</code>.</p>\n<pre><code class=\"language-mjs\">import { Worker, isMainThread, parentPort } from 'node:worker_threads';\n\nif (isMainThread) {\n  const worker = new Worker(new URL(import.meta.url));\n  worker.once('message', (message) => {\n    console.log(message);  // Prints 'Hello, world!'.\n  });\n  worker.postMessage('Hello, world!');\n} else {\n  // When a message from the parent thread is received, send it back:\n  parentPort.once('message', (message) => {\n    parentPort.postMessage(message);\n  });\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { Worker, isMainThread, parentPort } = require('node:worker_threads');\n\nif (isMainThread) {\n  const worker = new Worker(__filename);\n  worker.once('message', (message) => {\n    console.log(message);  // Prints 'Hello, world!'.\n  });\n  worker.postMessage('Hello, world!');\n} else {\n  // When a message from the parent thread is received, send it back:\n  parentPort.once('message', (message) => {\n    parentPort.postMessage(message);\n  });\n}\n</code></pre>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "resourceLimits",
          "type": "Object",
          "meta": {
            "added": [
              "v13.2.0",
              "v12.16.0"
            ],
            "changes": []
          },
          "desc": "<p>Provides the set of JS engine resource constraints inside this Worker thread.\nIf the <code>resourceLimits</code> option was passed to the <a href=\"#class-worker\"><code>Worker</code></a> constructor,\nthis matches its values.</p>\n<p>If this is used in the main thread, its value is an empty object.</p>",
          "options": [
            {
              "textRaw": "`maxYoungGenerationSizeMb` {number}",
              "name": "maxYoungGenerationSizeMb",
              "type": "number"
            },
            {
              "textRaw": "`maxOldGenerationSizeMb` {number}",
              "name": "maxOldGenerationSizeMb",
              "type": "number"
            },
            {
              "textRaw": "`codeRangeSizeMb` {number}",
              "name": "codeRangeSizeMb",
              "type": "number"
            },
            {
              "textRaw": "`stackSizeMb` {number}",
              "name": "stackSizeMb",
              "type": "number"
            }
          ]
        },
        {
          "textRaw": "Type: {symbol}",
          "name": "SHARE_ENV",
          "type": "symbol",
          "meta": {
            "added": [
              "v11.14.0"
            ],
            "changes": []
          },
          "desc": "<p>A special value that can be passed as the <code>env</code> option of the <a href=\"#class-worker\"><code>Worker</code></a>\nconstructor, to indicate that the current thread and the Worker thread should\nshare read and write access to the same set of environment variables.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\nimport { Worker, SHARE_ENV } from 'node:worker_threads';\nnew Worker('process.env.SET_IN_WORKER = \"foo\"', { eval: true, env: SHARE_ENV })\n  .once('exit', () => {\n    console.log(process.env.SET_IN_WORKER);  // Prints 'foo'.\n  });\n</code></pre>\n<pre><code class=\"language-cjs\">const { Worker, SHARE_ENV } = require('node:worker_threads');\nnew Worker('process.env.SET_IN_WORKER = \"foo\"', { eval: true, env: SHARE_ENV })\n  .once('exit', () => {\n    console.log(process.env.SET_IN_WORKER);  // Prints 'foo'.\n  });\n</code></pre>"
        },
        {
          "textRaw": "Type: {integer}",
          "name": "threadId",
          "type": "integer",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<p>An integer identifier for the current thread. On the corresponding worker object\n(if there is any), it is available as <a href=\"#workerthreadid\"><code>worker.threadId</code></a>.\nThis value is unique for each <a href=\"#class-worker\"><code>Worker</code></a> instance inside a single process.</p>"
        },
        {
          "textRaw": "{string|null}",
          "name": "threadName",
          "type": "string|null",
          "meta": {
            "added": [
              "v24.6.0",
              "v22.20.0"
            ],
            "changes": []
          },
          "desc": "<p>A string identifier for the current thread or null if the thread is not running.\nOn the corresponding worker object (if there is any), it is available as <a href=\"#workerthreadname\"><code>worker.threadName</code></a>.</p>"
        },
        {
          "textRaw": "`worker_threads.workerData`",
          "name": "workerData",
          "type": "property",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<p>An arbitrary JavaScript value that contains a clone of the data passed\nto this thread's <code>Worker</code> constructor.</p>\n<p>The data is cloned as if using <a href=\"#portpostmessagevalue-transferlist\"><code>postMessage()</code></a>,\naccording to the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\">HTML structured clone algorithm</a>.</p>\n<pre><code class=\"language-mjs\">import { Worker, isMainThread, workerData } from 'node:worker_threads';\n\nif (isMainThread) {\n  const worker = new Worker(new URL(import.meta.url), { workerData: 'Hello, world!' });\n} else {\n  console.log(workerData);  // Prints 'Hello, world!'.\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { Worker, isMainThread, workerData } = require('node:worker_threads');\n\nif (isMainThread) {\n  const worker = new Worker(__filename, { workerData: 'Hello, world!' });\n} else {\n  console.log(workerData);  // Prints 'Hello, world!'.\n}\n</code></pre>"
        },
        {
          "textRaw": "{LockManager}",
          "name": "locks",
          "type": "LockManager",
          "meta": {
            "added": [
              "v24.5.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>An instance of a <a href=\"#class-lockmanager\"><code>LockManager</code></a> that can be used to coordinate\naccess to resources that may be shared across multiple threads within the same\nprocess. The API mirrors the semantics of the\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/API/LockManager\">browser <code>LockManager</code></a></p>",
          "classes": [
            {
              "textRaw": "Class: `Lock`",
              "name": "Lock",
              "type": "class",
              "meta": {
                "added": [
                  "v24.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>Lock</code> interface provides information about a lock that has been granted via\n<a href=\"#locksrequestname-options-callback\"><code>locks.request()</code></a></p>",
              "properties": [
                {
                  "textRaw": "{string}",
                  "name": "name",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The name of the lock.</p>"
                },
                {
                  "textRaw": "{string}",
                  "name": "mode",
                  "type": "string",
                  "meta": {
                    "added": [
                      "v24.5.0"
                    ],
                    "changes": []
                  },
                  "desc": "<p>The mode of the lock. Either <code>shared</code> or <code>exclusive</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "Class: `LockManager`",
              "name": "LockManager",
              "type": "class",
              "meta": {
                "added": [
                  "v24.5.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>LockManager</code> interface provides methods for requesting and introspecting\nlocks. To obtain a <code>LockManager</code> instance use</p>\n<pre><code class=\"language-mjs\">import { locks } from 'node:worker_threads';\n</code></pre>\n<pre><code class=\"language-cjs\">const { locks } = require('node:worker_threads');\n</code></pre>\n<p>This implementation matches the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/LockManager\">browser <code>LockManager</code></a> API.</p>",
              "methods": [
                {
                  "textRaw": "`locks.request(name[, options], callback)`",
                  "name": "request",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v24.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`name` {string}",
                          "name": "name",
                          "type": "string"
                        },
                        {
                          "textRaw": "`options` {Object}",
                          "name": "options",
                          "type": "Object",
                          "options": [
                            {
                              "textRaw": "`mode` {string} Either `'exclusive'` or `'shared'`. **Default:** `'exclusive'`.",
                              "name": "mode",
                              "type": "string",
                              "default": "`'exclusive'`",
                              "desc": "Either `'exclusive'` or `'shared'`."
                            },
                            {
                              "textRaw": "`ifAvailable` {boolean} If `true`, the request will only be granted if the lock is not already held. If it cannot be granted, `callback` will be invoked with `null` instead of a `Lock` instance. **Default:** `false`.",
                              "name": "ifAvailable",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "If `true`, the request will only be granted if the lock is not already held. If it cannot be granted, `callback` will be invoked with `null` instead of a `Lock` instance."
                            },
                            {
                              "textRaw": "`steal` {boolean} If `true`, any existing locks with the same name are released and the request is granted immediately, pre-empting any queued requests. **Default:** `false`.",
                              "name": "steal",
                              "type": "boolean",
                              "default": "`false`",
                              "desc": "If `true`, any existing locks with the same name are released and the request is granted immediately, pre-empting any queued requests."
                            },
                            {
                              "textRaw": "`signal` {AbortSignal} that can be used to abort a pending (but not yet granted) lock request.",
                              "name": "signal",
                              "type": "AbortSignal",
                              "desc": "that can be used to abort a pending (but not yet granted) lock request."
                            }
                          ],
                          "optional": true
                        },
                        {
                          "textRaw": "`callback` {Function} Invoked once the lock is granted (or immediately with `null` if `ifAvailable` is `true` and the lock is unavailable). The lock is released automatically when the function returns, or—if the function returns a promise—when that promise settles.",
                          "name": "callback",
                          "type": "Function",
                          "desc": "Invoked once the lock is granted (or immediately with `null` if `ifAvailable` is `true` and the lock is unavailable). The lock is released automatically when the function returns, or—if the function returns a promise—when that promise settles."
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Promise} Resolves once the lock has been released.",
                        "name": "return",
                        "type": "Promise",
                        "desc": "Resolves once the lock has been released."
                      }
                    }
                  ],
                  "desc": "<pre><code class=\"language-mjs\">import { locks } from 'node:worker_threads';\n\nawait locks.request('my_resource', async (lock) => {\n  // The lock has been acquired.\n});\n// The lock has been released here.\n</code></pre>\n<pre><code class=\"language-cjs\">const { locks } = require('node:worker_threads');\n\nlocks.request('my_resource', async (lock) => {\n  // The lock has been acquired.\n}).then(() => {\n  // The lock has been released here.\n});\n</code></pre>"
                },
                {
                  "textRaw": "`locks.query()`",
                  "name": "query",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v24.5.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [],
                      "return": {
                        "textRaw": "Returns: {Promise}",
                        "name": "return",
                        "type": "Promise"
                      }
                    }
                  ],
                  "desc": "<p>Resolves with a <code>LockManagerSnapshot</code> describing the currently held and pending\nlocks for the current process.</p>\n<pre><code class=\"language-mjs\">import { locks } from 'node:worker_threads';\n\nconst snapshot = await locks.query();\nfor (const lock of snapshot.held) {\n  console.log(`held lock: name ${lock.name}, mode ${lock.mode}`);\n}\nfor (const pending of snapshot.pending) {\n  console.log(`pending lock: name ${pending.name}, mode ${pending.mode}`);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { locks } = require('node:worker_threads');\n\nlocks.query().then((snapshot) => {\n  for (const lock of snapshot.held) {\n    console.log(`held lock: name ${lock.name}, mode ${lock.mode}`);\n  }\n  for (const pending of snapshot.pending) {\n    console.log(`pending lock: name ${pending.name}, mode ${pending.mode}`);\n  }\n});\n</code></pre>"
                }
              ]
            }
          ]
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `BroadcastChannel extends EventTarget`",
          "name": "BroadcastChannel extends EventTarget",
          "type": "class",
          "meta": {
            "added": [
              "v15.4.0"
            ],
            "changes": [
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41271",
                "description": "No longer experimental."
              }
            ]
          },
          "desc": "<p>Instances of <code>BroadcastChannel</code> allow asynchronous one-to-many communication\nwith all other <code>BroadcastChannel</code> instances bound to the same channel name.</p>\n<pre><code class=\"language-mjs\">import {\n  isMainThread,\n  BroadcastChannel,\n  Worker,\n} from 'node:worker_threads';\n\nconst bc = new BroadcastChannel('hello');\n\nif (isMainThread) {\n  let c = 0;\n  bc.onmessage = (event) => {\n    console.log(event.data);\n    if (++c === 10) bc.close();\n  };\n  for (let n = 0; n &#x3C; 10; n++)\n    new Worker(new URL(import.meta.url));\n} else {\n  bc.postMessage('hello from every worker');\n  bc.close();\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  isMainThread,\n  BroadcastChannel,\n  Worker,\n} = require('node:worker_threads');\n\nconst bc = new BroadcastChannel('hello');\n\nif (isMainThread) {\n  let c = 0;\n  bc.onmessage = (event) => {\n    console.log(event.data);\n    if (++c === 10) bc.close();\n  };\n  for (let n = 0; n &#x3C; 10; n++)\n    new Worker(__filename);\n} else {\n  bc.postMessage('hello from every worker');\n  bc.close();\n}\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new BroadcastChannel(name)`",
              "name": "BroadcastChannel",
              "type": "ctor",
              "meta": {
                "added": [
                  "v15.4.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`name` {any} The name of the channel to connect to. Any JavaScript value that can be converted to a string using ``${name}`` is permitted.",
                  "name": "name",
                  "type": "any",
                  "desc": "The name of the channel to connect to. Any JavaScript value that can be converted to a string using ``${name}`` is permitted."
                }
              ]
            }
          ],
          "methods": [
            {
              "textRaw": "`broadcastChannel.close()`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v15.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Closes the <code>BroadcastChannel</code> connection.</p>"
            },
            {
              "textRaw": "`broadcastChannel.postMessage(message)`",
              "name": "postMessage",
              "type": "method",
              "meta": {
                "added": [
                  "v15.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`message` {any} Any cloneable JavaScript value.",
                      "name": "message",
                      "type": "any",
                      "desc": "Any cloneable JavaScript value."
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`broadcastChannel.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v15.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Opposite of <code>unref()</code>. Calling <code>ref()</code> on a previously <code>unref()</code>ed\nBroadcastChannel does <em>not</em> let the program exit if it's the only active handle\nleft (the default behavior). If the port is <code>ref()</code>ed, calling <code>ref()</code> again\nhas no effect.</p>"
            },
            {
              "textRaw": "`broadcastChannel.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v15.4.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calling <code>unref()</code> on a BroadcastChannel allows the thread to exit if this\nis the only active handle in the event system. If the BroadcastChannel is\nalready <code>unref()</code>ed calling <code>unref()</code> again has no effect.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "Type: {Function} Invoked with a single `MessageEvent` argument when a message is received.",
              "name": "onmessage",
              "type": "Function",
              "meta": {
                "added": [
                  "v15.4.0"
                ],
                "changes": []
              },
              "desc": "Invoked with a single `MessageEvent` argument when a message is received."
            },
            {
              "textRaw": "Type: {Function} Invoked with a received message cannot be deserialized.",
              "name": "onmessageerror",
              "type": "Function",
              "meta": {
                "added": [
                  "v15.4.0"
                ],
                "changes": []
              },
              "desc": "Invoked with a received message cannot be deserialized."
            }
          ]
        },
        {
          "textRaw": "Class: `MessageChannel`",
          "name": "MessageChannel",
          "type": "class",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<p>Instances of the <code>worker.MessageChannel</code> class represent an asynchronous,\ntwo-way communications channel.\nThe <code>MessageChannel</code> has no methods of its own. <code>new MessageChannel()</code>\nyields an object with <code>port1</code> and <code>port2</code> properties, which refer to linked\n<a href=\"#class-messageport\"><code>MessagePort</code></a> instances.</p>\n<pre><code class=\"language-mjs\">import { MessageChannel } from 'node:worker_threads';\n\nconst { port1, port2 } = new MessageChannel();\nport1.on('message', (message) => console.log('received', message));\nport2.postMessage({ foo: 'bar' });\n// Prints: received { foo: 'bar' } from the `port1.on('message')` listener\n</code></pre>\n<pre><code class=\"language-cjs\">const { MessageChannel } = require('node:worker_threads');\n\nconst { port1, port2 } = new MessageChannel();\nport1.on('message', (message) => console.log('received', message));\nport2.postMessage({ foo: 'bar' });\n// Prints: received { foo: 'bar' } from the `port1.on('message')` listener\n</code></pre>"
        },
        {
          "textRaw": "Class: `MessagePort`",
          "name": "MessagePort",
          "type": "class",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": [
              {
                "version": [
                  "v14.7.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/34057",
                "description": "This class now inherits from `EventTarget` rather than from `EventEmitter`."
              }
            ]
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventtarget\"><code>&#x3C;EventTarget></code></a></li>\n</ul>\n<p>Instances of the <code>worker.MessagePort</code> class represent one end of an\nasynchronous, two-way communications channel. It can be used to transfer\nstructured data, memory regions and other <code>MessagePort</code>s between different\n<a href=\"#class-worker\"><code>Worker</code></a>s.</p>\n<p>This implementation matches <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessagePort\">browser <code>MessagePort</code></a>s.</p>",
          "events": [
            {
              "textRaw": "Event: `'close'`",
              "name": "close",
              "type": "event",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'close'</code> event is emitted once either side of the channel has been\ndisconnected.</p>\n<pre><code class=\"language-mjs\">import { MessageChannel } from 'node:worker_threads';\nconst { port1, port2 } = new MessageChannel();\n\n// Prints:\n//   foobar\n//   closed!\nport2.on('message', (message) => console.log(message));\nport2.once('close', () => console.log('closed!'));\n\nport1.postMessage('foobar');\nport1.close();\n</code></pre>\n<pre><code class=\"language-cjs\">const { MessageChannel } = require('node:worker_threads');\nconst { port1, port2 } = new MessageChannel();\n\n// Prints:\n//   foobar\n//   closed!\nport2.on('message', (message) => console.log(message));\nport2.once('close', () => console.log('closed!'));\n\nport1.postMessage('foobar');\nport1.close();\n</code></pre>"
            },
            {
              "textRaw": "Event: `'message'`",
              "name": "message",
              "type": "event",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`value` {any} The transmitted value",
                  "name": "value",
                  "type": "any",
                  "desc": "The transmitted value"
                }
              ],
              "desc": "<p>The <code>'message'</code> event is emitted for any incoming message, containing the cloned\ninput of <a href=\"#portpostmessagevalue-transferlist\"><code>port.postMessage()</code></a>.</p>\n<p>Listeners on this event receive a clone of the <code>value</code> parameter as passed\nto <code>postMessage()</code> and no further arguments.</p>"
            },
            {
              "textRaw": "Event: `'messageerror'`",
              "name": "messageerror",
              "type": "event",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`error` {Error} An Error object",
                  "name": "error",
                  "type": "Error",
                  "desc": "An Error object"
                }
              ],
              "desc": "<p>The <code>'messageerror'</code> event is emitted when deserializing a message failed.</p>\n<p>Currently, this event is emitted when there is an error occurring while\ninstantiating the posted JS object on the receiving end. Such situations\nare rare, but can happen, for instance, when certain Node.js API objects\nare received in a <code>vm.Context</code> (where Node.js APIs are currently\nunavailable).</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`port.close()`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Disables further sending of messages on either side of the connection.\nThis method can be called when no further communication will happen over this\n<code>MessagePort</code>.</p>\n<p>The <a href=\"#event-close\"><code>'close'</code> event</a> is emitted on both <code>MessagePort</code> instances that\nare part of the channel.</p>"
            },
            {
              "textRaw": "`port.postMessage(value[, transferList])`",
              "name": "postMessage",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": "v21.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/47604",
                    "description": "An error is thrown when an untransferable object is in the transfer list."
                  },
                  {
                    "version": [
                      "v15.14.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37917",
                    "description": "Add 'BlockList' to the list of cloneable types."
                  },
                  {
                    "version": [
                      "v15.9.0",
                      "v14.18.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/37155",
                    "description": "Add 'Histogram' types to the list of cloneable types."
                  },
                  {
                    "version": "v15.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/36804",
                    "description": "Added `X509Certificate` to the list of cloneable types."
                  },
                  {
                    "version": "v15.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/35093",
                    "description": "Added `CryptoKey` to the list of cloneable types."
                  },
                  {
                    "version": [
                      "v14.5.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33360",
                    "description": "Added `KeyObject` to the list of cloneable types."
                  },
                  {
                    "version": [
                      "v14.5.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/33772",
                    "description": "Added `FileHandle` to the list of transferable types."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    },
                    {
                      "textRaw": "`transferList` {Object[]}",
                      "name": "transferList",
                      "type": "Object[]",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Sends a JavaScript value to the receiving side of this channel.\n<code>value</code> is transferred in a way which is compatible with\nthe <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\">HTML structured clone algorithm</a>.</p>\n<p>In particular, the significant differences to <code>JSON</code> are:</p>\n<ul>\n<li><code>value</code> may contain circular references.</li>\n<li><code>value</code> may contain instances of builtin JS types such as <code>RegExp</code>s,\n<code>BigInt</code>s, <code>Map</code>s, <code>Set</code>s, etc.</li>\n<li><code>value</code> may contain typed arrays, both using <code>ArrayBuffer</code>s\nand <code>SharedArrayBuffer</code>s.</li>\n<li><code>value</code> may contain <a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly/Reference/JavaScript_interface/Module\"><code>WebAssembly.Module</code></a> instances.</li>\n<li><code>value</code> may not contain native (C++-backed) objects other than:\n<ul>\n<li><a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>s,</li>\n<li><a href=\"fs.html#class-filehandle\"><code>&#x3C;FileHandle></code></a>s,</li>\n<li><a href=\"perf_hooks.html#class-histogram\"><code>&#x3C;Histogram></code></a>s,</li>\n<li><a href=\"crypto.html#class-keyobject\"><code>&#x3C;KeyObject></code></a>s,</li>\n<li><a href=\"worker_threads.html#class-messageport\"><code>&#x3C;MessagePort></code></a>s,</li>\n<li><a href=\"net.html#class-netblocklist\"><code>&#x3C;net.BlockList></code></a>s,</li>\n<li><a href=\"net.html#class-netsocketaddress\"><code>&#x3C;net.SocketAddress></code></a>es,</li>\n<li><a href=\"crypto.html#class-x509certificate\"><code>&#x3C;X509Certificate></code></a>s.</li>\n</ul>\n</li>\n</ul>\n<pre><code class=\"language-mjs\">import { MessageChannel } from 'node:worker_threads';\nconst { port1, port2 } = new MessageChannel();\n\nport1.on('message', (message) => console.log(message));\n\nconst circularData = {};\ncircularData.foo = circularData;\n// Prints: { foo: [Circular] }\nport2.postMessage(circularData);\n</code></pre>\n<pre><code class=\"language-cjs\">const { MessageChannel } = require('node:worker_threads');\nconst { port1, port2 } = new MessageChannel();\n\nport1.on('message', (message) => console.log(message));\n\nconst circularData = {};\ncircularData.foo = circularData;\n// Prints: { foo: [Circular] }\nport2.postMessage(circularData);\n</code></pre>\n<p><code>transferList</code> may be a list of <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>, <a href=\"#class-messageport\"><code>MessagePort</code></a>, and\n<a href=\"fs.html#class-filehandle\"><code>FileHandle</code></a> objects.\nAfter transferring, they are not usable on the sending side of the channel\nanymore (even if they are not contained in <code>value</code>). Unlike with\n<a href=\"child_process.html\">child processes</a>, transferring handles such as network sockets is currently\nnot supported.</p>\n<p>If <code>value</code> contains <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer\"><code>&#x3C;SharedArrayBuffer></code></a> instances, those are accessible\nfrom either thread. They cannot be listed in <code>transferList</code>.</p>\n<p><code>value</code> may still contain <code>ArrayBuffer</code> instances that are not in\n<code>transferList</code>; in that case, the underlying memory is copied rather than moved.</p>\n<pre><code class=\"language-mjs\">import { MessageChannel } from 'node:worker_threads';\nconst { port1, port2 } = new MessageChannel();\n\nport1.on('message', (message) => console.log(message));\n\nconst uint8Array = new Uint8Array([ 1, 2, 3, 4 ]);\n// This posts a copy of `uint8Array`:\nport2.postMessage(uint8Array);\n// This does not copy data, but renders `uint8Array` unusable:\nport2.postMessage(uint8Array, [ uint8Array.buffer ]);\n\n// The memory for the `sharedUint8Array` is accessible from both the\n// original and the copy received by `.on('message')`:\nconst sharedUint8Array = new Uint8Array(new SharedArrayBuffer(4));\nport2.postMessage(sharedUint8Array);\n\n// This transfers a freshly created message port to the receiver.\n// This can be used, for example, to create communication channels between\n// multiple `Worker` threads that are children of the same parent thread.\nconst otherChannel = new MessageChannel();\nport2.postMessage({ port: otherChannel.port1 }, [ otherChannel.port1 ]);\n</code></pre>\n<pre><code class=\"language-cjs\">const { MessageChannel } = require('node:worker_threads');\nconst { port1, port2 } = new MessageChannel();\n\nport1.on('message', (message) => console.log(message));\n\nconst uint8Array = new Uint8Array([ 1, 2, 3, 4 ]);\n// This posts a copy of `uint8Array`:\nport2.postMessage(uint8Array);\n// This does not copy data, but renders `uint8Array` unusable:\nport2.postMessage(uint8Array, [ uint8Array.buffer ]);\n\n// The memory for the `sharedUint8Array` is accessible from both the\n// original and the copy received by `.on('message')`:\nconst sharedUint8Array = new Uint8Array(new SharedArrayBuffer(4));\nport2.postMessage(sharedUint8Array);\n\n// This transfers a freshly created message port to the receiver.\n// This can be used, for example, to create communication channels between\n// multiple `Worker` threads that are children of the same parent thread.\nconst otherChannel = new MessageChannel();\nport2.postMessage({ port: otherChannel.port1 }, [ otherChannel.port1 ]);\n</code></pre>\n<p>The message object is cloned immediately, and can be modified after\nposting without having side effects.</p>\n<p>For more information on the serialization and deserialization mechanisms\nbehind this API, see the <a href=\"v8.html#serialization-api\">serialization API of the <code>node:v8</code> module</a>.</p>",
              "modules": [
                {
                  "textRaw": "Considerations when transferring TypedArrays and Buffers",
                  "name": "considerations_when_transferring_typedarrays_and_buffers",
                  "type": "module",
                  "desc": "<p>All <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> instances are views over an underlying\n<a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>. That is, it is the <code>ArrayBuffer</code> that actually stores\nthe raw data while the <code>TypedArray</code> and <code>Buffer</code> objects provide a\nway of viewing and manipulating the data. It is possible and common\nfor multiple views to be created over the same <code>ArrayBuffer</code> instance.\nGreat care must be taken when using a transfer list to transfer an\n<code>ArrayBuffer</code> as doing so causes all <code>TypedArray</code> and <code>Buffer</code>\ninstances that share that same <code>ArrayBuffer</code> to become unusable.</p>\n<pre><code class=\"language-js\">const ab = new ArrayBuffer(10);\n\nconst u1 = new Uint8Array(ab);\nconst u2 = new Uint16Array(ab);\n\nconsole.log(u2.length);  // prints 5\n\nport.postMessage(u1, [u1.buffer]);\n\nconsole.log(u2.length);  // prints 0\n</code></pre>\n<p>For <code>Buffer</code> instances, specifically, whether the underlying\n<code>ArrayBuffer</code> can be transferred or cloned depends entirely on how\ninstances were created, which often cannot be reliably determined.</p>\n<p>An <code>ArrayBuffer</code> can be marked with <a href=\"#worker_threadsmarkasuntransferableobject\"><code>markAsUntransferable()</code></a> to indicate\nthat it should always be cloned and never transferred.</p>\n<p>Depending on how a <code>Buffer</code> instance was created, it may or may\nnot own its underlying <code>ArrayBuffer</code>. An <code>ArrayBuffer</code> must not\nbe transferred unless it is known that the <code>Buffer</code> instance\nowns it. In particular, for <code>Buffer</code>s created from the internal\n<code>Buffer</code> pool (using, for instance <code>Buffer.from()</code> or <code>Buffer.allocUnsafe()</code>),\ntransferring them is not possible and they are always cloned,\nwhich sends a copy of the entire <code>Buffer</code> pool.\nThis behavior may come with unintended higher memory\nusage and possible security concerns.</p>\n<p>See <a href=\"buffer.html#static-method-bufferallocunsafesize\"><code>Buffer.allocUnsafe()</code></a> for more details on <code>Buffer</code> pooling.</p>\n<p>The <code>ArrayBuffer</code>s for <code>Buffer</code> instances created using\n<code>Buffer.alloc()</code> or <code>Buffer.allocUnsafeSlow()</code> can always be\ntransferred but doing so renders all other existing views of\nthose <code>ArrayBuffer</code>s unusable.</p>",
                  "displayName": "Considerations when transferring TypedArrays and Buffers"
                },
                {
                  "textRaw": "Considerations when cloning objects with prototypes, classes, and accessors",
                  "name": "considerations_when_cloning_objects_with_prototypes,_classes,_and_accessors",
                  "type": "module",
                  "desc": "<p>Because object cloning uses the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\">HTML structured clone algorithm</a>,\nnon-enumerable properties, property accessors, and object prototypes are\nnot preserved. In particular, <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> objects will be read as\nplain <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\"><code>&#x3C;Uint8Array></code></a>s on the receiving side, and instances of JavaScript\nclasses will be cloned as plain JavaScript objects.</p>\n<pre><code class=\"language-js\">const b = Symbol('b');\n\nclass Foo {\n  #a = 1;\n  constructor() {\n    this[b] = 2;\n    this.c = 3;\n  }\n\n  get d() { return this.#a + 3; }\n}\n\nconst { port1, port2 } = new MessageChannel();\n\nport1.onmessage = ({ data }) => console.log(data);\n\nport2.postMessage(new Foo());\n\n// Prints: { c: 3 }\n</code></pre>\n<p>Some built-in objects cannot be cloned at all. For example, posting a\n<code>URL</code> object throws a <code>DataCloneError</code>:</p>\n<pre><code class=\"language-js\">const { port1, port2 } = new MessageChannel();\n\nport2.postMessage(new URL('https://example.org'));\n// Throws DataCloneError: Cannot clone object of unsupported type.\n</code></pre>",
                  "displayName": "Considerations when cloning objects with prototypes, classes, and accessors"
                }
              ]
            },
            {
              "textRaw": "`port.hasRef()`",
              "name": "hasRef",
              "type": "method",
              "meta": {
                "added": [
                  "v18.1.0",
                  "v16.17.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v24.0.0",
                      "v22.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/57513",
                    "description": "Marking the API stable."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>If true, the <code>MessagePort</code> object will keep the Node.js event loop active.</p>"
            },
            {
              "textRaw": "`port.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Opposite of <code>unref()</code>. Calling <code>ref()</code> on a previously <code>unref()</code>ed port does\n<em>not</em> let the program exit if it's the only active handle left (the default\nbehavior). If the port is <code>ref()</code>ed, calling <code>ref()</code> again has no effect.</p>\n<p>If listeners are attached or removed using <code>.on('message')</code>, the port\nis <code>ref()</code>ed and <code>unref()</code>ed automatically depending on whether\nlisteners for the event exist.</p>"
            },
            {
              "textRaw": "`port.start()`",
              "name": "start",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Starts receiving messages on this <code>MessagePort</code>. When using this port\nas an event emitter, this is called automatically once <code>'message'</code>\nlisteners are attached.</p>\n<p>This method exists for parity with the Web <code>MessagePort</code> API. In Node.js,\nit is only useful for ignoring messages when no event listener is present.\nNode.js also diverges in its handling of <code>.onmessage</code>. Setting it\nautomatically calls <code>.start()</code>, but unsetting it lets messages queue up\nuntil a new handler is set or the port is discarded.</p>"
            },
            {
              "textRaw": "`port.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calling <code>unref()</code> on a port allows the thread to exit if this is the only\nactive handle in the event system. If the port is already <code>unref()</code>ed calling\n<code>unref()</code> again has no effect.</p>\n<p>If listeners are attached or removed using <code>.on('message')</code>, the port is\n<code>ref()</code>ed and <code>unref()</code>ed automatically depending on whether\nlisteners for the event exist.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `Worker`",
          "name": "Worker",
          "type": "class",
          "meta": {
            "added": [
              "v10.5.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventemitter\"><code>&#x3C;EventEmitter></code></a></li>\n</ul>\n<p>The <code>Worker</code> class represents an independent JavaScript execution thread.\nMost Node.js APIs are available inside of it.</p>\n<p>Notable differences inside a Worker environment are:</p>\n<ul>\n<li>The <a href=\"process.html#processstdin\"><code>process.stdin</code></a>, <a href=\"process.html#processstdout\"><code>process.stdout</code></a>, and <a href=\"process.html#processstderr\"><code>process.stderr</code></a>\nstreams may be redirected by the parent thread.</li>\n<li>The <a href=\"#worker_threadsismainthread\"><code>require('node:worker_threads').isMainThread</code></a> property is set to <code>false</code>.</li>\n<li>The <a href=\"#worker_threadsparentport\"><code>require('node:worker_threads').parentPort</code></a> message port is available.</li>\n<li><a href=\"process.html#processexitcode\"><code>process.exit()</code></a> does not stop the whole program, just the single thread,\nand <a href=\"process.html#processabort\"><code>process.abort()</code></a> is not available.</li>\n<li><a href=\"process.html#processchdirdirectory\"><code>process.chdir()</code></a> and <code>process</code> methods that set group or user ids\nare not available.</li>\n<li><a href=\"process.html#processenv\"><code>process.env</code></a> is a copy of the parent thread's environment variables,\nunless otherwise specified. Changes to one copy are not visible in other\nthreads, and are not visible to native add-ons (unless\n<a href=\"#worker_threadsshare_env\"><code>worker.SHARE_ENV</code></a> is passed as the <code>env</code> option to the\n<a href=\"#class-worker\"><code>Worker</code></a> constructor). On Windows, unlike the main thread, a copy of the\nenvironment variables operates in a case-sensitive manner.</li>\n<li><a href=\"process.html#processtitle\"><code>process.title</code></a> cannot be modified.</li>\n<li>Signals are not delivered through <a href=\"process.html#signal-events\"><code>process.on('...')</code></a>.</li>\n<li>Execution may stop at any point as a result of <a href=\"#workerterminate\"><code>worker.terminate()</code></a>\nbeing invoked.</li>\n<li>IPC channels from parent processes are not accessible.</li>\n<li>The <a href=\"tracing.html\"><code>trace_events</code></a> module is not supported.</li>\n<li>Native add-ons can only be loaded from multiple threads if they fulfill\n<a href=\"addons.html#worker-support\">certain conditions</a>.</li>\n</ul>\n<p>Creating <code>Worker</code> instances inside of other <code>Worker</code>s is possible.</p>\n<p>Like <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API\">Web Workers</a> and the <a href=\"cluster.html\"><code>node:cluster</code> module</a>, two-way communication\ncan be achieved through inter-thread message passing. Internally, a <code>Worker</code> has\na built-in pair of <a href=\"#class-messageport\"><code>MessagePort</code></a>s that are already associated with each\nother when the <code>Worker</code> is created. While the <code>MessagePort</code> object on the parent\nside is not directly exposed, its functionalities are exposed through\n<a href=\"#workerpostmessagevalue-transferlist\"><code>worker.postMessage()</code></a> and the <a href=\"#event-message_1\"><code>worker.on('message')</code></a> event\non the <code>Worker</code> object for the parent thread.</p>\n<p>To create custom messaging channels (which is encouraged over using the default\nglobal channel because it facilitates separation of concerns), users can create\na <code>MessageChannel</code> object on either thread and pass one of the\n<code>MessagePort</code>s on that <code>MessageChannel</code> to the other thread through a\npre-existing channel, such as the global one.</p>\n<p>See <a href=\"#portpostmessagevalue-transferlist\"><code>port.postMessage()</code></a> for more information on how messages are passed,\nand what kind of JavaScript values can be successfully transported through\nthe thread barrier.</p>\n<pre><code class=\"language-mjs\">import assert from 'node:assert';\nimport {\n  Worker, MessageChannel, MessagePort, isMainThread, parentPort,\n} from 'node:worker_threads';\nif (isMainThread) {\n  const worker = new Worker(new URL(import.meta.url));\n  const subChannel = new MessageChannel();\n  worker.postMessage({ hereIsYourPort: subChannel.port1 }, [subChannel.port1]);\n  subChannel.port2.on('message', (value) => {\n    console.log('received:', value);\n  });\n} else {\n  parentPort.once('message', (value) => {\n    assert(value.hereIsYourPort instanceof MessagePort);\n    value.hereIsYourPort.postMessage('the worker is sending this');\n    value.hereIsYourPort.close();\n  });\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const assert = require('node:assert');\nconst {\n  Worker, MessageChannel, MessagePort, isMainThread, parentPort,\n} = require('node:worker_threads');\nif (isMainThread) {\n  const worker = new Worker(__filename);\n  const subChannel = new MessageChannel();\n  worker.postMessage({ hereIsYourPort: subChannel.port1 }, [subChannel.port1]);\n  subChannel.port2.on('message', (value) => {\n    console.log('received:', value);\n  });\n} else {\n  parentPort.once('message', (value) => {\n    assert(value.hereIsYourPort instanceof MessagePort);\n    value.hereIsYourPort.postMessage('the worker is sending this');\n    value.hereIsYourPort.close();\n  });\n}\n</code></pre>",
          "signatures": [
            {
              "textRaw": "`new Worker(filename[, options])`",
              "name": "Worker",
              "type": "ctor",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v19.8.0",
                      "v18.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/46832",
                    "description": "Added support for a `name` option, which allows adding a name to worker title for debugging."
                  },
                  {
                    "version": "v14.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34584",
                    "description": "The `filename` parameter can be a WHATWG `URL` object using `data:` protocol."
                  },
                  {
                    "version": "v14.9.0",
                    "pr-url": "https://github.com/nodejs/node/pull/34394",
                    "description": "The `trackUnmanagedFds` option was set to `true` by default."
                  },
                  {
                    "version": [
                      "v14.6.0",
                      "v12.19.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/34303",
                    "description": "The `trackUnmanagedFds` option was introduced."
                  },
                  {
                    "version": [
                      "v13.13.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32278",
                    "description": "The `transferList` option was introduced."
                  },
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/31664",
                    "description": "The `filename` parameter can be a WHATWG `URL` object using `file:` protocol."
                  },
                  {
                    "version": [
                      "v13.4.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/30559",
                    "description": "The `argv` option was introduced."
                  },
                  {
                    "version": [
                      "v13.2.0",
                      "v12.16.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/26628",
                    "description": "The `resourceLimits` option was introduced."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`filename` {string|URL} The path to the Worker's main script or module. Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with `./` or `../`, or a WHATWG `URL` object using `file:` or `data:` protocol. When using a `data:` URL, the data is interpreted based on MIME type using the ECMAScript module loader. If `options.eval` is `true`, this is a string containing JavaScript code rather than a path.",
                  "name": "filename",
                  "type": "string|URL",
                  "desc": "The path to the Worker's main script or module. Must be either an absolute path or a relative path (i.e. relative to the current working directory) starting with `./` or `../`, or a WHATWG `URL` object using `file:` or `data:` protocol. When using a `data:` URL, the data is interpreted based on MIME type using the ECMAScript module loader. If `options.eval` is `true`, this is a string containing JavaScript code rather than a path."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`argv` {any[]} List of arguments which would be stringified and appended to `process.argv` in the worker. This is mostly similar to the `workerData` but the values are available on the global `process.argv` as if they were passed as CLI options to the script.",
                      "name": "argv",
                      "type": "any[]",
                      "desc": "List of arguments which would be stringified and appended to `process.argv` in the worker. This is mostly similar to the `workerData` but the values are available on the global `process.argv` as if they were passed as CLI options to the script."
                    },
                    {
                      "textRaw": "`env` {Object} If set, specifies the initial value of `process.env` inside the Worker thread. As a special value, `worker.SHARE_ENV` may be used to specify that the parent thread and the child thread should share their environment variables; in that case, changes to one thread's `process.env` object affect the other thread as well. **Default:** `process.env`.",
                      "name": "env",
                      "type": "Object",
                      "default": "`process.env`",
                      "desc": "If set, specifies the initial value of `process.env` inside the Worker thread. As a special value, `worker.SHARE_ENV` may be used to specify that the parent thread and the child thread should share their environment variables; in that case, changes to one thread's `process.env` object affect the other thread as well."
                    },
                    {
                      "textRaw": "`eval` {boolean} If `true` and the first argument is a `string`, interpret the first argument to the constructor as a script that is executed once the worker is online.",
                      "name": "eval",
                      "type": "boolean",
                      "desc": "If `true` and the first argument is a `string`, interpret the first argument to the constructor as a script that is executed once the worker is online."
                    },
                    {
                      "textRaw": "`execArgv` {string[]} List of node CLI options passed to the worker. V8 options (such as `--max-old-space-size`) and options that affect the process (such as `--title`) are not supported. If set, this is provided as `process.execArgv` inside the worker. By default, options are inherited from the parent thread.",
                      "name": "execArgv",
                      "type": "string[]",
                      "desc": "List of node CLI options passed to the worker. V8 options (such as `--max-old-space-size`) and options that affect the process (such as `--title`) are not supported. If set, this is provided as `process.execArgv` inside the worker. By default, options are inherited from the parent thread."
                    },
                    {
                      "textRaw": "`stdin` {boolean} If this is set to `true`, then `worker.stdin` provides a writable stream whose contents appear as `process.stdin` inside the Worker. By default, no data is provided.",
                      "name": "stdin",
                      "type": "boolean",
                      "desc": "If this is set to `true`, then `worker.stdin` provides a writable stream whose contents appear as `process.stdin` inside the Worker. By default, no data is provided."
                    },
                    {
                      "textRaw": "`stdout` {boolean} If this is set to `true`, then `worker.stdout` is not automatically piped through to `process.stdout` in the parent.",
                      "name": "stdout",
                      "type": "boolean",
                      "desc": "If this is set to `true`, then `worker.stdout` is not automatically piped through to `process.stdout` in the parent."
                    },
                    {
                      "textRaw": "`stderr` {boolean} If this is set to `true`, then `worker.stderr` is not automatically piped through to `process.stderr` in the parent.",
                      "name": "stderr",
                      "type": "boolean",
                      "desc": "If this is set to `true`, then `worker.stderr` is not automatically piped through to `process.stderr` in the parent."
                    },
                    {
                      "textRaw": "`workerData` {any} Any JavaScript value that is cloned and made available as `require('node:worker_threads').workerData`. The cloning occurs as described in the HTML structured clone algorithm, and an error is thrown if the object cannot be cloned (e.g. because it contains `function`s).",
                      "name": "workerData",
                      "type": "any",
                      "desc": "Any JavaScript value that is cloned and made available as `require('node:worker_threads').workerData`. The cloning occurs as described in the HTML structured clone algorithm, and an error is thrown if the object cannot be cloned (e.g. because it contains `function`s)."
                    },
                    {
                      "textRaw": "`trackUnmanagedFds` {boolean} If this is set to `true`, then the Worker tracks raw file descriptors managed through `fs.open()` and `fs.close()`, and closes them when the Worker exits, similar to other resources like network sockets or file descriptors managed through the `FileHandle` API. This option is automatically inherited by all nested `Worker`s. **Default:** `true`.",
                      "name": "trackUnmanagedFds",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "If this is set to `true`, then the Worker tracks raw file descriptors managed through `fs.open()` and `fs.close()`, and closes them when the Worker exits, similar to other resources like network sockets or file descriptors managed through the `FileHandle` API. This option is automatically inherited by all nested `Worker`s."
                    },
                    {
                      "textRaw": "`transferList` {Object[]} If one or more `MessagePort`-like objects are passed in `workerData`, a `transferList` is required for those items or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information.",
                      "name": "transferList",
                      "type": "Object[]",
                      "desc": "If one or more `MessagePort`-like objects are passed in `workerData`, a `transferList` is required for those items or `ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST` is thrown. See `port.postMessage()` for more information."
                    },
                    {
                      "textRaw": "`resourceLimits` {Object} An optional set of resource limits for the new JS engine instance. Reaching these limits leads to termination of the `Worker` instance. These limits only affect the JS engine, and no external data, including no `ArrayBuffer`s. Even if these limits are set, the process may still abort if it encounters a global out-of-memory situation.",
                      "name": "resourceLimits",
                      "type": "Object",
                      "desc": "An optional set of resource limits for the new JS engine instance. Reaching these limits leads to termination of the `Worker` instance. These limits only affect the JS engine, and no external data, including no `ArrayBuffer`s. Even if these limits are set, the process may still abort if it encounters a global out-of-memory situation.",
                      "options": [
                        {
                          "textRaw": "`maxOldGenerationSizeMb` {number} The maximum size of the main heap in MB. If the command-line argument `--max-old-space-size` is set, it overrides this setting.",
                          "name": "maxOldGenerationSizeMb",
                          "type": "number",
                          "desc": "The maximum size of the main heap in MB. If the command-line argument `--max-old-space-size` is set, it overrides this setting."
                        },
                        {
                          "textRaw": "`maxYoungGenerationSizeMb` {number} The maximum size of a heap space for recently created objects. If the command-line argument `--max-semi-space-size` is set, it overrides this setting.",
                          "name": "maxYoungGenerationSizeMb",
                          "type": "number",
                          "desc": "The maximum size of a heap space for recently created objects. If the command-line argument `--max-semi-space-size` is set, it overrides this setting."
                        },
                        {
                          "textRaw": "`codeRangeSizeMb` {number} The size of a pre-allocated memory range used for generated code.",
                          "name": "codeRangeSizeMb",
                          "type": "number",
                          "desc": "The size of a pre-allocated memory range used for generated code."
                        },
                        {
                          "textRaw": "`stackSizeMb` {number} The default maximum stack size for the thread. Small values may lead to unusable Worker instances. **Default:** `4`.",
                          "name": "stackSizeMb",
                          "type": "number",
                          "default": "`4`",
                          "desc": "The default maximum stack size for the thread. Small values may lead to unusable Worker instances."
                        }
                      ]
                    },
                    {
                      "textRaw": "`name` {string} An optional `name` to be replaced in the thread name and to the worker title for debugging/identification purposes, making the final title as `[worker ${id}] ${name}`. This parameter has a maximum allowed size, depending on the operating system. If the provided name exceeds the limit, it will be truncatedMaximum sizes:Windows: 32,767 charactersmacOS: 64 charactersLinux: 16 charactersNetBSD: limited to `PTHREAD_MAX_NAMELEN_NP`FreeBSD and OpenBSD: limited to `MAXCOMLEN` **Default:** `'WorkerThread'`.",
                      "name": "name",
                      "type": "string",
                      "default": "`'WorkerThread'`",
                      "desc": "An optional `name` to be replaced in the thread name and to the worker title for debugging/identification purposes, making the final title as `[worker ${id}] ${name}`. This parameter has a maximum allowed size, depending on the operating system. If the provided name exceeds the limit, it will be truncatedMaximum sizes:Windows: 32,767 charactersmacOS: 64 charactersLinux: 16 charactersNetBSD: limited to `PTHREAD_MAX_NAMELEN_NP`FreeBSD and OpenBSD: limited to `MAXCOMLEN`"
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "events": [
            {
              "textRaw": "Event: `'error'`",
              "name": "error",
              "type": "event",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`err` {any}",
                  "name": "err",
                  "type": "any"
                }
              ],
              "desc": "<p>The <code>'error'</code> event is emitted if the worker thread throws an uncaught\nexception. In that case, the worker is terminated.</p>"
            },
            {
              "textRaw": "Event: `'exit'`",
              "name": "exit",
              "type": "event",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`exitCode` {integer}",
                  "name": "exitCode",
                  "type": "integer"
                }
              ],
              "desc": "<p>The <code>'exit'</code> event is emitted once the worker has stopped. If the worker\nexited by calling <a href=\"process.html#processexitcode\"><code>process.exit()</code></a>, the <code>exitCode</code> parameter is the\npassed exit code. If the worker was terminated, the <code>exitCode</code> parameter is\n<code>1</code>.</p>\n<p>This is the final event emitted by any <code>Worker</code> instance.</p>"
            },
            {
              "textRaw": "Event: `'message'`",
              "name": "message",
              "type": "event",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`value` {any} The transmitted value",
                  "name": "value",
                  "type": "any",
                  "desc": "The transmitted value"
                }
              ],
              "desc": "<p>The <code>'message'</code> event is emitted when the worker thread has invoked\n<a href=\"#workerpostmessagevalue-transferlist\"><code>require('node:worker_threads').parentPort.postMessage()</code></a>.\nSee the <a href=\"#event-message\"><code>port.on('message')</code></a> event for more details.</p>\n<p>All messages sent from the worker thread are emitted before the\n<a href=\"#event-exit\"><code>'exit'</code> event</a> is emitted on the <code>Worker</code> object.</p>"
            },
            {
              "textRaw": "Event: `'messageerror'`",
              "name": "messageerror",
              "type": "event",
              "meta": {
                "added": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`error` {Error} An Error object",
                  "name": "error",
                  "type": "Error",
                  "desc": "An Error object"
                }
              ],
              "desc": "<p>The <code>'messageerror'</code> event is emitted when deserializing a message failed.</p>"
            },
            {
              "textRaw": "Event: `'online'`",
              "name": "online",
              "type": "event",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'online'</code> event is emitted when the worker thread has started executing\nJavaScript code.</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`worker.cpuUsage([prev])`",
              "name": "cpuUsage",
              "type": "method",
              "meta": {
                "added": [
                  "v24.6.0",
                  "v22.19.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "prev",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>This method returns a <code>Promise</code> that will resolve to an object identical to <a href=\"process.html#processthreadcpuusagepreviousvalue\"><code>process.threadCpuUsage()</code></a>,\nor reject with an <a href=\"errors.html#err_worker_not_running\"><code>ERR_WORKER_NOT_RUNNING</code></a> error if the worker is no longer running.\nThis methods allows the statistics to be observed from outside the actual thread.</p>"
            },
            {
              "textRaw": "`worker.getHeapSnapshot([options])`",
              "name": "getHeapSnapshot",
              "type": "method",
              "meta": {
                "added": [
                  "v13.9.0",
                  "v12.17.0"
                ],
                "changes": [
                  {
                    "version": "v19.1.0",
                    "pr-url": "https://github.com/nodejs/node/pull/44989",
                    "description": "Support options to configure the heap snapshot."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`exposeInternals` {boolean} If true, expose internals in the heap snapshot. **Default:** `false`.",
                          "name": "exposeInternals",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If true, expose internals in the heap snapshot."
                        },
                        {
                          "textRaw": "`exposeNumericValues` {boolean} If true, expose numeric values in artificial fields. **Default:** `false`.",
                          "name": "exposeNumericValues",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "If true, expose numeric values in artificial fields."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise} A promise for a Readable Stream containing a V8 heap snapshot",
                    "name": "return",
                    "type": "Promise",
                    "desc": "A promise for a Readable Stream containing a V8 heap snapshot"
                  }
                }
              ],
              "desc": "<p>Returns a readable stream for a V8 snapshot of the current state of the Worker.\nSee <a href=\"v8.html#v8getheapsnapshotoptions\"><code>v8.getHeapSnapshot()</code></a> for more details.</p>\n<p>If the Worker thread is no longer running, which may occur before the\n<a href=\"#event-exit\"><code>'exit'</code> event</a> is emitted, the returned <code>Promise</code> is rejected\nimmediately with an <a href=\"errors.html#err_worker_not_running\"><code>ERR_WORKER_NOT_RUNNING</code></a> error.</p>"
            },
            {
              "textRaw": "`worker.getHeapStatistics()`",
              "name": "getHeapStatistics",
              "type": "method",
              "meta": {
                "added": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>This method returns a <code>Promise</code> that will resolve to an object identical to <a href=\"v8.html#v8getheapstatistics\"><code>v8.getHeapStatistics()</code></a>,\nor reject with an <a href=\"errors.html#err_worker_not_running\"><code>ERR_WORKER_NOT_RUNNING</code></a> error if the worker is no longer running.\nThis methods allows the statistics to be observed from outside the actual thread.</p>"
            },
            {
              "textRaw": "`worker.postMessage(value[, transferList])`",
              "name": "postMessage",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`value` {any}",
                      "name": "value",
                      "type": "any"
                    },
                    {
                      "textRaw": "`transferList` {Object[]}",
                      "name": "transferList",
                      "type": "Object[]",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Send a message to the worker that is received via\n<a href=\"#event-message\"><code>require('node:worker_threads').parentPort.on('message')</code></a>.\nSee <a href=\"#portpostmessagevalue-transferlist\"><code>port.postMessage()</code></a> for more details.</p>"
            },
            {
              "textRaw": "`worker.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Opposite of <code>unref()</code>, calling <code>ref()</code> on a previously <code>unref()</code>ed worker does\n<em>not</em> let the program exit if it's the only active handle left (the default\nbehavior). If the worker is <code>ref()</code>ed, calling <code>ref()</code> again has\nno effect.</p>"
            },
            {
              "textRaw": "`worker.startCpuProfile([options])`",
              "name": "startCpuProfile",
              "type": "method",
              "meta": {
                "added": [
                  "v24.8.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`sampleInterval` {number} Requested sampling interval in milliseconds. **Default:** `0`.",
                          "name": "sampleInterval",
                          "type": "number",
                          "default": "`0`",
                          "desc": "Requested sampling interval in milliseconds."
                        },
                        {
                          "textRaw": "`maxBufferSize` {integer} Maximum number of samples to retain. **Default:** `4294967295`.",
                          "name": "maxBufferSize",
                          "type": "integer",
                          "default": "`4294967295`",
                          "desc": "Maximum number of samples to retain."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Starting a CPU profile then return a Promise that fulfills with an error\nor an <code>CPUProfileHandle</code> object. This API supports <code>await using</code> syntax.</p>\n<pre><code class=\"language-cjs\">const { Worker } = require('node:worker_threads');\n\nconst worker = new Worker(`\n  const { parentPort } = require('worker_threads');\n  parentPort.on('message', () => {});\n  `, { eval: true });\n\nworker.on('online', async () => {\n  const handle = await worker.startCpuProfile({ sampleInterval: 1 });\n  const profile = await handle.stop();\n  console.log(profile);\n  worker.terminate();\n});\n</code></pre>\n<p><code>await using</code> example.</p>\n<pre><code class=\"language-cjs\">const { Worker } = require('node:worker_threads');\n\nconst w = new Worker(`\n  const { parentPort } = require('node:worker_threads');\n  parentPort.on('message', () => {});\n  `, { eval: true });\n\nw.on('online', async () => {\n  // Stop profile automatically when return and profile will be discarded\n  await using handle = await w.startCpuProfile();\n});\n</code></pre>"
            },
            {
              "textRaw": "`worker.startHeapProfile([options])`",
              "name": "startHeapProfile",
              "type": "method",
              "meta": {
                "added": [
                  "v24.9.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`sampleInterval` {number} The average sampling interval in bytes. **Default:** `524288` (512 KiB).",
                          "name": "sampleInterval",
                          "type": "number",
                          "default": "`524288` (512 KiB)",
                          "desc": "The average sampling interval in bytes."
                        },
                        {
                          "textRaw": "`stackDepth` {integer} The maximum stack depth for samples. **Default:** `16`.",
                          "name": "stackDepth",
                          "type": "integer",
                          "default": "`16`",
                          "desc": "The maximum stack depth for samples."
                        },
                        {
                          "textRaw": "`forceGC` {boolean} Force garbage collection before taking the profile. **Default:** `false`.",
                          "name": "forceGC",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Force garbage collection before taking the profile."
                        },
                        {
                          "textRaw": "`includeObjectsCollectedByMajorGC` {boolean} Include objects collected by major GC. **Default:** `false`.",
                          "name": "includeObjectsCollectedByMajorGC",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Include objects collected by major GC."
                        },
                        {
                          "textRaw": "`includeObjectsCollectedByMinorGC` {boolean} Include objects collected by minor GC. **Default:** `false`.",
                          "name": "includeObjectsCollectedByMinorGC",
                          "type": "boolean",
                          "default": "`false`",
                          "desc": "Include objects collected by minor GC."
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Starting a Heap profile then return a Promise that fulfills with an error\nor an <code>HeapProfileHandle</code> object. This API supports <code>await using</code> syntax.</p>\n<pre><code class=\"language-cjs\">const { Worker } = require('node:worker_threads');\n\nconst worker = new Worker(`\n  const { parentPort } = require('worker_threads');\n  parentPort.on('message', () => {});\n  `, { eval: true });\n\nworker.on('online', async () => {\n  const handle = await worker.startHeapProfile();\n  const profile = await handle.stop();\n  console.log(profile);\n  worker.terminate();\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { Worker } from 'node:worker_threads';\n\nconst worker = new Worker(`\n  const { parentPort } = require('node:worker_threads');\n  parentPort.on('message', () => {});\n  `, { eval: true });\n\nworker.on('online', async () => {\n  const handle = await worker.startHeapProfile();\n  const profile = await handle.stop();\n  console.log(profile);\n  worker.terminate();\n});\n</code></pre>\n<p><code>await using</code> example.</p>\n<pre><code class=\"language-cjs\">const { Worker } = require('node:worker_threads');\n\nconst w = new Worker(`\n  const { parentPort } = require('node:worker_threads');\n  parentPort.on('message', () => {});\n  `, { eval: true });\n\nw.on('online', async () => {\n  // Stop profile automatically when return and profile will be discarded\n  await using handle = await w.startHeapProfile();\n});\n</code></pre>\n<pre><code class=\"language-mjs\">import { Worker } from 'node:worker_threads';\n\nconst w = new Worker(`\n  const { parentPort } = require('node:worker_threads');\n  parentPort.on('message', () => {});\n  `, { eval: true });\n\nw.on('online', async () => {\n  // Stop profile automatically when return and profile will be discarded\n  await using handle = await w.startHeapProfile();\n});\n</code></pre>"
            },
            {
              "textRaw": "`worker.terminate()`",
              "name": "terminate",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": [
                  {
                    "version": "v12.5.0",
                    "pr-url": "https://github.com/nodejs/node/pull/28021",
                    "description": "This function now returns a Promise. Passing a callback is deprecated, and was useless up to this version, as the Worker was actually terminated synchronously. Terminating is now a fully asynchronous operation."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise}",
                    "name": "return",
                    "type": "Promise"
                  }
                }
              ],
              "desc": "<p>Stop all JavaScript execution in the worker thread as soon as possible.\nReturns a Promise for the exit code that is fulfilled when the\n<a href=\"#event-exit\"><code>'exit'</code> event</a> is emitted.</p>"
            },
            {
              "textRaw": "`worker.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calling <code>unref()</code> on a worker allows the thread to exit if this is the only\nactive handle in the event system. If the worker is already <code>unref()</code>ed calling\n<code>unref()</code> again has no effect.</p>"
            },
            {
              "textRaw": "`worker[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "meta": {
                "added": [
                  "v24.2.0",
                  "v22.18.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Calls <a href=\"#workerterminate\"><code>worker.terminate()</code></a> when the dispose scope is exited.</p>\n<pre><code class=\"language-js\">async function example() {\n  await using worker = new Worker('for (;;) {}', { eval: true });\n  // Worker is automatically terminate when the scope is exited.\n}\n</code></pre>"
            }
          ],
          "properties": [
            {
              "textRaw": "`worker.performance`",
              "name": "performance",
              "type": "property",
              "meta": {
                "added": [
                  "v15.1.0",
                  "v14.17.0",
                  "v12.22.0"
                ],
                "changes": []
              },
              "desc": "<p>An object that can be used to query performance information from a worker\ninstance.</p>",
              "methods": [
                {
                  "textRaw": "`performance.eventLoopUtilization([utilization1[, utilization2]])`",
                  "name": "eventLoopUtilization",
                  "type": "method",
                  "meta": {
                    "added": [
                      "v15.1.0",
                      "v14.17.0",
                      "v12.22.0"
                    ],
                    "changes": []
                  },
                  "signatures": [
                    {
                      "params": [
                        {
                          "textRaw": "`utilization1` {Object} The result of a previous call to `eventLoopUtilization()`.",
                          "name": "utilization1",
                          "type": "Object",
                          "desc": "The result of a previous call to `eventLoopUtilization()`.",
                          "optional": true
                        },
                        {
                          "textRaw": "`utilization2` {Object} The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.",
                          "name": "utilization2",
                          "type": "Object",
                          "desc": "The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.",
                          "optional": true
                        }
                      ],
                      "return": {
                        "textRaw": "Returns: {Object}",
                        "name": "return",
                        "type": "Object",
                        "options": [
                          {
                            "textRaw": "`idle` {number}",
                            "name": "idle",
                            "type": "number"
                          },
                          {
                            "textRaw": "`active` {number}",
                            "name": "active",
                            "type": "number"
                          },
                          {
                            "textRaw": "`utilization` {number}",
                            "name": "utilization",
                            "type": "number"
                          }
                        ]
                      }
                    }
                  ],
                  "desc": "<p>The same call as <a href=\"perf_hooks.html#perf_hookseventlooputilizationutilization1-utilization2\"><code>perf_hooks</code> <code>eventLoopUtilization()</code></a>, except the values\nof the worker instance are returned.</p>\n<p>One difference is that, unlike the main thread, bootstrapping within a worker\nis done within the event loop. So the event loop utilization is\nimmediately available once the worker's script begins execution.</p>\n<p>An <code>idle</code> time that does not increase does not indicate that the worker is\nstuck in bootstrap. The following examples shows how the worker's entire\nlifetime never accumulates any <code>idle</code> time, but is still be able to process\nmessages.</p>\n<pre><code class=\"language-mjs\">import { Worker, isMainThread, parentPort } from 'node:worker_threads';\n\nif (isMainThread) {\n  const worker = new Worker(new URL(import.meta.url));\n  setInterval(() => {\n    worker.postMessage('hi');\n    console.log(worker.performance.eventLoopUtilization());\n  }, 100).unref();\n} else {\n  parentPort.on('message', () => console.log('msg')).unref();\n  (function r(n) {\n    if (--n &#x3C; 0) return;\n    const t = Date.now();\n    while (Date.now() - t &#x3C; 300);\n    setImmediate(r, n);\n  })(10);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { Worker, isMainThread, parentPort } = require('node:worker_threads');\n\nif (isMainThread) {\n  const worker = new Worker(__filename);\n  setInterval(() => {\n    worker.postMessage('hi');\n    console.log(worker.performance.eventLoopUtilization());\n  }, 100).unref();\n} else {\n  parentPort.on('message', () => console.log('msg')).unref();\n  (function r(n) {\n    if (--n &#x3C; 0) return;\n    const t = Date.now();\n    while (Date.now() - t &#x3C; 300);\n    setImmediate(r, n);\n  })(10);\n}\n</code></pre>\n<p>The event loop utilization of a worker is available only after the <a href=\"#event-online\"><code>'online'</code>\nevent</a> emitted, and if called before this, or after the <a href=\"#event-exit\"><code>'exit'</code>\nevent</a>, then all properties have the value of <code>0</code>.</p>"
                }
              ]
            },
            {
              "textRaw": "Type: {Object}",
              "name": "resourceLimits",
              "type": "Object",
              "meta": {
                "added": [
                  "v13.2.0",
                  "v12.16.0"
                ],
                "changes": []
              },
              "desc": "<p>Provides the set of JS engine resource constraints for this Worker thread.\nIf the <code>resourceLimits</code> option was passed to the <a href=\"#class-worker\"><code>Worker</code></a> constructor,\nthis matches its values.</p>\n<p>If the worker has stopped, the return value is an empty object.</p>",
              "options": [
                {
                  "textRaw": "`maxYoungGenerationSizeMb` {number}",
                  "name": "maxYoungGenerationSizeMb",
                  "type": "number"
                },
                {
                  "textRaw": "`maxOldGenerationSizeMb` {number}",
                  "name": "maxOldGenerationSizeMb",
                  "type": "number"
                },
                {
                  "textRaw": "`codeRangeSizeMb` {number}",
                  "name": "codeRangeSizeMb",
                  "type": "number"
                },
                {
                  "textRaw": "`stackSizeMb` {number}",
                  "name": "stackSizeMb",
                  "type": "number"
                }
              ]
            },
            {
              "textRaw": "Type: {stream.Readable}",
              "name": "stderr",
              "type": "stream.Readable",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This is a readable stream which contains data written to <a href=\"process.html#processstderr\"><code>process.stderr</code></a>\ninside the worker thread. If <code>stderr: true</code> was not passed to the\n<a href=\"#class-worker\"><code>Worker</code></a> constructor, then data is piped to the parent thread's\n<a href=\"process.html#processstderr\"><code>process.stderr</code></a> stream.</p>"
            },
            {
              "textRaw": "Type: {null|stream.Writable}",
              "name": "stdin",
              "type": "null|stream.Writable",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>stdin: true</code> was passed to the <a href=\"#class-worker\"><code>Worker</code></a> constructor, this is a\nwritable stream. The data written to this stream will be made available in\nthe worker thread as <a href=\"process.html#processstdin\"><code>process.stdin</code></a>.</p>"
            },
            {
              "textRaw": "Type: {stream.Readable}",
              "name": "stdout",
              "type": "stream.Readable",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "desc": "<p>This is a readable stream which contains data written to <a href=\"process.html#processstdout\"><code>process.stdout</code></a>\ninside the worker thread. If <code>stdout: true</code> was not passed to the\n<a href=\"#class-worker\"><code>Worker</code></a> constructor, then data is piped to the parent thread's\n<a href=\"process.html#processstdout\"><code>process.stdout</code></a> stream.</p>"
            },
            {
              "textRaw": "Type: {integer}",
              "name": "threadId",
              "type": "integer",
              "meta": {
                "added": [
                  "v10.5.0"
                ],
                "changes": []
              },
              "desc": "<p>An integer identifier for the referenced thread. Inside the worker thread,\nit is available as <a href=\"#worker_threadsthreadid\"><code>require('node:worker_threads').threadId</code></a>.\nThis value is unique for each <code>Worker</code> instance inside a single process.</p>"
            },
            {
              "textRaw": "{string|null}",
              "name": "threadName",
              "type": "string|null",
              "meta": {
                "added": [
                  "v24.6.0",
                  "v22.20.0"
                ],
                "changes": []
              },
              "desc": "<p>A string identifier for the referenced thread or null if the thread is not running.\nInside the worker thread, it is available as <a href=\"#worker_threadsthreadname\"><code>require('node:worker_threads').threadName</code></a>.</p>"
            }
          ]
        }
      ],
      "modules": [
        {
          "textRaw": "Notes",
          "name": "notes",
          "type": "module",
          "modules": [
            {
              "textRaw": "Synchronous blocking of stdio",
              "name": "synchronous_blocking_of_stdio",
              "type": "module",
              "desc": "<p><code>Worker</code>s utilize message passing via <a href=\"worker_threads.html#class-messageport\"><code>&#x3C;MessagePort></code></a> to implement interactions\nwith <code>stdio</code>. This means that <code>stdio</code> output originating from a <code>Worker</code> can\nget blocked by synchronous code on the receiving end that is blocking the\nNode.js event loop.</p>\n<pre><code class=\"language-mjs\">import {\n  Worker,\n  isMainThread,\n} from 'node:worker_threads';\n\nif (isMainThread) {\n  new Worker(new URL(import.meta.url));\n  for (let n = 0; n &#x3C; 1e10; n++) {\n    // Looping to simulate work.\n  }\n} else {\n  // This output will be blocked by the for loop in the main thread.\n  console.log('foo');\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  Worker,\n  isMainThread,\n} = require('node:worker_threads');\n\nif (isMainThread) {\n  new Worker(__filename);\n  for (let n = 0; n &#x3C; 1e10; n++) {\n    // Looping to simulate work.\n  }\n} else {\n  // This output will be blocked by the for loop in the main thread.\n  console.log('foo');\n}\n</code></pre>",
              "displayName": "Synchronous blocking of stdio"
            },
            {
              "textRaw": "Launching worker threads from preload scripts",
              "name": "launching_worker_threads_from_preload_scripts",
              "type": "module",
              "desc": "<p>Take care when launching worker threads from preload scripts (scripts loaded\nand run using the <code>-r</code> command line flag). Unless the <code>execArgv</code> option is\nexplicitly set, new Worker threads automatically inherit the command line flags\nfrom the running process and will preload the same preload scripts as the main\nthread. If the preload script unconditionally launches a worker thread, every\nthread spawned will spawn another until the application crashes.</p>",
              "displayName": "Launching worker threads from preload scripts"
            }
          ],
          "displayName": "Notes"
        }
      ],
      "displayName": "Worker threads",
      "source": "doc/api/worker_threads.md"
    },
    {
      "textRaw": "Zlib",
      "name": "zlib",
      "introduced_in": "v0.10.0",
      "type": "module",
      "stability": 2,
      "stabilityText": "Stable",
      "desc": "<p>The <code>node:zlib</code> module provides compression functionality implemented using\nGzip, Deflate/Inflate, Brotli, and Zstd.</p>\n<p>To access it:</p>\n<pre><code class=\"language-mjs\">import zlib from 'node:zlib';\n</code></pre>\n<pre><code class=\"language-cjs\">const zlib = require('node:zlib');\n</code></pre>\n<p>Compression and decompression are built around the Node.js <a href=\"stream.html\">Streams API</a>.</p>\n<p>Compressing or decompressing a stream (such as a file) can be accomplished by\npiping the source stream through a <code>zlib</code> <code>Transform</code> stream into a destination\nstream:</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n  createWriteStream,\n} from 'node:fs';\nimport process from 'node:process';\nimport { createGzip } from 'node:zlib';\nimport { pipeline } from 'node:stream';\n\nconst gzip = createGzip();\nconst source = createReadStream('input.txt');\nconst destination = createWriteStream('input.txt.gz');\n\npipeline(source, gzip, destination, (err) => {\n  if (err) {\n    console.error('An error occurred:', err);\n    process.exitCode = 1;\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n  createWriteStream,\n} = require('node:fs');\nconst { createGzip } = require('node:zlib');\nconst { pipeline } = require('node:stream');\n\nconst gzip = createGzip();\nconst source = createReadStream('input.txt');\nconst destination = createWriteStream('input.txt.gz');\n\npipeline(source, gzip, destination, (err) => {\n  if (err) {\n    console.error('An error occurred:', err);\n    process.exitCode = 1;\n  }\n});\n</code></pre>\n<p>Or, using the promise <code>pipeline</code> API:</p>\n<pre><code class=\"language-mjs\">import {\n  createReadStream,\n  createWriteStream,\n} from 'node:fs';\nimport { createGzip } from 'node:zlib';\nimport { pipeline } from 'node:stream/promises';\n\nasync function do_gzip(input, output) {\n  const gzip = createGzip();\n  const source = createReadStream(input);\n  const destination = createWriteStream(output);\n  await pipeline(source, gzip, destination);\n}\n\nawait do_gzip('input.txt', 'input.txt.gz');\n</code></pre>\n<pre><code class=\"language-cjs\">const {\n  createReadStream,\n  createWriteStream,\n} = require('node:fs');\nconst { createGzip } = require('node:zlib');\nconst { pipeline } = require('node:stream/promises');\n\nasync function do_gzip(input, output) {\n  const gzip = createGzip();\n  const source = createReadStream(input);\n  const destination = createWriteStream(output);\n  await pipeline(source, gzip, destination);\n}\n\ndo_gzip('input.txt', 'input.txt.gz')\n  .catch((err) => {\n    console.error('An error occurred:', err);\n    process.exitCode = 1;\n  });\n</code></pre>\n<p>It is also possible to compress or decompress data in a single step:</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\nimport { Buffer } from 'node:buffer';\nimport { deflate, unzip } from 'node:zlib';\n\nconst input = '.................................';\ndeflate(input, (err, buffer) => {\n  if (err) {\n    console.error('An error occurred:', err);\n    process.exitCode = 1;\n  }\n  console.log(buffer.toString('base64'));\n});\n\nconst buffer = Buffer.from('eJzT0yMAAGTvBe8=', 'base64');\nunzip(buffer, (err, buffer) => {\n  if (err) {\n    console.error('An error occurred:', err);\n    process.exitCode = 1;\n  }\n  console.log(buffer.toString());\n});\n\n// Or, Promisified\n\nimport { promisify } from 'node:util';\nconst do_unzip = promisify(unzip);\n\nconst unzippedBuffer = await do_unzip(buffer);\nconsole.log(unzippedBuffer.toString());\n</code></pre>\n<pre><code class=\"language-cjs\">const { deflate, unzip } = require('node:zlib');\n\nconst input = '.................................';\ndeflate(input, (err, buffer) => {\n  if (err) {\n    console.error('An error occurred:', err);\n    process.exitCode = 1;\n  }\n  console.log(buffer.toString('base64'));\n});\n\nconst buffer = Buffer.from('eJzT0yMAAGTvBe8=', 'base64');\nunzip(buffer, (err, buffer) => {\n  if (err) {\n    console.error('An error occurred:', err);\n    process.exitCode = 1;\n  }\n  console.log(buffer.toString());\n});\n\n// Or, Promisified\n\nconst { promisify } = require('node:util');\nconst do_unzip = promisify(unzip);\n\ndo_unzip(buffer)\n  .then((buf) => console.log(buf.toString()))\n  .catch((err) => {\n    console.error('An error occurred:', err);\n    process.exitCode = 1;\n  });\n</code></pre>",
      "modules": [
        {
          "textRaw": "Threadpool usage and performance considerations",
          "name": "threadpool_usage_and_performance_considerations",
          "type": "module",
          "desc": "<p>All <code>zlib</code> APIs, except those that are explicitly synchronous, use the Node.js\ninternal threadpool. This can lead to surprising effects and performance\nlimitations in some applications.</p>\n<p>Creating and using a large number of zlib objects simultaneously can cause\nsignificant memory fragmentation.</p>\n<pre><code class=\"language-mjs\">import zlib from 'node:zlib';\nimport { Buffer } from 'node:buffer';\n\nconst payload = Buffer.from('This is some data');\n\n// WARNING: DO NOT DO THIS!\nfor (let i = 0; i &#x3C; 30000; ++i) {\n  zlib.deflate(payload, (err, buffer) => {});\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const zlib = require('node:zlib');\n\nconst payload = Buffer.from('This is some data');\n\n// WARNING: DO NOT DO THIS!\nfor (let i = 0; i &#x3C; 30000; ++i) {\n  zlib.deflate(payload, (err, buffer) => {});\n}\n</code></pre>\n<p>In the preceding example, 30,000 deflate instances are created concurrently.\nBecause of how some operating systems handle memory allocation and\ndeallocation, this may lead to significant memory fragmentation.</p>\n<p>It is strongly recommended that the results of compression\noperations be cached to avoid duplication of effort.</p>",
          "displayName": "Threadpool usage and performance considerations"
        },
        {
          "textRaw": "Compressing HTTP requests and responses",
          "name": "compressing_http_requests_and_responses",
          "type": "module",
          "desc": "<p>The <code>node:zlib</code> module can be used to implement support for the <code>gzip</code>, <code>deflate</code>,\n<code>br</code>, and <code>zstd</code> content-encoding mechanisms defined by\n<a href=\"https://tools.ietf.org/html/rfc7230#section-4.2\">HTTP</a>.</p>\n<p>The HTTP <a href=\"https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\"><code>Accept-Encoding</code></a> header is used within an HTTP request to identify\nthe compression encodings accepted by the client. The <a href=\"https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11\"><code>Content-Encoding</code></a>\nheader is used to identify the compression encodings actually applied to a\nmessage.</p>\n<p>The examples given below are drastically simplified to show the basic concept.\nUsing <code>zlib</code> encoding can be expensive, and the results ought to be cached.\nSee <a href=\"#memory-usage-tuning\">Memory usage tuning</a> for more information on the speed/memory/compression\ntradeoffs involved in <code>zlib</code> usage.</p>\n<pre><code class=\"language-mjs\">// Client request example\nimport fs from 'node:fs';\nimport zlib from 'node:zlib';\nimport http from 'node:http';\nimport process from 'node:process';\nimport { pipeline } from 'node:stream';\n\nconst request = http.get({ host: 'example.com',\n                           path: '/',\n                           port: 80,\n                           headers: { 'Accept-Encoding': 'br,gzip,deflate,zstd' } });\nrequest.on('response', (response) => {\n  const output = fs.createWriteStream('example.com_index.html');\n\n  const onError = (err) => {\n    if (err) {\n      console.error('An error occurred:', err);\n      process.exitCode = 1;\n    }\n  };\n\n  switch (response.headers['content-encoding']) {\n    case 'br':\n      pipeline(response, zlib.createBrotliDecompress(), output, onError);\n      break;\n    // Or, just use zlib.createUnzip() to handle both of the following cases:\n    case 'gzip':\n      pipeline(response, zlib.createGunzip(), output, onError);\n      break;\n    case 'deflate':\n      pipeline(response, zlib.createInflate(), output, onError);\n      break;\n    case 'zstd':\n      pipeline(response, zlib.createZstdDecompress(), output, onError);\n      break;\n    default:\n      pipeline(response, output, onError);\n      break;\n  }\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Client request example\nconst zlib = require('node:zlib');\nconst http = require('node:http');\nconst fs = require('node:fs');\nconst { pipeline } = require('node:stream');\n\nconst request = http.get({ host: 'example.com',\n                           path: '/',\n                           port: 80,\n                           headers: { 'Accept-Encoding': 'br,gzip,deflate,zstd' } });\nrequest.on('response', (response) => {\n  const output = fs.createWriteStream('example.com_index.html');\n\n  const onError = (err) => {\n    if (err) {\n      console.error('An error occurred:', err);\n      process.exitCode = 1;\n    }\n  };\n\n  switch (response.headers['content-encoding']) {\n    case 'br':\n      pipeline(response, zlib.createBrotliDecompress(), output, onError);\n      break;\n    // Or, just use zlib.createUnzip() to handle both of the following cases:\n    case 'gzip':\n      pipeline(response, zlib.createGunzip(), output, onError);\n      break;\n    case 'deflate':\n      pipeline(response, zlib.createInflate(), output, onError);\n      break;\n    case 'zstd':\n      pipeline(response, zlib.createZstdDecompress(), output, onError);\n      break;\n    default:\n      pipeline(response, output, onError);\n      break;\n  }\n});\n</code></pre>\n<pre><code class=\"language-mjs\">// server example\n// Running a gzip operation on every request is quite expensive.\n// It would be much more efficient to cache the compressed buffer.\nimport zlib from 'node:zlib';\nimport http from 'node:http';\nimport fs from 'node:fs';\nimport { pipeline } from 'node:stream';\n\nhttp.createServer((request, response) => {\n  const raw = fs.createReadStream('index.html');\n  // Store both a compressed and an uncompressed version of the resource.\n  response.setHeader('Vary', 'Accept-Encoding');\n  const acceptEncoding = request.headers['accept-encoding'] || '';\n\n  const onError = (err) => {\n    if (err) {\n      // If an error occurs, there's not much we can do because\n      // the server has already sent the 200 response code and\n      // some amount of data has already been sent to the client.\n      // The best we can do is terminate the response immediately\n      // and log the error.\n      response.end();\n      console.error('An error occurred:', err);\n    }\n  };\n\n  // Note: This is not a conformant accept-encoding parser.\n  // See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n  if (/\\bdeflate\\b/.test(acceptEncoding)) {\n    response.writeHead(200, { 'Content-Encoding': 'deflate' });\n    pipeline(raw, zlib.createDeflate(), response, onError);\n  } else if (/\\bgzip\\b/.test(acceptEncoding)) {\n    response.writeHead(200, { 'Content-Encoding': 'gzip' });\n    pipeline(raw, zlib.createGzip(), response, onError);\n  } else if (/\\bbr\\b/.test(acceptEncoding)) {\n    response.writeHead(200, { 'Content-Encoding': 'br' });\n    pipeline(raw, zlib.createBrotliCompress(), response, onError);\n  } else if (/\\bzstd\\b/.test(acceptEncoding)) {\n    response.writeHead(200, { 'Content-Encoding': 'zstd' });\n    pipeline(raw, zlib.createZstdCompress(), response, onError);\n  } else {\n    response.writeHead(200, {});\n    pipeline(raw, response, onError);\n  }\n}).listen(1337);\n</code></pre>\n<pre><code class=\"language-cjs\">// server example\n// Running a gzip operation on every request is quite expensive.\n// It would be much more efficient to cache the compressed buffer.\nconst zlib = require('node:zlib');\nconst http = require('node:http');\nconst fs = require('node:fs');\nconst { pipeline } = require('node:stream');\n\nhttp.createServer((request, response) => {\n  const raw = fs.createReadStream('index.html');\n  // Store both a compressed and an uncompressed version of the resource.\n  response.setHeader('Vary', 'Accept-Encoding');\n  const acceptEncoding = request.headers['accept-encoding'] || '';\n\n  const onError = (err) => {\n    if (err) {\n      // If an error occurs, there's not much we can do because\n      // the server has already sent the 200 response code and\n      // some amount of data has already been sent to the client.\n      // The best we can do is terminate the response immediately\n      // and log the error.\n      response.end();\n      console.error('An error occurred:', err);\n    }\n  };\n\n  // Note: This is not a conformant accept-encoding parser.\n  // See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3\n  if (/\\bdeflate\\b/.test(acceptEncoding)) {\n    response.writeHead(200, { 'Content-Encoding': 'deflate' });\n    pipeline(raw, zlib.createDeflate(), response, onError);\n  } else if (/\\bgzip\\b/.test(acceptEncoding)) {\n    response.writeHead(200, { 'Content-Encoding': 'gzip' });\n    pipeline(raw, zlib.createGzip(), response, onError);\n  } else if (/\\bbr\\b/.test(acceptEncoding)) {\n    response.writeHead(200, { 'Content-Encoding': 'br' });\n    pipeline(raw, zlib.createBrotliCompress(), response, onError);\n  } else if (/\\bzstd\\b/.test(acceptEncoding)) {\n    response.writeHead(200, { 'Content-Encoding': 'zstd' });\n    pipeline(raw, zlib.createZstdCompress(), response, onError);\n  } else {\n    response.writeHead(200, {});\n    pipeline(raw, response, onError);\n  }\n}).listen(1337);\n</code></pre>\n<p>By default, the <code>zlib</code> methods will throw an error when decompressing\ntruncated data. However, if it is known that the data is incomplete, or\nthe desire is to inspect only the beginning of a compressed file, it is\npossible to suppress the default error handling by changing the flushing\nmethod that is used to decompress the last chunk of input data:</p>\n<pre><code class=\"language-js\">// This is a truncated version of the buffer from the above examples\nconst buffer = Buffer.from('eJzT0yMA', 'base64');\n\nzlib.unzip(\n  buffer,\n  // For Brotli, the equivalent is zlib.constants.BROTLI_OPERATION_FLUSH.\n  // For Zstd, the equivalent is zlib.constants.ZSTD_e_flush.\n  { finishFlush: zlib.constants.Z_SYNC_FLUSH },\n  (err, buffer) => {\n    if (err) {\n      console.error('An error occurred:', err);\n      process.exitCode = 1;\n    }\n    console.log(buffer.toString());\n  });\n</code></pre>\n<p>This will not change the behavior in other error-throwing situations, e.g.\nwhen the input data has an invalid format. Using this method, it will not be\npossible to determine whether the input ended prematurely or lacks the\nintegrity checks, making it necessary to manually check that the\ndecompressed result is valid.</p>",
          "displayName": "Compressing HTTP requests and responses"
        },
        {
          "textRaw": "Flushing",
          "name": "flushing",
          "type": "module",
          "desc": "<p>Calling <a href=\"#zlibflushkind-callback\"><code>.flush()</code></a> on a compression stream will make <code>zlib</code> return as much\noutput as currently possible. This may come at the cost of degraded compression\nquality, but can be useful when data needs to be available as soon as possible.</p>\n<p>In the following example, <code>flush()</code> is used to write a compressed partial\nHTTP response to the client:</p>\n<pre><code class=\"language-mjs\">import zlib from 'node:zlib';\nimport http from 'node:http';\nimport { pipeline } from 'node:stream';\n\nhttp.createServer((request, response) => {\n  // For the sake of simplicity, the Accept-Encoding checks are omitted.\n  response.writeHead(200, { 'content-encoding': 'gzip' });\n  const output = zlib.createGzip();\n  let i;\n\n  pipeline(output, response, (err) => {\n    if (err) {\n      // If an error occurs, there's not much we can do because\n      // the server has already sent the 200 response code and\n      // some amount of data has already been sent to the client.\n      // The best we can do is terminate the response immediately\n      // and log the error.\n      clearInterval(i);\n      response.end();\n      console.error('An error occurred:', err);\n    }\n  });\n\n  i = setInterval(() => {\n    output.write(`The current time is ${Date()}\\n`, () => {\n      // The data has been passed to zlib, but the compression algorithm may\n      // have decided to buffer the data for more efficient compression.\n      // Calling .flush() will make the data available as soon as the client\n      // is ready to receive it.\n      output.flush();\n    });\n  }, 1000);\n}).listen(1337);\n</code></pre>\n<pre><code class=\"language-cjs\">const zlib = require('node:zlib');\nconst http = require('node:http');\nconst { pipeline } = require('node:stream');\n\nhttp.createServer((request, response) => {\n  // For the sake of simplicity, the Accept-Encoding checks are omitted.\n  response.writeHead(200, { 'content-encoding': 'gzip' });\n  const output = zlib.createGzip();\n  let i;\n\n  pipeline(output, response, (err) => {\n    if (err) {\n      // If an error occurs, there's not much we can do because\n      // the server has already sent the 200 response code and\n      // some amount of data has already been sent to the client.\n      // The best we can do is terminate the response immediately\n      // and log the error.\n      clearInterval(i);\n      response.end();\n      console.error('An error occurred:', err);\n    }\n  });\n\n  i = setInterval(() => {\n    output.write(`The current time is ${Date()}\\n`, () => {\n      // The data has been passed to zlib, but the compression algorithm may\n      // have decided to buffer the data for more efficient compression.\n      // Calling .flush() will make the data available as soon as the client\n      // is ready to receive it.\n      output.flush();\n    });\n  }, 1000);\n}).listen(1337);\n</code></pre>",
          "displayName": "Flushing"
        },
        {
          "textRaw": "Iterable Compression",
          "name": "iterable_compression",
          "type": "module",
          "meta": {
            "added": [
              "v25.9.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>The <code>node:zlib/iter</code> module provides compression and decompression transforms\nfor use with the <a href=\"stream_iter.html\"><code>node:stream/iter</code></a> iterable streams API.</p>\n<p>This module is available only when the <code>--experimental-stream-iter</code> CLI flag\nis enabled.</p>\n<p>Each algorithm has both an async variant (stateful async generator, for use\nwith <a href=\"stream_iter.html#pullsource-transforms-options\"><code>pull()</code></a> and <a href=\"stream_iter.html#pipetosource-transforms-writer-options\"><code>pipeTo()</code></a>) and a sync variant (stateful sync\ngenerator, for use with <code>pullSync()</code> and <code>pipeToSync()</code>).</p>\n<p>The async transforms run compression on the libuv threadpool, overlapping\nI/O with JavaScript execution. The sync transforms run compression directly\non the main thread.</p>\n<blockquote>\n<p>Note: The defaults for these transforms are tuned for streaming throughput,\nand differ from the defaults in <code>node:zlib</code>. In particular, gzip/deflate\ndefault to level 4 (not 6) and memLevel 9 (not 8), and Brotli defaults to\nquality 6 (not 11). These choices match common HTTP server configurations\nand provide significantly faster compression with only a small reduction in\ncompression ratio. All defaults can be overridden via options.</p>\n</blockquote>\n<pre><code class=\"language-mjs\">import { from, pull, bytes, text } from 'node:stream/iter';\nimport { compressGzip, decompressGzip } from 'node:zlib/iter';\n\n// Async round-trip\nconst compressed = await bytes(pull(from('hello'), compressGzip()));\nconst original = await text(pull(from(compressed), decompressGzip()));\nconsole.log(original); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { from, pull, bytes, text } = require('node:stream/iter');\nconst { compressGzip, decompressGzip } = require('node:zlib/iter');\n\nasync function run() {\n  const compressed = await bytes(pull(from('hello'), compressGzip()));\n  const original = await text(pull(from(compressed), decompressGzip()));\n  console.log(original); // 'hello'\n}\n\nrun().catch(console.error);\n</code></pre>\n<pre><code class=\"language-mjs\">import { fromSync, pullSync, textSync } from 'node:stream/iter';\nimport { compressGzipSync, decompressGzipSync } from 'node:zlib/iter';\n\n// Sync round-trip\nconst compressed = pullSync(fromSync('hello'), compressGzipSync());\nconst original = textSync(pullSync(compressed, decompressGzipSync()));\nconsole.log(original); // 'hello'\n</code></pre>\n<pre><code class=\"language-cjs\">const { fromSync, pullSync, textSync } = require('node:stream/iter');\nconst { compressGzipSync, decompressGzipSync } = require('node:zlib/iter');\n\nconst compressed = pullSync(fromSync('hello'), compressGzipSync());\nconst original = textSync(pullSync(compressed, decompressGzipSync()));\nconsole.log(original); // 'hello'\n</code></pre>",
          "methods": [
            {
              "textRaw": "`compressBrotli([options])`",
              "name": "compressBrotli",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`compressBrotliSync([options])`",
              "name": "compressBrotliSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`chunkSize` {number} Output buffer size. **Default:** `65536` (64 KB).",
                          "name": "chunkSize",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "Output buffer size."
                        },
                        {
                          "textRaw": "`params` {Object} Key-value object where keys and values are `zlib.constants` entries. The most important compressor parameters are:",
                          "name": "params",
                          "type": "Object",
                          "desc": "Key-value object where keys and values are `zlib.constants` entries. The most important compressor parameters are:",
                          "options": [
                            {
                              "textRaw": "`BROTLI_PARAM_MODE` -- `BROTLI_MODE_GENERIC` (default), `BROTLI_MODE_TEXT`, or `BROTLI_MODE_FONT`.",
                              "name": "BROTLI_PARAM_MODE",
                              "desc": "- `BROTLI_MODE_GENERIC` (default), `BROTLI_MODE_TEXT`, or `BROTLI_MODE_FONT`."
                            },
                            {
                              "textRaw": "`BROTLI_PARAM_QUALITY` -- ranges from `BROTLI_MIN_QUALITY` to `BROTLI_MAX_QUALITY`. **Default:** `6` (not `BROTLI_DEFAULT_QUALITY` which is 11). Quality 6 is appropriate for streaming; quality 11 is intended for offline/build-time compression.",
                              "name": "BROTLI_PARAM_QUALITY",
                              "default": "`6` (not `BROTLI_DEFAULT_QUALITY` which is 11). Quality 6 is appropriate for streaming; quality 11 is intended for offline/build-time compression",
                              "desc": "- ranges from `BROTLI_MIN_QUALITY` to `BROTLI_MAX_QUALITY`."
                            },
                            {
                              "textRaw": "`BROTLI_PARAM_SIZE_HINT` -- expected input size. **Default:** `0` (unknown).",
                              "name": "BROTLI_PARAM_SIZE_HINT",
                              "default": "`0` (unknown)",
                              "desc": "- expected input size."
                            },
                            {
                              "textRaw": "`BROTLI_PARAM_LGWIN` -- window size (log2). **Default:** `20` (1 MB). The Brotli library default is 22 (4 MB); the reduced default saves memory without significant compression impact for streaming workloads.",
                              "name": "BROTLI_PARAM_LGWIN",
                              "default": "`20` (1 MB). The Brotli library default is 22 (4 MB); the reduced default saves memory without significant compression impact for streaming workloads",
                              "desc": "- window size (log2)."
                            },
                            {
                              "textRaw": "`BROTLI_PARAM_LGBLOCK` -- input block size (log2). See the Brotli compressor options in the zlib documentation for the full list.",
                              "name": "BROTLI_PARAM_LGBLOCK",
                              "desc": "- input block size (log2). See the Brotli compressor options in the zlib documentation for the full list."
                            }
                          ]
                        },
                        {
                          "textRaw": "`dictionary` {Buffer|TypedArray|DataView}",
                          "name": "dictionary",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stateful transform.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stateful transform."
                  }
                }
              ],
              "desc": "<p>Create a Brotli compression transform. Output is compatible with\n<code>zlib.brotliDecompress()</code> and <code>decompressBrotli()</code>/<code>decompressBrotliSync()</code>.</p>"
            },
            {
              "textRaw": "`compressDeflate([options])`",
              "name": "compressDeflate",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`compressDeflateSync([options])`",
              "name": "compressDeflateSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`chunkSize` {number} Output buffer size. **Default:** `65536` (64 KB).",
                          "name": "chunkSize",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "Output buffer size."
                        },
                        {
                          "textRaw": "`level` {number} Compression level (`0`-`9`). **Default:** `4`.",
                          "name": "level",
                          "type": "number",
                          "default": "`4`",
                          "desc": "Compression level (`0`-`9`)."
                        },
                        {
                          "textRaw": "`windowBits` {number} **Default:** `Z_DEFAULT_WINDOWBITS` (15).",
                          "name": "windowBits",
                          "type": "number",
                          "default": "`Z_DEFAULT_WINDOWBITS` (15)"
                        },
                        {
                          "textRaw": "`memLevel` {number} **Default:** `9`.",
                          "name": "memLevel",
                          "type": "number",
                          "default": "`9`"
                        },
                        {
                          "textRaw": "`strategy` {number} **Default:** `Z_DEFAULT_STRATEGY`.",
                          "name": "strategy",
                          "type": "number",
                          "default": "`Z_DEFAULT_STRATEGY`"
                        },
                        {
                          "textRaw": "`dictionary` {Buffer|TypedArray|DataView}",
                          "name": "dictionary",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stateful transform.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stateful transform."
                  }
                }
              ],
              "desc": "<p>Create a deflate compression transform. Output is compatible with\n<code>zlib.inflate()</code> and <code>decompressDeflate()</code>/<code>decompressDeflateSync()</code>.</p>"
            },
            {
              "textRaw": "`compressGzip([options])`",
              "name": "compressGzip",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`compressGzipSync([options])`",
              "name": "compressGzipSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`chunkSize` {number} Output buffer size. **Default:** `65536` (64 KB).",
                          "name": "chunkSize",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "Output buffer size."
                        },
                        {
                          "textRaw": "`level` {number} Compression level (`0`-`9`). **Default:** `4`.",
                          "name": "level",
                          "type": "number",
                          "default": "`4`",
                          "desc": "Compression level (`0`-`9`)."
                        },
                        {
                          "textRaw": "`windowBits` {number} **Default:** `Z_DEFAULT_WINDOWBITS` (15).",
                          "name": "windowBits",
                          "type": "number",
                          "default": "`Z_DEFAULT_WINDOWBITS` (15)"
                        },
                        {
                          "textRaw": "`memLevel` {number} **Default:** `9`.",
                          "name": "memLevel",
                          "type": "number",
                          "default": "`9`"
                        },
                        {
                          "textRaw": "`strategy` {number} **Default:** `Z_DEFAULT_STRATEGY`.",
                          "name": "strategy",
                          "type": "number",
                          "default": "`Z_DEFAULT_STRATEGY`"
                        },
                        {
                          "textRaw": "`dictionary` {Buffer|TypedArray|DataView}",
                          "name": "dictionary",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stateful transform.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stateful transform."
                  }
                }
              ],
              "desc": "<p>Create a gzip compression transform. Output is compatible with <code>zlib.gunzip()</code>\nand <code>decompressGzip()</code>/<code>decompressGzipSync()</code>.</p>"
            },
            {
              "textRaw": "`compressZstd([options])`",
              "name": "compressZstd",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`compressZstdSync([options])`",
              "name": "compressZstdSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`chunkSize` {number} Output buffer size. **Default:** `65536` (64 KB).",
                          "name": "chunkSize",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "Output buffer size."
                        },
                        {
                          "textRaw": "`params` {Object} Key-value object where keys and values are `zlib.constants` entries. The most important compressor parameters are:",
                          "name": "params",
                          "type": "Object",
                          "desc": "Key-value object where keys and values are `zlib.constants` entries. The most important compressor parameters are:",
                          "options": [
                            {
                              "textRaw": "`ZSTD_c_compressionLevel` -- **Default:** `ZSTD_CLEVEL_DEFAULT` (3).",
                              "name": "ZSTD_c_compressionLevel",
                              "default": "`ZSTD_CLEVEL_DEFAULT` (3)",
                              "desc": "-"
                            },
                            {
                              "textRaw": "`ZSTD_c_checksumFlag` -- generate a checksum. **Default:** `0`.",
                              "name": "ZSTD_c_checksumFlag",
                              "default": "`0`",
                              "desc": "- generate a checksum."
                            },
                            {
                              "textRaw": "`ZSTD_c_strategy` -- compression strategy. Values include `ZSTD_fast`, `ZSTD_dfast`, `ZSTD_greedy`, `ZSTD_lazy`, `ZSTD_lazy2`, `ZSTD_btlazy2`, `ZSTD_btopt`, `ZSTD_btultra`, `ZSTD_btultra2`. See the Zstd compressor options in the zlib documentation for the full list.",
                              "name": "ZSTD_c_strategy",
                              "desc": "- compression strategy. Values include `ZSTD_fast`, `ZSTD_dfast`, `ZSTD_greedy`, `ZSTD_lazy`, `ZSTD_lazy2`, `ZSTD_btlazy2`, `ZSTD_btopt`, `ZSTD_btultra`, `ZSTD_btultra2`. See the Zstd compressor options in the zlib documentation for the full list."
                            }
                          ]
                        },
                        {
                          "textRaw": "`pledgedSrcSize` {number} Expected uncompressed size (optional hint).",
                          "name": "pledgedSrcSize",
                          "type": "number",
                          "desc": "Expected uncompressed size (optional hint)."
                        },
                        {
                          "textRaw": "`dictionary` {Buffer|TypedArray|DataView}",
                          "name": "dictionary",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stateful transform.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stateful transform."
                  }
                }
              ],
              "desc": "<p>Create a Zstandard compression transform. Output is compatible with\n<code>zlib.zstdDecompress()</code> and <code>decompressZstd()</code>/<code>decompressZstdSync()</code>.</p>"
            },
            {
              "textRaw": "`decompressBrotli([options])`",
              "name": "decompressBrotli",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`decompressBrotliSync([options])`",
              "name": "decompressBrotliSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`chunkSize` {number} Output buffer size. **Default:** `65536` (64 KB).",
                          "name": "chunkSize",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "Output buffer size."
                        },
                        {
                          "textRaw": "`params` {Object} Key-value object where keys and values are `zlib.constants` entries. Available decompressor parameters:",
                          "name": "params",
                          "type": "Object",
                          "desc": "Key-value object where keys and values are `zlib.constants` entries. Available decompressor parameters:",
                          "options": [
                            {
                              "textRaw": "`BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION` -- boolean flag affecting internal memory allocation.",
                              "name": "BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION",
                              "desc": "- boolean flag affecting internal memory allocation."
                            },
                            {
                              "textRaw": "`BROTLI_DECODER_PARAM_LARGE_WINDOW` -- boolean flag enabling \"Large Window Brotli\" mode (not compatible with RFC 7932). See the Brotli decompressor options in the zlib documentation for details.",
                              "name": "BROTLI_DECODER_PARAM_LARGE_WINDOW",
                              "desc": "- boolean flag enabling \"Large Window Brotli\" mode (not compatible with RFC 7932). See the Brotli decompressor options in the zlib documentation for details."
                            }
                          ]
                        },
                        {
                          "textRaw": "`dictionary` {Buffer|TypedArray|DataView}",
                          "name": "dictionary",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stateful transform.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stateful transform."
                  }
                }
              ],
              "desc": "<p>Create a Brotli decompression transform.</p>"
            },
            {
              "textRaw": "`decompressDeflate([options])`",
              "name": "decompressDeflate",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`decompressDeflateSync([options])`",
              "name": "decompressDeflateSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`chunkSize` {number} Output buffer size. **Default:** `65536` (64 KB).",
                          "name": "chunkSize",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "Output buffer size."
                        },
                        {
                          "textRaw": "`windowBits` {number} **Default:** `Z_DEFAULT_WINDOWBITS` (15).",
                          "name": "windowBits",
                          "type": "number",
                          "default": "`Z_DEFAULT_WINDOWBITS` (15)"
                        },
                        {
                          "textRaw": "`dictionary` {Buffer|TypedArray|DataView}",
                          "name": "dictionary",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stateful transform.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stateful transform."
                  }
                }
              ],
              "desc": "<p>Create a deflate decompression transform.</p>"
            },
            {
              "textRaw": "`decompressGzip([options])`",
              "name": "decompressGzip",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`decompressGzipSync([options])`",
              "name": "decompressGzipSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`chunkSize` {number} Output buffer size. **Default:** `65536` (64 KB).",
                          "name": "chunkSize",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "Output buffer size."
                        },
                        {
                          "textRaw": "`windowBits` {number} **Default:** `Z_DEFAULT_WINDOWBITS` (15).",
                          "name": "windowBits",
                          "type": "number",
                          "default": "`Z_DEFAULT_WINDOWBITS` (15)"
                        },
                        {
                          "textRaw": "`dictionary` {Buffer|TypedArray|DataView}",
                          "name": "dictionary",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stateful transform.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stateful transform."
                  }
                }
              ],
              "desc": "<p>Create a gzip decompression transform.</p>"
            },
            {
              "textRaw": "`decompressZstd([options])`",
              "name": "decompressZstd",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`decompressZstdSync([options])`",
              "name": "decompressZstdSync",
              "type": "method",
              "meta": {
                "added": [
                  "v25.9.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`options` {Object}",
                      "name": "options",
                      "type": "Object",
                      "options": [
                        {
                          "textRaw": "`chunkSize` {number} Output buffer size. **Default:** `65536` (64 KB).",
                          "name": "chunkSize",
                          "type": "number",
                          "default": "`65536` (64 KB)",
                          "desc": "Output buffer size."
                        },
                        {
                          "textRaw": "`params` {Object} Key-value object where keys and values are `zlib.constants` entries. Available decompressor parameters:",
                          "name": "params",
                          "type": "Object",
                          "desc": "Key-value object where keys and values are `zlib.constants` entries. Available decompressor parameters:",
                          "options": [
                            {
                              "textRaw": "`ZSTD_d_windowLogMax` -- maximum window size (log2) the decompressor will allocate. Limits memory usage against malicious input. See the Zstd decompressor options in the zlib documentation for details.",
                              "name": "ZSTD_d_windowLogMax",
                              "desc": "- maximum window size (log2) the decompressor will allocate. Limits memory usage against malicious input. See the Zstd decompressor options in the zlib documentation for details."
                            }
                          ]
                        },
                        {
                          "textRaw": "`dictionary` {Buffer|TypedArray|DataView}",
                          "name": "dictionary",
                          "type": "Buffer|TypedArray|DataView"
                        }
                      ],
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object} A stateful transform.",
                    "name": "return",
                    "type": "Object",
                    "desc": "A stateful transform."
                  }
                }
              ],
              "desc": "<p>Create a Zstandard decompression transform.</p>"
            }
          ],
          "displayName": "Iterable Compression"
        }
      ],
      "miscs": [
        {
          "textRaw": "Memory usage tuning",
          "name": "Memory usage tuning",
          "type": "misc",
          "miscs": [
            {
              "textRaw": "For zlib-based streams",
              "name": "for_zlib-based_streams",
              "type": "misc",
              "desc": "<p>From <code>zlib/zconf.h</code>, modified for Node.js usage:</p>\n<p>The memory requirements for deflate are (in bytes):</p>\n<pre><code class=\"language-js\">(1 &#x3C;&#x3C; (windowBits + 2)) + (1 &#x3C;&#x3C; (memLevel + 9));\n</code></pre>\n<p>That is: 128K for <code>windowBits</code> = 15 + 128K for <code>memLevel</code> = 8\n(default values) plus a few kilobytes for small objects.</p>\n<p>For example, to reduce the default memory requirements from 256K to 128K, the\noptions should be set to:</p>\n<pre><code class=\"language-js\">const options = { windowBits: 14, memLevel: 7 };\n</code></pre>\n<p>This will, however, generally degrade compression.</p>\n<p>The memory requirements for inflate are (in bytes) <code>1 &#x3C;&#x3C; windowBits</code>.\nThat is, 32K for <code>windowBits</code> = 15 (default value) plus a few kilobytes\nfor small objects.</p>\n<p>This is in addition to a single internal output slab buffer of size\n<code>chunkSize</code>, which defaults to 16K.</p>\n<p>The speed of <code>zlib</code> compression is affected most dramatically by the\n<code>level</code> setting. A higher level will result in better compression, but\nwill take longer to complete. A lower level will result in less\ncompression, but will be much faster.</p>\n<p>In general, greater memory usage options will mean that Node.js has to make\nfewer calls to <code>zlib</code> because it will be able to process more data on\neach <code>write</code> operation. So, this is another factor that affects the\nspeed, at the cost of memory usage.</p>",
              "displayName": "For zlib-based streams"
            },
            {
              "textRaw": "For Brotli-based streams",
              "name": "for_brotli-based_streams",
              "type": "misc",
              "desc": "<p>There are equivalents to the zlib options for Brotli-based streams, although\nthese options have different ranges than the zlib ones:</p>\n<ul>\n<li>zlib's <code>level</code> option matches Brotli's <code>BROTLI_PARAM_QUALITY</code> option.</li>\n<li>zlib's <code>windowBits</code> option matches Brotli's <code>BROTLI_PARAM_LGWIN</code> option.</li>\n</ul>\n<p>See <a href=\"#brotli-constants\">below</a> for more details on Brotli-specific options.</p>",
              "displayName": "For Brotli-based streams"
            },
            {
              "textRaw": "For Zstd-based streams",
              "name": "for_zstd-based_streams",
              "type": "misc",
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>There are equivalents to the zlib options for Zstd-based streams, although\nthese options have different ranges than the zlib ones:</p>\n<ul>\n<li>zlib's <code>level</code> option matches Zstd's <code>ZSTD_c_compressionLevel</code> option.</li>\n<li>zlib's <code>windowBits</code> option matches Zstd's <code>ZSTD_c_windowLog</code> option.</li>\n</ul>\n<p>See <a href=\"#zstd-constants\">below</a> for more details on Zstd-specific options.</p>",
              "displayName": "For Zstd-based streams"
            }
          ]
        },
        {
          "textRaw": "Constants",
          "name": "Constants",
          "type": "misc",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "miscs": [
            {
              "textRaw": "zlib constants",
              "name": "zlib_constants",
              "type": "misc",
              "desc": "<p>All of the constants defined in <code>zlib.h</code> are also defined on\n<code>require('node:zlib').constants</code>. In the normal course of operations, it will\nnot be necessary to use these constants. They are documented so that their\npresence is not surprising. This section is taken almost directly from the\n<a href=\"https://zlib.net/manual.html#Constants\">zlib documentation</a>.</p>\n<p>Previously, the constants were available directly from <code>require('node:zlib')</code>,\nfor instance <code>zlib.Z_NO_FLUSH</code>. Accessing the constants directly from the module\nis currently still possible but is deprecated.</p>\n<p>Allowed flush values.</p>\n<ul>\n<li><code>zlib.constants.Z_NO_FLUSH</code></li>\n<li><code>zlib.constants.Z_PARTIAL_FLUSH</code></li>\n<li><code>zlib.constants.Z_SYNC_FLUSH</code></li>\n<li><code>zlib.constants.Z_FULL_FLUSH</code></li>\n<li><code>zlib.constants.Z_FINISH</code></li>\n<li><code>zlib.constants.Z_BLOCK</code></li>\n</ul>\n<p>Return codes for the compression/decompression functions. Negative\nvalues are errors, positive values are used for special but normal\nevents.</p>\n<ul>\n<li><code>zlib.constants.Z_OK</code></li>\n<li><code>zlib.constants.Z_STREAM_END</code></li>\n<li><code>zlib.constants.Z_NEED_DICT</code></li>\n<li><code>zlib.constants.Z_ERRNO</code></li>\n<li><code>zlib.constants.Z_STREAM_ERROR</code></li>\n<li><code>zlib.constants.Z_DATA_ERROR</code></li>\n<li><code>zlib.constants.Z_MEM_ERROR</code></li>\n<li><code>zlib.constants.Z_BUF_ERROR</code></li>\n<li><code>zlib.constants.Z_VERSION_ERROR</code></li>\n</ul>\n<p>Compression levels.</p>\n<ul>\n<li><code>zlib.constants.Z_NO_COMPRESSION</code></li>\n<li><code>zlib.constants.Z_BEST_SPEED</code></li>\n<li><code>zlib.constants.Z_BEST_COMPRESSION</code></li>\n<li><code>zlib.constants.Z_DEFAULT_COMPRESSION</code></li>\n</ul>\n<p>Compression strategy.</p>\n<ul>\n<li><code>zlib.constants.Z_FILTERED</code></li>\n<li><code>zlib.constants.Z_HUFFMAN_ONLY</code></li>\n<li><code>zlib.constants.Z_RLE</code></li>\n<li><code>zlib.constants.Z_FIXED</code></li>\n<li><code>zlib.constants.Z_DEFAULT_STRATEGY</code></li>\n</ul>",
              "displayName": "zlib constants"
            },
            {
              "textRaw": "Brotli constants",
              "name": "brotli_constants",
              "type": "misc",
              "meta": {
                "added": [
                  "v11.7.0",
                  "v10.16.0"
                ],
                "changes": []
              },
              "desc": "<p>There are several options and other constants available for Brotli-based\nstreams:</p>",
              "modules": [
                {
                  "textRaw": "Flush operations",
                  "name": "flush_operations",
                  "type": "module",
                  "desc": "<p>The following values are valid flush operations for Brotli-based streams:</p>\n<ul>\n<li><code>zlib.constants.BROTLI_OPERATION_PROCESS</code> (default for all operations)</li>\n<li><code>zlib.constants.BROTLI_OPERATION_FLUSH</code> (default when calling <code>.flush()</code>)</li>\n<li><code>zlib.constants.BROTLI_OPERATION_FINISH</code> (default for the last chunk)</li>\n<li><code>zlib.constants.BROTLI_OPERATION_EMIT_METADATA</code>\n<ul>\n<li>This particular operation may be hard to use in a Node.js context,\nas the streaming layer makes it hard to know which data will end up\nin this frame. Also, there is currently no way to consume this data through\nthe Node.js API.</li>\n</ul>\n</li>\n</ul>",
                  "displayName": "Flush operations"
                },
                {
                  "textRaw": "Compressor options",
                  "name": "compressor_options",
                  "type": "module",
                  "desc": "<p>There are several options that can be set on Brotli encoders, affecting\ncompression efficiency and speed. Both the keys and the values can be accessed\nas properties of the <code>zlib.constants</code> object.</p>\n<p>The most important options are:</p>\n<ul>\n<li><code>BROTLI_PARAM_MODE</code>\n<ul>\n<li><code>BROTLI_MODE_GENERIC</code> (default)</li>\n<li><code>BROTLI_MODE_TEXT</code>, adjusted for UTF-8 text</li>\n<li><code>BROTLI_MODE_FONT</code>, adjusted for WOFF 2.0 fonts</li>\n</ul>\n</li>\n<li><code>BROTLI_PARAM_QUALITY</code>\n<ul>\n<li>Ranges from <code>BROTLI_MIN_QUALITY</code> to <code>BROTLI_MAX_QUALITY</code>,\nwith a default of <code>BROTLI_DEFAULT_QUALITY</code>.</li>\n</ul>\n</li>\n<li><code>BROTLI_PARAM_SIZE_HINT</code>\n<ul>\n<li>Integer value representing the expected input size;\ndefaults to <code>0</code> for an unknown input size.</li>\n</ul>\n</li>\n</ul>\n<p>The following flags can be set for advanced control over the compression\nalgorithm and memory usage tuning:</p>\n<ul>\n<li><code>BROTLI_PARAM_LGWIN</code>\n<ul>\n<li>Ranges from <code>BROTLI_MIN_WINDOW_BITS</code> to <code>BROTLI_MAX_WINDOW_BITS</code>,\nwith a default of <code>BROTLI_DEFAULT_WINDOW</code>, or up to\n<code>BROTLI_LARGE_MAX_WINDOW_BITS</code> if the <code>BROTLI_PARAM_LARGE_WINDOW</code> flag\nis set.</li>\n</ul>\n</li>\n<li><code>BROTLI_PARAM_LGBLOCK</code>\n<ul>\n<li>Ranges from <code>BROTLI_MIN_INPUT_BLOCK_BITS</code> to <code>BROTLI_MAX_INPUT_BLOCK_BITS</code>.</li>\n</ul>\n</li>\n<li><code>BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING</code>\n<ul>\n<li>Boolean flag that decreases compression ratio in favour of\ndecompression speed.</li>\n</ul>\n</li>\n<li><code>BROTLI_PARAM_LARGE_WINDOW</code>\n<ul>\n<li>Boolean flag enabling “Large Window Brotli” mode (not compatible with the\nBrotli format as standardized in <a href=\"https://www.rfc-editor.org/rfc/rfc7932.html\">RFC 7932</a>).</li>\n</ul>\n</li>\n<li><code>BROTLI_PARAM_NPOSTFIX</code>\n<ul>\n<li>Ranges from <code>0</code> to <code>BROTLI_MAX_NPOSTFIX</code>.</li>\n</ul>\n</li>\n<li><code>BROTLI_PARAM_NDIRECT</code>\n<ul>\n<li>Ranges from <code>0</code> to <code>15 &#x3C;&#x3C; NPOSTFIX</code> in steps of <code>1 &#x3C;&#x3C; NPOSTFIX</code>.</li>\n</ul>\n</li>\n</ul>",
                  "displayName": "Compressor options"
                },
                {
                  "textRaw": "Decompressor options",
                  "name": "decompressor_options",
                  "type": "module",
                  "desc": "<p>These advanced options are available for controlling decompression:</p>\n<ul>\n<li><code>BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION</code>\n<ul>\n<li>Boolean flag that affects internal memory allocation patterns.</li>\n</ul>\n</li>\n<li><code>BROTLI_DECODER_PARAM_LARGE_WINDOW</code>\n<ul>\n<li>Boolean flag enabling “Large Window Brotli” mode (not compatible with the\nBrotli format as standardized in <a href=\"https://www.rfc-editor.org/rfc/rfc7932.html\">RFC 7932</a>).</li>\n</ul>\n</li>\n</ul>",
                  "displayName": "Decompressor options"
                }
              ],
              "displayName": "Brotli constants"
            },
            {
              "textRaw": "Zstd constants",
              "name": "zstd_constants",
              "type": "misc",
              "meta": {
                "added": [
                  "v23.8.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "desc": "<p>There are several options and other constants available for Zstd-based\nstreams:</p>",
              "modules": [
                {
                  "textRaw": "Flush operations",
                  "name": "flush_operations",
                  "type": "module",
                  "desc": "<p>The following values are valid flush operations for Zstd-based streams:</p>\n<ul>\n<li><code>zlib.constants.ZSTD_e_continue</code> (default for all operations)</li>\n<li><code>zlib.constants.ZSTD_e_flush</code> (default when calling <code>.flush()</code>)</li>\n<li><code>zlib.constants.ZSTD_e_end</code> (default for the last chunk)</li>\n</ul>",
                  "displayName": "Flush operations"
                },
                {
                  "textRaw": "Compressor options",
                  "name": "compressor_options",
                  "type": "module",
                  "desc": "<p>There are several options that can be set on Zstd encoders, affecting\ncompression efficiency and speed. Both the keys and the values can be accessed\nas properties of the <code>zlib.constants</code> object.</p>\n<p>The most important options are:</p>\n<ul>\n<li><code>ZSTD_c_compressionLevel</code>\n<ul>\n<li>Set compression parameters according to pre-defined cLevel table. Default\nlevel is ZSTD_CLEVEL_DEFAULT==3.</li>\n</ul>\n</li>\n<li><code>ZSTD_c_strategy</code>\n<ul>\n<li>Select the compression strategy.</li>\n<li>Possible values are listed in the strategy options section below.</li>\n</ul>\n</li>\n</ul>",
                  "displayName": "Compressor options"
                },
                {
                  "textRaw": "Strategy options",
                  "name": "strategy_options",
                  "type": "module",
                  "desc": "<p>The following constants can be used as values for the <code>ZSTD_c_strategy</code>\nparameter:</p>\n<ul>\n<li><code>zlib.constants.ZSTD_fast</code></li>\n<li><code>zlib.constants.ZSTD_dfast</code></li>\n<li><code>zlib.constants.ZSTD_greedy</code></li>\n<li><code>zlib.constants.ZSTD_lazy</code></li>\n<li><code>zlib.constants.ZSTD_lazy2</code></li>\n<li><code>zlib.constants.ZSTD_btlazy2</code></li>\n<li><code>zlib.constants.ZSTD_btopt</code></li>\n<li><code>zlib.constants.ZSTD_btultra</code></li>\n<li><code>zlib.constants.ZSTD_btultra2</code></li>\n</ul>\n<p>Example:</p>\n<pre><code class=\"language-js\">const stream = zlib.createZstdCompress({\n  params: {\n    [zlib.constants.ZSTD_c_strategy]: zlib.constants.ZSTD_btultra,\n  },\n});\n</code></pre>",
                  "displayName": "Strategy options"
                },
                {
                  "textRaw": "Pledged Source Size",
                  "name": "pledged_source_size",
                  "type": "module",
                  "desc": "<p>It's possible to specify the expected total size of the uncompressed input via\n<code>opts.pledgedSrcSize</code>. If the size doesn't match at the end of the input,\ncompression will fail with the code <code>ZSTD_error_srcSize_wrong</code>.</p>",
                  "displayName": "Pledged Source Size"
                },
                {
                  "textRaw": "Decompressor options",
                  "name": "decompressor_options",
                  "type": "module",
                  "desc": "<p>These advanced options are available for controlling decompression:</p>\n<ul>\n<li><code>ZSTD_d_windowLogMax</code>\n<ul>\n<li>Select a size limit (in power of 2) beyond which the streaming API will\nrefuse to allocate memory buffer in order to protect the host from\nunreasonable memory requirements.</li>\n</ul>\n</li>\n</ul>",
                  "displayName": "Decompressor options"
                }
              ],
              "displayName": "Zstd constants"
            }
          ]
        },
        {
          "textRaw": "Class: `Options`",
          "name": "Options",
          "type": "misc",
          "meta": {
            "added": [
              "v0.11.1"
            ],
            "changes": [
              {
                "version": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/33516",
                "description": "The `maxOutputLength` option is supported now."
              },
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `dictionary` option can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `dictionary` option can be an `Uint8Array` now."
              },
              {
                "version": "v5.11.0",
                "pr-url": "https://github.com/nodejs/node/pull/6069",
                "description": "The `finishFlush` option is supported now."
              }
            ]
          },
          "desc": "<p>Each zlib-based class takes an <code>options</code> object. No options are required.</p>\n<p>Some options are only relevant when compressing and are\nignored by the decompression classes.</p>\n<ul>\n<li><code>flush</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>zlib.constants.Z_NO_FLUSH</code></li>\n<li><code>finishFlush</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>zlib.constants.Z_FINISH</code></li>\n<li><code>chunkSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>16 * 1024</code></li>\n<li><code>windowBits</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a></li>\n<li><code>level</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> (compression only)</li>\n<li><code>memLevel</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> (compression only)</li>\n<li><code>strategy</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> (compression only)</li>\n<li><code>dictionary</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a> (deflate/inflate only,\nempty dictionary by default)</li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> (If <code>true</code>, returns an object with <code>buffer</code> and <code>engine</code>.)</li>\n<li><code>maxOutputLength</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Limits output size when using <a href=\"#convenience-methods\">convenience methods</a>. <strong>Default:</strong> <a href=\"buffer.html#bufferkmaxlength\"><code>buffer.kMaxLength</code></a></li>\n</ul>\n<p>See the <a href=\"https://zlib.net/manual.html#Advanced\"><code>deflateInit2</code> and <code>inflateInit2</code></a> documentation for more\ninformation.</p>"
        },
        {
          "textRaw": "Class: `BrotliOptions`",
          "name": "BrotliOptions",
          "type": "misc",
          "meta": {
            "added": [
              "v11.7.0"
            ],
            "changes": [
              {
                "version": [
                  "v14.5.0",
                  "v12.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/33516",
                "description": "The `maxOutputLength` option is supported now."
              }
            ]
          },
          "desc": "<p>Each Brotli-based class takes an <code>options</code> object. All options are optional.</p>\n<ul>\n<li><code>flush</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>zlib.constants.BROTLI_OPERATION_PROCESS</code></li>\n<li><code>finishFlush</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>zlib.constants.BROTLI_OPERATION_FINISH</code></li>\n<li><code>chunkSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>16 * 1024</code></li>\n<li><code>params</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Key-value object containing indexed <a href=\"#brotli-constants\">Brotli parameters</a>.</li>\n<li><code>maxOutputLength</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Limits output size when using <a href=\"#convenience-methods\">convenience methods</a>. <strong>Default:</strong> <a href=\"buffer.html#bufferkmaxlength\"><code>buffer.kMaxLength</code></a></li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> If <code>true</code>, returns an object with <code>buffer</code> and <code>engine</code>. <strong>Default:</strong> <code>false</code></li>\n</ul>\n<p>For example:</p>\n<pre><code class=\"language-js\">const stream = zlib.createBrotliCompress({\n  chunkSize: 32 * 1024,\n  params: {\n    [zlib.constants.BROTLI_PARAM_MODE]: zlib.constants.BROTLI_MODE_TEXT,\n    [zlib.constants.BROTLI_PARAM_QUALITY]: 4,\n    [zlib.constants.BROTLI_PARAM_SIZE_HINT]: fs.statSync(inputFile).size,\n  },\n});\n</code></pre>"
        },
        {
          "textRaw": "Class: `ZstdOptions`",
          "name": "ZstdOptions",
          "type": "misc",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>Each Zstd-based class takes an <code>options</code> object. All options are optional.</p>\n<ul>\n<li><code>flush</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>zlib.constants.ZSTD_e_continue</code></li>\n<li><code>finishFlush</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>zlib.constants.ZSTD_e_end</code></li>\n<li><code>chunkSize</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> <strong>Default:</strong> <code>16 * 1024</code></li>\n<li><code>params</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> Key-value object containing indexed <a href=\"#zstd-constants\">Zstd parameters</a>.</li>\n<li><code>maxOutputLength</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;integer></code></a> Limits output size when using <a href=\"#convenience-methods\">convenience methods</a>. <strong>Default:</strong> <a href=\"buffer.html#bufferkmaxlength\"><code>buffer.kMaxLength</code></a></li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a> If <code>true</code>, returns an object with <code>buffer</code> and <code>engine</code>. <strong>Default:</strong> <code>false</code></li>\n<li><code>dictionary</code> <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a> Optional dictionary used to\nimprove compression efficiency when compressing or decompressing data that\nshares common patterns with the dictionary.</li>\n</ul>\n<p>For example:</p>\n<pre><code class=\"language-js\">const stream = zlib.createZstdCompress({\n  chunkSize: 32 * 1024,\n  params: {\n    [zlib.constants.ZSTD_c_compressionLevel]: 10,\n    [zlib.constants.ZSTD_c_checksumFlag]: 1,\n  },\n});\n</code></pre>"
        },
        {
          "textRaw": "Convenience methods",
          "name": "Convenience methods",
          "type": "misc",
          "desc": "<p>All of these take a <a href=\"buffer.html#class-buffer\"><code>&#x3C;Buffer></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/TypedArray\"><code>&#x3C;TypedArray></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/DataView\"><code>&#x3C;DataView></code></a>, <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer\"><code>&#x3C;ArrayBuffer></code></a>, or string\nas the first argument, an optional second argument\nto supply options to the <code>zlib</code> classes and will call the supplied callback\nwith <code>callback(error, result)</code>.</p>\n<p>Every method has a <code>*Sync</code> counterpart, which accept the same arguments, but\nwithout a callback.</p>",
          "methods": [
            {
              "textRaw": "`zlib.brotliCompress(buffer[, options], callback)`",
              "name": "brotliCompress",
              "type": "method",
              "meta": {
                "added": [
                  "v11.7.0",
                  "v10.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {brotli options}",
                      "name": "options",
                      "type": "brotli options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.brotliCompressSync(buffer[, options])`",
              "name": "brotliCompressSync",
              "type": "method",
              "meta": {
                "added": [
                  "v11.7.0",
                  "v10.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {brotli options}",
                      "name": "options",
                      "type": "brotli options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibbrotlicompress\"><code>BrotliCompress</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.brotliDecompress(buffer[, options], callback)`",
              "name": "brotliDecompress",
              "type": "method",
              "meta": {
                "added": [
                  "v11.7.0",
                  "v10.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {brotli options}",
                      "name": "options",
                      "type": "brotli options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.brotliDecompressSync(buffer[, options])`",
              "name": "brotliDecompressSync",
              "type": "method",
              "meta": {
                "added": [
                  "v11.7.0",
                  "v10.16.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {brotli options}",
                      "name": "options",
                      "type": "brotli options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibbrotlidecompress\"><code>BrotliDecompress</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.deflate(buffer[, options], callback)`",
              "name": "deflate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.deflateSync(buffer[, options])`",
              "name": "deflateSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibdeflate\"><code>Deflate</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.deflateRaw(buffer[, options], callback)`",
              "name": "deflateRaw",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": [
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.deflateRawSync(buffer[, options])`",
              "name": "deflateRawSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibdeflateraw\"><code>DeflateRaw</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.gunzip(buffer[, options], callback)`",
              "name": "gunzip",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.gunzipSync(buffer[, options])`",
              "name": "gunzipSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibgunzip\"><code>Gunzip</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.gzip(buffer[, options], callback)`",
              "name": "gzip",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.gzipSync(buffer[, options])`",
              "name": "gzipSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibgzip\"><code>Gzip</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.inflate(buffer[, options], callback)`",
              "name": "inflate",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.inflateSync(buffer[, options])`",
              "name": "inflateSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibinflate\"><code>Inflate</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.inflateRaw(buffer[, options], callback)`",
              "name": "inflateRaw",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.inflateRawSync(buffer[, options])`",
              "name": "inflateRawSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibinflateraw\"><code>InflateRaw</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.unzip(buffer[, options], callback)`",
              "name": "unzip",
              "type": "method",
              "meta": {
                "added": [
                  "v0.6.0"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.unzipSync(buffer[, options])`",
              "name": "unzipSync",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": [
                  {
                    "version": "v9.4.0",
                    "pr-url": "https://github.com/nodejs/node/pull/16042",
                    "description": "The `buffer` parameter can be an `ArrayBuffer`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12223",
                    "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
                  },
                  {
                    "version": "v8.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/12001",
                    "description": "The `buffer` parameter can be an `Uint8Array` now."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zlib options}",
                      "name": "options",
                      "type": "zlib options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibunzip\"><code>Unzip</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.zstdCompress(buffer[, options], callback)`",
              "name": "zstdCompress",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zstd options}",
                      "name": "options",
                      "type": "zstd options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.zstdCompressSync(buffer[, options])`",
              "name": "zstdCompressSync",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zstd options}",
                      "name": "options",
                      "type": "zstd options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibzstdcompress\"><code>ZstdCompress</code></a>.</p>"
            },
            {
              "textRaw": "`zlib.zstdDecompress(buffer[, options], callback)`",
              "name": "zstdDecompress",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zstd options}",
                      "name": "options",
                      "type": "zstd options",
                      "optional": true
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "`zlib.zstdDecompressSync(buffer[, options])`",
              "name": "zstdDecompressSync",
              "type": "method",
              "meta": {
                "added": [
                  "v23.8.0",
                  "v22.15.0"
                ],
                "changes": []
              },
              "stability": 1,
              "stabilityText": "Experimental",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                      "name": "buffer",
                      "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                    },
                    {
                      "textRaw": "`options` {zstd options}",
                      "name": "options",
                      "type": "zstd options",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibzstddecompress\"><code>ZstdDecompress</code></a>.</p>"
            }
          ]
        }
      ],
      "meta": {
        "added": [
          "v0.5.8"
        ],
        "changes": []
      },
      "classes": [
        {
          "textRaw": "Class: `zlib.BrotliCompress`",
          "name": "zlib.BrotliCompress",
          "type": "class",
          "meta": {
            "added": [
              "v11.7.0",
              "v10.16.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Compress data using the Brotli algorithm.</p>"
        },
        {
          "textRaw": "Class: `zlib.BrotliDecompress`",
          "name": "zlib.BrotliDecompress",
          "type": "class",
          "meta": {
            "added": [
              "v11.7.0",
              "v10.16.0"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Decompress data using the Brotli algorithm.</p>"
        },
        {
          "textRaw": "Class: `zlib.Deflate`",
          "name": "zlib.Deflate",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Compress data using deflate.</p>"
        },
        {
          "textRaw": "Class: `zlib.DeflateRaw`",
          "name": "zlib.DeflateRaw",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Compress data using deflate, and do not append a <code>zlib</code> header.</p>"
        },
        {
          "textRaw": "Class: `zlib.Gunzip`",
          "name": "zlib.Gunzip",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": [
              {
                "version": "v6.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/5883",
                "description": "Trailing garbage at the end of the input stream will now result in an `'error'` event."
              },
              {
                "version": "v5.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/5120",
                "description": "Multiple concatenated gzip file members are supported now."
              },
              {
                "version": "v5.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/2595",
                "description": "A truncated input stream will now result in an `'error'` event."
              }
            ]
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Decompress a gzip stream.</p>"
        },
        {
          "textRaw": "Class: `zlib.Gzip`",
          "name": "zlib.Gzip",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Compress data using gzip.</p>"
        },
        {
          "textRaw": "Class: `zlib.Inflate`",
          "name": "zlib.Inflate",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": [
              {
                "version": "v5.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/2595",
                "description": "A truncated input stream will now result in an `'error'` event."
              }
            ]
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Decompress a deflate stream.</p>"
        },
        {
          "textRaw": "Class: `zlib.InflateRaw`",
          "name": "zlib.InflateRaw",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": [
              {
                "version": "v6.8.0",
                "pr-url": "https://github.com/nodejs/node/pull/8512",
                "description": "Custom dictionaries are now supported by `InflateRaw`."
              },
              {
                "version": "v5.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/2595",
                "description": "A truncated input stream will now result in an `'error'` event."
              }
            ]
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Decompress a raw deflate stream.</p>"
        },
        {
          "textRaw": "Class: `zlib.Unzip`",
          "name": "zlib.Unzip",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "desc": "<ul>\n<li>Extends: <a href=\"#class-zlibzlibbase\"><code>ZlibBase</code></a></li>\n</ul>\n<p>Decompress either a Gzip- or Deflate-compressed stream by auto-detecting\nthe header.</p>"
        },
        {
          "textRaw": "Class: `zlib.ZlibBase`",
          "name": "zlib.ZlibBase",
          "type": "class",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": [
              {
                "version": [
                  "v11.7.0",
                  "v10.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/24939",
                "description": "This class was renamed from `Zlib` to `ZlibBase`."
              }
            ]
          },
          "desc": "<ul>\n<li>Extends: <a href=\"stream.html#class-streamtransform\"><code>stream.Transform</code></a></li>\n</ul>\n<p>Not exported by the <code>node:zlib</code> module. It is documented here because it is the\nbase class of the compressor/decompressor classes.</p>\n<p>This class inherits from <a href=\"stream.html#class-streamtransform\"><code>stream.Transform</code></a>, allowing <code>node:zlib</code> objects to\nbe used in pipes and similar stream operations.</p>",
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "bytesWritten",
              "type": "number",
              "meta": {
                "added": [
                  "v10.0.0"
                ],
                "changes": []
              },
              "desc": "<p>The <code>zlib.bytesWritten</code> property specifies the number of bytes written to\nthe engine, before the bytes are processed (compressed or decompressed,\nas appropriate for the derived class).</p>"
            }
          ],
          "methods": [
            {
              "textRaw": "`zlib.close([callback])`",
              "name": "close",
              "type": "method",
              "meta": {
                "added": [
                  "v0.9.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Close the underlying handle.</p>"
            },
            {
              "textRaw": "`zlib.flush([kind, ]callback)`",
              "name": "flush",
              "type": "method",
              "meta": {
                "added": [
                  "v0.5.8"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "name": "kind",
                      "optional": true
                    },
                    {
                      "name": "callback"
                    }
                  ]
                }
              ],
              "desc": "<ul>\n<li><code>kind</code> <strong>Default:</strong> <code>zlib.constants.Z_FULL_FLUSH</code> for zlib-based streams,\n<code>zlib.constants.BROTLI_OPERATION_FLUSH</code> for Brotli-based streams.</li>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a></li>\n</ul>\n<p>Flush pending data. Don't call this frivolously, premature flushes negatively\nimpact the effectiveness of the compression algorithm.</p>\n<p>Calling this only flushes data from the internal <code>zlib</code> state, and does not\nperform flushing of any kind on the streams level. Rather, it behaves like a\nnormal call to <code>.write()</code>, i.e. it will be queued up behind other pending\nwrites and will only produce output when data is being read from the stream.</p>"
            },
            {
              "textRaw": "`zlib.params(level, strategy, callback)`",
              "name": "params",
              "type": "method",
              "meta": {
                "added": [
                  "v0.11.4"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`level` {integer}",
                      "name": "level",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`strategy` {integer}",
                      "name": "strategy",
                      "type": "integer"
                    },
                    {
                      "textRaw": "`callback` {Function}",
                      "name": "callback",
                      "type": "Function"
                    }
                  ]
                }
              ],
              "desc": "<p>This function is only available for zlib-based streams, i.e. not Brotli.</p>\n<p>Dynamically update the compression level and compression strategy.\nOnly applicable to deflate algorithm.</p>"
            },
            {
              "textRaw": "`zlib.reset()`",
              "name": "reset",
              "type": "method",
              "meta": {
                "added": [
                  "v0.7.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Reset the compressor/decompressor to factory defaults. Only applicable to\nthe inflate and deflate algorithms.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `zlib.ZstdCompress`",
          "name": "zlib.ZstdCompress",
          "type": "class",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>Compress data using the Zstd algorithm.</p>"
        },
        {
          "textRaw": "Class: `zlib.ZstdDecompress`",
          "name": "zlib.ZstdDecompress",
          "type": "class",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "desc": "<p>Decompress data using the Zstd algorithm.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "`zlib.constants`",
          "name": "constants",
          "type": "property",
          "meta": {
            "added": [
              "v7.0.0"
            ],
            "changes": []
          },
          "desc": "<p>Provides an object enumerating Zlib-related constants.</p>"
        }
      ],
      "methods": [
        {
          "textRaw": "`zlib.crc32(data[, value])`",
          "name": "crc32",
          "type": "method",
          "meta": {
            "added": [
              "v22.2.0",
              "v20.15.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`data` {string|Buffer|TypedArray|DataView} When `data` is a string, it will be encoded as UTF-8 before being used for computation.",
                  "name": "data",
                  "type": "string|Buffer|TypedArray|DataView",
                  "desc": "When `data` is a string, it will be encoded as UTF-8 before being used for computation."
                },
                {
                  "textRaw": "`value` {integer} An optional starting value. It must be a 32-bit unsigned integer. **Default:** `0`",
                  "name": "value",
                  "type": "integer",
                  "default": "`0`",
                  "desc": "An optional starting value. It must be a 32-bit unsigned integer.",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {integer} A 32-bit unsigned integer containing the checksum.",
                "name": "return",
                "type": "integer",
                "desc": "A 32-bit unsigned integer containing the checksum."
              }
            }
          ],
          "desc": "<p>Computes a 32-bit <a href=\"https://en.wikipedia.org/wiki/Cyclic_redundancy_check\">Cyclic Redundancy Check</a> checksum of <code>data</code>. If\n<code>value</code> is specified, it is used as the starting value of the checksum,\notherwise, 0 is used as the starting value.</p>\n<p>The CRC algorithm is designed to compute checksums and to detect error\nin data transmission. It's not suitable for cryptographic authentication.</p>\n<p>To be consistent with other APIs, if the <code>data</code> is a string, it will\nbe encoded with UTF-8 before being used for computation. If users only\nuse Node.js to compute and match the checksums, this works well with\nother APIs that uses the UTF-8 encoding by default.</p>\n<p>Some third-party JavaScript libraries compute the checksum on a\nstring based on <code>str.charCodeAt()</code> so that it can be run in browsers.\nIf users want to match the checksum computed with this kind of library\nin the browser, it's better to use the same library in Node.js\nif it also runs in Node.js. If users have to use <code>zlib.crc32()</code> to\nmatch the checksum produced by such a third-party library:</p>\n<ol>\n<li>If the library accepts <code>Uint8Array</code> as input, use <code>TextEncoder</code>\nin the browser to encode the string into a <code>Uint8Array</code> with UTF-8\nencoding, and compute the checksum based on the UTF-8 encoded string\nin the browser.</li>\n<li>If the library only takes a string and compute the data based on\n<code>str.charCodeAt()</code>, on the Node.js side, convert the string into\na buffer using <code>Buffer.from(str, 'utf16le')</code>.</li>\n</ol>\n<pre><code class=\"language-mjs\">import zlib from 'node:zlib';\nimport { Buffer } from 'node:buffer';\n\nlet crc = zlib.crc32('hello');  // 907060870\ncrc = zlib.crc32('world', crc);  // 4192936109\n\ncrc = zlib.crc32(Buffer.from('hello', 'utf16le'));  // 1427272415\ncrc = zlib.crc32(Buffer.from('world', 'utf16le'), crc);  // 4150509955\n</code></pre>\n<pre><code class=\"language-cjs\">const zlib = require('node:zlib');\nconst { Buffer } = require('node:buffer');\n\nlet crc = zlib.crc32('hello');  // 907060870\ncrc = zlib.crc32('world', crc);  // 4192936109\n\ncrc = zlib.crc32(Buffer.from('hello', 'utf16le'));  // 1427272415\ncrc = zlib.crc32(Buffer.from('world', 'utf16le'), crc);  // 4150509955\n</code></pre>"
        },
        {
          "textRaw": "`zlib.createBrotliCompress([options])`",
          "name": "createBrotliCompress",
          "type": "method",
          "meta": {
            "added": [
              "v11.7.0",
              "v10.16.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {brotli options}",
                  "name": "options",
                  "type": "brotli options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibbrotlicompress\"><code>BrotliCompress</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createBrotliDecompress([options])`",
          "name": "createBrotliDecompress",
          "type": "method",
          "meta": {
            "added": [
              "v11.7.0",
              "v10.16.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {brotli options}",
                  "name": "options",
                  "type": "brotli options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibbrotlidecompress\"><code>BrotliDecompress</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createDeflate([options])`",
          "name": "createDeflate",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibdeflate\"><code>Deflate</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createDeflateRaw([options])`",
          "name": "createDeflateRaw",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibdeflateraw\"><code>DeflateRaw</code></a> object.</p>\n<p>An upgrade of zlib from 1.2.8 to 1.2.11 changed behavior when <code>windowBits</code>\nis set to 8 for raw deflate streams. zlib would automatically set <code>windowBits</code>\nto 9 if was initially set to 8. Newer versions of zlib will throw an exception,\nso Node.js restored the original behavior of upgrading a value of 8 to 9,\nsince passing <code>windowBits = 9</code> to zlib actually results in a compressed stream\nthat effectively uses an 8-bit window only.</p>"
        },
        {
          "textRaw": "`zlib.createGunzip([options])`",
          "name": "createGunzip",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibgunzip\"><code>Gunzip</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createGzip([options])`",
          "name": "createGzip",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibgzip\"><code>Gzip</code></a> object.\nSee <a href=\"#zlib\">example</a>.</p>"
        },
        {
          "textRaw": "`zlib.createInflate([options])`",
          "name": "createInflate",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibinflate\"><code>Inflate</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createInflateRaw([options])`",
          "name": "createInflateRaw",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibinflateraw\"><code>InflateRaw</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createUnzip([options])`",
          "name": "createUnzip",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibunzip\"><code>Unzip</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createZstdCompress([options])`",
          "name": "createZstdCompress",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zstd options}",
                  "name": "options",
                  "type": "zstd options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibzstdcompress\"><code>ZstdCompress</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.createZstdDecompress([options])`",
          "name": "createZstdDecompress",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`options` {zstd options}",
                  "name": "options",
                  "type": "zstd options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates and returns a new <a href=\"#class-zlibzstddecompress\"><code>ZstdDecompress</code></a> object.</p>"
        },
        {
          "textRaw": "`zlib.brotliCompress(buffer[, options], callback)`",
          "name": "brotliCompress",
          "type": "method",
          "meta": {
            "added": [
              "v11.7.0",
              "v10.16.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {brotli options}",
                  "name": "options",
                  "type": "brotli options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.brotliCompressSync(buffer[, options])`",
          "name": "brotliCompressSync",
          "type": "method",
          "meta": {
            "added": [
              "v11.7.0",
              "v10.16.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {brotli options}",
                  "name": "options",
                  "type": "brotli options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibbrotlicompress\"><code>BrotliCompress</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.brotliDecompress(buffer[, options], callback)`",
          "name": "brotliDecompress",
          "type": "method",
          "meta": {
            "added": [
              "v11.7.0",
              "v10.16.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {brotli options}",
                  "name": "options",
                  "type": "brotli options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.brotliDecompressSync(buffer[, options])`",
          "name": "brotliDecompressSync",
          "type": "method",
          "meta": {
            "added": [
              "v11.7.0",
              "v10.16.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {brotli options}",
                  "name": "options",
                  "type": "brotli options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibbrotlidecompress\"><code>BrotliDecompress</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.deflate(buffer[, options], callback)`",
          "name": "deflate",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.deflateSync(buffer[, options])`",
          "name": "deflateSync",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.12"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibdeflate\"><code>Deflate</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.deflateRaw(buffer[, options], callback)`",
          "name": "deflateRaw",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": [
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.deflateRawSync(buffer[, options])`",
          "name": "deflateRawSync",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.12"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibdeflateraw\"><code>DeflateRaw</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.gunzip(buffer[, options], callback)`",
          "name": "gunzip",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.gunzipSync(buffer[, options])`",
          "name": "gunzipSync",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.12"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibgunzip\"><code>Gunzip</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.gzip(buffer[, options], callback)`",
          "name": "gzip",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.gzipSync(buffer[, options])`",
          "name": "gzipSync",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.12"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibgzip\"><code>Gzip</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.inflate(buffer[, options], callback)`",
          "name": "inflate",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.inflateSync(buffer[, options])`",
          "name": "inflateSync",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.12"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibinflate\"><code>Inflate</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.inflateRaw(buffer[, options], callback)`",
          "name": "inflateRaw",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.inflateRawSync(buffer[, options])`",
          "name": "inflateRawSync",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.12"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibinflateraw\"><code>InflateRaw</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.unzip(buffer[, options], callback)`",
          "name": "unzip",
          "type": "method",
          "meta": {
            "added": [
              "v0.6.0"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.unzipSync(buffer[, options])`",
          "name": "unzipSync",
          "type": "method",
          "meta": {
            "added": [
              "v0.11.12"
            ],
            "changes": [
              {
                "version": "v9.4.0",
                "pr-url": "https://github.com/nodejs/node/pull/16042",
                "description": "The `buffer` parameter can be an `ArrayBuffer`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12223",
                "description": "The `buffer` parameter can be any `TypedArray` or `DataView`."
              },
              {
                "version": "v8.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12001",
                "description": "The `buffer` parameter can be an `Uint8Array` now."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zlib options}",
                  "name": "options",
                  "type": "zlib options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibunzip\"><code>Unzip</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.zstdCompress(buffer[, options], callback)`",
          "name": "zstdCompress",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zstd options}",
                  "name": "options",
                  "type": "zstd options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.zstdCompressSync(buffer[, options])`",
          "name": "zstdCompressSync",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zstd options}",
                  "name": "options",
                  "type": "zstd options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Compress a chunk of data with <a href=\"#class-zlibzstdcompress\"><code>ZstdCompress</code></a>.</p>"
        },
        {
          "textRaw": "`zlib.zstdDecompress(buffer[, options], callback)`",
          "name": "zstdDecompress",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zstd options}",
                  "name": "options",
                  "type": "zstd options",
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "`zlib.zstdDecompressSync(buffer[, options])`",
          "name": "zstdDecompressSync",
          "type": "method",
          "meta": {
            "added": [
              "v23.8.0",
              "v22.15.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`buffer` {Buffer|TypedArray|DataView|ArrayBuffer|string}",
                  "name": "buffer",
                  "type": "Buffer|TypedArray|DataView|ArrayBuffer|string"
                },
                {
                  "textRaw": "`options` {zstd options}",
                  "name": "options",
                  "type": "zstd options",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Decompress a chunk of data with <a href=\"#class-zlibzstddecompress\"><code>ZstdDecompress</code></a>.</p>"
        }
      ],
      "displayName": "Zlib",
      "source": "doc/api/zlib.md"
    }
  ],
  "classes": [
    {
      "textRaw": "Class: `Error`",
      "name": "Error",
      "type": "class",
      "desc": "<p>A generic JavaScript <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\"><code>&#x3C;Error></code></a> object that does not denote any specific\ncircumstance of why the error occurred. <code>Error</code> objects capture a \"stack trace\"\ndetailing the point in the code at which the <code>Error</code> was instantiated, and may\nprovide a text description of the error.</p>\n<p>All errors generated by Node.js, including all system and JavaScript errors,\nwill either be instances of, or inherit from, the <code>Error</code> class.</p>",
      "signatures": [
        {
          "textRaw": "`new Error(message[, options])`",
          "name": "Error",
          "type": "ctor",
          "params": [
            {
              "textRaw": "`message` {string}",
              "name": "message",
              "type": "string"
            },
            {
              "textRaw": "`options` {Object}",
              "name": "options",
              "type": "Object",
              "options": [
                {
                  "textRaw": "`cause` {any} The error that caused the newly created error.",
                  "name": "cause",
                  "type": "any",
                  "desc": "The error that caused the newly created error."
                }
              ],
              "optional": true
            }
          ],
          "desc": "<p>Creates a new <code>Error</code> object and sets the <code>error.message</code> property to the\nprovided text message. If an object is passed as <code>message</code>, the text message\nis generated by calling <code>String(message)</code>. If the <code>cause</code> option is provided,\nit is assigned to the <code>error.cause</code> property. The <code>error.stack</code> property will\nrepresent the point in the code at which <code>new Error()</code> was called. Stack traces\nare dependent on <a href=\"https://v8.dev/docs/stack-trace-api\">V8's stack trace API</a>. Stack traces extend only to either\n(a) the beginning of <em>synchronous code execution</em>, or (b) the number of frames\ngiven by the property <code>Error.stackTraceLimit</code>, whichever is smaller.</p>"
        }
      ],
      "methods": [
        {
          "textRaw": "`Error.captureStackTrace(targetObject[, constructorOpt])`",
          "name": "captureStackTrace",
          "type": "method",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`targetObject` {Object}",
                  "name": "targetObject",
                  "type": "Object"
                },
                {
                  "textRaw": "`constructorOpt` {Function}",
                  "name": "constructorOpt",
                  "type": "Function",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Creates a <code>.stack</code> property on <code>targetObject</code>, which when accessed returns\na string representing the location in the code at which\n<code>Error.captureStackTrace()</code> was called.</p>\n<pre><code class=\"language-js\">const myObject = {};\nError.captureStackTrace(myObject);\nmyObject.stack;  // Similar to `new Error().stack`\n</code></pre>\n<p>The first line of the trace will be prefixed with\n<code>${myObject.name}: ${myObject.message}</code>.</p>\n<p>The optional <code>constructorOpt</code> argument accepts a function. If given, all frames\nabove <code>constructorOpt</code>, including <code>constructorOpt</code>, will be omitted from the\ngenerated stack trace.</p>\n<p>The <code>constructorOpt</code> argument is useful for hiding implementation\ndetails of error generation from the user. For instance:</p>\n<pre><code class=\"language-js\">function a() {\n  b();\n}\n\nfunction b() {\n  c();\n}\n\nfunction c() {\n  // Create an error without stack trace to avoid calculating the stack trace twice.\n  const { stackTraceLimit } = Error;\n  Error.stackTraceLimit = 0;\n  const error = new Error();\n  Error.stackTraceLimit = stackTraceLimit;\n\n  // Capture the stack trace above function b\n  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace\n  throw error;\n}\n\na();\n</code></pre>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {number}",
          "name": "stackTraceLimit",
          "type": "number",
          "desc": "<p>The <code>Error.stackTraceLimit</code> property specifies the number of stack frames\ncollected by a stack trace (whether generated by <code>new Error().stack</code> or\n<code>Error.captureStackTrace(obj)</code>).</p>\n<p>The default value is <code>10</code> but may be set to any valid JavaScript number. Changes\nwill affect any stack trace captured <em>after</em> the value has been changed.</p>\n<p>If set to a non-number value, or set to a negative number, stack traces will\nnot capture any frames.</p>"
        },
        {
          "textRaw": "Type: {any}",
          "name": "cause",
          "type": "any",
          "meta": {
            "added": [
              "v16.9.0"
            ],
            "changes": []
          },
          "desc": "<p>If present, the <code>error.cause</code> property is the underlying cause of the <code>Error</code>.\nIt is used when catching an error and throwing a new one with a different\nmessage or code in order to still have access to the original error.</p>\n<p>The <code>error.cause</code> property is typically set by calling\n<code>new Error(message, { cause })</code>. It is not set by the constructor if the\n<code>cause</code> option is not provided.</p>\n<p>This property allows errors to be chained. When serializing <code>Error</code> objects,\n<a href=\"util.html#utilinspectobject-options\"><code>util.inspect()</code></a> recursively serializes <code>error.cause</code> if it is set.</p>\n<pre><code class=\"language-js\">const cause = new Error('The remote HTTP server responded with a 500 status');\nconst symptom = new Error('The message failed to send', { cause });\n\nconsole.log(symptom);\n// Prints:\n//   Error: The message failed to send\n//       at REPL2:1:17\n//       at Script.runInThisContext (node:vm:130:12)\n//       ... 7 lines matching cause stack trace ...\n//       at [_line] [as _line] (node:internal/readline/interface:886:18) {\n//     [cause]: Error: The remote HTTP server responded with a 500 status\n//         at REPL1:1:15\n//         at Script.runInThisContext (node:vm:130:12)\n//         at REPLServer.defaultEval (node:repl:574:29)\n//         at bound (node:domain:426:15)\n//         at REPLServer.runBound [as eval] (node:domain:437:12)\n//         at REPLServer.onLine (node:repl:902:10)\n//         at REPLServer.emit (node:events:549:35)\n//         at REPLServer.emit (node:domain:482:12)\n//         at [_onLine] [as _onLine] (node:internal/readline/interface:425:12)\n//         at [_line] [as _line] (node:internal/readline/interface:886:18)\n</code></pre>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "code",
          "type": "string",
          "desc": "<p>The <code>error.code</code> property is a string label that identifies the kind of error.\n<code>error.code</code> is the most stable way to identify an error. It will only change\nbetween major versions of Node.js. In contrast, <code>error.message</code> strings may\nchange between any versions of Node.js. See <a href=\"#nodejs-error-codes\">Node.js error codes</a> for details\nabout specific codes.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "message",
          "type": "string",
          "desc": "<p>The <code>error.message</code> property is the string description of the error as set by\ncalling <code>new Error(message)</code>. The <code>message</code> passed to the constructor will also\nappear in the first line of the stack trace of the <code>Error</code>, however changing\nthis property after the <code>Error</code> object is created <em>may not</em> change the first\nline of the stack trace (for example, when <code>error.stack</code> is read before this\nproperty is changed).</p>\n<pre><code class=\"language-js\">const err = new Error('The message');\nconsole.error(err.message);\n// Prints: The message\n</code></pre>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "stack",
          "type": "string",
          "desc": "<p>The <code>error.stack</code> property is a string describing the point in the code at which\nthe <code>Error</code> was instantiated.</p>\n<pre><code class=\"language-console\">Error: Things keep happening!\n   at /home/gbusey/file.js:525:2\n   at Frobnicator.refrobulate (/home/gbusey/business-logic.js:424:21)\n   at Actor.&#x3C;anonymous> (/home/gbusey/actors.js:400:8)\n   at increaseSynergy (/home/gbusey/actors.js:701:6)\n</code></pre>\n<p>The first line is formatted as <code>&#x3C;error class name>: &#x3C;error message></code>, and\nis followed by a series of stack frames (each line beginning with \"at \").\nEach frame describes a call site within the code that lead to the error being\ngenerated. V8 attempts to display a name for each function (by variable name,\nfunction name, or object method name), but occasionally it will not be able to\nfind a suitable name. If V8 cannot determine a name for the function, only\nlocation information will be displayed for that frame. Otherwise, the\ndetermined function name will be displayed with location information appended\nin parentheses.</p>\n<p>Frames are only generated for JavaScript functions. If, for example, execution\nsynchronously passes through a C++ addon function called <code>cheetahify</code> which\nitself calls a JavaScript function, the frame representing the <code>cheetahify</code> call\nwill not be present in the stack traces:</p>\n<pre><code class=\"language-js\">const cheetahify = require('./native-binding.node');\n\nfunction makeFaster() {\n  // `cheetahify()` *synchronously* calls speedy.\n  cheetahify(function speedy() {\n    throw new Error('oh no!');\n  });\n}\n\nmakeFaster();\n// will throw:\n//   /home/gbusey/file.js:6\n//       throw new Error('oh no!');\n//           ^\n//   Error: oh no!\n//       at speedy (/home/gbusey/file.js:6:11)\n//       at makeFaster (/home/gbusey/file.js:5:3)\n//       at Object.&#x3C;anonymous> (/home/gbusey/file.js:10:1)\n//       at Module._compile (module.js:456:26)\n//       at Object.Module._extensions..js (module.js:474:10)\n//       at Module.load (module.js:356:32)\n//       at Function.Module._load (module.js:312:12)\n//       at Function.Module.runMain (module.js:497:10)\n//       at startup (node.js:119:16)\n//       at node.js:906:3\n</code></pre>\n<p>The location information will be one of:</p>\n<ul>\n<li><code>native</code>, if the frame represents a call internal to V8 (as in <code>[].forEach</code>).</li>\n<li><code>plain-filename.js:line:column</code>, if the frame represents a call internal\nto Node.js.</li>\n<li><code>/absolute/path/to/file.js:line:column</code>, if the frame represents a call in\na user program (using CommonJS module system), or its dependencies.</li>\n<li><code>&#x3C;transport-protocol>:///url/to/module/file.mjs:line:column</code>, if the frame\nrepresents a call in a user program (using ES module system), or\nits dependencies.</li>\n</ul>\n<p>The number of frames captured by the stack trace is bounded by the smaller of\n<code>Error.stackTraceLimit</code> or the number of available frames on the current event\nloop tick.</p>\n<p><code>error.stack</code> is a getter/setter for a hidden internal property which is only\npresent on builtin <code>Error</code> objects (those for which <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/isError\"><code>Error.isError</code></a> returns\ntrue). If <code>error</code> is not a builtin error object, then the <code>error.stack</code> getter\nwill always return <code>undefined</code>, and the setter will do nothing. This can occur\nif the accessor is manually invoked with a <code>this</code> value that is not a builtin\nerror object, such as a <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Proxy\"><code>&#x3C;Proxy></code></a>.</p>"
        }
      ],
      "source": "doc/api/errors.md"
    },
    {
      "textRaw": "Class: `AssertionError`",
      "name": "AssertionError",
      "type": "class",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates the failure of an assertion. For details, see\n<a href=\"assert.html#class-assertassertionerror\"><code>Class: assert.AssertionError</code></a>.</p>",
      "source": "doc/api/errors.md"
    },
    {
      "textRaw": "Class: `RangeError`",
      "name": "RangeError",
      "type": "class",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates that a provided argument was not within the set or range of\nacceptable values for a function; whether that is a numeric range, or\noutside the set of options for a given function parameter.</p>\n<pre><code class=\"language-js\">require('node:net').connect(-1);\n// Throws \"RangeError: \"port\" option should be >= 0 and &#x3C; 65536: -1\"\n</code></pre>\n<p>Node.js will generate and throw <code>RangeError</code> instances <em>immediately</em> as a form\nof argument validation.</p>",
      "source": "doc/api/errors.md"
    },
    {
      "textRaw": "Class: `ReferenceError`",
      "name": "ReferenceError",
      "type": "class",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates that an attempt is being made to access a variable that is not\ndefined. Such errors commonly indicate typos in code, or an otherwise broken\nprogram.</p>\n<p>While client code may generate and propagate these errors, in practice, only V8\nwill do so.</p>\n<pre><code class=\"language-js\">doesNotExist;\n// Throws ReferenceError, doesNotExist is not a variable in this program.\n</code></pre>\n<p>Unless an application is dynamically generating and running code,\n<code>ReferenceError</code> instances indicate a bug in the code or its dependencies.</p>",
      "source": "doc/api/errors.md"
    },
    {
      "textRaw": "Class: `SyntaxError`",
      "name": "SyntaxError",
      "type": "class",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates that a program is not valid JavaScript. These errors may only be\ngenerated and propagated as a result of code evaluation. Code evaluation may\nhappen as a result of <code>eval</code>, <code>Function</code>, <code>require</code>, or <a href=\"vm.html\">vm</a>. These errors\nare almost always indicative of a broken program.</p>\n<pre><code class=\"language-js\">try {\n  require('node:vm').runInThisContext('binary ! isNotOk');\n} catch (err) {\n  // 'err' will be a SyntaxError.\n}\n</code></pre>\n<p><code>SyntaxError</code> instances are unrecoverable in the context that created them –\nthey may only be caught by other contexts.</p>",
      "source": "doc/api/errors.md"
    },
    {
      "textRaw": "Class: `SystemError`",
      "name": "SystemError",
      "type": "class",
      "desc": "<ul>\n<li>Extends: <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Node.js generates system errors when exceptions occur within its runtime\nenvironment. These usually occur when an application violates an operating\nsystem constraint. For example, a system error will occur if an application\nattempts to read a file that does not exist.</p>\n<ul>\n<li><code>address</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If present, the address to which a network connection\nfailed</li>\n<li><code>code</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The string error code</li>\n<li><code>dest</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If present, the file path destination when reporting a file\nsystem error</li>\n<li><code>errno</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> The system-provided error number</li>\n<li><code>info</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a> If present, extra details about the error condition</li>\n<li><code>message</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> A system-provided human-readable description of the error</li>\n<li><code>path</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> If present, the file path when reporting a file system error</li>\n<li><code>port</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a> If present, the network connection port that is not available</li>\n<li><code>syscall</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> The name of the system call that triggered the error</li>\n</ul>",
      "properties": [
        {
          "textRaw": "Type: {string}",
          "name": "address",
          "type": "string",
          "desc": "<p>If present, <code>error.address</code> is a string describing the address to which a\nnetwork connection failed.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "code",
          "type": "string",
          "desc": "<p>The <code>error.code</code> property is a string representing the error code.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "dest",
          "type": "string",
          "desc": "<p>If present, <code>error.dest</code> is the file path destination when reporting a file\nsystem error.</p>"
        },
        {
          "textRaw": "Type: {number}",
          "name": "errno",
          "type": "number",
          "desc": "<p>The <code>error.errno</code> property is a negative number which corresponds\nto the error code defined in <a href=\"https://docs.libuv.org/en/v1.x/errors.html\"><code>libuv Error handling</code></a>.</p>\n<p>On Windows the error number provided by the system will be normalized by libuv.</p>\n<p>To get the string representation of the error code, use\n<a href=\"util.html#utilgetsystemerrornameerr\"><code>util.getSystemErrorName(error.errno)</code></a>.</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "info",
          "type": "Object",
          "desc": "<p>If present, <code>error.info</code> is an object with details about the error condition.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "message",
          "type": "string",
          "desc": "<p><code>error.message</code> is a system-provided human-readable description of the error.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "path",
          "type": "string",
          "desc": "<p>If present, <code>error.path</code> is a string containing a relevant invalid pathname.</p>"
        },
        {
          "textRaw": "Type: {number}",
          "name": "port",
          "type": "number",
          "desc": "<p>If present, <code>error.port</code> is the network connection port that is not available.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "syscall",
          "type": "string",
          "desc": "<p>The <code>error.syscall</code> property is a string describing the <a href=\"https://man7.org/linux/man-pages/man2/syscalls.2.html\">syscall</a> that failed.</p>"
        }
      ],
      "modules": [
        {
          "textRaw": "Common system errors",
          "name": "common_system_errors",
          "type": "module",
          "desc": "<p>This is a list of system errors commonly-encountered when writing a Node.js\nprogram. For a comprehensive list, see the <a href=\"https://man7.org/linux/man-pages/man3/errno.3.html\"><code>errno</code>(3) man page</a>.</p>\n<ul>\n<li>\n<p><code>EACCES</code> (Permission denied): An attempt was made to access a file in a way\nforbidden by its file access permissions.</p>\n</li>\n<li>\n<p><code>EADDRINUSE</code> (Address already in use): An attempt to bind a server\n(<a href=\"net.html\"><code>net</code></a>, <a href=\"http.html\"><code>http</code></a>, or <a href=\"https.html\"><code>https</code></a>) to a local address failed due to\nanother server on the local system already occupying that address.</p>\n</li>\n<li>\n<p><code>ECONNREFUSED</code> (Connection refused): No connection could be made because the\ntarget machine actively refused it. This usually results from trying to\nconnect to a service that is inactive on the foreign host.</p>\n</li>\n<li>\n<p><code>ECONNRESET</code> (Connection reset by peer): A connection was forcibly closed by\na peer. This normally results from a loss of the connection on the remote\nsocket due to a timeout or reboot. Commonly encountered via the <a href=\"http.html\"><code>http</code></a>\nand <a href=\"net.html\"><code>net</code></a> modules.</p>\n</li>\n<li>\n<p><code>EEXIST</code> (File exists): An existing file was the target of an operation that\nrequired that the target not exist.</p>\n</li>\n<li>\n<p><code>EISDIR</code> (Is a directory): An operation expected a file, but the given\npathname was a directory.</p>\n</li>\n<li>\n<p><code>EMFILE</code> (Too many open files in system): Maximum number of\n<a href=\"https://en.wikipedia.org/wiki/File_descriptor\">file descriptors</a> allowable on the system has been reached, and\nrequests for another descriptor cannot be fulfilled until at least one\nhas been closed. This is encountered when opening many files at once in\nparallel, especially on systems (in particular, macOS) where there is a low\nfile descriptor limit for processes. To remedy a low limit, run\n<code>ulimit -n 2048</code> in the same shell that will run the Node.js process.</p>\n</li>\n<li>\n<p><code>ENOENT</code> (No such file or directory): Commonly raised by <a href=\"fs.html\"><code>fs</code></a> operations\nto indicate that a component of the specified pathname does not exist. No\nentity (file or directory) could be found by the given path.</p>\n</li>\n<li>\n<p><code>ENOTDIR</code> (Not a directory): A component of the given pathname existed, but\nwas not a directory as expected. Commonly raised by <a href=\"fs.html#fsreaddirpath-options-callback\"><code>fs.readdir</code></a>.</p>\n</li>\n<li>\n<p><code>ENOTEMPTY</code> (Directory not empty): A directory with entries was the target\nof an operation that requires an empty directory, usually <a href=\"fs.html#fsunlinkpath-callback\"><code>fs.unlink</code></a>.</p>\n</li>\n<li>\n<p><code>ENOTFOUND</code> (DNS lookup failed): Indicates a DNS failure of either\n<code>EAI_NODATA</code> or <code>EAI_NONAME</code>. This is not a standard POSIX error.</p>\n</li>\n<li>\n<p><code>EPERM</code> (Operation not permitted): An attempt was made to perform an\noperation that requires elevated privileges.</p>\n</li>\n<li>\n<p><code>EPIPE</code> (Broken pipe): A write on a pipe, socket, or FIFO for which there is\nno process to read the data. Commonly encountered at the <a href=\"net.html\"><code>net</code></a> and\n<a href=\"http.html\"><code>http</code></a> layers, indicative that the remote side of the stream being\nwritten to has been closed.</p>\n</li>\n<li>\n<p><code>ETIMEDOUT</code> (Operation timed out): A connect or send request failed because\nthe connected party did not properly respond after a period of time. Usually\nencountered by <a href=\"http.html\"><code>http</code></a> or <a href=\"net.html\"><code>net</code></a>. Often a sign that a <code>socket.end()</code>\nwas not properly called.</p>\n</li>\n</ul>",
          "displayName": "Common system errors"
        }
      ],
      "source": "doc/api/errors.md"
    },
    {
      "textRaw": "Class: `TypeError`",
      "name": "TypeError",
      "type": "class",
      "desc": "<ul>\n<li>Extends <a href=\"errors.html#class-errorserror\"><code>&#x3C;errors.Error></code></a></li>\n</ul>\n<p>Indicates that a provided argument is not an allowable type. For example,\npassing a function to a parameter which expects a string would be a <code>TypeError</code>.</p>\n<pre><code class=\"language-js\">require('node:url').parse(() => { });\n// Throws TypeError, since it expected a string.\n</code></pre>\n<p>Node.js will generate and throw <code>TypeError</code> instances <em>immediately</em> as a form\nof argument validation.</p>",
      "source": "doc/api/errors.md"
    },
    {
      "textRaw": "Class: `AbortController`",
      "name": "AbortController",
      "type": "class",
      "meta": {
        "added": [
          "v15.0.0",
          "v14.17.0"
        ],
        "changes": [
          {
            "version": "v15.4.0",
            "pr-url": "https://github.com/nodejs/node/pull/35949",
            "description": "No longer experimental."
          }
        ]
      },
      "desc": "<p>A utility class used to signal cancelation in selected <code>Promise</code>-based APIs.\nThe API is based on the Web API <a href=\"globals.html#class-abortcontroller\"><code>&#x3C;AbortController></code></a>.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\n\nac.signal.addEventListener('abort', () => console.log('Aborted!'),\n                           { once: true });\n\nac.abort();\n\nconsole.log(ac.signal.aborted);  // Prints true\n</code></pre>",
      "methods": [
        {
          "textRaw": "`abortController.abort([reason])`",
          "name": "abort",
          "type": "method",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v17.2.0",
                  "v16.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/40807",
                "description": "Added the new optional reason argument."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`reason` {any} An optional reason, retrievable on the `AbortSignal`'s `reason` property.",
                  "name": "reason",
                  "type": "any",
                  "desc": "An optional reason, retrievable on the `AbortSignal`'s `reason` property.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Triggers the abort signal, causing the <code>abortController.signal</code> to emit\nthe <code>'abort'</code> event.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {AbortSignal}",
          "name": "signal",
          "type": "AbortSignal",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": []
          }
        }
      ],
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `AbortSignal`",
      "name": "AbortSignal",
      "type": "class",
      "meta": {
        "added": [
          "v15.0.0",
          "v14.17.0"
        ],
        "changes": []
      },
      "desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventtarget\"><code>&#x3C;EventTarget></code></a></li>\n</ul>\n<p>The <code>AbortSignal</code> is used to notify observers when the\n<code>abortController.abort()</code> method is called.</p>",
      "classMethods": [
        {
          "textRaw": "Static method: `AbortSignal.abort([reason])`",
          "name": "abort",
          "type": "classMethod",
          "meta": {
            "added": [
              "v15.12.0",
              "v14.17.0"
            ],
            "changes": [
              {
                "version": [
                  "v17.2.0",
                  "v16.14.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/40807",
                "description": "Added the new optional reason argument."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`reason` {any}",
                  "name": "reason",
                  "type": "any",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {AbortSignal}",
                "name": "return",
                "type": "AbortSignal"
              }
            }
          ],
          "desc": "<p>Returns a new already aborted <code>AbortSignal</code>.</p>"
        },
        {
          "textRaw": "Static method: `AbortSignal.timeout(delay)`",
          "name": "timeout",
          "type": "classMethod",
          "meta": {
            "added": [
              "v17.3.0",
              "v16.14.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`delay` {number} The number of milliseconds to wait before triggering the AbortSignal.",
                  "name": "delay",
                  "type": "number",
                  "desc": "The number of milliseconds to wait before triggering the AbortSignal."
                }
              ]
            }
          ],
          "desc": "<p>Returns a new <code>AbortSignal</code> which will be aborted in <code>delay</code> milliseconds.</p>"
        },
        {
          "textRaw": "Static method: `AbortSignal.any(signals)`",
          "name": "any",
          "type": "classMethod",
          "meta": {
            "added": [
              "v20.3.0",
              "v18.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`signals` {AbortSignal[]} The `AbortSignal`s of which to compose a new `AbortSignal`.",
                  "name": "signals",
                  "type": "AbortSignal[]",
                  "desc": "The `AbortSignal`s of which to compose a new `AbortSignal`."
                }
              ]
            }
          ],
          "desc": "<p>Returns a new <code>AbortSignal</code> which will be aborted if any of the provided\nsignals are aborted. Its <a href=\"#abortsignalreason\"><code>abortSignal.reason</code></a> will be set to whichever\none of the <code>signals</code> caused it to be aborted.</p>"
        }
      ],
      "events": [
        {
          "textRaw": "Event: `'abort'`",
          "name": "abort",
          "type": "event",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": []
          },
          "params": [],
          "desc": "<p>The <code>'abort'</code> event is emitted when the <code>abortController.abort()</code> method\nis called. The callback is invoked with a single object argument with a\nsingle <code>type</code> property set to <code>'abort'</code>:</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\n\n// Use either the onabort property...\nac.signal.onabort = () => console.log('aborted!');\n\n// Or the EventTarget API...\nac.signal.addEventListener('abort', (event) => {\n  console.log(event.type);  // Prints 'abort'\n}, { once: true });\n\nac.abort();\n</code></pre>\n<p>The <code>AbortController</code> with which the <code>AbortSignal</code> is associated will only\never trigger the <code>'abort'</code> event once. We recommended that code check\nthat the <code>abortSignal.aborted</code> attribute is <code>false</code> before adding an <code>'abort'</code>\nevent listener.</p>\n<p>Any event listeners attached to the <code>AbortSignal</code> should use the\n<code>{ once: true }</code> option (or, if using the <code>EventEmitter</code> APIs to attach a\nlistener, use the <code>once()</code> method) to ensure that the event listener is\nremoved as soon as the <code>'abort'</code> event is handled. Failure to do so may\nresult in memory leaks.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {boolean}",
          "name": "aborted",
          "type": "boolean",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": []
          },
          "desc": "<p>True after the <code>AbortController</code> has been aborted.</p>"
        },
        {
          "textRaw": "Type: {Function}",
          "name": "onabort",
          "type": "Function",
          "meta": {
            "added": [
              "v15.0.0",
              "v14.17.0"
            ],
            "changes": []
          },
          "desc": "<p>An optional callback function that may be set by user code to be notified\nwhen the <code>abortController.abort()</code> function has been called.</p>"
        },
        {
          "textRaw": "Type: {any}",
          "name": "reason",
          "type": "any",
          "meta": {
            "added": [
              "v17.2.0",
              "v16.14.0"
            ],
            "changes": []
          },
          "desc": "<p>An optional reason specified when the <code>AbortSignal</code> was triggered.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\nac.abort(new Error('boom!'));\nconsole.log(ac.signal.reason);  // Error: boom!\n</code></pre>"
        }
      ],
      "methods": [
        {
          "textRaw": "`abortSignal.throwIfAborted()`",
          "name": "throwIfAborted",
          "type": "method",
          "meta": {
            "added": [
              "v17.3.0",
              "v16.17.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>If <code>abortSignal.aborted</code> is <code>true</code>, throws <code>abortSignal.reason</code>.</p>"
        }
      ],
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Blob`",
      "name": "Blob",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": []
      },
      "desc": "<p>See <a href=\"buffer.html#class-blob\"><code>&#x3C;Blob></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `BroadcastChannel`",
      "name": "BroadcastChannel",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": []
      },
      "desc": "<p>See <a href=\"worker_threads.html#class-broadcastchannel-extends-eventtarget\"><code>&#x3C;BroadcastChannel></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Buffer`",
      "name": "Buffer",
      "type": "class",
      "meta": {
        "added": [
          "v0.1.103"
        ],
        "changes": []
      },
      "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function\"><code>&#x3C;Function></code></a></li>\n</ul>\n<p>Used to handle binary data. See the <a href=\"buffer.html\">buffer section</a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `ByteLengthQueuingStrategy`",
      "name": "ByteLengthQueuingStrategy",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-bytelengthqueuingstrategy\"><code>ByteLengthQueuingStrategy</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `CloseEvent`",
      "name": "CloseEvent",
      "type": "class",
      "meta": {
        "added": [
          "v23.0.0"
        ],
        "changes": []
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/CloseEvent\"><code>&#x3C;CloseEvent></code></a>. Disable this API\nwith the <a href=\"cli.html#--no-experimental-websocket\"><code>--no-experimental-websocket</code></a> CLI flag.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `CompressionStream`",
      "name": "CompressionStream",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v24.7.0",
              "v22.20.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/59464",
            "description": "format now accepts `brotli` value."
          },
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-compressionstream\"><code>CompressionStream</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `CountQueuingStrategy`",
      "name": "CountQueuingStrategy",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-countqueuingstrategy\"><code>CountQueuingStrategy</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Crypto`",
      "name": "Crypto",
      "type": "class",
      "meta": {
        "added": [
          "v17.6.0",
          "v16.15.0"
        ],
        "changes": [
          {
            "version": "v23.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/52564",
            "description": "No longer experimental."
          },
          {
            "version": "v19.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/42083",
            "description": "No longer behind `--experimental-global-webcrypto` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-crypto\"><code>&#x3C;Crypto></code></a>. This global is available\nonly if the Node.js binary was compiled with including support for the <code>node:crypto</code> module.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `CryptoKey`",
      "name": "CryptoKey",
      "type": "class",
      "meta": {
        "added": [
          "v17.6.0",
          "v16.15.0"
        ],
        "changes": [
          {
            "version": "v23.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/52564",
            "description": "No longer experimental."
          },
          {
            "version": "v19.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/42083",
            "description": "No longer behind `--experimental-global-webcrypto` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-cryptokey\"><code>&#x3C;CryptoKey></code></a>. This global is available\nonly if the Node.js binary was compiled with including support for the <code>node:crypto</code> module.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `CustomEvent`",
      "name": "CustomEvent",
      "type": "class",
      "meta": {
        "added": [
          "v18.7.0",
          "v16.17.0"
        ],
        "changes": [
          {
            "version": "v23.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/52723",
            "description": "No longer experimental."
          },
          {
            "version": [
              "v22.1.0",
              "v20.13.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/52618",
            "description": "CustomEvent is now stable."
          },
          {
            "version": "v19.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/44860",
            "description": "No longer behind `--experimental-global-customevent` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"events.html#class-customevent\"><code>&#x3C;CustomEvent></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `DecompressionStream`",
      "name": "DecompressionStream",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v24.7.0",
              "v22.20.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/59464",
            "description": "format now accepts `brotli` value."
          },
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-decompressionstream\"><code>DecompressionStream</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `DOMException`",
      "name": "DOMException",
      "type": "class",
      "meta": {
        "added": [
          "v17.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/docs/Web/API/DOMException\"><code>&#x3C;DOMException></code></a> class.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Event`",
      "name": "Event",
      "type": "class",
      "meta": {
        "added": [
          "v15.0.0"
        ],
        "changes": [
          {
            "version": "v15.4.0",
            "pr-url": "https://github.com/nodejs/node/pull/35949",
            "description": "No longer experimental."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of the <code>Event</code> class. See\n<a href=\"events.html#eventtarget-and-event-api\"><code>EventTarget</code> and <code>Event</code> API</a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `EventSource`",
      "name": "EventSource",
      "type": "class",
      "meta": {
        "added": [
          "v22.3.0",
          "v20.18.0"
        ],
        "changes": []
      },
      "stability": 1,
      "stabilityText": "Experimental. Enable this API with the `--experimental-eventsource` CLI flag.",
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/EventSource\"><code>&#x3C;EventSource></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `EventTarget`",
      "name": "EventTarget",
      "type": "class",
      "meta": {
        "added": [
          "v15.0.0"
        ],
        "changes": [
          {
            "version": "v15.4.0",
            "pr-url": "https://github.com/nodejs/node/pull/35949",
            "description": "No longer experimental."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of the <code>EventTarget</code> class. See\n<a href=\"events.html#eventtarget-and-event-api\"><code>EventTarget</code> and <code>Event</code> API</a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `File`",
      "name": "File",
      "type": "class",
      "meta": {
        "added": [
          "v20.0.0"
        ],
        "changes": []
      },
      "desc": "<p>See <a href=\"buffer.html#class-file\"><code>&#x3C;File></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `FormData`",
      "name": "FormData",
      "type": "class",
      "meta": {
        "added": [
          "v17.6.0",
          "v16.15.0"
        ],
        "changes": [
          {
            "version": [
              "v21.0.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/45684",
            "description": "No longer experimental."
          },
          {
            "version": "v18.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/41811",
            "description": "No longer behind `--experimental-fetch` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/FormData\"><code>&#x3C;FormData></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Headers`",
      "name": "Headers",
      "type": "class",
      "meta": {
        "added": [
          "v17.5.0",
          "v16.15.0"
        ],
        "changes": [
          {
            "version": [
              "v21.0.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/45684",
            "description": "No longer experimental."
          },
          {
            "version": "v18.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/41811",
            "description": "No longer behind `--experimental-fetch` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/Headers\"><code>&#x3C;Headers></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `MessageChannel`",
      "name": "MessageChannel",
      "type": "class",
      "meta": {
        "added": [
          "v15.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The <code>MessageChannel</code> class. See <a href=\"worker_threads.html#class-messagechannel\"><code>MessageChannel</code></a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `MessageEvent`",
      "name": "MessageEvent",
      "type": "class",
      "meta": {
        "added": [
          "v15.0.0"
        ],
        "changes": []
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/MessageEvent\"><code>&#x3C;MessageEvent></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `MessagePort`",
      "name": "MessagePort",
      "type": "class",
      "meta": {
        "added": [
          "v15.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The <code>MessagePort</code> class. See <a href=\"worker_threads.html#class-messageport\"><code>MessagePort</code></a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Navigator`",
      "name": "Navigator",
      "type": "class",
      "meta": {
        "added": [
          "v21.0.0"
        ],
        "changes": []
      },
      "stability": 1.1,
      "stabilityText": "Active development. Disable this API with the `--no-experimental-global-navigator` CLI flag.",
      "desc": "<p>A partial implementation of the <a href=\"https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object\">Navigator API</a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `PerformanceEntry`",
      "name": "PerformanceEntry",
      "type": "class",
      "meta": {
        "added": [
          "v19.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The <code>PerformanceEntry</code> class. See <a href=\"perf_hooks.html#class-performanceentry\"><code>PerformanceEntry</code></a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `PerformanceMark`",
      "name": "PerformanceMark",
      "type": "class",
      "meta": {
        "added": [
          "v19.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The <code>PerformanceMark</code> class. See <a href=\"perf_hooks.html#class-performancemark\"><code>PerformanceMark</code></a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `PerformanceMeasure`",
      "name": "PerformanceMeasure",
      "type": "class",
      "meta": {
        "added": [
          "v19.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The <code>PerformanceMeasure</code> class. See <a href=\"perf_hooks.html#class-performancemeasure\"><code>PerformanceMeasure</code></a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `PerformanceObserver`",
      "name": "PerformanceObserver",
      "type": "class",
      "meta": {
        "added": [
          "v19.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The <code>PerformanceObserver</code> class. See <a href=\"perf_hooks.html#class-performanceobserver\"><code>PerformanceObserver</code></a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `PerformanceObserverEntryList`",
      "name": "PerformanceObserverEntryList",
      "type": "class",
      "meta": {
        "added": [
          "v19.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The <code>PerformanceObserverEntryList</code> class. See\n<a href=\"perf_hooks.html#class-performanceobserverentrylist\"><code>PerformanceObserverEntryList</code></a> for more details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `PerformanceResourceTiming`",
      "name": "PerformanceResourceTiming",
      "type": "class",
      "meta": {
        "added": [
          "v19.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The <code>PerformanceResourceTiming</code> class. See <a href=\"perf_hooks.html#class-performanceresourcetiming\"><code>PerformanceResourceTiming</code></a> for\nmore details.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `QuotaExceededError`",
      "name": "QuotaExceededError",
      "type": "class",
      "meta": {
        "added": [
          "v26.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/docs/Web/API/QuotaExceededError\"><code>&#x3C;QuotaExceededError></code></a> class. Extends <a href=\"https://developer.mozilla.org/docs/Web/API/DOMException\"><code>&#x3C;DOMException></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `ReadableByteStreamController`",
      "name": "ReadableByteStreamController",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablebytestreamcontroller\"><code>ReadableByteStreamController</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `ReadableStream`",
      "name": "ReadableStream",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestream\"><code>ReadableStream</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `ReadableStreamBYOBReader`",
      "name": "ReadableStreamBYOBReader",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreambyobreader\"><code>ReadableStreamBYOBReader</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `ReadableStreamBYOBRequest`",
      "name": "ReadableStreamBYOBRequest",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreambyobrequest\"><code>ReadableStreamBYOBRequest</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `ReadableStreamDefaultController`",
      "name": "ReadableStreamDefaultController",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreamdefaultcontroller\"><code>ReadableStreamDefaultController</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `ReadableStreamDefaultReader`",
      "name": "ReadableStreamDefaultReader",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreamdefaultreader\"><code>ReadableStreamDefaultReader</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Request`",
      "name": "Request",
      "type": "class",
      "meta": {
        "added": [
          "v17.5.0",
          "v16.15.0"
        ],
        "changes": [
          {
            "version": [
              "v21.0.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/45684",
            "description": "No longer experimental."
          },
          {
            "version": "v18.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/41811",
            "description": "No longer behind `--experimental-fetch` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/Request\"><code>&#x3C;Request></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Response`",
      "name": "Response",
      "type": "class",
      "meta": {
        "added": [
          "v17.5.0",
          "v16.15.0"
        ],
        "changes": [
          {
            "version": [
              "v21.0.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/45684",
            "description": "No longer experimental."
          },
          {
            "version": "v18.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/41811",
            "description": "No longer behind `--experimental-fetch` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/Response\"><code>&#x3C;Response></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `Storage`",
      "name": "Storage",
      "type": "class",
      "meta": {
        "added": [
          "v22.4.0"
        ],
        "changes": []
      },
      "stability": 1.2,
      "stabilityText": "Release candidate. Disable this API with `--no-experimental-webstorage`.",
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/Storage\"><code>&#x3C;Storage></code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `SubtleCrypto`",
      "name": "SubtleCrypto",
      "type": "class",
      "meta": {
        "added": [
          "v17.6.0",
          "v16.15.0"
        ],
        "changes": [
          {
            "version": "v19.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/42083",
            "description": "No longer behind `--experimental-global-webcrypto` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-subtlecrypto\"><code>&#x3C;SubtleCrypto></code></a>. This global is available\nonly if the Node.js binary was compiled with including support for the <code>node:crypto</code> module.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `TextDecoder`",
      "name": "TextDecoder",
      "type": "class",
      "meta": {
        "added": [
          "v11.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The WHATWG <code>TextDecoder</code> class. See the <a href=\"util.html#class-utiltextdecoder\"><code>TextDecoder</code></a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `TextDecoderStream`",
      "name": "TextDecoderStream",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-textdecoderstream\"><code>TextDecoderStream</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `TextEncoder`",
      "name": "TextEncoder",
      "type": "class",
      "meta": {
        "added": [
          "v11.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The WHATWG <code>TextEncoder</code> class. See the <a href=\"util.html#class-utiltextencoder\"><code>TextEncoder</code></a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `TextEncoderStream`",
      "name": "TextEncoderStream",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-textencoderstream\"><code>TextEncoderStream</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `TransformStream`",
      "name": "TransformStream",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-transformstream\"><code>TransformStream</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `TransformStreamDefaultController`",
      "name": "TransformStreamDefaultController",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-transformstreamdefaultcontroller\"><code>TransformStreamDefaultController</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `URL`",
      "name": "URL",
      "type": "class",
      "meta": {
        "added": [
          "v10.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The WHATWG <code>URL</code> class. See the <a href=\"url.html#class-url\"><code>URL</code></a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `URLPattern`",
      "name": "URLPattern",
      "type": "class",
      "meta": {
        "added": [
          "v24.0.0"
        ],
        "changes": []
      },
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The WHATWG <code>URLPattern</code> class. See the <a href=\"url.html#class-urlpattern\"><code>URLPattern</code></a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `URLSearchParams`",
      "name": "URLSearchParams",
      "type": "class",
      "meta": {
        "added": [
          "v10.0.0"
        ],
        "changes": []
      },
      "desc": "<p>The WHATWG <code>URLSearchParams</code> class. See the <a href=\"url.html#class-urlsearchparams\"><code>URLSearchParams</code></a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `WebAssembly`",
      "name": "WebAssembly",
      "type": "class",
      "meta": {
        "added": [
          "v8.0.0"
        ],
        "changes": []
      },
      "desc": "<ul>\n<li>Type: <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\"><code>&#x3C;Object></code></a></li>\n</ul>\n<p>The object that acts as the namespace for all W3C\n<a href=\"https://webassembly.org\">WebAssembly</a> related functionality. See the\n<a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly\">Mozilla Developer Network</a> for usage and compatibility.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `WebSocket`",
      "name": "WebSocket",
      "type": "class",
      "meta": {
        "added": [
          "v21.0.0",
          "v20.10.0"
        ],
        "changes": [
          {
            "version": "v22.4.0",
            "pr-url": "https://github.com/nodejs/node/pull/53352",
            "description": "No longer experimental."
          },
          {
            "version": "v22.0.0",
            "pr-url": "https://github.com/nodejs/node/pull/51594",
            "description": "No longer behind `--experimental-websocket` CLI flag."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/docs/Web/API/WebSocket\"><code>&#x3C;WebSocket></code></a>. Disable this API\nwith the <a href=\"cli.html#--no-experimental-websocket\"><code>--no-experimental-websocket</code></a> CLI flag.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `WritableStream`",
      "name": "WritableStream",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestream\"><code>WritableStream</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `WritableStreamDefaultController`",
      "name": "WritableStreamDefaultController",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestreamdefaultcontroller\"><code>WritableStreamDefaultController</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "Class: `WritableStreamDefaultWriter`",
      "name": "WritableStreamDefaultWriter",
      "type": "class",
      "meta": {
        "added": [
          "v18.0.0"
        ],
        "changes": [
          {
            "version": [
              "v23.11.0",
              "v22.15.0"
            ],
            "pr-url": "https://github.com/nodejs/node/pull/57510",
            "description": "Marking the API stable."
          }
        ]
      },
      "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestreamdefaultwriter\"><code>WritableStreamDefaultWriter</code></a>.</p>",
      "source": "doc/api/globals.md"
    }
  ],
  "globals": [
    {
      "textRaw": "Process",
      "name": "Process",
      "introduced_in": "v0.10.0",
      "type": "global",
      "desc": "<p>The <code>process</code> object provides information about, and control over, the current\nNode.js process.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n</code></pre>\n<pre><code class=\"language-cjs\">const process = require('node:process');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Process events",
          "name": "process_events",
          "type": "module",
          "desc": "<p>The <code>process</code> object is an instance of <a href=\"events.html#class-eventemitter\"><code>EventEmitter</code></a>.</p>",
          "events": [
            {
              "textRaw": "Event: `'beforeExit'`",
              "name": "beforeExit",
              "type": "event",
              "meta": {
                "added": [
                  "v0.11.12"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>The <code>'beforeExit'</code> event is emitted when Node.js empties its event loop and has\nno additional work to schedule. Normally, the Node.js process will exit when\nthere is no work scheduled, but a listener registered on the <code>'beforeExit'</code>\nevent can make asynchronous calls, and thereby cause the Node.js process to\ncontinue.</p>\n<p>The listener callback function is invoked with the value of\n<a href=\"#processexitcode_1\"><code>process.exitCode</code></a> passed as the only argument.</p>\n<p>The <code>'beforeExit'</code> event is <em>not</em> emitted for conditions causing explicit\ntermination, such as calling <a href=\"#processexitcode\"><code>process.exit()</code></a> or uncaught exceptions.</p>\n<p>The <code>'beforeExit'</code> should <em>not</em> be used as an alternative to the <code>'exit'</code> event\nunless the intention is to schedule additional work.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.on('beforeExit', (code) => {\n  console.log('Process beforeExit event with code: ', code);\n});\n\nprocess.on('exit', (code) => {\n  console.log('Process exit event with code: ', code);\n});\n\nconsole.log('This message is displayed first.');\n\n// Prints:\n// This message is displayed first.\n// Process beforeExit event with code: 0\n// Process exit event with code: 0\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('beforeExit', (code) => {\n  console.log('Process beforeExit event with code: ', code);\n});\n\nprocess.on('exit', (code) => {\n  console.log('Process exit event with code: ', code);\n});\n\nconsole.log('This message is displayed first.');\n\n// Prints:\n// This message is displayed first.\n// Process beforeExit event with code: 0\n// Process exit event with code: 0\n</code></pre>"
            },
            {
              "textRaw": "Event: `'disconnect'`",
              "name": "disconnect",
              "type": "event",
              "meta": {
                "added": [
                  "v0.7.7"
                ],
                "changes": []
              },
              "params": [],
              "desc": "<p>If the Node.js process is spawned with an IPC channel (see the <a href=\"child_process.html\">Child Process</a>\nand <a href=\"cluster.html\">Cluster</a> documentation), the <code>'disconnect'</code> event will be emitted when\nthe IPC channel is closed.</p>"
            },
            {
              "textRaw": "Event: `'exit'`",
              "name": "exit",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.7"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`code` {integer}",
                  "name": "code",
                  "type": "integer"
                }
              ],
              "desc": "<p>The <code>'exit'</code> event is emitted when the Node.js process is about to exit as a\nresult of either:</p>\n<ul>\n<li>The <code>process.exit()</code> method being called explicitly;</li>\n<li>The Node.js event loop no longer having any additional work to perform.</li>\n</ul>\n<p>There is no way to prevent the exiting of the event loop at this point, and once\nall <code>'exit'</code> listeners have finished running the Node.js process will terminate.</p>\n<p>The listener callback function is invoked with the exit code specified either\nby the <a href=\"#processexitcode_1\"><code>process.exitCode</code></a> property, or the <code>exitCode</code> argument passed to the\n<a href=\"#processexitcode\"><code>process.exit()</code></a> method.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.on('exit', (code) => {\n  console.log(`About to exit with code: ${code}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('exit', (code) => {\n  console.log(`About to exit with code: ${code}`);\n});\n</code></pre>\n<p>Listener functions <strong>must</strong> only perform <strong>synchronous</strong> operations. The Node.js\nprocess will exit immediately after calling the <code>'exit'</code> event listeners\ncausing any additional work still queued in the event loop to be abandoned.\nIn the following example, for instance, the timeout will never occur:</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.on('exit', (code) => {\n  setTimeout(() => {\n    console.log('This will not run');\n  }, 0);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('exit', (code) => {\n  setTimeout(() => {\n    console.log('This will not run');\n  }, 0);\n});\n</code></pre>"
            },
            {
              "textRaw": "Event: `'message'`",
              "name": "message",
              "type": "event",
              "meta": {
                "added": [
                  "v0.5.10"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`message` {Object|boolean|number|string|null} a parsed JSON object or a serializable primitive value.",
                  "name": "message",
                  "type": "Object|boolean|number|string|null",
                  "desc": "a parsed JSON object or a serializable primitive value."
                },
                {
                  "textRaw": "`sendHandle` {net.Server|net.Socket} a `net.Server` or `net.Socket` object, or undefined.",
                  "name": "sendHandle",
                  "type": "net.Server|net.Socket",
                  "desc": "a `net.Server` or `net.Socket` object, or undefined."
                }
              ],
              "desc": "<p>If the Node.js process is spawned with an IPC channel (see the <a href=\"child_process.html\">Child Process</a>\nand <a href=\"cluster.html\">Cluster</a> documentation), the <code>'message'</code> event is emitted whenever a\nmessage sent by a parent process using <a href=\"child_process.html#subprocesssendmessage-sendhandle-options-callback\"><code>childprocess.send()</code></a> is received by\nthe child process.</p>\n<p>The message goes through serialization and parsing. The resulting message might\nnot be the same as what is originally sent.</p>\n<p>If the <code>serialization</code> option was set to <code>advanced</code> used when spawning the\nprocess, the <code>message</code> argument can contain data that JSON is not able\nto represent.\nSee <a href=\"child_process.html#advanced-serialization\">Advanced serialization for <code>child_process</code></a> for more details.</p>"
            },
            {
              "textRaw": "Event: `'rejectionHandled'`",
              "name": "rejectionHandled",
              "type": "event",
              "meta": {
                "added": [
                  "v1.4.1"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`promise` {Promise} The late handled promise.",
                  "name": "promise",
                  "type": "Promise",
                  "desc": "The late handled promise."
                }
              ],
              "desc": "<p>The <code>'rejectionHandled'</code> event is emitted whenever a <code>Promise</code> has been rejected\nand an error handler was attached to it (using <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch\"><code>promise.catch()</code></a>, for\nexample) later than one turn of the Node.js event loop.</p>\n<p>The <code>Promise</code> object would have previously been emitted in an\n<code>'unhandledRejection'</code> event, but during the course of processing gained a\nrejection handler.</p>\n<p>There is no notion of a top level for a <code>Promise</code> chain at which rejections can\nalways be handled. Being inherently asynchronous in nature, a <code>Promise</code>\nrejection can be handled at a future point in time, possibly much later than\nthe event loop turn it takes for the <code>'unhandledRejection'</code> event to be emitted.</p>\n<p>Another way of stating this is that, unlike in synchronous code where there is\nan ever-growing list of unhandled exceptions, with Promises there can be a\ngrowing-and-shrinking list of unhandled rejections.</p>\n<p>In synchronous code, the <code>'uncaughtException'</code> event is emitted when the list of\nunhandled exceptions grows.</p>\n<p>In asynchronous code, the <code>'unhandledRejection'</code> event is emitted when the list\nof unhandled rejections grows, and the <code>'rejectionHandled'</code> event is emitted\nwhen the list of unhandled rejections shrinks.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nconst unhandledRejections = new Map();\nprocess.on('unhandledRejection', (reason, promise) => {\n  unhandledRejections.set(promise, reason);\n});\nprocess.on('rejectionHandled', (promise) => {\n  unhandledRejections.delete(promise);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const unhandledRejections = new Map();\nprocess.on('unhandledRejection', (reason, promise) => {\n  unhandledRejections.set(promise, reason);\n});\nprocess.on('rejectionHandled', (promise) => {\n  unhandledRejections.delete(promise);\n});\n</code></pre>\n<p>In this example, the <code>unhandledRejections</code> <code>Map</code> will grow and shrink over time,\nreflecting rejections that start unhandled and then become handled. It is\npossible to record such errors in an error log, either periodically (which is\nlikely best for long-running application) or upon process exit (which is likely\nmost convenient for scripts).</p>"
            },
            {
              "textRaw": "Event: `'workerMessage'`",
              "name": "workerMessage",
              "type": "event",
              "meta": {
                "added": [
                  "v22.5.0",
                  "v20.19.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`value` {any} A value transmitted using `postMessageToThread()`.",
                  "name": "value",
                  "type": "any",
                  "desc": "A value transmitted using `postMessageToThread()`."
                },
                {
                  "textRaw": "`source` {number} The transmitting worker thread ID or `0` for the main thread.",
                  "name": "source",
                  "type": "number",
                  "desc": "The transmitting worker thread ID or `0` for the main thread."
                }
              ],
              "desc": "<p>The <code>'workerMessage'</code> event is emitted for any incoming message send by the other\nparty by using <a href=\"worker_threads.html#worker_threadspostmessagetothreadthreadid-value-transferlist-timeout\"><code>postMessageToThread()</code></a>.</p>"
            },
            {
              "textRaw": "Event: `'uncaughtException'`",
              "name": "uncaughtException",
              "type": "event",
              "meta": {
                "added": [
                  "v0.1.18"
                ],
                "changes": [
                  {
                    "version": [
                      "v12.0.0",
                      "v10.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/26599",
                    "description": "Added the `origin` argument."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`err` {Error} The uncaught exception.",
                  "name": "err",
                  "type": "Error",
                  "desc": "The uncaught exception."
                },
                {
                  "textRaw": "`origin` {string} Indicates if the exception originates from an unhandled rejection or from a synchronous error. Can either be `'uncaughtException'` or `'unhandledRejection'`. The latter is used when an exception happens in a `Promise` based async context (or if a `Promise` is rejected) and `--unhandled-rejections` flag set to `strict` or `throw` (which is the default) and the rejection is not handled, or when a rejection happens during the command line entry point's ES module static loading phase.",
                  "name": "origin",
                  "type": "string",
                  "desc": "Indicates if the exception originates from an unhandled rejection or from a synchronous error. Can either be `'uncaughtException'` or `'unhandledRejection'`. The latter is used when an exception happens in a `Promise` based async context (or if a `Promise` is rejected) and `--unhandled-rejections` flag set to `strict` or `throw` (which is the default) and the rejection is not handled, or when a rejection happens during the command line entry point's ES module static loading phase."
                }
              ],
              "desc": "<p>The <code>'uncaughtException'</code> event is emitted when an uncaught JavaScript\nexception bubbles all the way back to the event loop. By default, Node.js\nhandles such exceptions by printing the stack trace to <code>stderr</code> and exiting\nwith code 1, overriding any previously set <a href=\"#processexitcode_1\"><code>process.exitCode</code></a>.\nAdding a handler for the <code>'uncaughtException'</code> event overrides this default\nbehavior. Alternatively, change the <a href=\"#processexitcode_1\"><code>process.exitCode</code></a> in the\n<code>'uncaughtException'</code> handler which will result in the process exiting with the\nprovided exit code. Otherwise, in the presence of such handler the process will\nexit with 0.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\nimport fs from 'node:fs';\n\nprocess.on('uncaughtException', (err, origin) => {\n  fs.writeSync(\n    process.stderr.fd,\n    `Caught exception: ${err}\\n` +\n    `Exception origin: ${origin}\\n`,\n  );\n});\n\nsetTimeout(() => {\n  console.log('This will still run.');\n}, 500);\n\n// Intentionally cause an exception, but don't catch it.\nnonexistentFunc();\nconsole.log('This will not run.');\n</code></pre>\n<pre><code class=\"language-cjs\">const fs = require('node:fs');\n\nprocess.on('uncaughtException', (err, origin) => {\n  fs.writeSync(\n    process.stderr.fd,\n    `Caught exception: ${err}\\n` +\n    `Exception origin: ${origin}\\n`,\n  );\n});\n\nsetTimeout(() => {\n  console.log('This will still run.');\n}, 500);\n\n// Intentionally cause an exception, but don't catch it.\nnonexistentFunc();\nconsole.log('This will not run.');\n</code></pre>\n<p>It is possible to monitor <code>'uncaughtException'</code> events without overriding the\ndefault behavior to exit the process by installing a\n<code>'uncaughtExceptionMonitor'</code> listener.</p>",
              "modules": [
                {
                  "textRaw": "Warning: Using `'uncaughtException'` correctly",
                  "name": "warning:_using_`'uncaughtexception'`_correctly",
                  "type": "module",
                  "desc": "<p><code>'uncaughtException'</code> is a crude mechanism for exception handling\nintended to be used only as a last resort. The event <em>should not</em> be used as\nan equivalent to <code>On Error Resume Next</code>. Unhandled exceptions inherently mean\nthat an application is in an undefined state. Attempting to resume application\ncode without properly recovering from the exception can cause additional\nunforeseen and unpredictable issues.</p>\n<p>Exceptions thrown from within the event handler will not be caught. Instead the\nprocess will exit with a non-zero exit code and the stack trace will be printed.\nThis is to avoid infinite recursion.</p>\n<p>Attempting to resume normally after an uncaught exception can be similar to\npulling out the power cord when upgrading a computer. Nine out of ten\ntimes, nothing happens. But the tenth time, the system becomes corrupted.</p>\n<p>The correct use of <code>'uncaughtException'</code> is to perform synchronous cleanup\nof allocated resources (e.g. file descriptors, handles, etc) before shutting\ndown the process. <strong>It is not safe to resume normal operation after\n<code>'uncaughtException'</code>.</strong></p>\n<p>To restart a crashed application in a more reliable way, whether\n<code>'uncaughtException'</code> is emitted or not, an external monitor should be employed\nin a separate process to detect application failures and recover or restart as\nneeded.</p>",
                  "displayName": "Warning: Using `'uncaughtException'` correctly"
                }
              ]
            },
            {
              "textRaw": "Event: `'uncaughtExceptionMonitor'`",
              "name": "uncaughtExceptionMonitor",
              "type": "event",
              "meta": {
                "added": [
                  "v13.7.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`err` {Error} The uncaught exception.",
                  "name": "err",
                  "type": "Error",
                  "desc": "The uncaught exception."
                },
                {
                  "textRaw": "`origin` {string} Indicates if the exception originates from an unhandled rejection or from synchronous errors. Can either be `'uncaughtException'` or `'unhandledRejection'`. The latter is used when an exception happens in a `Promise` based async context (or if a `Promise` is rejected) and `--unhandled-rejections` flag set to `strict` or `throw` (which is the default) and the rejection is not handled, or when a rejection happens during the command line entry point's ES module static loading phase.",
                  "name": "origin",
                  "type": "string",
                  "desc": "Indicates if the exception originates from an unhandled rejection or from synchronous errors. Can either be `'uncaughtException'` or `'unhandledRejection'`. The latter is used when an exception happens in a `Promise` based async context (or if a `Promise` is rejected) and `--unhandled-rejections` flag set to `strict` or `throw` (which is the default) and the rejection is not handled, or when a rejection happens during the command line entry point's ES module static loading phase."
                }
              ],
              "desc": "<p>The <code>'uncaughtExceptionMonitor'</code> event is emitted before an\n<code>'uncaughtException'</code> event is emitted or a hook installed via\n<a href=\"#processsetuncaughtexceptioncapturecallbackfn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a> is called.</p>\n<p>Installing an <code>'uncaughtExceptionMonitor'</code> listener does not change the behavior\nonce an <code>'uncaughtException'</code> event is emitted. The process will\nstill crash if no <code>'uncaughtException'</code> listener is installed.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.on('uncaughtExceptionMonitor', (err, origin) => {\n  MyMonitoringTool.logSync(err, origin);\n});\n\n// Intentionally cause an exception, but don't catch it.\nnonexistentFunc();\n// Still crashes Node.js\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('uncaughtExceptionMonitor', (err, origin) => {\n  MyMonitoringTool.logSync(err, origin);\n});\n\n// Intentionally cause an exception, but don't catch it.\nnonexistentFunc();\n// Still crashes Node.js\n</code></pre>"
            },
            {
              "textRaw": "Event: `'unhandledRejection'`",
              "name": "unhandledRejection",
              "type": "event",
              "meta": {
                "added": [
                  "v1.4.1"
                ],
                "changes": [
                  {
                    "version": "v7.0.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8217",
                    "description": "Not handling `Promise` rejections is deprecated."
                  },
                  {
                    "version": "v6.6.0",
                    "pr-url": "https://github.com/nodejs/node/pull/8223",
                    "description": "Unhandled `Promise` rejections will now emit a process warning."
                  }
                ]
              },
              "params": [
                {
                  "textRaw": "`reason` {Error|any} The object with which the promise was rejected (typically an `Error` object).",
                  "name": "reason",
                  "type": "Error|any",
                  "desc": "The object with which the promise was rejected (typically an `Error` object)."
                },
                {
                  "textRaw": "`promise` {Promise} The rejected promise.",
                  "name": "promise",
                  "type": "Promise",
                  "desc": "The rejected promise."
                }
              ],
              "desc": "<p>The <code>'unhandledRejection'</code> event is emitted whenever a <code>Promise</code> is rejected and\nno error handler is attached to the promise within a turn of the event loop.\nWhen programming with Promises, exceptions are encapsulated as \"rejected\npromises\". Rejections can be caught and handled using <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch\"><code>promise.catch()</code></a> and\nare propagated through a <code>Promise</code> chain. The <code>'unhandledRejection'</code> event is\nuseful for detecting and keeping track of promises that were rejected whose\nrejections have not yet been handled.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.on('unhandledRejection', (reason, promise) => {\n  console.log('Unhandled Rejection at:', promise, 'reason:', reason);\n  // Application specific logging, throwing an error, or other logic here\n});\n\nsomePromise.then((res) => {\n  return reportToUser(JSON.pasre(res)); // Note the typo (`pasre`)\n}); // No `.catch()` or `.then()`\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('unhandledRejection', (reason, promise) => {\n  console.log('Unhandled Rejection at:', promise, 'reason:', reason);\n  // Application specific logging, throwing an error, or other logic here\n});\n\nsomePromise.then((res) => {\n  return reportToUser(JSON.pasre(res)); // Note the typo (`pasre`)\n}); // No `.catch()` or `.then()`\n</code></pre>\n<p>The following will also trigger the <code>'unhandledRejection'</code> event to be\nemitted:</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nfunction SomeResource() {\n  // Initially set the loaded status to a rejected promise\n  this.loaded = Promise.reject(new Error('Resource not yet loaded!'));\n}\n\nconst resource = new SomeResource();\n// no .catch or .then on resource.loaded for at least a turn\n</code></pre>\n<pre><code class=\"language-cjs\">function SomeResource() {\n  // Initially set the loaded status to a rejected promise\n  this.loaded = Promise.reject(new Error('Resource not yet loaded!'));\n}\n\nconst resource = new SomeResource();\n// no .catch or .then on resource.loaded for at least a turn\n</code></pre>\n<p>In this example case, it is possible to track the rejection as a developer error\nas would typically be the case for other <code>'unhandledRejection'</code> events. To\naddress such failures, a non-operational\n<a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch\"><code>.catch(() => { })</code></a> handler may be attached to\n<code>resource.loaded</code>, which would prevent the <code>'unhandledRejection'</code> event from\nbeing emitted.</p>\n<p>If an <code>'unhandledRejection'</code> event is emitted but not handled it will\nbe raised as an uncaught exception. This alongside other behaviors of\n<code>'unhandledRejection'</code> events can changed via the <a href=\"cli.html#--unhandled-rejectionsmode\"><code>--unhandled-rejections</code></a> flag.</p>"
            },
            {
              "textRaw": "Event: `'warning'`",
              "name": "warning",
              "type": "event",
              "meta": {
                "added": [
                  "v6.0.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`warning` {Error} Key properties of the warning are:",
                  "name": "warning",
                  "type": "Error",
                  "desc": "Key properties of the warning are:",
                  "options": [
                    {
                      "textRaw": "`name` {string} The name of the warning. **Default:** `'Warning'`.",
                      "name": "name",
                      "type": "string",
                      "default": "`'Warning'`",
                      "desc": "The name of the warning."
                    },
                    {
                      "textRaw": "`message` {string} A system-provided description of the warning.",
                      "name": "message",
                      "type": "string",
                      "desc": "A system-provided description of the warning."
                    },
                    {
                      "textRaw": "`stack` {string} A stack trace to the location in the code where the warning was issued.",
                      "name": "stack",
                      "type": "string",
                      "desc": "A stack trace to the location in the code where the warning was issued."
                    }
                  ]
                }
              ],
              "desc": "<p>The <code>'warning'</code> event is emitted whenever Node.js emits a process warning.</p>\n<p>A process warning is similar to an error in that it describes exceptional\nconditions that are being brought to the user's attention. However, warnings\nare not part of the normal Node.js and JavaScript error handling flow.\nNode.js can emit warnings whenever it detects bad coding practices that could\nlead to sub-optimal application performance, bugs, or security vulnerabilities.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.on('warning', (warning) => {\n  console.warn(warning.name);    // Print the warning name\n  console.warn(warning.message); // Print the warning message\n  console.warn(warning.stack);   // Print the stack trace\n});\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('warning', (warning) => {\n  console.warn(warning.name);    // Print the warning name\n  console.warn(warning.message); // Print the warning message\n  console.warn(warning.stack);   // Print the stack trace\n});\n</code></pre>\n<p>By default, Node.js will print process warnings to <code>stderr</code>. The <code>--no-warnings</code>\ncommand-line option can be used to suppress the default console output but the\n<code>'warning'</code> event will still be emitted by the <code>process</code> object. Currently, it\nis not possible to suppress specific warning types other than deprecation\nwarnings. To suppress deprecation warnings, check out the <a href=\"cli.html#--no-deprecation\"><code>--no-deprecation</code></a>\nflag.</p>\n<p>The following example illustrates the warning that is printed to <code>stderr</code> when\ntoo many listeners have been added to an event:</p>\n<pre><code class=\"language-console\">$ node\n> events.defaultMaxListeners = 1;\n> process.on('foo', () => {});\n> process.on('foo', () => {});\n> (node:38638) MaxListenersExceededWarning: Possible EventEmitter memory leak\ndetected. 2 foo listeners added. Use emitter.setMaxListeners() to increase limit\n</code></pre>\n<p>In contrast, the following example turns off the default warning output and\nadds a custom handler to the <code>'warning'</code> event:</p>\n<pre><code class=\"language-console\">$ node --no-warnings\n> const p = process.on('warning', (warning) => console.warn('Do not do that!'));\n> events.defaultMaxListeners = 1;\n> process.on('foo', () => {});\n> process.on('foo', () => {});\n> Do not do that!\n</code></pre>\n<p>The <code>--trace-warnings</code> command-line option can be used to have the default\nconsole output for warnings include the full stack trace of the warning.</p>\n<p>Launching Node.js using the <code>--throw-deprecation</code> command-line flag will\ncause custom deprecation warnings to be thrown as exceptions.</p>\n<p>Using the <code>--trace-deprecation</code> command-line flag will cause the custom\ndeprecation to be printed to <code>stderr</code> along with the stack trace.</p>\n<p>Using the <code>--no-deprecation</code> command-line flag will suppress all reporting\nof the custom deprecation.</p>\n<p>The <code>*-deprecation</code> command-line flags only affect warnings that use the name\n<code>'DeprecationWarning'</code>.</p>",
              "modules": [
                {
                  "textRaw": "Emitting custom warnings",
                  "name": "emitting_custom_warnings",
                  "type": "module",
                  "desc": "<p>See the <a href=\"#processemitwarningwarning-type-code-ctor\"><code>process.emitWarning()</code></a> method for issuing\ncustom or application-specific warnings.</p>",
                  "displayName": "Emitting custom warnings"
                },
                {
                  "textRaw": "Node.js warning names",
                  "name": "node.js_warning_names",
                  "type": "module",
                  "desc": "<p>There are no strict guidelines for warning types (as identified by the <code>name</code>\nproperty) emitted by Node.js. New types of warnings can be added at any time.\nA few of the warning types that are most common include:</p>\n<ul>\n<li><code>'DeprecationWarning'</code> - Indicates use of a deprecated Node.js API or feature.\nSuch warnings must include a <code>'code'</code> property identifying the\n<a href=\"deprecations.html\">deprecation code</a>.</li>\n<li><code>'ExperimentalWarning'</code> - Indicates use of an experimental Node.js API or\nfeature. Such features must be used with caution as they may change at any\ntime and are not subject to the same strict semantic-versioning and long-term\nsupport policies as supported features.</li>\n<li><code>'MaxListenersExceededWarning'</code> - Indicates that too many listeners for a\ngiven event have been registered on either an <code>EventEmitter</code> or <code>EventTarget</code>.\nThis is often an indication of a memory leak.</li>\n<li><code>'TimeoutOverflowWarning'</code> - Indicates that a numeric value that cannot fit\nwithin a 32-bit signed integer has been provided to either the <code>setTimeout()</code>\nor <code>setInterval()</code> functions.</li>\n<li><code>'TimeoutNegativeWarning'</code> - Indicates that a negative number has provided to\neither the <code>setTimeout()</code> or <code>setInterval()</code> functions.</li>\n<li><code>'TimeoutNaNWarning'</code> - Indicates that a value which is not a number has\nprovided to either the <code>setTimeout()</code> or <code>setInterval()</code> functions.</li>\n<li><code>'UnsupportedWarning'</code> - Indicates use of an unsupported option or feature\nthat will be ignored rather than treated as an error. One example is use of\nthe HTTP response status message when using the HTTP/2 compatibility API.</li>\n</ul>",
                  "displayName": "Node.js warning names"
                }
              ]
            },
            {
              "textRaw": "Event: `'worker'`",
              "name": "worker",
              "type": "event",
              "meta": {
                "added": [
                  "v16.2.0",
                  "v14.18.0"
                ],
                "changes": []
              },
              "params": [
                {
                  "textRaw": "`worker` {Worker} The {Worker} that was created.",
                  "name": "worker",
                  "type": "Worker",
                  "desc": "The {Worker} that was created."
                }
              ],
              "desc": "<p>The <code>'worker'</code> event is emitted after a new <a href=\"worker_threads.html#class-worker\"><code>&#x3C;Worker></code></a> thread has been created.</p>"
            },
            {
              "textRaw": "Signal events",
              "name": "Signal events",
              "type": "event",
              "params": [],
              "desc": "<p>Signal events will be emitted when the Node.js process receives a signal. Please\nrefer to <a href=\"http://man7.org/linux/man-pages/man7/signal.7.html\"><code>signal(7)</code></a> for a listing of standard POSIX signal names such as <code>'SIGINT'</code>, <code>'SIGHUP'</code>, etc.</p>\n<p>Signals are not available on <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>\n<p>The signal handler will receive the signal's name (<code>'SIGINT'</code>,\n<code>'SIGTERM'</code>, etc.) as the first argument.</p>\n<p>The name of each event will be the uppercase common name for the signal (e.g.\n<code>'SIGINT'</code> for <code>SIGINT</code> signals).</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\n// Begin reading from stdin so the process does not exit.\nprocess.stdin.resume();\n\nprocess.on('SIGINT', () => {\n  console.log('Received SIGINT. Press Control-D to exit.');\n});\n\n// Using a single function to handle multiple signals\nfunction handle(signal) {\n  console.log(`Received ${signal}`);\n}\n\nprocess.on('SIGINT', handle);\nprocess.on('SIGTERM', handle);\n</code></pre>\n<pre><code class=\"language-cjs\">// Begin reading from stdin so the process does not exit.\nprocess.stdin.resume();\n\nprocess.on('SIGINT', () => {\n  console.log('Received SIGINT. Press Control-D to exit.');\n});\n\n// Using a single function to handle multiple signals\nfunction handle(signal) {\n  console.log(`Received ${signal}`);\n}\n\nprocess.on('SIGINT', handle);\nprocess.on('SIGTERM', handle);\n</code></pre>\n<ul>\n<li><code>'SIGUSR1'</code> is reserved by Node.js to start the <a href=\"debugger.html\">debugger</a>. It's possible to\ninstall a listener but doing so might interfere with the debugger.</li>\n<li><code>'SIGTERM'</code> and <code>'SIGINT'</code> have default handlers on non-Windows platforms that\nreset the terminal mode before exiting with code <code>128 + signal number</code>. If one\nof these signals has a listener installed, its default behavior will be\nremoved (Node.js will no longer exit).</li>\n<li><code>'SIGPIPE'</code> is ignored by default. It can have a listener installed.</li>\n<li><code>'SIGHUP'</code> is generated on Windows when the console window is closed, and on\nother platforms under various similar conditions. See <a href=\"http://man7.org/linux/man-pages/man7/signal.7.html\"><code>signal(7)</code></a>. It can have a\nlistener installed, however Node.js will be unconditionally terminated by\nWindows about 10 seconds later. On non-Windows platforms, the default\nbehavior of <code>SIGHUP</code> is to terminate Node.js, but once a listener has been\ninstalled its default behavior will be removed.</li>\n<li><code>'SIGTERM'</code> is not supported on Windows, it can be listened on.</li>\n<li><code>'SIGINT'</code> from the terminal is supported on all platforms, and can usually be\ngenerated with <kbd>Ctrl</kbd>+<kbd>C</kbd> (though this may be configurable).\nIt is not generated when <a href=\"tty.html#readstreamsetrawmodemode\">terminal raw mode</a> is enabled\nand <kbd>Ctrl</kbd>+<kbd>C</kbd> is used.</li>\n<li><code>'SIGBREAK'</code> is delivered on Windows when <kbd>Ctrl</kbd>+<kbd>Break</kbd> is\npressed. On non-Windows platforms, it can be listened on, but there is no way\nto send or generate it.</li>\n<li><code>'SIGWINCH'</code> is delivered when the console has been resized. On Windows, this\nwill only happen on write to the console when the cursor is being moved, or\nwhen a readable tty is used in raw mode.</li>\n<li><code>'SIGKILL'</code> cannot have a listener installed, it will unconditionally\nterminate Node.js on all platforms.</li>\n<li><code>'SIGSTOP'</code> cannot have a listener installed.</li>\n<li><code>'SIGBUS'</code>, <code>'SIGFPE'</code>, <code>'SIGSEGV'</code>, and <code>'SIGILL'</code>, when not raised\nartificially using <a href=\"http://man7.org/linux/man-pages/man2/kill.2.html\"><code>kill(2)</code></a>, inherently leave the process in a state from\nwhich it is not safe to call JS listeners. Doing so might cause the process\nto stop responding.</li>\n<li><code>0</code> can be sent to test for the existence of a process, it has no effect if\nthe process exists, but will throw an error if the process does not exist.</li>\n</ul>\n<p>Windows does not support signals so has no equivalent to termination by signal,\nbut Node.js offers some emulation with <a href=\"#processkillpid-signal\"><code>process.kill()</code></a>, and\n<a href=\"child_process.html#subprocesskillsignal\"><code>subprocess.kill()</code></a>:</p>\n<ul>\n<li>Sending <code>SIGINT</code>, <code>SIGTERM</code>, and <code>SIGKILL</code> will cause the unconditional\ntermination of the target process, and afterwards, subprocess will report that\nthe process was terminated by signal.</li>\n<li>Sending signal <code>0</code> can be used as a platform independent way to test for the\nexistence of a process.</li>\n</ul>"
            }
          ],
          "displayName": "Process events"
        },
        {
          "textRaw": "Exit codes",
          "name": "exit_codes",
          "type": "module",
          "desc": "<p>Node.js will normally exit with a <code>0</code> status code when no more async\noperations are pending. The following status codes are used in other\ncases:</p>\n<ul>\n<li><code>1</code> <strong>Uncaught Fatal Exception</strong>: There was an uncaught exception,\nand it was not handled by a domain or an <a href=\"#event-uncaughtexception\"><code>'uncaughtException'</code></a> event\nhandler.</li>\n<li><code>2</code>: Unused (reserved by Bash for builtin misuse)</li>\n<li><code>3</code> <strong>Internal JavaScript Parse Error</strong>: The JavaScript source code\ninternal in the Node.js bootstrapping process caused a parse error. This\nis extremely rare, and generally can only happen during development\nof Node.js itself.</li>\n<li><code>4</code> <strong>Internal JavaScript Evaluation Failure</strong>: The JavaScript\nsource code internal in the Node.js bootstrapping process failed to\nreturn a function value when evaluated. This is extremely rare, and\ngenerally can only happen during development of Node.js itself.</li>\n<li><code>5</code> <strong>Fatal Error</strong>: There was a fatal unrecoverable error in V8.\nTypically a message will be printed to stderr with the prefix <code>FATAL ERROR</code>.</li>\n<li><code>6</code> <strong>Non-function Internal Exception Handler</strong>: There was an\nuncaught exception, but the internal fatal exception handler\nfunction was somehow set to a non-function, and could not be called.</li>\n<li><code>7</code> <strong>Internal Exception Handler Run-Time Failure</strong>: There was an\nuncaught exception, and the internal fatal exception handler\nfunction itself threw an error while attempting to handle it. This\ncan happen, for example, if an <a href=\"#event-uncaughtexception\"><code>'uncaughtException'</code></a> or\n<code>domain.on('error')</code> handler throws an error.</li>\n<li><code>8</code>: Unused. In previous versions of Node.js, exit code 8 sometimes\nindicated an uncaught exception.</li>\n<li><code>9</code> <strong>Invalid Argument</strong>: Either an unknown option was specified,\nor an option requiring a value was provided without a value.</li>\n<li><code>10</code> <strong>Internal JavaScript Run-Time Failure</strong>: The JavaScript\nsource code internal in the Node.js bootstrapping process threw an error\nwhen the bootstrapping function was called. This is extremely rare,\nand generally can only happen during development of Node.js itself.</li>\n<li><code>12</code> <strong>Invalid Debug Argument</strong>: The <code>--inspect</code> and/or <code>--inspect-brk</code>\noptions were set, but the port number chosen was invalid or unavailable.</li>\n<li><code>13</code> <strong>Unsettled Top-Level Await</strong>: <code>await</code> was used outside of a function\nin the top-level code, but the passed <code>Promise</code> never settled.</li>\n<li><code>14</code> <strong>Snapshot Failure</strong>: Node.js was started to build a V8 startup\nsnapshot and it failed because certain requirements of the state of\nthe application were not met.</li>\n<li><code>>128</code> <strong>Signal Exits</strong>: If Node.js receives a fatal signal such as\n<code>SIGKILL</code> or <code>SIGHUP</code>, then its exit code will be <code>128</code> plus the\nvalue of the signal code. This is a standard POSIX practice, since\nexit codes are defined to be 7-bit integers, and signal exits set\nthe high-order bit, and then contain the value of the signal code.\nFor example, signal <code>SIGABRT</code> has value <code>6</code>, so the expected exit\ncode will be <code>128</code> + <code>6</code>, or <code>134</code>.</li>\n</ul>",
          "displayName": "Exit codes"
        }
      ],
      "methods": [
        {
          "textRaw": "`process.abort()`",
          "name": "abort",
          "type": "method",
          "meta": {
            "added": [
              "v0.7.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>The <code>process.abort()</code> method causes the Node.js process to exit immediately and\ngenerate a core file.</p>\n<p>This feature is not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.addUncaughtExceptionCaptureCallback(fn)`",
          "name": "addUncaughtExceptionCaptureCallback",
          "type": "method",
          "meta": {
            "added": [
              "v25.9.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function}",
                  "name": "fn",
                  "type": "Function"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.addUncaughtExceptionCaptureCallback()</code> function adds a callback\nthat will be invoked when an uncaught exception occurs, receiving the exception\nvalue as its first argument.</p>\n<p>Unlike <a href=\"#processsetuncaughtexceptioncapturecallbackfn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a>, this function allows\nmultiple callbacks to be registered and does not conflict with the\n<a href=\"domain.html\"><code>domain</code></a> module. Callbacks are called in reverse order of registration\n(most recent first). If a callback returns <code>true</code>, subsequent callbacks\nand the default uncaught exception handling are skipped.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.addUncaughtExceptionCaptureCallback((err) => {\n  console.error('Caught exception:', err.message);\n  return true; // Indicates exception was handled\n});\n</code></pre>\n<pre><code class=\"language-cjs\">process.addUncaughtExceptionCaptureCallback((err) => {\n  console.error('Caught exception:', err.message);\n  return true; // Indicates exception was handled\n});\n</code></pre>"
        },
        {
          "textRaw": "`process.availableMemory()`",
          "name": "availableMemory",
          "type": "method",
          "meta": {
            "added": [
              "v22.0.0",
              "v20.13.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57765",
                "description": "Change stability index for this feature from Experimental to Stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {number}",
                "name": "return",
                "type": "number"
              }
            }
          ],
          "desc": "<p>Gets the amount of free memory that is still available to the process\n(in bytes).</p>\n<p>See <a href=\"https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_available_memory\"><code>uv_get_available_memory</code></a> for more\ninformation.</p>"
        },
        {
          "textRaw": "`process.chdir(directory)`",
          "name": "chdir",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`directory` {string}",
                  "name": "directory",
                  "type": "string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.chdir()</code> method changes the current working directory of the\nNode.js process or throws an exception if doing so fails (for instance, if\nthe specified <code>directory</code> does not exist).</p>\n<pre><code class=\"language-mjs\">import { chdir, cwd } from 'node:process';\n\nconsole.log(`Starting directory: ${cwd()}`);\ntry {\n  chdir('/tmp');\n  console.log(`New directory: ${cwd()}`);\n} catch (err) {\n  console.error(`chdir: ${err}`);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { chdir, cwd } = require('node:process');\n\nconsole.log(`Starting directory: ${cwd()}`);\ntry {\n  chdir('/tmp');\n  console.log(`New directory: ${cwd()}`);\n} catch (err) {\n  console.error(`chdir: ${err}`);\n}\n</code></pre>\n<p>This feature is not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.constrainedMemory()`",
          "name": "constrainedMemory",
          "type": "method",
          "meta": {
            "added": [
              "v19.6.0",
              "v18.15.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57765",
                "description": "Change stability index for this feature from Experimental to Stable."
              },
              {
                "version": [
                  "v22.0.0",
                  "v20.13.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/52039",
                "description": "Aligned return value with `uv_get_constrained_memory`."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {number}",
                "name": "return",
                "type": "number"
              }
            }
          ],
          "desc": "<p>Gets the amount of memory available to the process (in bytes) based on\nlimits imposed by the OS. If there is no such constraint, or the constraint\nis unknown, <code>0</code> is returned.</p>\n<p>See <a href=\"https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory\"><code>uv_get_constrained_memory</code></a> for more\ninformation.</p>"
        },
        {
          "textRaw": "`process.cpuUsage([previousValue])`",
          "name": "cpuUsage",
          "type": "method",
          "meta": {
            "added": [
              "v6.1.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`previousValue` {Object} A previous return value from calling `process.cpuUsage()`",
                  "name": "previousValue",
                  "type": "Object",
                  "desc": "A previous return value from calling `process.cpuUsage()`",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object",
                "options": [
                  {
                    "textRaw": "`user` {integer}",
                    "name": "user",
                    "type": "integer"
                  },
                  {
                    "textRaw": "`system` {integer}",
                    "name": "system",
                    "type": "integer"
                  }
                ]
              }
            }
          ],
          "desc": "<p>The <code>process.cpuUsage()</code> method returns the user and system CPU time usage of\nthe current process, in an object with properties <code>user</code> and <code>system</code>, whose\nvalues are microsecond values (millionth of a second). These values measure time\nspent in user and system code respectively, and may end up being greater than\nactual elapsed time if multiple CPU cores are performing work for this process.</p>\n<p>The result of a previous call to <code>process.cpuUsage()</code> can be passed as the\nargument to the function, to get a diff reading.</p>\n<pre><code class=\"language-mjs\">import { cpuUsage } from 'node:process';\n\nconst startUsage = cpuUsage();\n// { user: 38579, system: 6986 }\n\n// spin the CPU for 500 milliseconds\nconst now = Date.now();\nwhile (Date.now() - now &#x3C; 500);\n\nconsole.log(cpuUsage(startUsage));\n// { user: 514883, system: 11226 }\n</code></pre>\n<pre><code class=\"language-cjs\">const { cpuUsage } = require('node:process');\n\nconst startUsage = cpuUsage();\n// { user: 38579, system: 6986 }\n\n// spin the CPU for 500 milliseconds\nconst now = Date.now();\nwhile (Date.now() - now &#x3C; 500);\n\nconsole.log(cpuUsage(startUsage));\n// { user: 514883, system: 11226 }\n</code></pre>"
        },
        {
          "textRaw": "`process.cwd()`",
          "name": "cwd",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.8"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string}",
                "name": "return",
                "type": "string"
              }
            }
          ],
          "desc": "<p>The <code>process.cwd()</code> method returns the current working directory of the Node.js\nprocess.</p>\n<pre><code class=\"language-mjs\">import { cwd } from 'node:process';\n\nconsole.log(`Current directory: ${cwd()}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { cwd } = require('node:process');\n\nconsole.log(`Current directory: ${cwd()}`);\n</code></pre>"
        },
        {
          "textRaw": "`process.disconnect()`",
          "name": "disconnect",
          "type": "method",
          "meta": {
            "added": [
              "v0.7.2"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>If the Node.js process is spawned with an IPC channel (see the <a href=\"child_process.html\">Child Process</a>\nand <a href=\"cluster.html\">Cluster</a> documentation), the <code>process.disconnect()</code> method will close the\nIPC channel to the parent process, allowing the child process to exit gracefully\nonce there are no other connections keeping it alive.</p>\n<p>The effect of calling <code>process.disconnect()</code> is the same as calling\n<a href=\"child_process.html#subprocessdisconnect\"><code>ChildProcess.disconnect()</code></a> from the parent process.</p>\n<p>If the Node.js process was not spawned with an IPC channel,\n<code>process.disconnect()</code> will be <code>undefined</code>.</p>"
        },
        {
          "textRaw": "`process.dlopen(module, filename[, flags])`",
          "name": "dlopen",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/12794",
                "description": "Added support for the `flags` argument."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`module` {Object}",
                  "name": "module",
                  "type": "Object"
                },
                {
                  "textRaw": "`filename` {string}",
                  "name": "filename",
                  "type": "string"
                },
                {
                  "textRaw": "`flags` {os.constants.dlopen} **Default:** `os.constants.dlopen.RTLD_LAZY`",
                  "name": "flags",
                  "type": "os.constants.dlopen",
                  "default": "`os.constants.dlopen.RTLD_LAZY`",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.dlopen()</code> method allows dynamically loading shared objects. It is\nprimarily used by <code>require()</code> to load C++ Addons, and should not be used\ndirectly, except in special cases. In other words, <a href=\"globals.html#require\"><code>require()</code></a> should be\npreferred over <code>process.dlopen()</code> unless there are specific reasons such as\ncustom dlopen flags or loading from ES modules.</p>\n<p>The <code>flags</code> argument is an integer that allows to specify dlopen\nbehavior. See the <a href=\"os.html#dlopen-constants\"><code>os.constants.dlopen</code></a> documentation for details.</p>\n<p>An important requirement when calling <code>process.dlopen()</code> is that the <code>module</code>\ninstance must be passed. Functions exported by the C++ Addon are then\naccessible via <code>module.exports</code>.</p>\n<p>The example below shows how to load a C++ Addon, named <code>local.node</code>,\nthat exports a <code>foo</code> function. All the symbols are loaded before\nthe call returns, by passing the <code>RTLD_NOW</code> constant. In this example\nthe constant is assumed to be available.</p>\n<pre><code class=\"language-mjs\">import { dlopen } from 'node:process';\nimport { constants } from 'node:os';\nimport { fileURLToPath } from 'node:url';\n\nconst module = { exports: {} };\ndlopen(module, fileURLToPath(new URL('local.node', import.meta.url)),\n       constants.dlopen.RTLD_NOW);\nmodule.exports.foo();\n</code></pre>\n<pre><code class=\"language-cjs\">const { dlopen } = require('node:process');\nconst { constants } = require('node:os');\nconst { join } = require('node:path');\n\nconst module = { exports: {} };\ndlopen(module, join(__dirname, 'local.node'), constants.dlopen.RTLD_NOW);\nmodule.exports.foo();\n</code></pre>"
        },
        {
          "textRaw": "`process.emitWarning(warning[, options])`",
          "name": "emitWarning",
          "type": "method",
          "meta": {
            "added": [
              "v8.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`warning` {string|Error} The warning to emit.",
                  "name": "warning",
                  "type": "string|Error",
                  "desc": "The warning to emit."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`type` {string} When `warning` is a `String`, `type` is the name to use for the _type_ of warning being emitted. **Default:** `'Warning'`.",
                      "name": "type",
                      "type": "string",
                      "default": "`'Warning'`",
                      "desc": "When `warning` is a `String`, `type` is the name to use for the _type_ of warning being emitted."
                    },
                    {
                      "textRaw": "`code` {string} A unique identifier for the warning instance being emitted.",
                      "name": "code",
                      "type": "string",
                      "desc": "A unique identifier for the warning instance being emitted."
                    },
                    {
                      "textRaw": "`ctor` {Function} When `warning` is a `String`, `ctor` is an optional function used to limit the generated stack trace. **Default:** `process.emitWarning`.",
                      "name": "ctor",
                      "type": "Function",
                      "default": "`process.emitWarning`",
                      "desc": "When `warning` is a `String`, `ctor` is an optional function used to limit the generated stack trace."
                    },
                    {
                      "textRaw": "`detail` {string} Additional text to include with the error.",
                      "name": "detail",
                      "type": "string",
                      "desc": "Additional text to include with the error."
                    }
                  ],
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.emitWarning()</code> method can be used to emit custom or application\nspecific process warnings. These can be listened for by adding a handler to the\n<a href=\"#event-warning\"><code>'warning'</code></a> event.</p>\n<pre><code class=\"language-mjs\">import { emitWarning } from 'node:process';\n\n// Emit a warning with a code and additional detail.\nemitWarning('Something happened!', {\n  code: 'MY_WARNING',\n  detail: 'This is some additional information',\n});\n// Emits:\n// (node:56338) [MY_WARNING] Warning: Something happened!\n// This is some additional information\n</code></pre>\n<pre><code class=\"language-cjs\">const { emitWarning } = require('node:process');\n\n// Emit a warning with a code and additional detail.\nemitWarning('Something happened!', {\n  code: 'MY_WARNING',\n  detail: 'This is some additional information',\n});\n// Emits:\n// (node:56338) [MY_WARNING] Warning: Something happened!\n// This is some additional information\n</code></pre>\n<p>In this example, an <code>Error</code> object is generated internally by\n<code>process.emitWarning()</code> and passed through to the\n<a href=\"#event-warning\"><code>'warning'</code></a> handler.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.on('warning', (warning) => {\n  console.warn(warning.name);    // 'Warning'\n  console.warn(warning.message); // 'Something happened!'\n  console.warn(warning.code);    // 'MY_WARNING'\n  console.warn(warning.stack);   // Stack trace\n  console.warn(warning.detail);  // 'This is some additional information'\n});\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('warning', (warning) => {\n  console.warn(warning.name);    // 'Warning'\n  console.warn(warning.message); // 'Something happened!'\n  console.warn(warning.code);    // 'MY_WARNING'\n  console.warn(warning.stack);   // Stack trace\n  console.warn(warning.detail);  // 'This is some additional information'\n});\n</code></pre>\n<p>If <code>warning</code> is passed as an <code>Error</code> object, the <code>options</code> argument is ignored.</p>"
        },
        {
          "textRaw": "`process.emitWarning(warning[, type[, code]][, ctor])`",
          "name": "emitWarning",
          "type": "method",
          "meta": {
            "added": [
              "v6.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`warning` {string|Error} The warning to emit.",
                  "name": "warning",
                  "type": "string|Error",
                  "desc": "The warning to emit."
                },
                {
                  "textRaw": "`type` {string} When `warning` is a `String`, `type` is the name to use for the _type_ of warning being emitted. **Default:** `'Warning'`.",
                  "name": "type",
                  "type": "string",
                  "default": "`'Warning'`",
                  "desc": "When `warning` is a `String`, `type` is the name to use for the _type_ of warning being emitted.",
                  "optional": true
                },
                {
                  "textRaw": "`code` {string} A unique identifier for the warning instance being emitted.",
                  "name": "code",
                  "type": "string",
                  "desc": "A unique identifier for the warning instance being emitted.",
                  "optional": true
                },
                {
                  "textRaw": "`ctor` {Function} When `warning` is a `String`, `ctor` is an optional function used to limit the generated stack trace. **Default:** `process.emitWarning`.",
                  "name": "ctor",
                  "type": "Function",
                  "default": "`process.emitWarning`",
                  "desc": "When `warning` is a `String`, `ctor` is an optional function used to limit the generated stack trace.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.emitWarning()</code> method can be used to emit custom or application\nspecific process warnings. These can be listened for by adding a handler to the\n<a href=\"#event-warning\"><code>'warning'</code></a> event.</p>\n<pre><code class=\"language-mjs\">import { emitWarning } from 'node:process';\n\n// Emit a warning using a string.\nemitWarning('Something happened!');\n// Emits: (node: 56338) Warning: Something happened!\n</code></pre>\n<pre><code class=\"language-cjs\">const { emitWarning } = require('node:process');\n\n// Emit a warning using a string.\nemitWarning('Something happened!');\n// Emits: (node: 56338) Warning: Something happened!\n</code></pre>\n<pre><code class=\"language-mjs\">import { emitWarning } from 'node:process';\n\n// Emit a warning using a string and a type.\nemitWarning('Something Happened!', 'CustomWarning');\n// Emits: (node:56338) CustomWarning: Something Happened!\n</code></pre>\n<pre><code class=\"language-cjs\">const { emitWarning } = require('node:process');\n\n// Emit a warning using a string and a type.\nemitWarning('Something Happened!', 'CustomWarning');\n// Emits: (node:56338) CustomWarning: Something Happened!\n</code></pre>\n<pre><code class=\"language-mjs\">import { emitWarning } from 'node:process';\n\nemitWarning('Something happened!', 'CustomWarning', 'WARN001');\n// Emits: (node:56338) [WARN001] CustomWarning: Something happened!\n</code></pre>\n<pre><code class=\"language-cjs\">const { emitWarning } = require('node:process');\n\nprocess.emitWarning('Something happened!', 'CustomWarning', 'WARN001');\n// Emits: (node:56338) [WARN001] CustomWarning: Something happened!\n</code></pre>\n<p>In each of the previous examples, an <code>Error</code> object is generated internally by\n<code>process.emitWarning()</code> and passed through to the <a href=\"#event-warning\"><code>'warning'</code></a>\nhandler.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.on('warning', (warning) => {\n  console.warn(warning.name);\n  console.warn(warning.message);\n  console.warn(warning.code);\n  console.warn(warning.stack);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('warning', (warning) => {\n  console.warn(warning.name);\n  console.warn(warning.message);\n  console.warn(warning.code);\n  console.warn(warning.stack);\n});\n</code></pre>\n<p>If <code>warning</code> is passed as an <code>Error</code> object, it will be passed through to the\n<code>'warning'</code> event handler unmodified (and the optional <code>type</code>,\n<code>code</code> and <code>ctor</code> arguments will be ignored):</p>\n<pre><code class=\"language-mjs\">import { emitWarning } from 'node:process';\n\n// Emit a warning using an Error object.\nconst myWarning = new Error('Something happened!');\n// Use the Error name property to specify the type name\nmyWarning.name = 'CustomWarning';\nmyWarning.code = 'WARN001';\n\nemitWarning(myWarning);\n// Emits: (node:56338) [WARN001] CustomWarning: Something happened!\n</code></pre>\n<pre><code class=\"language-cjs\">const { emitWarning } = require('node:process');\n\n// Emit a warning using an Error object.\nconst myWarning = new Error('Something happened!');\n// Use the Error name property to specify the type name\nmyWarning.name = 'CustomWarning';\nmyWarning.code = 'WARN001';\n\nemitWarning(myWarning);\n// Emits: (node:56338) [WARN001] CustomWarning: Something happened!\n</code></pre>\n<p>A <code>TypeError</code> is thrown if <code>warning</code> is anything other than a string or <code>Error</code>\nobject.</p>\n<p>While process warnings use <code>Error</code> objects, the process warning\nmechanism is <strong>not</strong> a replacement for normal error handling mechanisms.</p>\n<p>The following additional handling is implemented if the warning <code>type</code> is\n<code>'DeprecationWarning'</code>:</p>\n<ul>\n<li>If the <code>--throw-deprecation</code> command-line flag is used, the deprecation\nwarning is thrown as an exception rather than being emitted as an event.</li>\n<li>If the <code>--no-deprecation</code> command-line flag is used, the deprecation\nwarning is suppressed.</li>\n<li>If the <code>--trace-deprecation</code> command-line flag is used, the deprecation\nwarning is printed to <code>stderr</code> along with the full stack trace.</li>\n</ul>",
          "modules": [
            {
              "textRaw": "Avoiding duplicate warnings",
              "name": "avoiding_duplicate_warnings",
              "type": "module",
              "desc": "<p>As a best practice, warnings should be emitted only once per process. To do\nso, place the <code>emitWarning()</code> behind a boolean.</p>\n<pre><code class=\"language-mjs\">import { emitWarning } from 'node:process';\n\nfunction emitMyWarning() {\n  if (!emitMyWarning.warned) {\n    emitMyWarning.warned = true;\n    emitWarning('Only warn once!');\n  }\n}\nemitMyWarning();\n// Emits: (node: 56339) Warning: Only warn once!\nemitMyWarning();\n// Emits nothing\n</code></pre>\n<pre><code class=\"language-cjs\">const { emitWarning } = require('node:process');\n\nfunction emitMyWarning() {\n  if (!emitMyWarning.warned) {\n    emitMyWarning.warned = true;\n    emitWarning('Only warn once!');\n  }\n}\nemitMyWarning();\n// Emits: (node: 56339) Warning: Only warn once!\nemitMyWarning();\n// Emits nothing\n</code></pre>",
              "displayName": "Avoiding duplicate warnings"
            }
          ]
        },
        {
          "textRaw": "`process.execve(file[, args[, env]])`",
          "name": "execve",
          "type": "method",
          "meta": {
            "added": [
              "v23.11.0",
              "v22.15.0"
            ],
            "changes": [
              {
                "version": "v26.1.0",
                "pr-url": "https://github.com/nodejs/node/pull/62878",
                "description": "A failed `execve(2)` system call now throws an exception instead of aborting the process. Native `AtExit` callbacks registered via the embedder API are no longer invoked before the `execve(2)` call."
              }
            ]
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`file` {string} The name or path of the executable file to run.",
                  "name": "file",
                  "type": "string",
                  "desc": "The name or path of the executable file to run."
                },
                {
                  "textRaw": "`args` {string[]} List of string arguments. No argument can contain a null-byte (`\\u0000`).",
                  "name": "args",
                  "type": "string[]",
                  "desc": "List of string arguments. No argument can contain a null-byte (`\\u0000`).",
                  "optional": true
                },
                {
                  "textRaw": "`env` {Object} Environment key-value pairs. No key or value can contain a null-byte (`\\u0000`). **Default:** `process.env`.",
                  "name": "env",
                  "type": "Object",
                  "default": "`process.env`",
                  "desc": "Environment key-value pairs. No key or value can contain a null-byte (`\\u0000`).",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>Replaces the current process with a new process.</p>\n<p>This is achieved by using the <code>execve</code> POSIX function and therefore no memory or other\nresources from the current process are preserved, except for the standard input,\nstandard output and standard error file descriptor.</p>\n<p>On success, all other resources are discarded by the system when the\nprocesses are swapped, without triggering any exit or close events, without\nrunning any JavaScript cleanup handler (for example <code>process.on('exit')</code>),\nand without invoking native <code>AtExit</code> callbacks registered through the\nembedder API. Callers that need to run cleanup logic should do so before\ncalling <code>process.execve()</code>.</p>\n<p>This function does not return on success. If the underlying <code>execve(2)</code>\nsystem call fails, an <code>Error</code> is thrown whose <code>code</code> property is set to the\ncorresponding <code>errno</code> string (for example, <code>'ENOENT'</code> when <code>file</code> does not\nexist), with <code>syscall</code> set to <code>'execve'</code> and <code>path</code> set to <code>file</code>. When\n<code>execve(2)</code> fails the current process continues to run with its state\nunchanged, so a caller may handle the error and take another action.</p>\n<p>This function is not available on Windows or IBM i.</p>"
        },
        {
          "textRaw": "`process.exit([code])`",
          "name": "exit",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.13"
            ],
            "changes": [
              {
                "version": "v20.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/43716",
                "description": "Only accepts a code of type number, or of type string if it represents an integer."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`code` {integer|string|null|undefined} The exit code. For string type, only integer strings (e.g.,'1') are allowed. **Default:** `0`.",
                  "name": "code",
                  "type": "integer|string|null|undefined",
                  "default": "`0`",
                  "desc": "The exit code. For string type, only integer strings (e.g.,'1') are allowed.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.exit()</code> method instructs Node.js to terminate the process\nsynchronously with an exit status of <code>code</code>. If <code>code</code> is omitted, exit uses\neither the 'success' code <code>0</code> or the value of <code>process.exitCode</code> if it has been\nset. Node.js will not terminate until all the <a href=\"#event-exit\"><code>'exit'</code></a> event listeners are\ncalled.</p>\n<p>To exit with a 'failure' code:</p>\n<pre><code class=\"language-mjs\">import { exit } from 'node:process';\n\nexit(1);\n</code></pre>\n<pre><code class=\"language-cjs\">const { exit } = require('node:process');\n\nexit(1);\n</code></pre>\n<p>The shell that executed Node.js should see the exit code as <code>1</code>.</p>\n<p>Calling <code>process.exit()</code> will force the process to exit as quickly as possible\neven if there are still asynchronous operations pending that have not yet\ncompleted fully, including I/O operations to <code>process.stdout</code> and\n<code>process.stderr</code>.</p>\n<p>In most situations, it is not actually necessary to call <code>process.exit()</code>\nexplicitly. The Node.js process will exit on its own <em>if there is no additional\nwork pending</em> in the event loop. The <code>process.exitCode</code> property can be set to\ntell the process which exit code to use when the process exits gracefully.</p>\n<p>For instance, the following example illustrates a <em>misuse</em> of the\n<code>process.exit()</code> method that could lead to data printed to stdout being\ntruncated and lost:</p>\n<pre><code class=\"language-mjs\">import { exit } from 'node:process';\n\n// This is an example of what *not* to do:\nif (someConditionNotMet()) {\n  printUsageToStdout();\n  exit(1);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { exit } = require('node:process');\n\n// This is an example of what *not* to do:\nif (someConditionNotMet()) {\n  printUsageToStdout();\n  exit(1);\n}\n</code></pre>\n<p>The reason this is problematic is because writes to <code>process.stdout</code> in Node.js\nare sometimes <em>asynchronous</em> and may occur over multiple ticks of the Node.js\nevent loop. Calling <code>process.exit()</code>, however, forces the process to exit\n<em>before</em> those additional writes to <code>stdout</code> can be performed.</p>\n<p>Rather than calling <code>process.exit()</code> directly, the code <em>should</em> set the\n<code>process.exitCode</code> and allow the process to exit naturally by avoiding\nscheduling any additional work for the event loop:</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\n// How to properly set the exit code while letting\n// the process exit gracefully.\nif (someConditionNotMet()) {\n  printUsageToStdout();\n  process.exitCode = 1;\n}\n</code></pre>\n<pre><code class=\"language-cjs\">// How to properly set the exit code while letting\n// the process exit gracefully.\nif (someConditionNotMet()) {\n  printUsageToStdout();\n  process.exitCode = 1;\n}\n</code></pre>\n<p>If it is necessary to terminate the Node.js process due to an error condition,\nthrowing an <em>uncaught</em> error and allowing the process to terminate accordingly\nis safer than calling <code>process.exit()</code>.</p>\n<p>In <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads, this function stops the current thread rather\nthan the current process.</p>"
        },
        {
          "textRaw": "`process.finalization.register(ref, callback)`",
          "name": "register",
          "type": "method",
          "meta": {
            "added": [
              "v22.5.0"
            ],
            "changes": []
          },
          "stability": 1.1,
          "stabilityText": "Active Development",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`ref` {Object|Function} The reference to the resource that is being tracked.",
                  "name": "ref",
                  "type": "Object|Function",
                  "desc": "The reference to the resource that is being tracked."
                },
                {
                  "textRaw": "`callback` {Function} The callback function to be called when the resource is finalized.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "The callback function to be called when the resource is finalized.",
                  "options": [
                    {
                      "textRaw": "`ref` {Object|Function} The reference to the resource that is being tracked.",
                      "name": "ref",
                      "type": "Object|Function",
                      "desc": "The reference to the resource that is being tracked."
                    },
                    {
                      "textRaw": "`event` {string} The event that triggered the finalization. Defaults to 'exit'.",
                      "name": "event",
                      "type": "string",
                      "desc": "The event that triggered the finalization. Defaults to 'exit'."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>This function registers a callback to be called when the process emits the <code>exit</code>\nevent if the <code>ref</code> object was not garbage collected. If the object <code>ref</code> was garbage collected\nbefore the <code>exit</code> event is emitted, the callback will be removed from the finalization registry,\nand it will not be called on process exit.</p>\n<p>Inside the callback you can release the resources allocated by the <code>ref</code> object.\nBe aware that all limitations applied to the <code>beforeExit</code> event are also applied to the <code>callback</code> function,\nthis means that there is a possibility that the callback will not be called under special circumstances.</p>\n<p>The idea of ​​this function is to help you free up resources when the starts process exiting,\nbut also let the object be garbage collected if it is no longer being used.</p>\n<p>Eg: you can register an object that contains a buffer, you want to make sure that buffer is released\nwhen the process exit, but if the object is garbage collected before the process exit, we no longer\nneed to release the buffer, so in this case we just remove the callback from the finalization registry.</p>\n<pre><code class=\"language-cjs\">const { finalization } = require('node:process');\n\n// Please make sure that the function passed to finalization.register()\n// does not create a closure around unnecessary objects.\nfunction onFinalize(obj, event) {\n  // You can do whatever you want with the object\n  obj.dispose();\n}\n\nfunction setup() {\n  // This object can be safely garbage collected,\n  // and the resulting shutdown function will not be called.\n  // There are no leaks.\n  const myDisposableObject = {\n    dispose() {\n      // Free your resources synchronously\n    },\n  };\n\n  finalization.register(myDisposableObject, onFinalize);\n}\n\nsetup();\n</code></pre>\n<pre><code class=\"language-mjs\">import { finalization } from 'node:process';\n\n// Please make sure that the function passed to finalization.register()\n// does not create a closure around unnecessary objects.\nfunction onFinalize(obj, event) {\n  // You can do whatever you want with the object\n  obj.dispose();\n}\n\nfunction setup() {\n  // This object can be safely garbage collected,\n  // and the resulting shutdown function will not be called.\n  // There are no leaks.\n  const myDisposableObject = {\n    dispose() {\n      // Free your resources synchronously\n    },\n  };\n\n  finalization.register(myDisposableObject, onFinalize);\n}\n\nsetup();\n</code></pre>\n<p>The code above relies on the following assumptions:</p>\n<ul>\n<li>arrow functions are avoided</li>\n<li>regular functions are recommended to be within the global context (root)</li>\n</ul>\n<p>Regular functions <em>could</em> reference the context where the <code>obj</code> lives, making the <code>obj</code> not garbage collectible.</p>\n<p>Arrow functions will hold the previous context. Consider, for example:</p>\n<pre><code class=\"language-js\">class Test {\n  constructor() {\n    finalization.register(this, (ref) => ref.dispose());\n\n    // Even something like this is highly discouraged\n    // finalization.register(this, () => this.dispose());\n  }\n  dispose() {}\n}\n</code></pre>\n<p>It is very unlikely (not impossible) that this object will be garbage collected,\nbut if it is not, <code>dispose</code> will be called when <code>process.exit</code> is called.</p>\n<p>Be careful and avoid relying on this feature for the disposal of critical resources,\nas it is not guaranteed that the callback will be called under all circumstances.</p>"
        },
        {
          "textRaw": "`process.finalization.registerBeforeExit(ref, callback)`",
          "name": "registerBeforeExit",
          "type": "method",
          "meta": {
            "added": [
              "v22.5.0"
            ],
            "changes": []
          },
          "stability": 1.1,
          "stabilityText": "Active Development",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`ref` {Object|Function} The reference to the resource that is being tracked.",
                  "name": "ref",
                  "type": "Object|Function",
                  "desc": "The reference to the resource that is being tracked."
                },
                {
                  "textRaw": "`callback` {Function} The callback function to be called when the resource is finalized.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "The callback function to be called when the resource is finalized.",
                  "options": [
                    {
                      "textRaw": "`ref` {Object|Function} The reference to the resource that is being tracked.",
                      "name": "ref",
                      "type": "Object|Function",
                      "desc": "The reference to the resource that is being tracked."
                    },
                    {
                      "textRaw": "`event` {string} The event that triggered the finalization. Defaults to 'beforeExit'.",
                      "name": "event",
                      "type": "string",
                      "desc": "The event that triggered the finalization. Defaults to 'beforeExit'."
                    }
                  ]
                }
              ]
            }
          ],
          "desc": "<p>This function behaves exactly like the <code>register</code>, except that the callback will be called\nwhen the process emits the <code>beforeExit</code> event if <code>ref</code> object was not garbage collected.</p>\n<p>Be aware that all limitations applied to the <code>beforeExit</code> event are also applied to the <code>callback</code> function,\nthis means that there is a possibility that the callback will not be called under special circumstances.</p>"
        },
        {
          "textRaw": "`process.finalization.unregister(ref)`",
          "name": "unregister",
          "type": "method",
          "meta": {
            "added": [
              "v22.5.0"
            ],
            "changes": []
          },
          "stability": 1.1,
          "stabilityText": "Active Development",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`ref` {Object|Function} The reference to the resource that was registered previously.",
                  "name": "ref",
                  "type": "Object|Function",
                  "desc": "The reference to the resource that was registered previously."
                }
              ]
            }
          ],
          "desc": "<p>This function remove the register of the object from the finalization\nregistry, so the callback will not be called anymore.</p>\n<pre><code class=\"language-cjs\">const { finalization } = require('node:process');\n\n// Please make sure that the function passed to finalization.register()\n// does not create a closure around unnecessary objects.\nfunction onFinalize(obj, event) {\n  // You can do whatever you want with the object\n  obj.dispose();\n}\n\nfunction setup() {\n  // This object can be safely garbage collected,\n  // and the resulting shutdown function will not be called.\n  // There are no leaks.\n  const myDisposableObject = {\n    dispose() {\n      // Free your resources synchronously\n    },\n  };\n\n  finalization.register(myDisposableObject, onFinalize);\n\n  // Do something\n\n  myDisposableObject.dispose();\n  finalization.unregister(myDisposableObject);\n}\n\nsetup();\n</code></pre>\n<pre><code class=\"language-mjs\">import { finalization } from 'node:process';\n\n// Please make sure that the function passed to finalization.register()\n// does not create a closure around unnecessary objects.\nfunction onFinalize(obj, event) {\n  // You can do whatever you want with the object\n  obj.dispose();\n}\n\nfunction setup() {\n  // This object can be safely garbage collected,\n  // and the resulting shutdown function will not be called.\n  // There are no leaks.\n  const myDisposableObject = {\n    dispose() {\n      // Free your resources synchronously\n    },\n  };\n\n  // Please make sure that the function passed to finalization.register()\n  // does not create a closure around unnecessary objects.\n  function onFinalize(obj, event) {\n    // You can do whatever you want with the object\n    obj.dispose();\n  }\n\n  finalization.register(myDisposableObject, onFinalize);\n\n  // Do something\n\n  myDisposableObject.dispose();\n  finalization.unregister(myDisposableObject);\n}\n\nsetup();\n</code></pre>"
        },
        {
          "textRaw": "`process.getActiveResourcesInfo()`",
          "name": "getActiveResourcesInfo",
          "type": "method",
          "meta": {
            "added": [
              "v17.3.0",
              "v16.14.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.0.0",
                  "v22.16.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/57765",
                "description": "Change stability index for this feature from Experimental to Stable."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {string[]}",
                "name": "return",
                "type": "string[]"
              }
            }
          ],
          "desc": "<p>The <code>process.getActiveResourcesInfo()</code> method returns an array of strings\ncontaining the types of the active resources that are currently keeping the\nevent loop alive.</p>\n<pre><code class=\"language-mjs\">import { getActiveResourcesInfo } from 'node:process';\nimport { setTimeout } from 'node:timers';\n\nconsole.log('Before:', getActiveResourcesInfo());\nsetTimeout(() => {}, 1000);\nconsole.log('After:', getActiveResourcesInfo());\n// Prints:\n//   Before: [ 'CloseReq', 'TTYWrap', 'TTYWrap', 'TTYWrap' ]\n//   After: [ 'CloseReq', 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ]\n</code></pre>\n<pre><code class=\"language-cjs\">const { getActiveResourcesInfo } = require('node:process');\nconst { setTimeout } = require('node:timers');\n\nconsole.log('Before:', getActiveResourcesInfo());\nsetTimeout(() => {}, 1000);\nconsole.log('After:', getActiveResourcesInfo());\n// Prints:\n//   Before: [ 'TTYWrap', 'TTYWrap', 'TTYWrap' ]\n//   After: [ 'TTYWrap', 'TTYWrap', 'TTYWrap', 'Timeout' ]\n</code></pre>"
        },
        {
          "textRaw": "`process.getBuiltinModule(id)`",
          "name": "getBuiltinModule",
          "type": "method",
          "meta": {
            "added": [
              "v22.3.0",
              "v20.16.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`id` {string} ID of the built-in module being requested.",
                  "name": "id",
                  "type": "string",
                  "desc": "ID of the built-in module being requested."
                }
              ],
              "return": {
                "textRaw": "Returns: {Object|undefined}",
                "name": "return",
                "type": "Object|undefined"
              }
            }
          ],
          "desc": "<p><code>process.getBuiltinModule(id)</code> provides a way to load built-in modules\nin a globally available function. ES Modules that need to support\nother environments can use it to conditionally load a Node.js built-in\nwhen it is run in Node.js, without having to deal with the resolution\nerror that can be thrown by <code>import</code> in a non-Node.js environment or\nhaving to use dynamic <code>import()</code> which either turns the module into\nan asynchronous module, or turns a synchronous API into an asynchronous one.</p>\n<pre><code class=\"language-mjs\">if (globalThis.process?.getBuiltinModule) {\n  // Run in Node.js, use the Node.js fs module.\n  const fs = globalThis.process.getBuiltinModule('fs');\n  // If `require()` is needed to load user-modules, use createRequire()\n  const module = globalThis.process.getBuiltinModule('module');\n  const require = module.createRequire(import.meta.url);\n  const foo = require('foo');\n}\n</code></pre>\n<p>If <code>id</code> specifies a built-in module available in the current Node.js process,\n<code>process.getBuiltinModule(id)</code> method returns the corresponding built-in\nmodule. If <code>id</code> does not correspond to any built-in module, <code>undefined</code>\nis returned.</p>\n<p><code>process.getBuiltinModule(id)</code> accepts built-in module IDs that are recognized\nby <a href=\"module.html#moduleisbuiltinmodulename\"><code>module.isBuiltin(id)</code></a>. Some built-in modules must be loaded with the\n<code>node:</code> prefix, see <a href=\"modules.html#built-in-modules-with-mandatory-node-prefix\">built-in modules with mandatory <code>node:</code> prefix</a>.\nThe references returned by <code>process.getBuiltinModule(id)</code> always point to\nthe built-in module corresponding to <code>id</code> even if users modify\n<a href=\"modules.html#requirecache\"><code>require.cache</code></a> so that <code>require(id)</code> returns something else.</p>"
        },
        {
          "textRaw": "`process.getegid()`",
          "name": "getegid",
          "type": "method",
          "meta": {
            "added": [
              "v2.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p>The <code>process.getegid()</code> method returns the numerical effective group identity\nof the Node.js process. (See <a href=\"http://man7.org/linux/man-pages/man2/getegid.2.html\"><code>getegid(2)</code></a>.)</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.getegid) {\n  console.log(`Current gid: ${process.getegid()}`);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.getegid) {\n  console.log(`Current gid: ${process.getegid()}`);\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).</p>"
        },
        {
          "textRaw": "`process.geteuid()`",
          "name": "geteuid",
          "type": "method",
          "meta": {
            "added": [
              "v2.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>The <code>process.geteuid()</code> method returns the numerical effective user identity of\nthe process. (See <a href=\"http://man7.org/linux/man-pages/man2/geteuid.2.html\"><code>geteuid(2)</code></a>.)</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.geteuid) {\n  console.log(`Current uid: ${process.geteuid()}`);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.geteuid) {\n  console.log(`Current uid: ${process.geteuid()}`);\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).</p>"
        },
        {
          "textRaw": "`process.getgid()`",
          "name": "getgid",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object"
              }
            }
          ],
          "desc": "<p>The <code>process.getgid()</code> method returns the numerical group identity of the\nprocess. (See <a href=\"http://man7.org/linux/man-pages/man2/getgid.2.html\"><code>getgid(2)</code></a>.)</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.getgid) {\n  console.log(`Current gid: ${process.getgid()}`);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.getgid) {\n  console.log(`Current gid: ${process.getgid()}`);\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).</p>"
        },
        {
          "textRaw": "`process.getgroups()`",
          "name": "getgroups",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {integer[]}",
                "name": "return",
                "type": "integer[]"
              }
            }
          ],
          "desc": "<p>The <code>process.getgroups()</code> method returns an array with the supplementary group\nIDs. POSIX leaves it unspecified if the effective group ID is included but\nNode.js ensures it always is.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.getgroups) {\n  console.log(process.getgroups()); // [ 16, 21, 297 ]\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.getgroups) {\n  console.log(process.getgroups()); // [ 16, 21, 297 ]\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).</p>"
        },
        {
          "textRaw": "`process.getuid()`",
          "name": "getuid",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.28"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>The <code>process.getuid()</code> method returns the numeric user identity of the process.\n(See <a href=\"http://man7.org/linux/man-pages/man2/getuid.2.html\"><code>getuid(2)</code></a>.)</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.getuid) {\n  console.log(`Current uid: ${process.getuid()}`);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.getuid) {\n  console.log(`Current uid: ${process.getuid()}`);\n}\n</code></pre>\n<p>This function not available on Windows.</p>"
        },
        {
          "textRaw": "`process.hasUncaughtExceptionCaptureCallback()`",
          "name": "hasUncaughtExceptionCaptureCallback",
          "type": "method",
          "meta": {
            "added": [
              "v9.3.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>Indicates whether a callback has been set using\n<a href=\"#processsetuncaughtexceptioncapturecallbackfn\"><code>process.setUncaughtExceptionCaptureCallback()</code></a>.</p>"
        },
        {
          "textRaw": "`process.hrtime([time])`",
          "name": "hrtime",
          "type": "method",
          "meta": {
            "added": [
              "v0.7.6"
            ],
            "changes": []
          },
          "stability": 3,
          "stabilityText": "Legacy. Use `process.hrtime.bigint()` instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`time` {integer[]} The result of a previous call to `process.hrtime()`",
                  "name": "time",
                  "type": "integer[]",
                  "desc": "The result of a previous call to `process.hrtime()`",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {integer[]}",
                "name": "return",
                "type": "integer[]"
              }
            }
          ],
          "desc": "<p>This is the legacy version of <a href=\"#processhrtimebigint\"><code>process.hrtime.bigint()</code></a>\nbefore <code>bigint</code> was introduced in JavaScript.</p>\n<p>The <code>process.hrtime()</code> method returns the current high-resolution real time\nin a <code>[seconds, nanoseconds]</code> tuple <code>Array</code>, where <code>nanoseconds</code> is the\nremaining part of the real time that can't be represented in second precision.</p>\n<p><code>time</code> is an optional parameter that must be the result of a previous\n<code>process.hrtime()</code> call to diff with the current time. If the parameter\npassed in is not a tuple <code>Array</code>, a <code>TypeError</code> will be thrown. Passing in a\nuser-defined array instead of the result of a previous call to\n<code>process.hrtime()</code> will lead to undefined behavior.</p>\n<p>These times are relative to an arbitrary time in the\npast, and not related to the time of day and therefore not subject to clock\ndrift. The primary use is for measuring performance between intervals:</p>\n<pre><code class=\"language-mjs\">import { hrtime } from 'node:process';\n\nconst NS_PER_SEC = 1e9;\nconst time = hrtime();\n// [ 1800216, 25 ]\n\nsetTimeout(() => {\n  const diff = hrtime(time);\n  // [ 1, 552 ]\n\n  console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);\n  // Benchmark took 1000000552 nanoseconds\n}, 1000);\n</code></pre>\n<pre><code class=\"language-cjs\">const { hrtime } = require('node:process');\n\nconst NS_PER_SEC = 1e9;\nconst time = hrtime();\n// [ 1800216, 25 ]\n\nsetTimeout(() => {\n  const diff = hrtime(time);\n  // [ 1, 552 ]\n\n  console.log(`Benchmark took ${diff[0] * NS_PER_SEC + diff[1]} nanoseconds`);\n  // Benchmark took 1000000552 nanoseconds\n}, 1000);\n</code></pre>"
        },
        {
          "textRaw": "`process.hrtime.bigint()`",
          "name": "bigint",
          "type": "method",
          "meta": {
            "added": [
              "v10.7.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {bigint}",
                "name": "return",
                "type": "bigint"
              }
            }
          ],
          "desc": "<p>The <code>bigint</code> version of the <a href=\"#processhrtimetime\"><code>process.hrtime()</code></a> method returning the\ncurrent high-resolution real time in nanoseconds as a <code>bigint</code>.</p>\n<p>Unlike <a href=\"#processhrtimetime\"><code>process.hrtime()</code></a>, it does not support an additional <code>time</code>\nargument since the difference can just be computed directly\nby subtraction of the two <code>bigint</code>s.</p>\n<pre><code class=\"language-mjs\">import { hrtime } from 'node:process';\n\nconst start = hrtime.bigint();\n// 191051479007711n\n\nsetTimeout(() => {\n  const end = hrtime.bigint();\n  // 191052633396993n\n\n  console.log(`Benchmark took ${end - start} nanoseconds`);\n  // Benchmark took 1154389282 nanoseconds\n}, 1000);\n</code></pre>\n<pre><code class=\"language-cjs\">const { hrtime } = require('node:process');\n\nconst start = hrtime.bigint();\n// 191051479007711n\n\nsetTimeout(() => {\n  const end = hrtime.bigint();\n  // 191052633396993n\n\n  console.log(`Benchmark took ${end - start} nanoseconds`);\n  // Benchmark took 1154389282 nanoseconds\n}, 1000);\n</code></pre>"
        },
        {
          "textRaw": "`process.initgroups(user, extraGroup)`",
          "name": "initgroups",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`user` {string|number} The user name or numeric identifier.",
                  "name": "user",
                  "type": "string|number",
                  "desc": "The user name or numeric identifier."
                },
                {
                  "textRaw": "`extraGroup` {string|number} A group name or numeric identifier.",
                  "name": "extraGroup",
                  "type": "string|number",
                  "desc": "A group name or numeric identifier."
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.initgroups()</code> method reads the <code>/etc/group</code> file and initializes\nthe group access list, using all groups of which the user is a member. This is\na privileged operation that requires that the Node.js process either have <code>root</code>\naccess or the <code>CAP_SETGID</code> capability.</p>\n<p>Use care when dropping privileges:</p>\n<pre><code class=\"language-mjs\">import { getgroups, initgroups, setgid } from 'node:process';\n\nconsole.log(getgroups());         // [ 0 ]\ninitgroups('nodeuser', 1000);     // switch user\nconsole.log(getgroups());         // [ 27, 30, 46, 1000, 0 ]\nsetgid(1000);                     // drop root gid\nconsole.log(getgroups());         // [ 27, 30, 46, 1000 ]\n</code></pre>\n<pre><code class=\"language-cjs\">const { getgroups, initgroups, setgid } = require('node:process');\n\nconsole.log(getgroups());         // [ 0 ]\ninitgroups('nodeuser', 1000);     // switch user\nconsole.log(getgroups());         // [ 27, 30, 46, 1000, 0 ]\nsetgid(1000);                     // drop root gid\nconsole.log(getgroups());         // [ 27, 30, 46, 1000 ]\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).\nThis feature is not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.kill(pid[, signal])`",
          "name": "kill",
          "type": "method",
          "meta": {
            "added": [
              "v0.0.6"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`pid` {number} A process ID",
                  "name": "pid",
                  "type": "number",
                  "desc": "A process ID"
                },
                {
                  "textRaw": "`signal` {string|number} The signal to send, either as a string or number. **Default:** `'SIGTERM'`.",
                  "name": "signal",
                  "type": "string|number",
                  "default": "`'SIGTERM'`",
                  "desc": "The signal to send, either as a string or number.",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.kill()</code> method sends the <code>signal</code> to the process identified by\n<code>pid</code>.</p>\n<p>Signal names are strings such as <code>'SIGINT'</code> or <code>'SIGHUP'</code>. See <a href=\"#signal-events\">Signal Events</a> and <a href=\"http://man7.org/linux/man-pages/man2/kill.2.html\"><code>kill(2)</code></a> for more information.</p>\n<p>This method will throw an error if the target <code>pid</code> does not exist. As a special\ncase, a signal of <code>0</code> can be used to test for the existence of a process.\nWindows platforms will throw an error if the <code>pid</code> is used to kill a process\ngroup.</p>\n<p>Even though the name of this function is <code>process.kill()</code>, it is really just a\nsignal sender, like the <code>kill</code> system call. The signal sent may do something\nother than kill the target process.</p>\n<pre><code class=\"language-mjs\">import process, { kill } from 'node:process';\n\nprocess.on('SIGHUP', () => {\n  console.log('Got SIGHUP signal.');\n});\n\nsetTimeout(() => {\n  console.log('Exiting.');\n  process.exit(0);\n}, 100);\n\nkill(process.pid, 'SIGHUP');\n</code></pre>\n<pre><code class=\"language-cjs\">process.on('SIGHUP', () => {\n  console.log('Got SIGHUP signal.');\n});\n\nsetTimeout(() => {\n  console.log('Exiting.');\n  process.exit(0);\n}, 100);\n\nprocess.kill(process.pid, 'SIGHUP');\n</code></pre>\n<p>When <code>SIGUSR1</code> is received by a Node.js process, Node.js will start the\ndebugger. See <a href=\"#signal-events\">Signal Events</a>.</p>"
        },
        {
          "textRaw": "`process.loadEnvFile(path)`",
          "name": "loadEnvFile",
          "type": "method",
          "meta": {
            "added": [
              "v21.7.0",
              "v20.12.0"
            ],
            "changes": [
              {
                "version": [
                  "v24.10.0",
                  "v22.21.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/59925",
                "description": "This API is no longer experimental."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`path` {string|URL|Buffer|undefined}. **Default:** `'./.env'`",
                  "name": "path",
                  "type": "string|URL|Buffer|undefined",
                  "default": "`'./.env'`",
                  "desc": "."
                }
              ]
            }
          ],
          "desc": "<p>Loads the <code>.env</code> file into <code>process.env</code>. Usage of <code>NODE_OPTIONS</code>\nin the <code>.env</code> file will not have any effect on Node.js.</p>\n<pre><code class=\"language-cjs\">const { loadEnvFile } = require('node:process');\nloadEnvFile();\n</code></pre>\n<pre><code class=\"language-mjs\">import { loadEnvFile } from 'node:process';\nloadEnvFile();\n</code></pre>"
        },
        {
          "textRaw": "`process.memoryUsage()`",
          "name": "memoryUsage",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": [
              {
                "version": [
                  "v13.9.0",
                  "v12.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/31550",
                "description": "Added `arrayBuffers` to the returned object."
              },
              {
                "version": "v7.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/9587",
                "description": "Added `external` to the returned object."
              }
            ]
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object",
                "options": [
                  {
                    "textRaw": "`rss` {integer}",
                    "name": "rss",
                    "type": "integer"
                  },
                  {
                    "textRaw": "`heapTotal` {integer}",
                    "name": "heapTotal",
                    "type": "integer"
                  },
                  {
                    "textRaw": "`heapUsed` {integer}",
                    "name": "heapUsed",
                    "type": "integer"
                  },
                  {
                    "textRaw": "`external` {integer}",
                    "name": "external",
                    "type": "integer"
                  },
                  {
                    "textRaw": "`arrayBuffers` {integer}",
                    "name": "arrayBuffers",
                    "type": "integer"
                  }
                ]
              }
            }
          ],
          "desc": "<p>Returns an object describing the memory usage of the Node.js process measured in\nbytes.</p>\n<pre><code class=\"language-mjs\">import { memoryUsage } from 'node:process';\n\nconsole.log(memoryUsage());\n// Prints:\n// {\n//  rss: 4935680,\n//  heapTotal: 1826816,\n//  heapUsed: 650472,\n//  external: 49879,\n//  arrayBuffers: 9386\n// }\n</code></pre>\n<pre><code class=\"language-cjs\">const { memoryUsage } = require('node:process');\n\nconsole.log(memoryUsage());\n// Prints:\n// {\n//  rss: 4935680,\n//  heapTotal: 1826816,\n//  heapUsed: 650472,\n//  external: 49879,\n//  arrayBuffers: 9386\n// }\n</code></pre>\n<ul>\n<li><code>heapTotal</code> and <code>heapUsed</code> refer to V8's memory usage.</li>\n<li><code>external</code> refers to the memory usage of C++ objects bound to JavaScript\nobjects managed by V8.</li>\n<li><code>rss</code>, Resident Set Size, is the amount of space occupied in the main\nmemory device (that is a subset of the total allocated memory) for the\nprocess, including all C++ and JavaScript objects and code.</li>\n<li><code>arrayBuffers</code> refers to memory allocated for <code>ArrayBuffer</code>s and\n<code>SharedArrayBuffer</code>s, including all Node.js <a href=\"buffer.html\"><code>Buffer</code></a>s.\nThis is also included in the <code>external</code> value. When Node.js is used as an\nembedded library, this value may be <code>0</code> because allocations for <code>ArrayBuffer</code>s\nmay not be tracked in that case.</li>\n</ul>\n<p>When using <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads, <code>rss</code> will be a value that is valid for the\nentire process, while the other fields will only refer to the current thread.</p>\n<p>The <code>process.memoryUsage()</code> method iterates over each page to gather\ninformation about memory usage which might be slow depending on the\nprogram memory allocations.</p>",
          "modules": [
            {
              "textRaw": "A note on process memoryUsage",
              "name": "a_note_on_process_memoryusage",
              "type": "module",
              "desc": "<p>On Linux or other systems where glibc is commonly used, an application may have sustained\n<code>rss</code> growth despite stable <code>heapTotal</code> due to fragmentation caused by the glibc <code>malloc</code>\nimplementation. See <a href=\"https://github.com/nodejs/node/issues/21973\">nodejs/node#21973</a> on how to switch to an alternative <code>malloc</code>\nimplementation to address the performance issue.</p>",
              "displayName": "A note on process memoryUsage"
            }
          ]
        },
        {
          "textRaw": "`process.memoryUsage.rss()`",
          "name": "rss",
          "type": "method",
          "meta": {
            "added": [
              "v15.6.0",
              "v14.18.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {integer}",
                "name": "return",
                "type": "integer"
              }
            }
          ],
          "desc": "<p>The <code>process.memoryUsage.rss()</code> method returns an integer representing the\nResident Set Size (RSS) in bytes.</p>\n<p>The Resident Set Size, is the amount of space occupied in the main\nmemory device (that is a subset of the total allocated memory) for the\nprocess, including all C++ and JavaScript objects and code.</p>\n<p>This is the same value as the <code>rss</code> property provided by <code>process.memoryUsage()</code>\nbut <code>process.memoryUsage.rss()</code> is faster.</p>\n<pre><code class=\"language-mjs\">import { memoryUsage } from 'node:process';\n\nconsole.log(memoryUsage.rss());\n// 35655680\n</code></pre>\n<pre><code class=\"language-cjs\">const { memoryUsage } = require('node:process');\n\nconsole.log(memoryUsage.rss());\n// 35655680\n</code></pre>"
        },
        {
          "textRaw": "`process.nextTick(callback[, ...args])`",
          "name": "nextTick",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.26"
            ],
            "changes": [
              {
                "version": [
                  "v22.7.0",
                  "v20.18.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/51280",
                "description": "Changed stability to Legacy."
              },
              {
                "version": "v18.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/41678",
                "description": "Passing an invalid callback to the `callback` argument now throws `ERR_INVALID_ARG_TYPE` instead of `ERR_INVALID_CALLBACK`."
              },
              {
                "version": "v1.8.1",
                "pr-url": "https://github.com/nodejs/node/pull/1077",
                "description": "Additional arguments after `callback` are now supported."
              }
            ]
          },
          "stability": 3,
          "stabilityText": "Legacy: Use `queueMicrotask()` instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function"
                },
                {
                  "textRaw": "`...args` {any} Additional arguments to pass when invoking the `callback`",
                  "name": "...args",
                  "type": "any",
                  "desc": "Additional arguments to pass when invoking the `callback`",
                  "optional": true
                }
              ]
            }
          ],
          "desc": "<p><code>process.nextTick()</code> adds <code>callback</code> to the \"next tick queue\". This queue is\nfully drained after the current operation on the JavaScript stack runs to\ncompletion and before the event loop is allowed to continue. It's possible to\ncreate an infinite loop if one were to recursively call <code>process.nextTick()</code>.\nSee the <a href=\"https://nodejs.org/en/learn/asynchronous-work/event-loop-timers-and-nexttick#understanding-processnexttick\">Event Loop</a> guide for more background.</p>\n<pre><code class=\"language-mjs\">import { nextTick } from 'node:process';\n\nconsole.log('start');\nnextTick(() => {\n  console.log('nextTick callback');\n});\nconsole.log('scheduled');\n// Output:\n// start\n// scheduled\n// nextTick callback\n</code></pre>\n<pre><code class=\"language-cjs\">const { nextTick } = require('node:process');\n\nconsole.log('start');\nnextTick(() => {\n  console.log('nextTick callback');\n});\nconsole.log('scheduled');\n// Output:\n// start\n// scheduled\n// nextTick callback\n</code></pre>\n<p>This is important when developing APIs in order to give users the opportunity\nto assign event handlers <em>after</em> an object has been constructed but before any\nI/O has occurred:</p>\n<pre><code class=\"language-mjs\">import { nextTick } from 'node:process';\n\nfunction MyThing(options) {\n  this.setupOptions(options);\n\n  nextTick(() => {\n    this.startDoingStuff();\n  });\n}\n\nconst thing = new MyThing();\nthing.getReadyForStuff();\n\n// thing.startDoingStuff() gets called now, not before.\n</code></pre>\n<pre><code class=\"language-cjs\">const { nextTick } = require('node:process');\n\nfunction MyThing(options) {\n  this.setupOptions(options);\n\n  nextTick(() => {\n    this.startDoingStuff();\n  });\n}\n\nconst thing = new MyThing();\nthing.getReadyForStuff();\n\n// thing.startDoingStuff() gets called now, not before.\n</code></pre>\n<p>It is very important for APIs to be either 100% synchronous or 100%\nasynchronous. Consider this example:</p>\n<pre><code class=\"language-js\">// WARNING!  DO NOT USE!  BAD UNSAFE HAZARD!\nfunction maybeSync(arg, cb) {\n  if (arg) {\n    cb();\n    return;\n  }\n\n  fs.stat('file', cb);\n}\n</code></pre>\n<p>This API is hazardous because in the following case:</p>\n<pre><code class=\"language-js\">const maybeTrue = Math.random() > 0.5;\n\nmaybeSync(maybeTrue, () => {\n  foo();\n});\n\nbar();\n</code></pre>\n<p>It is not clear whether <code>foo()</code> or <code>bar()</code> will be called first.</p>\n<p>The following approach is much better:</p>\n<pre><code class=\"language-mjs\">import { nextTick } from 'node:process';\n\nfunction definitelyAsync(arg, cb) {\n  if (arg) {\n    nextTick(cb);\n    return;\n  }\n\n  fs.stat('file', cb);\n}\n</code></pre>\n<pre><code class=\"language-cjs\">const { nextTick } = require('node:process');\n\nfunction definitelyAsync(arg, cb) {\n  if (arg) {\n    nextTick(cb);\n    return;\n  }\n\n  fs.stat('file', cb);\n}\n</code></pre>",
          "modules": [
            {
              "textRaw": "When to use `queueMicrotask()` vs. `process.nextTick()`",
              "name": "when_to_use_`queuemicrotask()`_vs._`process.nexttick()`",
              "type": "module",
              "desc": "<p>The <a href=\"globals.html#queuemicrotaskcallback\"><code>queueMicrotask()</code></a> API is an alternative to <code>process.nextTick()</code> that instead of using the\n\"next tick queue\" defers execution of a function using the same microtask queue used to execute the\nthen, catch, and finally handlers of resolved promises.</p>\n<p>Within Node.js, every time the \"next tick queue\" is drained, the microtask queue\nis drained immediately after.</p>\n<p>So in CJS modules <code>process.nextTick()</code> callbacks are always run before <code>queueMicrotask()</code> ones.\nHowever since ESM modules are processed already as part of the microtask queue, there\n<code>queueMicrotask()</code> callbacks are always executed before <code>process.nextTick()</code> ones since Node.js\nis already in the process of draining the microtask queue.</p>\n<pre><code class=\"language-mjs\">import { nextTick } from 'node:process';\n\nPromise.resolve().then(() => console.log('resolve'));\nqueueMicrotask(() => console.log('microtask'));\nnextTick(() => console.log('nextTick'));\n// Output:\n// resolve\n// microtask\n// nextTick\n</code></pre>\n<pre><code class=\"language-cjs\">const { nextTick } = require('node:process');\n\nPromise.resolve().then(() => console.log('resolve'));\nqueueMicrotask(() => console.log('microtask'));\nnextTick(() => console.log('nextTick'));\n// Output:\n// nextTick\n// resolve\n// microtask\n</code></pre>\n<p>For <em>most</em> userland use cases, the <code>queueMicrotask()</code> API provides a portable\nand reliable mechanism for deferring execution that works across multiple\nJavaScript platform environments and should be favored over <code>process.nextTick()</code>.\nIn simple scenarios, <code>queueMicrotask()</code> can be a drop-in replacement for\n<code>process.nextTick()</code>.</p>\n<pre><code class=\"language-js\">console.log('start');\nqueueMicrotask(() => {\n  console.log('microtask callback');\n});\nconsole.log('scheduled');\n// Output:\n// start\n// scheduled\n// microtask callback\n</code></pre>\n<p>One note-worthy difference between the two APIs is that <code>process.nextTick()</code>\nallows specifying additional values that will be passed as arguments to the\ndeferred function when it is called. Achieving the same result with\n<code>queueMicrotask()</code> requires using either a closure or a bound function:</p>\n<pre><code class=\"language-js\">function deferred(a, b) {\n  console.log('microtask', a + b);\n}\n\nconsole.log('start');\nqueueMicrotask(deferred.bind(undefined, 1, 2));\nconsole.log('scheduled');\n// Output:\n// start\n// scheduled\n// microtask 3\n</code></pre>\n<p>There are minor differences in the way errors raised from within the next tick\nqueue and microtask queue are handled. Errors thrown within a queued microtask\ncallback should be handled within the queued callback when possible. If they are\nnot, the <code>process.on('uncaughtException')</code> event handler can be used to capture\nand handle the errors.</p>\n<p>When in doubt, unless the specific capabilities of <code>process.nextTick()</code> are\nneeded, use <code>queueMicrotask()</code>.</p>",
              "displayName": "When to use `queueMicrotask()` vs. `process.nextTick()`"
            }
          ]
        },
        {
          "textRaw": "`process.ref(maybeRefable)`",
          "name": "ref",
          "type": "method",
          "meta": {
            "added": [
              "v23.6.0",
              "v22.14.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`maybeRefable` {any} An object that may be \"refable\".",
                  "name": "maybeRefable",
                  "type": "any",
                  "desc": "An object that may be \"refable\"."
                }
              ]
            }
          ],
          "desc": "<p>An object is \"refable\" if it implements the Node.js \"Refable protocol\".\nSpecifically, this means that the object implements the <code>Symbol.for('nodejs.ref')</code>\nand <code>Symbol.for('nodejs.unref')</code> methods. \"Ref'd\" objects will keep the Node.js\nevent loop alive, while \"unref'd\" objects will not. Historically, this was\nimplemented by using <code>ref()</code> and <code>unref()</code> methods directly on the objects.\nThis pattern, however, is being deprecated in favor of the \"Refable protocol\"\nin order to better support Web Platform API types whose APIs cannot be modified\nto add <code>ref()</code> and <code>unref()</code> methods but still need to support that behavior.</p>"
        },
        {
          "textRaw": "`process.resourceUsage()`",
          "name": "resourceUsage",
          "type": "method",
          "meta": {
            "added": [
              "v12.6.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {Object} the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a `uv_rusage_t` struct.",
                "name": "return",
                "type": "Object",
                "desc": "the resource usage for the current process. All of these values come from the `uv_getrusage` call which returns a `uv_rusage_t` struct.",
                "options": [
                  {
                    "textRaw": "`userCPUTime` {integer} maps to `ru_utime` computed in microseconds. It is the same value as `process.cpuUsage().user`.",
                    "name": "userCPUTime",
                    "type": "integer",
                    "desc": "maps to `ru_utime` computed in microseconds. It is the same value as `process.cpuUsage().user`."
                  },
                  {
                    "textRaw": "`systemCPUTime` {integer} maps to `ru_stime` computed in microseconds. It is the same value as `process.cpuUsage().system`.",
                    "name": "systemCPUTime",
                    "type": "integer",
                    "desc": "maps to `ru_stime` computed in microseconds. It is the same value as `process.cpuUsage().system`."
                  },
                  {
                    "textRaw": "`maxRSS` {integer} maps to `ru_maxrss` which is the maximum resident set size used in kibibytes (1024 bytes).",
                    "name": "maxRSS",
                    "type": "integer",
                    "desc": "maps to `ru_maxrss` which is the maximum resident set size used in kibibytes (1024 bytes)."
                  },
                  {
                    "textRaw": "`sharedMemorySize` {integer} maps to `ru_ixrss` but is not supported by any platform.",
                    "name": "sharedMemorySize",
                    "type": "integer",
                    "desc": "maps to `ru_ixrss` but is not supported by any platform."
                  },
                  {
                    "textRaw": "`unsharedDataSize` {integer} maps to `ru_idrss` but is not supported by any platform.",
                    "name": "unsharedDataSize",
                    "type": "integer",
                    "desc": "maps to `ru_idrss` but is not supported by any platform."
                  },
                  {
                    "textRaw": "`unsharedStackSize` {integer} maps to `ru_isrss` but is not supported by any platform.",
                    "name": "unsharedStackSize",
                    "type": "integer",
                    "desc": "maps to `ru_isrss` but is not supported by any platform."
                  },
                  {
                    "textRaw": "`minorPageFault` {integer} maps to `ru_minflt` which is the number of minor page faults for the process, see this article for more details.",
                    "name": "minorPageFault",
                    "type": "integer",
                    "desc": "maps to `ru_minflt` which is the number of minor page faults for the process, see this article for more details."
                  },
                  {
                    "textRaw": "`majorPageFault` {integer} maps to `ru_majflt` which is the number of major page faults for the process, see this article for more details. This field is not supported on Windows.",
                    "name": "majorPageFault",
                    "type": "integer",
                    "desc": "maps to `ru_majflt` which is the number of major page faults for the process, see this article for more details. This field is not supported on Windows."
                  },
                  {
                    "textRaw": "`swappedOut` {integer} maps to `ru_nswap` but is not supported by any platform.",
                    "name": "swappedOut",
                    "type": "integer",
                    "desc": "maps to `ru_nswap` but is not supported by any platform."
                  },
                  {
                    "textRaw": "`fsRead` {integer} maps to `ru_inblock` which is the number of times the file system had to perform input.",
                    "name": "fsRead",
                    "type": "integer",
                    "desc": "maps to `ru_inblock` which is the number of times the file system had to perform input."
                  },
                  {
                    "textRaw": "`fsWrite` {integer} maps to `ru_oublock` which is the number of times the file system had to perform output.",
                    "name": "fsWrite",
                    "type": "integer",
                    "desc": "maps to `ru_oublock` which is the number of times the file system had to perform output."
                  },
                  {
                    "textRaw": "`ipcSent` {integer} maps to `ru_msgsnd` but is not supported by any platform.",
                    "name": "ipcSent",
                    "type": "integer",
                    "desc": "maps to `ru_msgsnd` but is not supported by any platform."
                  },
                  {
                    "textRaw": "`ipcReceived` {integer} maps to `ru_msgrcv` but is not supported by any platform.",
                    "name": "ipcReceived",
                    "type": "integer",
                    "desc": "maps to `ru_msgrcv` but is not supported by any platform."
                  },
                  {
                    "textRaw": "`signalsCount` {integer} maps to `ru_nsignals` but is not supported by any platform.",
                    "name": "signalsCount",
                    "type": "integer",
                    "desc": "maps to `ru_nsignals` but is not supported by any platform."
                  },
                  {
                    "textRaw": "`voluntaryContextSwitches` {integer} maps to `ru_nvcsw` which is the number of times a CPU context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource). This field is not supported on Windows.",
                    "name": "voluntaryContextSwitches",
                    "type": "integer",
                    "desc": "maps to `ru_nvcsw` which is the number of times a CPU context switch resulted due to a process voluntarily giving up the processor before its time slice was completed (usually to await availability of a resource). This field is not supported on Windows."
                  },
                  {
                    "textRaw": "`involuntaryContextSwitches` {integer} maps to `ru_nivcsw` which is the number of times a CPU context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice. This field is not supported on Windows.",
                    "name": "involuntaryContextSwitches",
                    "type": "integer",
                    "desc": "maps to `ru_nivcsw` which is the number of times a CPU context switch resulted due to a higher priority process becoming runnable or because the current process exceeded its time slice. This field is not supported on Windows."
                  }
                ]
              }
            }
          ],
          "desc": "<pre><code class=\"language-mjs\">import { resourceUsage } from 'node:process';\n\nconsole.log(resourceUsage());\n/*\n  Will output:\n  {\n    userCPUTime: 82872,\n    systemCPUTime: 4143,\n    maxRSS: 33164,\n    sharedMemorySize: 0,\n    unsharedDataSize: 0,\n    unsharedStackSize: 0,\n    minorPageFault: 2469,\n    majorPageFault: 0,\n    swappedOut: 0,\n    fsRead: 0,\n    fsWrite: 8,\n    ipcSent: 0,\n    ipcReceived: 0,\n    signalsCount: 0,\n    voluntaryContextSwitches: 79,\n    involuntaryContextSwitches: 1\n  }\n*/\n</code></pre>\n<pre><code class=\"language-cjs\">const { resourceUsage } = require('node:process');\n\nconsole.log(resourceUsage());\n/*\n  Will output:\n  {\n    userCPUTime: 82872,\n    systemCPUTime: 4143,\n    maxRSS: 33164,\n    sharedMemorySize: 0,\n    unsharedDataSize: 0,\n    unsharedStackSize: 0,\n    minorPageFault: 2469,\n    majorPageFault: 0,\n    swappedOut: 0,\n    fsRead: 0,\n    fsWrite: 8,\n    ipcSent: 0,\n    ipcReceived: 0,\n    signalsCount: 0,\n    voluntaryContextSwitches: 79,\n    involuntaryContextSwitches: 1\n  }\n*/\n</code></pre>"
        },
        {
          "textRaw": "`process.send(message[, sendHandle[, options]][, callback])`",
          "name": "send",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.9"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`message` {Object}",
                  "name": "message",
                  "type": "Object"
                },
                {
                  "textRaw": "`sendHandle` {net.Server|net.Socket}",
                  "name": "sendHandle",
                  "type": "net.Server|net.Socket",
                  "optional": true
                },
                {
                  "textRaw": "`options` {Object} used to parameterize the sending of certain types of handles.`options` supports the following properties:",
                  "name": "options",
                  "type": "Object",
                  "desc": "used to parameterize the sending of certain types of handles.`options` supports the following properties:",
                  "options": [
                    {
                      "textRaw": "`keepOpen` {boolean} A value that can be used when passing instances of `net.Socket`. When `true`, the socket is kept open in the sending process. **Default:** `false`.",
                      "name": "keepOpen",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "A value that can be used when passing instances of `net.Socket`. When `true`, the socket is kept open in the sending process."
                    }
                  ],
                  "optional": true
                },
                {
                  "textRaw": "`callback` {Function}",
                  "name": "callback",
                  "type": "Function",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {boolean}",
                "name": "return",
                "type": "boolean"
              }
            }
          ],
          "desc": "<p>If Node.js is spawned with an IPC channel, the <code>process.send()</code> method can be\nused to send messages to the parent process. Messages will be received as a\n<a href=\"child_process.html#event-message\"><code>'message'</code></a> event on the parent's <a href=\"child_process.html#class-childprocess\"><code>ChildProcess</code></a> object.</p>\n<p>If Node.js was not spawned with an IPC channel, <code>process.send</code> will be\n<code>undefined</code>.</p>\n<p>The message goes through serialization and parsing. The resulting message might\nnot be the same as what is originally sent.</p>"
        },
        {
          "textRaw": "`process.setegid(id)`",
          "name": "setegid",
          "type": "method",
          "meta": {
            "added": [
              "v2.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`id` {string|number} A group name or ID",
                  "name": "id",
                  "type": "string|number",
                  "desc": "A group name or ID"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.setegid()</code> method sets the effective group identity of the process.\n(See <a href=\"http://man7.org/linux/man-pages/man2/setegid.2.html\"><code>setegid(2)</code></a>.) The <code>id</code> can be passed as either a numeric ID or a group\nname string. If a group name is specified, this method blocks while resolving\nthe associated a numeric ID.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.getegid &#x26;&#x26; process.setegid) {\n  console.log(`Current gid: ${process.getegid()}`);\n  try {\n    process.setegid(501);\n    console.log(`New gid: ${process.getegid()}`);\n  } catch (err) {\n    console.error(`Failed to set gid: ${err}`);\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.getegid &#x26;&#x26; process.setegid) {\n  console.log(`Current gid: ${process.getegid()}`);\n  try {\n    process.setegid(501);\n    console.log(`New gid: ${process.getegid()}`);\n  } catch (err) {\n    console.error(`Failed to set gid: ${err}`);\n  }\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).\nThis feature is not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.seteuid(id)`",
          "name": "seteuid",
          "type": "method",
          "meta": {
            "added": [
              "v2.0.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`id` {string|number} A user name or ID",
                  "name": "id",
                  "type": "string|number",
                  "desc": "A user name or ID"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.seteuid()</code> method sets the effective user identity of the process.\n(See <a href=\"http://man7.org/linux/man-pages/man2/seteuid.2.html\"><code>seteuid(2)</code></a>.) The <code>id</code> can be passed as either a numeric ID or a username\nstring. If a username is specified, the method blocks while resolving the\nassociated numeric ID.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.geteuid &#x26;&#x26; process.seteuid) {\n  console.log(`Current uid: ${process.geteuid()}`);\n  try {\n    process.seteuid(501);\n    console.log(`New uid: ${process.geteuid()}`);\n  } catch (err) {\n    console.error(`Failed to set uid: ${err}`);\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.geteuid &#x26;&#x26; process.seteuid) {\n  console.log(`Current uid: ${process.geteuid()}`);\n  try {\n    process.seteuid(501);\n    console.log(`New uid: ${process.geteuid()}`);\n  } catch (err) {\n    console.error(`Failed to set uid: ${err}`);\n  }\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).\nThis feature is not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.setgid(id)`",
          "name": "setgid",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.31"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`id` {string|number} The group name or ID",
                  "name": "id",
                  "type": "string|number",
                  "desc": "The group name or ID"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.setgid()</code> method sets the group identity of the process. (See\n<a href=\"http://man7.org/linux/man-pages/man2/setgid.2.html\"><code>setgid(2)</code></a>.) The <code>id</code> can be passed as either a numeric ID or a group name\nstring. If a group name is specified, this method blocks while resolving the\nassociated numeric ID.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.getgid &#x26;&#x26; process.setgid) {\n  console.log(`Current gid: ${process.getgid()}`);\n  try {\n    process.setgid(501);\n    console.log(`New gid: ${process.getgid()}`);\n  } catch (err) {\n    console.error(`Failed to set gid: ${err}`);\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.getgid &#x26;&#x26; process.setgid) {\n  console.log(`Current gid: ${process.getgid()}`);\n  try {\n    process.setgid(501);\n    console.log(`New gid: ${process.getgid()}`);\n  } catch (err) {\n    console.error(`Failed to set gid: ${err}`);\n  }\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).\nThis feature is not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.setgroups(groups)`",
          "name": "setgroups",
          "type": "method",
          "meta": {
            "added": [
              "v0.9.4"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`groups` {integer[]}",
                  "name": "groups",
                  "type": "integer[]"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.setgroups()</code> method sets the supplementary group IDs for the\nNode.js process. This is a privileged operation that requires the Node.js\nprocess to have <code>root</code> or the <code>CAP_SETGID</code> capability.</p>\n<p>The <code>groups</code> array can contain numeric group IDs, group names, or both.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.getgroups &#x26;&#x26; process.setgroups) {\n  try {\n    process.setgroups([501]);\n    console.log(process.getgroups()); // new groups\n  } catch (err) {\n    console.error(`Failed to set groups: ${err}`);\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.getgroups &#x26;&#x26; process.setgroups) {\n  try {\n    process.setgroups([501]);\n    console.log(process.getgroups()); // new groups\n  } catch (err) {\n    console.error(`Failed to set groups: ${err}`);\n  }\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).\nThis feature is not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.setuid(id)`",
          "name": "setuid",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.28"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`id` {integer|string}",
                  "name": "id",
                  "type": "integer|string"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.setuid(id)</code> method sets the user identity of the process. (See\n<a href=\"http://man7.org/linux/man-pages/man2/setuid.2.html\"><code>setuid(2)</code></a>.) The <code>id</code> can be passed as either a numeric ID or a username string.\nIf a username is specified, the method blocks while resolving the associated\nnumeric ID.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nif (process.getuid &#x26;&#x26; process.setuid) {\n  console.log(`Current uid: ${process.getuid()}`);\n  try {\n    process.setuid(501);\n    console.log(`New uid: ${process.getuid()}`);\n  } catch (err) {\n    console.error(`Failed to set uid: ${err}`);\n  }\n}\n</code></pre>\n<pre><code class=\"language-cjs\">if (process.getuid &#x26;&#x26; process.setuid) {\n  console.log(`Current uid: ${process.getuid()}`);\n  try {\n    process.setuid(501);\n    console.log(`New uid: ${process.getuid()}`);\n  } catch (err) {\n    console.error(`Failed to set uid: ${err}`);\n  }\n}\n</code></pre>\n<p>This function is only available on POSIX platforms (i.e. not Windows or\nAndroid).\nThis feature is not available in <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.</p>"
        },
        {
          "textRaw": "`process.setSourceMapsEnabled(val)`",
          "name": "setSourceMapsEnabled",
          "type": "method",
          "meta": {
            "added": [
              "v16.6.0",
              "v14.18.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental: Use `module.setSourceMapsSupport()` instead.",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`val` {boolean}",
                  "name": "val",
                  "type": "boolean"
                }
              ]
            }
          ],
          "desc": "<p>This function enables or disables the <a href=\"https://tc39.es/ecma426/\">Source Map</a> support for\nstack traces.</p>\n<p>It provides same features as launching Node.js process with commandline options\n<code>--enable-source-maps</code>.</p>\n<p>Only source maps in JavaScript files that are loaded after source maps has been\nenabled will be parsed and loaded.</p>\n<p>This implies calling <code>module.setSourceMapsSupport()</code> with an option\n<code>{ nodeModules: true, generatedCode: true }</code>.</p>"
        },
        {
          "textRaw": "`process.setUncaughtExceptionCaptureCallback(fn)`",
          "name": "setUncaughtExceptionCaptureCallback",
          "type": "method",
          "meta": {
            "added": [
              "v9.3.0"
            ],
            "changes": [
              {
                "version": "v25.9.0",
                "pr-url": "https://github.com/nodejs/node/pull/61227",
                "description": "Use `process.addUncaughtExceptionCaptureCallback()` to register multiple callbacks."
              }
            ]
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`fn` {Function|null}",
                  "name": "fn",
                  "type": "Function|null"
                }
              ]
            }
          ],
          "desc": "<p>The <code>process.setUncaughtExceptionCaptureCallback()</code> function sets a function\nthat will be invoked when an uncaught exception occurs, which will receive the\nexception value itself as its first argument.</p>\n<p>If such a function is set, the <a href=\"#event-uncaughtexception\"><code>'uncaughtException'</code></a> event will\nnot be emitted. If <code>--abort-on-uncaught-exception</code> was passed from the\ncommand line or set through <a href=\"v8.html#v8setflagsfromstringflags\"><code>v8.setFlagsFromString()</code></a>, the process will\nnot abort. Actions configured to take place on exceptions such as report\ngenerations will be affected too</p>\n<p>To unset the capture function,\n<code>process.setUncaughtExceptionCaptureCallback(null)</code> may be used. Calling this\nmethod with a non-<code>null</code> argument while another capture function is set will\nthrow an error.</p>\n<p>To register multiple callbacks that can coexist, use\n<a href=\"#processadduncaughtexceptioncapturecallbackfn\"><code>process.addUncaughtExceptionCaptureCallback()</code></a> instead.</p>"
        },
        {
          "textRaw": "`process.threadCpuUsage([previousValue])`",
          "name": "threadCpuUsage",
          "type": "method",
          "meta": {
            "added": [
              "v23.9.0",
              "v22.19.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`previousValue` {Object} A previous return value from calling `process.threadCpuUsage()`",
                  "name": "previousValue",
                  "type": "Object",
                  "desc": "A previous return value from calling `process.threadCpuUsage()`",
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {Object}",
                "name": "return",
                "type": "Object",
                "options": [
                  {
                    "textRaw": "`user` {integer}",
                    "name": "user",
                    "type": "integer"
                  },
                  {
                    "textRaw": "`system` {integer}",
                    "name": "system",
                    "type": "integer"
                  }
                ]
              }
            }
          ],
          "desc": "<p>The <code>process.threadCpuUsage()</code> method returns the user and system CPU time usage of\nthe current worker thread, in an object with properties <code>user</code> and <code>system</code>, whose\nvalues are microsecond values (millionth of a second).</p>\n<p>The result of a previous call to <code>process.threadCpuUsage()</code> can be passed as the\nargument to the function, to get a diff reading.</p>"
        },
        {
          "textRaw": "`process.umask()`",
          "name": "umask",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.19"
            ],
            "changes": [
              {
                "version": [
                  "v14.0.0",
                  "v12.19.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/32499",
                "description": "Calling `process.umask()` with no arguments is deprecated."
              }
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated. Calling `process.umask()` with no argument causes the process-wide umask to be written twice. This introduces a race condition between threads, and is a potential security vulnerability. There is no safe, cross-platform alternative API.",
          "signatures": [
            {
              "params": []
            }
          ],
          "desc": "<p><code>process.umask()</code> returns the Node.js process's file mode creation mask. Child\nprocesses inherit the mask from the parent process.</p>"
        },
        {
          "textRaw": "`process.umask(mask)`",
          "name": "umask",
          "type": "method",
          "meta": {
            "added": [
              "v0.1.19"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`mask` {string|integer}",
                  "name": "mask",
                  "type": "string|integer"
                }
              ]
            }
          ],
          "desc": "<p><code>process.umask(mask)</code> sets the Node.js process's file mode creation mask. Child\nprocesses inherit the mask from the parent process. Returns the previous mask.</p>\n<pre><code class=\"language-mjs\">import { umask } from 'node:process';\n\nconst newmask = 0o022;\nconst oldmask = umask(newmask);\nconsole.log(\n  `Changed umask from ${oldmask.toString(8)} to ${newmask.toString(8)}`,\n);\n</code></pre>\n<pre><code class=\"language-cjs\">const { umask } = require('node:process');\n\nconst newmask = 0o022;\nconst oldmask = umask(newmask);\nconsole.log(\n  `Changed umask from ${oldmask.toString(8)} to ${newmask.toString(8)}`,\n);\n</code></pre>\n<p>In <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads, <code>process.umask(mask)</code> will throw an exception.</p>"
        },
        {
          "textRaw": "`process.unref(maybeRefable)`",
          "name": "unref",
          "type": "method",
          "meta": {
            "added": [
              "v23.6.0",
              "v22.14.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental",
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`maybeRefable` {any} An object that may be \"unref'd\".",
                  "name": "maybeRefable",
                  "type": "any",
                  "desc": "An object that may be \"unref'd\"."
                }
              ]
            }
          ],
          "desc": "<p>An object is \"unrefable\" if it implements the Node.js \"Refable protocol\".\nSpecifically, this means that the object implements the <code>Symbol.for('nodejs.ref')</code>\nand <code>Symbol.for('nodejs.unref')</code> methods. \"Ref'd\" objects will keep the Node.js\nevent loop alive, while \"unref'd\" objects will not. Historically, this was\nimplemented by using <code>ref()</code> and <code>unref()</code> methods directly on the objects.\nThis pattern, however, is being deprecated in favor of the \"Refable protocol\"\nin order to better support Web Platform API types whose APIs cannot be modified\nto add <code>ref()</code> and <code>unref()</code> methods but still need to support that behavior.</p>"
        },
        {
          "textRaw": "`process.uptime()`",
          "name": "uptime",
          "type": "method",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [],
              "return": {
                "textRaw": "Returns: {number}",
                "name": "return",
                "type": "number"
              }
            }
          ],
          "desc": "<p>The <code>process.uptime()</code> method returns the number of seconds the current Node.js\nprocess has been running.</p>\n<p>The return value includes fractions of a second. Use <code>Math.floor()</code> to get whole\nseconds.</p>"
        }
      ],
      "properties": [
        {
          "textRaw": "Type: {Set}",
          "name": "allowedNodeEnvironmentFlags",
          "type": "Set",
          "meta": {
            "added": [
              "v10.10.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.allowedNodeEnvironmentFlags</code> property is a special,\nread-only <code>Set</code> of flags allowable within the <a href=\"cli.html#node_optionsoptions\"><code>NODE_OPTIONS</code></a>\nenvironment variable.</p>\n<p><code>process.allowedNodeEnvironmentFlags</code> extends <code>Set</code>, but overrides\n<code>Set.prototype.has</code> to recognize several different possible flag\nrepresentations. <code>process.allowedNodeEnvironmentFlags.has()</code> will\nreturn <code>true</code> in the following cases:</p>\n<ul>\n<li>Flags may omit leading single (<code>-</code>) or double (<code>--</code>) dashes; e.g.,\n<code>inspect-brk</code> for <code>--inspect-brk</code>, or <code>r</code> for <code>-r</code>.</li>\n<li>Flags passed through to V8 (as listed in <code>--v8-options</code>) may replace\none or more <em>non-leading</em> dashes for an underscore, or vice-versa;\ne.g., <code>--perf_basic_prof</code>, <code>--perf-basic-prof</code>, <code>--perf_basic-prof</code>,\netc.</li>\n<li>Flags may contain one or more equals (<code>=</code>) characters; all\ncharacters after and including the first equals will be ignored;\ne.g., <code>--stack-trace-limit=100</code>.</li>\n<li>Flags <em>must</em> be allowable within <a href=\"cli.html#node_optionsoptions\"><code>NODE_OPTIONS</code></a>.</li>\n</ul>\n<p>When iterating over <code>process.allowedNodeEnvironmentFlags</code>, flags will\nappear only <em>once</em>; each will begin with one or more dashes. Flags\npassed through to V8 will contain underscores instead of non-leading\ndashes:</p>\n<pre><code class=\"language-mjs\">import { allowedNodeEnvironmentFlags } from 'node:process';\n\nallowedNodeEnvironmentFlags.forEach((flag) => {\n  // -r\n  // --inspect-brk\n  // --abort_on_uncaught_exception\n  // ...\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { allowedNodeEnvironmentFlags } = require('node:process');\n\nallowedNodeEnvironmentFlags.forEach((flag) => {\n  // -r\n  // --inspect-brk\n  // --abort_on_uncaught_exception\n  // ...\n});\n</code></pre>\n<p>The methods <code>add()</code>, <code>clear()</code>, and <code>delete()</code> of\n<code>process.allowedNodeEnvironmentFlags</code> do nothing, and will fail\nsilently.</p>\n<p>If Node.js was compiled <em>without</em> <a href=\"cli.html#node_optionsoptions\"><code>NODE_OPTIONS</code></a> support (shown in\n<a href=\"#processconfig\"><code>process.config</code></a>), <code>process.allowedNodeEnvironmentFlags</code> will\ncontain what <em>would have</em> been allowable.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "arch",
          "type": "string",
          "meta": {
            "added": [
              "v0.5.0"
            ],
            "changes": []
          },
          "desc": "<p>The operating system CPU architecture for which the Node.js binary was compiled.\nPossible values are: <code>'arm'</code>, <code>'arm64'</code>, <code>'ia32'</code>, <code>'loong64'</code>, <code>'mips'</code>,\n<code>'mipsel'</code>, <code>'ppc64'</code>, <code>'riscv64'</code>, <code>'s390'</code>, <code>'s390x'</code>, and <code>'x64'</code>.</p>\n<pre><code class=\"language-mjs\">import { arch } from 'node:process';\n\nconsole.log(`This processor architecture is ${arch}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { arch } = require('node:process');\n\nconsole.log(`This processor architecture is ${arch}`);\n</code></pre>"
        },
        {
          "textRaw": "Type: {string[]}",
          "name": "argv",
          "type": "string[]",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.argv</code> property returns an array containing the command-line\narguments passed when the Node.js process was launched. The first element will\nbe <a href=\"#processexecpath\"><code>process.execPath</code></a>. See <code>process.argv0</code> if access to the original value\nof <code>argv[0]</code> is needed. If a <a href=\"https://nodejs.org/api/cli.html#program-entry-point\">program entry point</a> was provided, the second element\nwill be the absolute path to it. The remaining elements are additional command-line\narguments.</p>\n<p>For example, assuming the following script for <code>process-args.js</code>:</p>\n<pre><code class=\"language-mjs\">import { argv } from 'node:process';\n\n// print process.argv\nargv.forEach((val, index) => {\n  console.log(`${index}: ${val}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">const { argv } = require('node:process');\n\n// print process.argv\nargv.forEach((val, index) => {\n  console.log(`${index}: ${val}`);\n});\n</code></pre>\n<p>Launching the Node.js process as:</p>\n<pre><code class=\"language-bash\">node process-args.js one two=three four\n</code></pre>\n<p>Would generate the output:</p>\n<pre><code class=\"language-text\">0: /usr/local/bin/node\n1: /Users/mjr/work/node/process-args.js\n2: one\n3: two=three\n4: four\n</code></pre>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "argv0",
          "type": "string",
          "meta": {
            "added": [
              "v6.4.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.argv0</code> property stores a read-only copy of the original value of\n<code>argv[0]</code> passed when Node.js starts.</p>\n<pre><code class=\"language-console\">$ bash -c 'exec -a customArgv0 ./node'\n> process.argv[0]\n'/Volumes/code/external/node/out/Release/node'\n> process.argv0\n'customArgv0'\n</code></pre>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "channel",
          "type": "Object",
          "meta": {
            "added": [
              "v7.1.0"
            ],
            "changes": [
              {
                "version": "v14.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/30165",
                "description": "The object no longer accidentally exposes native C++ bindings."
              }
            ]
          },
          "desc": "<p>If the Node.js process was spawned with an IPC channel (see the\n<a href=\"child_process.html\">Child Process</a> documentation), the <code>process.channel</code>\nproperty is a reference to the IPC channel. If no IPC channel exists, this\nproperty is <code>undefined</code>.</p>",
          "methods": [
            {
              "textRaw": "`process.channel.ref()`",
              "name": "ref",
              "type": "method",
              "meta": {
                "added": [
                  "v7.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This method makes the IPC channel keep the event loop of the process\nrunning if <code>.unref()</code> has been called before.</p>\n<p>Typically, this is managed through the number of <code>'disconnect'</code> and <code>'message'</code>\nlisteners on the <code>process</code> object. However, this method can be used to\nexplicitly request a specific behavior.</p>"
            },
            {
              "textRaw": "`process.channel.unref()`",
              "name": "unref",
              "type": "method",
              "meta": {
                "added": [
                  "v7.1.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>This method makes the IPC channel not keep the event loop of the process\nrunning, and lets it finish even while the channel is open.</p>\n<p>Typically, this is managed through the number of <code>'disconnect'</code> and <code>'message'</code>\nlisteners on the <code>process</code> object. However, this method can be used to\nexplicitly request a specific behavior.</p>"
            }
          ]
        },
        {
          "textRaw": "Type: {Object}",
          "name": "config",
          "type": "Object",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": [
              {
                "version": "v19.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/43627",
                "description": "The `process.config` object is now frozen."
              },
              {
                "version": "v16.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/36902",
                "description": "Modifying process.config has been deprecated."
              }
            ]
          },
          "desc": "<p>The <code>process.config</code> property returns a frozen <code>Object</code> containing the\nJavaScript representation of the configure options used to compile the current\nNode.js executable. This is the same as the <code>config.gypi</code> file that was produced\nwhen running the <code>./configure</code> script.</p>\n<p>An example of the possible output looks like:</p>\n<pre><code class=\"language-json\">{\n  \"target_defaults\":\n   { \"cflags\": [],\n     \"default_configuration\": \"Release\",\n     \"defines\": [],\n     \"include_dirs\": [],\n     \"libraries\": [] },\n  \"variables\":\n   {\n     \"host_arch\": \"x64\",\n     \"napi_build_version\": 5,\n     \"node_install_npm\": \"true\",\n     \"node_prefix\": \"\",\n     \"node_shared_cares\": \"false\",\n     \"node_shared_http_parser\": \"false\",\n     \"node_shared_libuv\": \"false\",\n     \"node_shared_zlib\": \"false\",\n     \"node_use_openssl\": \"true\",\n     \"node_shared_openssl\": \"false\",\n     \"target_arch\": \"x64\",\n     \"v8_use_snapshot\": 1\n   }\n}\n</code></pre>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "connected",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.7.2"
            ],
            "changes": []
          },
          "desc": "<p>If the Node.js process is spawned with an IPC channel (see the <a href=\"child_process.html\">Child Process</a>\nand <a href=\"cluster.html\">Cluster</a> documentation), the <code>process.connected</code> property will return\n<code>true</code> so long as the IPC channel is connected and will return <code>false</code> after\n<code>process.disconnect()</code> is called.</p>\n<p>Once <code>process.connected</code> is <code>false</code>, it is no longer possible to send messages\nover the IPC channel using <code>process.send()</code>.</p>"
        },
        {
          "textRaw": "Type: {number}",
          "name": "debugPort",
          "type": "number",
          "meta": {
            "added": [
              "v0.7.2"
            ],
            "changes": []
          },
          "desc": "<p>The port used by the Node.js debugger when enabled.</p>\n<pre><code class=\"language-mjs\">import process from 'node:process';\n\nprocess.debugPort = 5858;\n</code></pre>\n<pre><code class=\"language-cjs\">process.debugPort = 5858;\n</code></pre>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "env",
          "type": "Object",
          "meta": {
            "added": [
              "v0.1.27"
            ],
            "changes": [
              {
                "version": "v11.14.0",
                "pr-url": "https://github.com/nodejs/node/pull/26544",
                "description": "Worker threads will now use a copy of the parent thread's `process.env` by default, configurable through the `env` option of the `Worker` constructor."
              },
              {
                "version": "v10.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/18990",
                "description": "Implicit conversion of variable value to string is deprecated."
              }
            ]
          },
          "desc": "<p>The <code>process.env</code> property returns an object containing the user environment.\nSee <a href=\"http://man7.org/linux/man-pages/man7/environ.7.html\"><code>environ(7)</code></a>.</p>\n<p>An example of this object looks like:</p>\n<pre><code class=\"language-json\">{\n  \"TERM\": \"xterm-256color\",\n  \"SHELL\": \"/usr/local/bin/bash\",\n  \"USER\": \"maciej\",\n  \"PATH\": \"~/.bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin\",\n  \"PWD\": \"/Users/maciej\",\n  \"EDITOR\": \"vim\",\n  \"SHLVL\": \"1\",\n  \"HOME\": \"/Users/maciej\",\n  \"LOGNAME\": \"maciej\",\n  \"_\": \"/usr/local/bin/node\"\n}\n</code></pre>\n<p>It is possible to modify this object, but such modifications will not be\nreflected outside the Node.js process, or (unless explicitly requested)\nto other <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads.\nIn other words, the following example would not work:</p>\n<pre><code class=\"language-bash\">node -e 'process.env.foo = \"bar\"' &#x26;&#x26; echo $foo\n</code></pre>\n<p>While the following will:</p>\n<pre><code class=\"language-mjs\">import { env } from 'node:process';\n\nenv.foo = 'bar';\nconsole.log(env.foo);\n</code></pre>\n<pre><code class=\"language-cjs\">const { env } = require('node:process');\n\nenv.foo = 'bar';\nconsole.log(env.foo);\n</code></pre>\n<p>Assigning a property on <code>process.env</code> will implicitly convert the value\nto a string. <strong>This behavior is deprecated.</strong> Future versions of Node.js may\nthrow an error when the value is not a string, number, or boolean.</p>\n<pre><code class=\"language-mjs\">import { env } from 'node:process';\n\nenv.test = null;\nconsole.log(env.test);\n// => 'null'\nenv.test = undefined;\nconsole.log(env.test);\n// => 'undefined'\n</code></pre>\n<pre><code class=\"language-cjs\">const { env } = require('node:process');\n\nenv.test = null;\nconsole.log(env.test);\n// => 'null'\nenv.test = undefined;\nconsole.log(env.test);\n// => 'undefined'\n</code></pre>\n<p>Use <code>delete</code> to delete a property from <code>process.env</code>.</p>\n<pre><code class=\"language-mjs\">import { env } from 'node:process';\n\nenv.TEST = 1;\ndelete env.TEST;\nconsole.log(env.TEST);\n// => undefined\n</code></pre>\n<pre><code class=\"language-cjs\">const { env } = require('node:process');\n\nenv.TEST = 1;\ndelete env.TEST;\nconsole.log(env.TEST);\n// => undefined\n</code></pre>\n<p>On Windows operating systems, environment variables are case-insensitive.</p>\n<pre><code class=\"language-mjs\">import { env } from 'node:process';\n\nenv.TEST = 1;\nconsole.log(env.test);\n// => 1\n</code></pre>\n<pre><code class=\"language-cjs\">const { env } = require('node:process');\n\nenv.TEST = 1;\nconsole.log(env.test);\n// => 1\n</code></pre>\n<p>Unless explicitly specified when creating a <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> instance,\neach <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> thread has its own copy of <code>process.env</code>, based on its\nparent thread's <code>process.env</code>, or whatever was specified as the <code>env</code> option\nto the <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> constructor. Changes to <code>process.env</code> will not be visible\nacross <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads, and only the main thread can make changes that\nare visible to the operating system or to native add-ons. On Windows, a copy of\n<code>process.env</code> on a <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> instance operates in a case-sensitive manner\nunlike the main thread.</p>"
        },
        {
          "textRaw": "Type: {string[]}",
          "name": "execArgv",
          "type": "string[]",
          "meta": {
            "added": [
              "v0.7.7"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.execArgv</code> property returns the set of Node.js-specific command-line\noptions passed when the Node.js process was launched. These options do not\nappear in the array returned by the <a href=\"#processargv\"><code>process.argv</code></a> property, and do not\ninclude the Node.js executable, the name of the script, or any options following\nthe script name. These options are useful in order to spawn child processes with\nthe same execution environment as the parent.</p>\n<pre><code class=\"language-bash\">node --icu-data-dir=./foo --require ./bar.js script.js --version\n</code></pre>\n<p>Results in <code>process.execArgv</code>:</p>\n<pre><code class=\"language-json\">[\"--icu-data-dir=./foo\", \"--require\", \"./bar.js\"]\n</code></pre>\n<p>And <code>process.argv</code>:</p>\n<pre><code class=\"language-json\">[\"/usr/local/bin/node\", \"script.js\", \"--version\"]\n</code></pre>\n<p>Refer to <a href=\"worker_threads.html#new-workerfilename-options\"><code>Worker</code> constructor</a> for the detailed behavior of worker\nthreads with this property.</p>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "execPath",
          "type": "string",
          "meta": {
            "added": [
              "v0.1.100"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.execPath</code> property returns the absolute pathname of the executable\nthat started the Node.js process. Symbolic links, if any, are resolved.</p>\n<pre><code class=\"language-json\">\"/usr/local/bin/node\"\n</code></pre>"
        },
        {
          "textRaw": "Type: {integer|string|null|undefined} The exit code. For string type, only integer strings (e.g.,'1') are allowed. **Default:** `undefined`.",
          "name": "exitCode",
          "type": "integer|string|null|undefined",
          "meta": {
            "added": [
              "v0.11.8"
            ],
            "changes": [
              {
                "version": "v20.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/43716",
                "description": "Only accepts a code of type number, or of type string if it represents an integer."
              }
            ]
          },
          "default": "`undefined`",
          "desc": "<p>A number which will be the process exit code, when the process either\nexits gracefully, or is exited via <a href=\"#processexitcode\"><code>process.exit()</code></a> without specifying\na code.</p>\n<p>The value of <code>process.exitCode</code> can be updated by either assigning a value to\n<code>process.exitCode</code> or by passing an argument to <a href=\"#processexitcode\"><code>process.exit()</code></a>:</p>\n<pre><code class=\"language-console\">$ node -e 'process.exitCode = 9'; echo $?\n9\n$ node -e 'process.exit(42)'; echo $?\n42\n$ node -e 'process.exitCode = 9; process.exit(42)'; echo $?\n42\n</code></pre>\n<p>The value can also be set implicitly by Node.js when unrecoverable errors occur (e.g.\nsuch as the encountering of an unsettled top-level await). However explicit\nmanipulations of the exit code always take precedence over implicit ones:</p>\n<pre><code class=\"language-console\">$ node --input-type=module -e 'await new Promise(() => {})'; echo $?\n13\n$ node --input-type=module -e 'process.exitCode = 9; await new Promise(() => {})'; echo $?\n9\n</code></pre>",
          "shortDesc": "The exit code. For string type, only integer strings (e.g.,'1') are allowed."
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "cached_builtins",
          "type": "boolean",
          "meta": {
            "added": [
              "v12.0.0"
            ],
            "changes": []
          },
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build is caching builtin modules.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "debug",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.5.5"
            ],
            "changes": []
          },
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build is a debug build.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "inspector",
          "type": "boolean",
          "meta": {
            "added": [
              "v11.10.0"
            ],
            "changes": []
          },
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build includes the inspector.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "ipv6",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.5.3"
            ],
            "changes": [],
            "deprecated": [
              "v23.4.0",
              "v22.13.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated. This property is always true, and any checks based on it are redundant.",
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build includes support for IPv6.</p>\n<p>Since all Node.js builds have IPv6 support, this value is always <code>true</code>.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "require_module",
          "type": "boolean",
          "meta": {
            "added": [
              "v23.0.0",
              "v22.10.0",
              "v20.19.0"
            ],
            "changes": []
          },
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build supports\n<a href=\"modules.html#loading-ecmascript-modules-using-require\">loading ECMAScript modules using <code>require()</code></a>.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "tls",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.5.3"
            ],
            "changes": []
          },
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build includes support for TLS.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "tls_alpn",
          "type": "boolean",
          "meta": {
            "added": [
              "v4.8.0"
            ],
            "changes": [],
            "deprecated": [
              "v23.4.0",
              "v22.13.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated. Use `process.features.tls` instead.",
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build includes support for ALPN in TLS.</p>\n<p>In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional ALPN support.\nThis value is therefore identical to that of <code>process.features.tls</code>.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "tls_ocsp",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.11.13"
            ],
            "changes": [],
            "deprecated": [
              "v23.4.0",
              "v22.13.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated. Use `process.features.tls` instead.",
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build includes support for OCSP in TLS.</p>\n<p>In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional OCSP support.\nThis value is therefore identical to that of <code>process.features.tls</code>.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "tls_sni",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.5.3"
            ],
            "changes": [],
            "deprecated": [
              "v23.4.0",
              "v22.13.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated. Use `process.features.tls` instead.",
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build includes support for SNI in TLS.</p>\n<p>In Node.js 11.0.0 and later versions, the OpenSSL dependencies feature unconditional SNI support.\nThis value is therefore identical to that of <code>process.features.tls</code>.</p>"
        },
        {
          "textRaw": "Type: {boolean|string}",
          "name": "typescript",
          "type": "boolean|string",
          "meta": {
            "added": [
              "v23.0.0",
              "v22.10.0"
            ],
            "changes": [
              {
                "version": "v26.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/61803",
                "description": "Removed `transform` value."
              },
              {
                "version": [
                  "v25.2.0",
                  "v24.12.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/60600",
                "description": "Type stripping is now stable."
              }
            ]
          },
          "stability": 1.2,
          "stabilityText": "Release candidate",
          "desc": "<p>A value that is <code>\"strip\"</code> by default, and <code>false</code> if\nNode.js is run with <code>--no-strip-types</code>.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "uv",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.5.3"
            ],
            "changes": [],
            "deprecated": [
              "v23.4.0",
              "v22.13.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated. This property is always true, and any checks based on it are redundant.",
          "desc": "<p>A boolean value that is <code>true</code> if the current Node.js build includes support for libuv.</p>\n<p>Since it's not possible to build Node.js without libuv, this value is always <code>true</code>.</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "mainModule",
          "type": "Object",
          "meta": {
            "added": [
              "v0.1.17"
            ],
            "changes": [],
            "deprecated": [
              "v14.0.0"
            ]
          },
          "stability": 0,
          "stabilityText": "Deprecated: Use `require.main` instead.",
          "desc": "<p>The <code>process.mainModule</code> property provides an alternative way of retrieving\n<a href=\"modules.html#accessing-the-main-module\"><code>require.main</code></a>. The difference is that if the main module changes at\nruntime, <a href=\"modules.html#accessing-the-main-module\"><code>require.main</code></a> may still refer to the original main module in\nmodules that were required before the change occurred. Generally, it's\nsafe to assume that the two refer to the same module.</p>\n<p>As with <a href=\"modules.html#accessing-the-main-module\"><code>require.main</code></a>, <code>process.mainModule</code> will be <code>undefined</code> if there\nis no entry script.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "noDeprecation",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.8.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.noDeprecation</code> property indicates whether the <code>--no-deprecation</code>\nflag is set on the current Node.js process. See the documentation for\nthe <a href=\"#event-warning\"><code>'warning'</code> event</a> and the\n<a href=\"#processemitwarningwarning-type-code-ctor\"><code>emitWarning()</code> method</a> for more information about this\nflag's behavior.</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "permission",
          "type": "Object",
          "meta": {
            "added": [
              "v20.0.0"
            ],
            "changes": []
          },
          "desc": "<p>This API is available through the <a href=\"cli.html#--permission\"><code>--permission</code></a> flag.</p>\n<p><code>process.permission</code> is an object whose methods are used to manage permissions\nfor the current process. Additional documentation is available in the\n<a href=\"permissions.html#permission-model\">Permission Model</a>.</p>",
          "methods": [
            {
              "textRaw": "`process.permission.has(scope[, reference])`",
              "name": "has",
              "type": "method",
              "meta": {
                "added": [
                  "v20.0.0"
                ],
                "changes": []
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`scope` {string}",
                      "name": "scope",
                      "type": "string"
                    },
                    {
                      "textRaw": "`reference` {string}",
                      "name": "reference",
                      "type": "string",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {boolean}",
                    "name": "return",
                    "type": "boolean"
                  }
                }
              ],
              "desc": "<p>Verifies that the process is able to access the given scope and reference.\nIf no reference is provided, a global scope is assumed, for instance,\n<code>process.permission.has('fs.read')</code> will check if the process has ALL\nfile system read permissions.</p>\n<p>The reference has a meaning based on the provided scope. For example,\nthe reference when the scope is File System means files and folders.</p>\n<p>The available scopes are:</p>\n<ul>\n<li><code>fs</code> - All File System</li>\n<li><code>fs.read</code> - File System read operations</li>\n<li><code>fs.write</code> - File System write operations</li>\n<li><code>child</code> - Child process spawning operations</li>\n<li><code>worker</code> - Worker thread spawning operation</li>\n<li><code>ffi</code> - Foreign function interface operations</li>\n</ul>\n<pre><code class=\"language-js\">// Check if the process has permission to read the README file\nprocess.permission.has('fs.read', './README.md');\n// Check if the process has read permission operations\nprocess.permission.has('fs.read');\n</code></pre>"
            },
            {
              "textRaw": "`process.permission.drop(scope[, reference])`",
              "name": "drop",
              "type": "method",
              "meta": {
                "added": [
                  "v26.3.0"
                ],
                "changes": []
              },
              "stability": 1.1,
              "stabilityText": "Active Development",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`scope` {string}",
                      "name": "scope",
                      "type": "string"
                    },
                    {
                      "textRaw": "`reference` {string}",
                      "name": "reference",
                      "type": "string",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Drops the specified permission from the current process. This operation is\n<strong>irreversible</strong> — once a permission is dropped, it cannot be restored through\nany Node.js API.</p>\n<p>If no reference is provided, the entire scope is dropped. For example,\n<code>process.permission.drop('fs.read')</code> will revoke ALL file system read\npermissions.</p>\n<p>When a reference is provided, only the permission for that specific resource\nis dropped. For example, <code>process.permission.drop('fs.read', '/etc/myapp')</code>\nwill revoke read access to that directory while keeping other read\npermissions intact.</p>\n<p><strong>Important:</strong> You can only drop the exact resource that was explicitly\ngranted. The reference passed to <code>drop()</code> must match the original grant:</p>\n<ul>\n<li>If a permission was granted using a wildcard (<code>*</code>), such as\n<code>--allow-fs-read=*</code>, individual paths cannot be dropped - only the entire\nscope can be dropped (by calling <code>drop()</code> without a reference).</li>\n<li>If a directory was granted (e.g. <code>--allow-fs-read=/my/folder</code>), you cannot\ndrop access to individual files inside it. You must drop the same directory\nthat was granted. Any remaining grants continue to apply.</li>\n</ul>\n<p>The available scopes are the same as <a href=\"#processpermissionhasscope-reference\"><code>process.permission.has()</code></a>:</p>\n<ul>\n<li><code>fs</code> - All File System (drops both read and write)</li>\n<li><code>fs.read</code> - File System read operations</li>\n<li><code>fs.write</code> - File System write operations</li>\n<li><code>child</code> - Child process spawning operations</li>\n<li><code>worker</code> - Worker thread spawning operation</li>\n<li><code>net</code> - Network operations</li>\n<li><code>inspector</code> - Inspector operations</li>\n<li><code>wasi</code> - WASI operations</li>\n<li><code>addon</code> - Native addon operations</li>\n</ul>\n<pre><code class=\"language-js\">const fs = require('node:fs');\n\n// Read configuration during startup\nconst config = fs.readFileSync('/etc/myapp/config.json', 'utf8');\n\n// Drop read access to the config directory after initialization\nprocess.permission.drop('fs.read', '/etc/myapp');\n\n// This will now throw ERR_ACCESS_DENIED\nfs.readFileSync('/etc/myapp/config.json');\n</code></pre>"
            }
          ]
        },
        {
          "textRaw": "Type: {integer}",
          "name": "pid",
          "type": "integer",
          "meta": {
            "added": [
              "v0.1.15"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.pid</code> property returns the PID of the process.</p>\n<pre><code class=\"language-mjs\">import { pid } from 'node:process';\n\nconsole.log(`This process is pid ${pid}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { pid } = require('node:process');\n\nconsole.log(`This process is pid ${pid}`);\n</code></pre>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "platform",
          "type": "string",
          "meta": {
            "added": [
              "v0.1.16"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.platform</code> property returns a string identifying the operating\nsystem platform for which the Node.js binary was compiled.</p>\n<p>Currently possible values are:</p>\n<ul>\n<li><code>'aix'</code></li>\n<li><code>'darwin'</code></li>\n<li><code>'freebsd'</code></li>\n<li><code>'linux'</code></li>\n<li><code>'openbsd'</code></li>\n<li><code>'sunos'</code></li>\n<li><code>'win32'</code></li>\n</ul>\n<pre><code class=\"language-mjs\">import { platform } from 'node:process';\n\nconsole.log(`This platform is ${platform}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { platform } = require('node:process');\n\nconsole.log(`This platform is ${platform}`);\n</code></pre>\n<p>The value <code>'android'</code> may also be returned if the Node.js is built on the\nAndroid operating system. However, Android support in Node.js\n<a href=\"https://github.com/nodejs/node/blob/HEAD/BUILDING.md#android\">is experimental</a>.</p>"
        },
        {
          "textRaw": "Type: {integer}",
          "name": "ppid",
          "type": "integer",
          "meta": {
            "added": [
              "v9.2.0",
              "v8.10.0",
              "v6.13.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.ppid</code> property returns the PID of the parent of the\ncurrent process.</p>\n<pre><code class=\"language-mjs\">import { ppid } from 'node:process';\n\nconsole.log(`The parent process is pid ${ppid}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { ppid } = require('node:process');\n\nconsole.log(`The parent process is pid ${ppid}`);\n</code></pre>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "release",
          "type": "Object",
          "meta": {
            "added": [
              "v3.0.0"
            ],
            "changes": [
              {
                "version": "v4.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/3212",
                "description": "The `lts` property is now supported."
              }
            ]
          },
          "desc": "<p>The <code>process.release</code> property returns an <code>Object</code> containing metadata related\nto the current release, including URLs for the source tarball and headers-only\ntarball.</p>\n<p><code>process.release</code> contains the following properties:</p>\n<ul>\n<li><code>name</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> A value that will always be <code>'node'</code>.</li>\n<li><code>sourceUrl</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> an absolute URL pointing to a <em><code>.tar.gz</code></em> file containing\nthe source code of the current release.</li>\n<li><code>headersUrl</code><a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> an absolute URL pointing to a <em><code>.tar.gz</code></em> file containing\nonly the source header files for the current release. This file is\nsignificantly smaller than the full source file and can be used for compiling\nNode.js native add-ons.</li>\n<li><code>libUrl</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> an absolute URL pointing to a <em><code>node.lib</code></em> file\nmatching the architecture and version of the current release. This file is\nused for compiling Node.js native add-ons. <em>This property is only present on\nWindows builds of Node.js and will be missing on all other platforms.</em></li>\n<li><code>lts</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#string_type\"><code>&#x3C;string></code></a> | <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#undefined_type\"><code>&#x3C;undefined></code></a> a string label identifying the <a href=\"https://github.com/nodejs/Release\">LTS</a> label for this\nrelease. This property only exists for LTS releases and is <code>undefined</code> for all\nother release types, including <em>Current</em> releases. Valid values include the\nLTS Release code names (including those that are no longer supported).\n<ul>\n<li><code>'Fermium'</code> for the 14.x LTS line beginning with 14.15.0.</li>\n<li><code>'Gallium'</code> for the 16.x LTS line beginning with 16.13.0.</li>\n<li><code>'Hydrogen'</code> for the 18.x LTS line beginning with 18.12.0.\nFor other LTS Release code names, see <a href=\"https://github.com/nodejs/node/blob/HEAD/doc/changelogs/CHANGELOG_ARCHIVE.md\">Node.js Changelog Archive</a></li>\n</ul>\n</li>\n</ul>\n<pre><code class=\"language-json\">{\n  \"name\": \"node\",\n  \"lts\": \"Hydrogen\",\n  \"sourceUrl\": \"https://nodejs.org/download/release/v18.12.0/node-v18.12.0.tar.gz\",\n  \"headersUrl\": \"https://nodejs.org/download/release/v18.12.0/node-v18.12.0-headers.tar.gz\",\n  \"libUrl\": \"https://nodejs.org/download/release/v18.12.0/win-x64/node.lib\"\n}\n</code></pre>\n<p>In custom builds from non-release versions of the source tree, only the\n<code>name</code> property may be present. The additional properties should not be\nrelied upon to exist.</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "report",
          "type": "Object",
          "meta": {
            "added": [
              "v11.8.0"
            ],
            "changes": [
              {
                "version": [
                  "v13.12.0",
                  "v12.17.0"
                ],
                "pr-url": "https://github.com/nodejs/node/pull/32242",
                "description": "This API is no longer experimental."
              }
            ]
          },
          "desc": "<p><code>process.report</code> is an object whose methods are used to generate diagnostic\nreports for the current process. Additional documentation is available in the\n<a href=\"report.html\">report documentation</a>.</p>",
          "properties": [
            {
              "textRaw": "Type: {boolean}",
              "name": "compact",
              "type": "boolean",
              "meta": {
                "added": [
                  "v13.12.0",
                  "v12.17.0"
                ],
                "changes": []
              },
              "desc": "<p>Write reports in a compact format, single-line JSON, more easily consumable\nby log processing systems than the default multi-line format designed for\nhuman consumption.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\n\nconsole.log(`Reports are compact? ${report.compact}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\n\nconsole.log(`Reports are compact? ${report.compact}`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "directory",
              "type": "string",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Directory where the report is written. The default value is the empty string,\nindicating that reports are written to the current working directory of the\nNode.js process.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\n\nconsole.log(`Report directory is ${report.directory}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\n\nconsole.log(`Report directory is ${report.directory}`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "filename",
              "type": "string",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "desc": "<p>Filename where the report is written. If set to the empty string, the output\nfilename will be comprised of a timestamp, PID, and sequence number. The default\nvalue is the empty string.</p>\n<p>If the value of <code>process.report.filename</code> is set to <code>'stdout'</code> or <code>'stderr'</code>,\nthe report is written to the stdout or stderr of the process respectively.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\n\nconsole.log(`Report filename is ${report.filename}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\n\nconsole.log(`Report filename is ${report.filename}`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "reportOnFatalError",
              "type": "boolean",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v15.0.0",
                      "v14.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/35654",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "desc": "<p>If <code>true</code>, a diagnostic report is generated on fatal errors, such as out of\nmemory errors or failed C++ assertions.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\n\nconsole.log(`Report on fatal error: ${report.reportOnFatalError}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\n\nconsole.log(`Report on fatal error: ${report.reportOnFatalError}`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "reportOnSignal",
              "type": "boolean",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "desc": "<p>If <code>true</code>, a diagnostic report is generated when the process receives the\nsignal specified by <code>process.report.signal</code>.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\n\nconsole.log(`Report on signal: ${report.reportOnSignal}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\n\nconsole.log(`Report on signal: ${report.reportOnSignal}`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "reportOnUncaughtException",
              "type": "boolean",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "desc": "<p>If <code>true</code>, a diagnostic report is generated on uncaught exception.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\n\nconsole.log(`Report on exception: ${report.reportOnUncaughtException}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\n\nconsole.log(`Report on exception: ${report.reportOnUncaughtException}`);\n</code></pre>"
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "excludeEnv",
              "type": "boolean",
              "meta": {
                "added": [
                  "v23.3.0",
                  "v22.13.0"
                ],
                "changes": []
              },
              "desc": "<p>If <code>true</code>, a diagnostic report is generated without the environment variables.</p>"
            },
            {
              "textRaw": "Type: {string}",
              "name": "signal",
              "type": "string",
              "meta": {
                "added": [
                  "v11.12.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "desc": "<p>The signal used to trigger the creation of a diagnostic report. Defaults to\n<code>'SIGUSR2'</code>.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\n\nconsole.log(`Report signal: ${report.signal}`);\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\n\nconsole.log(`Report signal: ${report.signal}`);\n</code></pre>"
            }
          ],
          "methods": [
            {
              "textRaw": "`process.report.getReport([err])`",
              "name": "getReport",
              "type": "method",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`err` {Error} A custom error used for reporting the JavaScript stack.",
                      "name": "err",
                      "type": "Error",
                      "desc": "A custom error used for reporting the JavaScript stack.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Object}",
                    "name": "return",
                    "type": "Object"
                  }
                }
              ],
              "desc": "<p>Returns a JavaScript Object representation of a diagnostic report for the\nrunning process. The report's JavaScript stack trace is taken from <code>err</code>, if\npresent.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\nimport util from 'node:util';\n\nconst data = report.getReport();\nconsole.log(data.header.nodejsVersion);\n\n// Similar to process.report.writeReport()\nimport fs from 'node:fs';\nfs.writeFileSync('my-report.log', util.inspect(data), 'utf8');\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\nconst util = require('node:util');\n\nconst data = report.getReport();\nconsole.log(data.header.nodejsVersion);\n\n// Similar to process.report.writeReport()\nconst fs = require('node:fs');\nfs.writeFileSync('my-report.log', util.inspect(data), 'utf8');\n</code></pre>\n<p>Additional documentation is available in the <a href=\"report.html\">report documentation</a>.</p>"
            },
            {
              "textRaw": "`process.report.writeReport([filename][, err])`",
              "name": "writeReport",
              "type": "method",
              "meta": {
                "added": [
                  "v11.8.0"
                ],
                "changes": [
                  {
                    "version": [
                      "v13.12.0",
                      "v12.17.0"
                    ],
                    "pr-url": "https://github.com/nodejs/node/pull/32242",
                    "description": "This API is no longer experimental."
                  }
                ]
              },
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`filename` {string} Name of the file where the report is written. This should be a relative path, that will be appended to the directory specified in `process.report.directory`, or the current working directory of the Node.js process, if unspecified.",
                      "name": "filename",
                      "type": "string",
                      "desc": "Name of the file where the report is written. This should be a relative path, that will be appended to the directory specified in `process.report.directory`, or the current working directory of the Node.js process, if unspecified.",
                      "optional": true
                    },
                    {
                      "textRaw": "`err` {Error} A custom error used for reporting the JavaScript stack.",
                      "name": "err",
                      "type": "Error",
                      "desc": "A custom error used for reporting the JavaScript stack.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {string} Returns the filename of the generated report.",
                    "name": "return",
                    "type": "string",
                    "desc": "Returns the filename of the generated report."
                  }
                }
              ],
              "desc": "<p>Writes a diagnostic report to a file. If <code>filename</code> is not provided, the default\nfilename includes the date, time, PID, and a sequence number. The report's\nJavaScript stack trace is taken from <code>err</code>, if present.</p>\n<p>If the value of <code>filename</code> is set to <code>'stdout'</code> or <code>'stderr'</code>, the report is\nwritten to the stdout or stderr of the process respectively.</p>\n<pre><code class=\"language-mjs\">import { report } from 'node:process';\n\nreport.writeReport();\n</code></pre>\n<pre><code class=\"language-cjs\">const { report } = require('node:process');\n\nreport.writeReport();\n</code></pre>\n<p>Additional documentation is available in the <a href=\"report.html\">report documentation</a>.</p>"
            }
          ]
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "sourceMapsEnabled",
          "type": "boolean",
          "meta": {
            "added": [
              "v20.7.0",
              "v18.19.0"
            ],
            "changes": []
          },
          "stability": 1,
          "stabilityText": "Experimental: Use `module.getSourceMapsSupport()` instead.",
          "desc": "<p>The <code>process.sourceMapsEnabled</code> property returns whether the\n<a href=\"https://tc39.es/ecma426/\">Source Map</a> support for stack traces is enabled.</p>"
        },
        {
          "textRaw": "Type: {Stream}",
          "name": "stderr",
          "type": "Stream",
          "desc": "<p>The <code>process.stderr</code> property returns a stream connected to\n<code>stderr</code> (fd <code>2</code>). It is a <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a> (which is a <a href=\"stream.html#duplex-and-transform-streams\">Duplex</a>\nstream) unless fd <code>2</code> refers to a file, in which case it is\na <a href=\"stream.html#writable-streams\">Writable</a> stream.</p>\n<p><code>process.stderr</code> differs from other Node.js streams in important ways. See\n<a href=\"#a-note-on-process-io\">note on process I/O</a> for more information.</p>",
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "fd",
              "type": "number",
              "desc": "<p>This property refers to the value of underlying file descriptor of\n<code>process.stderr</code>. The value is fixed at <code>2</code>. In <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads,\nthis field does not exist.</p>"
            }
          ]
        },
        {
          "textRaw": "Type: {Stream}",
          "name": "stdin",
          "type": "Stream",
          "desc": "<p>The <code>process.stdin</code> property returns a stream connected to\n<code>stdin</code> (fd <code>0</code>). It is a <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a> (which is a <a href=\"stream.html#duplex-and-transform-streams\">Duplex</a>\nstream) unless fd <code>0</code> refers to a file, in which case it is\na <a href=\"stream.html#readable-streams\">Readable</a> stream.</p>\n<p>For details of how to read from <code>stdin</code> see <a href=\"stream.html#readablereadsize\"><code>readable.read()</code></a>.</p>\n<p>As a <a href=\"stream.html#duplex-and-transform-streams\">Duplex</a> stream, <code>process.stdin</code> can also be used in \"old\" mode that\nis compatible with scripts written for Node.js prior to v0.10.\nFor more information see <a href=\"stream.html#compatibility-with-older-nodejs-versions\">Stream compatibility</a>.</p>\n<p>In \"old\" streams mode the <code>stdin</code> stream is paused by default, so one\nmust call <code>process.stdin.resume()</code> to read from it. Note also that calling\n<code>process.stdin.resume()</code> itself would switch stream to \"old\" mode.</p>",
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "fd",
              "type": "number",
              "desc": "<p>This property refers to the value of underlying file descriptor of\n<code>process.stdin</code>. The value is fixed at <code>0</code>. In <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads,\nthis field does not exist.</p>"
            }
          ]
        },
        {
          "textRaw": "Type: {Stream}",
          "name": "stdout",
          "type": "Stream",
          "desc": "<p>The <code>process.stdout</code> property returns a stream connected to\n<code>stdout</code> (fd <code>1</code>). It is a <a href=\"net.html#class-netsocket\"><code>net.Socket</code></a> (which is a <a href=\"stream.html#duplex-and-transform-streams\">Duplex</a>\nstream) unless fd <code>1</code> refers to a file, in which case it is\na <a href=\"stream.html#writable-streams\">Writable</a> stream.</p>\n<p>For example, to copy <code>process.stdin</code> to <code>process.stdout</code>:</p>\n<pre><code class=\"language-mjs\">import { stdin, stdout } from 'node:process';\n\nstdin.pipe(stdout);\n</code></pre>\n<pre><code class=\"language-cjs\">const { stdin, stdout } = require('node:process');\n\nstdin.pipe(stdout);\n</code></pre>\n<p><code>process.stdout</code> differs from other Node.js streams in important ways. See\n<a href=\"#a-note-on-process-io\">note on process I/O</a> for more information.</p>",
          "properties": [
            {
              "textRaw": "Type: {number}",
              "name": "fd",
              "type": "number",
              "desc": "<p>This property refers to the value of underlying file descriptor of\n<code>process.stdout</code>. The value is fixed at <code>1</code>. In <a href=\"worker_threads.html#class-worker\"><code>Worker</code></a> threads,\nthis field does not exist.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "A note on process I/O",
              "name": "a_note_on_process_i/o",
              "type": "module",
              "desc": "<p><code>process.stdout</code> and <code>process.stderr</code> differ from other Node.js streams in\nimportant ways:</p>\n<ol>\n<li>They are used internally by <a href=\"console.html#consolelogdata-args\"><code>console.log()</code></a> and <a href=\"console.html#consoleerrordata-args\"><code>console.error()</code></a>,\nrespectively.</li>\n<li>Writes may be synchronous depending on what the stream is connected to\nand whether the system is Windows or POSIX:\n<ul>\n<li>Files: <em>synchronous</em> on Windows and POSIX</li>\n<li>TTYs (Terminals): <em>asynchronous</em> on Windows, <em>synchronous</em> on POSIX</li>\n<li>Pipes (and sockets): <em>synchronous</em> on Windows, <em>asynchronous</em> on POSIX</li>\n</ul>\n</li>\n</ol>\n<p>These behaviors are partly for historical reasons, as changing them would\ncreate backward incompatibility, but they are also expected by some users.</p>\n<p>Synchronous writes avoid problems such as output written with <code>console.log()</code> or\n<code>console.error()</code> being unexpectedly interleaved, or not written at all if\n<code>process.exit()</code> is called before an asynchronous write completes. See\n<a href=\"#processexitcode\"><code>process.exit()</code></a> for more information.</p>\n<p><em><strong>Warning</strong></em>: Synchronous writes block the event loop until the write has\ncompleted. This can be near instantaneous in the case of output to a file, but\nunder high system load, pipes that are not being read at the receiving end, or\nwith slow terminals or file systems, it's possible for the event loop to be\nblocked often enough and long enough to have severe negative performance\nimpacts. This may not be a problem when writing to an interactive terminal\nsession, but consider this particularly careful when doing production logging to\nthe process output streams.</p>\n<p>To check if a stream is connected to a <a href=\"tty.html#tty\">TTY</a> context, check the <code>isTTY</code>\nproperty.</p>\n<p>For instance:</p>\n<pre><code class=\"language-console\">$ node -p \"Boolean(process.stdin.isTTY)\"\ntrue\n$ echo \"foo\" | node -p \"Boolean(process.stdin.isTTY)\"\nfalse\n$ node -p \"Boolean(process.stdout.isTTY)\"\ntrue\n$ node -p \"Boolean(process.stdout.isTTY)\" | cat\nfalse\n</code></pre>\n<p>See the <a href=\"tty.html#tty\">TTY</a> documentation for more information.</p>",
              "displayName": "A note on process I/O"
            }
          ]
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "throwDeprecation",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.9.12"
            ],
            "changes": []
          },
          "desc": "<p>The initial value of <code>process.throwDeprecation</code> indicates whether the\n<code>--throw-deprecation</code> flag is set on the current Node.js process.\n<code>process.throwDeprecation</code> is mutable, so whether or not deprecation\nwarnings result in errors may be altered at runtime. See the\ndocumentation for the <a href=\"#event-warning\"><code>'warning'</code> event</a> and the\n<a href=\"#processemitwarningwarning-type-code-ctor\"><code>emitWarning()</code> method</a> for more information.</p>\n<pre><code class=\"language-console\">$ node --throw-deprecation -p \"process.throwDeprecation\"\ntrue\n$ node -p \"process.throwDeprecation\"\nundefined\n$ node\n> process.emitWarning('test', 'DeprecationWarning');\nundefined\n> (node:26598) DeprecationWarning: test\n> process.throwDeprecation = true;\ntrue\n> process.emitWarning('test', 'DeprecationWarning');\nThrown:\n[DeprecationWarning: test] { name: 'DeprecationWarning' }\n</code></pre>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "title",
          "type": "string",
          "meta": {
            "added": [
              "v0.1.104"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.title</code> property returns the current process title (i.e. returns\nthe current value of <code>ps</code>). Assigning a new value to <code>process.title</code> modifies\nthe current value of <code>ps</code>.</p>\n<p>When a new value is assigned, different platforms will impose different maximum\nlength restrictions on the title. Usually such restrictions are quite limited.\nFor instance, on Linux and macOS, <code>process.title</code> is limited to the size of the\nbinary name plus the length of the command-line arguments because setting the\n<code>process.title</code> overwrites the <code>argv</code> memory of the process. Node.js 0.8\nallowed for longer process title strings by also overwriting the <code>environ</code>\nmemory but that was potentially insecure and confusing in some (rather obscure)\ncases.</p>\n<p>Assigning a value to <code>process.title</code> might not result in an accurate label\nwithin process manager applications such as macOS Activity Monitor or Windows\nServices Manager.</p>"
        },
        {
          "textRaw": "Type: {boolean}",
          "name": "traceDeprecation",
          "type": "boolean",
          "meta": {
            "added": [
              "v0.8.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.traceDeprecation</code> property indicates whether the\n<code>--trace-deprecation</code> flag is set on the current Node.js process. See the\ndocumentation for the <a href=\"#event-warning\"><code>'warning'</code> event</a> and the\n<a href=\"#processemitwarningwarning-type-code-ctor\"><code>emitWarning()</code> method</a> for more information about this\nflag's behavior.</p>"
        },
        {
          "textRaw": "{boolean}",
          "name": "traceProcessWarnings",
          "type": "boolean",
          "meta": {
            "added": [
              "v6.10.0"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.traceProcessWarnings</code> property indicates whether the <code>--trace-warnings</code> flag\nis set on the current Node.js process. This property allows programmatic control over the\ntracing of warnings, enabling or disabling stack traces for warnings at runtime.</p>\n<pre><code class=\"language-js\">// Enable trace warnings\nprocess.traceProcessWarnings = true;\n\n// Emit a warning with a stack trace\nprocess.emitWarning('Warning with stack trace');\n\n// Disable trace warnings\nprocess.traceProcessWarnings = false;\n</code></pre>"
        },
        {
          "textRaw": "Type: {string}",
          "name": "version",
          "type": "string",
          "meta": {
            "added": [
              "v0.1.3"
            ],
            "changes": []
          },
          "desc": "<p>The <code>process.version</code> property contains the Node.js version string.</p>\n<pre><code class=\"language-mjs\">import { version } from 'node:process';\n\nconsole.log(`Version: ${version}`);\n// Version: v14.8.0\n</code></pre>\n<pre><code class=\"language-cjs\">const { version } = require('node:process');\n\nconsole.log(`Version: ${version}`);\n// Version: v14.8.0\n</code></pre>\n<p>To get the version string without the prepended <em>v</em>, use\n<code>process.versions.node</code>.</p>"
        },
        {
          "textRaw": "Type: {Object}",
          "name": "versions",
          "type": "Object",
          "meta": {
            "added": [
              "v0.2.0"
            ],
            "changes": [
              {
                "version": "v9.0.0",
                "pr-url": "https://github.com/nodejs/node/pull/15785",
                "description": "The `v8` property now includes a Node.js specific suffix."
              },
              {
                "version": "v4.2.0",
                "pr-url": "https://github.com/nodejs/node/pull/3102",
                "description": "The `icu` property is now supported."
              }
            ]
          },
          "desc": "<p>The <code>process.versions</code> property returns an object listing the version strings of\nNode.js and its dependencies. <code>process.versions.modules</code> indicates the current\nABI version, which is increased whenever a C++ API changes. Node.js will refuse\nto load modules that were compiled against a different module ABI version.</p>\n<pre><code class=\"language-mjs\">import { versions } from 'node:process';\n\nconsole.log(versions);\n</code></pre>\n<pre><code class=\"language-cjs\">const { versions } = require('node:process');\n\nconsole.log(versions);\n</code></pre>\n<p>Will generate an object similar to:</p>\n<pre><code class=\"language-console\">{ node: '26.0.0-pre',\n  acorn: '8.15.0',\n  ada: '3.4.1',\n  amaro: '1.1.5',\n  ares: '1.34.6',\n  brotli: '1.2.0',\n  merve: '1.0.0',\n  cldr: '48.0',\n  icu: '78.2',\n  llhttp: '9.3.0',\n  modules: '144',\n  napi: '10',\n  nbytes: '0.1.1',\n  ncrypto: '0.0.1',\n  nghttp2: '1.68.0',\n  nghttp3: '',\n  ngtcp2: '',\n  openssl: '3.5.4',\n  simdjson: '4.2.4',\n  simdutf: '7.3.3',\n  sqlite: '3.51.2',\n  tz: '2025c',\n  undici: '7.18.2',\n  unicode: '17.0',\n  uv: '1.51.0',\n  uvwasi: '0.0.23',\n  v8: '14.3.127.18-node.10',\n  zlib: '1.3.1-e00f703',\n  zstd: '1.5.7' }\n</code></pre>"
        }
      ],
      "source": "doc/api/process.md"
    }
  ],
  "methods": [
    {
      "textRaw": "`atob(data)`",
      "name": "atob",
      "type": "method",
      "meta": {
        "added": [
          "v16.0.0"
        ],
        "changes": []
      },
      "stability": 3,
      "stabilityText": "Legacy. Use `Buffer.from(data, 'base64')` instead.",
      "signatures": [
        {
          "params": [
            {
              "name": "data"
            }
          ]
        }
      ],
      "desc": "<p>Global alias for <a href=\"buffer.html#bufferatobdata\"><code>buffer.atob()</code></a>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`btoa(data)`",
      "name": "btoa",
      "type": "method",
      "meta": {
        "added": [
          "v16.0.0"
        ],
        "changes": []
      },
      "stability": 3,
      "stabilityText": "Legacy. Use `buf.toString('base64')` instead.",
      "signatures": [
        {
          "params": [
            {
              "name": "data"
            }
          ]
        }
      ],
      "desc": "<p>Global alias for <a href=\"buffer.html#bufferbtoadata\"><code>buffer.btoa()</code></a>.</p>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`clearImmediate(immediateObject)`",
      "name": "clearImmediate",
      "type": "method",
      "meta": {
        "added": [
          "v0.9.1"
        ],
        "changes": []
      },
      "signatures": [
        {
          "params": [
            {
              "name": "immediateObject"
            }
          ]
        }
      ],
      "desc": "<p><a href=\"timers.html#clearimmediateimmediate\"><code>clearImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`clearInterval(intervalObject)`",
      "name": "clearInterval",
      "type": "method",
      "meta": {
        "added": [
          "v0.0.1"
        ],
        "changes": []
      },
      "signatures": [
        {
          "params": [
            {
              "name": "intervalObject"
            }
          ]
        }
      ],
      "desc": "<p><a href=\"timers.html#clearintervaltimeout\"><code>clearInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`clearTimeout(timeoutObject)`",
      "name": "clearTimeout",
      "type": "method",
      "meta": {
        "added": [
          "v0.0.1"
        ],
        "changes": []
      },
      "signatures": [
        {
          "params": [
            {
              "name": "timeoutObject"
            }
          ]
        }
      ],
      "desc": "<p><a href=\"timers.html#cleartimeouttimeout\"><code>clearTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`queueMicrotask(callback)`",
      "name": "queueMicrotask",
      "type": "method",
      "meta": {
        "added": [
          "v11.0.0"
        ],
        "changes": []
      },
      "signatures": [
        {
          "params": [
            {
              "textRaw": "`callback` {Function} Function to be queued.",
              "name": "callback",
              "type": "Function",
              "desc": "Function to be queued."
            }
          ]
        }
      ],
      "desc": "<p>The <code>queueMicrotask()</code> method queues a microtask to invoke <code>callback</code>. If\n<code>callback</code> throws an exception, the <a href=\"process.html#process\"><code>process</code> object</a> <code>'uncaughtException'</code>\nevent will be emitted.</p>\n<p>The microtask queue is managed by V8 and may be used in a similar manner to\nthe <a href=\"process.html#processnexttickcallback-args\"><code>process.nextTick()</code></a> queue, which is managed by Node.js. The\n<code>process.nextTick()</code> queue is always processed before the microtask queue\nwithin each turn of the Node.js event loop.</p>\n<pre><code class=\"language-js\">// Here, `queueMicrotask()` is used to ensure the 'load' event is always\n// emitted asynchronously, and therefore consistently. Using\n// `process.nextTick()` here would result in the 'load' event always emitting\n// before any other promise jobs.\n\nDataHandler.prototype.load = async function load(key) {\n  const hit = this._cache.get(key);\n  if (hit !== undefined) {\n    queueMicrotask(() => {\n      this.emit('load', hit);\n    });\n    return;\n  }\n\n  const data = await fetchData(key);\n  this._cache.set(key, data);\n  this.emit('load', data);\n};\n</code></pre>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`require()`",
      "name": "require",
      "type": "method",
      "signatures": [
        {
          "params": []
        }
      ],
      "desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#requireid\"><code>require()</code></a>.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`setImmediate(callback[, ...args])`",
      "name": "setImmediate",
      "type": "method",
      "meta": {
        "added": [
          "v0.9.1"
        ],
        "changes": []
      },
      "signatures": [
        {
          "params": [
            {
              "name": "callback"
            },
            {
              "name": "...args",
              "optional": true
            }
          ]
        }
      ],
      "desc": "<p><a href=\"timers.html#setimmediatecallback-args\"><code>setImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`setInterval(callback, delay[, ...args])`",
      "name": "setInterval",
      "type": "method",
      "meta": {
        "added": [
          "v0.0.1"
        ],
        "changes": []
      },
      "signatures": [
        {
          "params": [
            {
              "name": "callback"
            },
            {
              "name": "delay"
            },
            {
              "name": "...args",
              "optional": true
            }
          ]
        }
      ],
      "desc": "<p><a href=\"timers.html#setintervalcallback-delay-args\"><code>setInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`setTimeout(callback, delay[, ...args])`",
      "name": "setTimeout",
      "type": "method",
      "meta": {
        "added": [
          "v0.0.1"
        ],
        "changes": []
      },
      "signatures": [
        {
          "params": [
            {
              "name": "callback"
            },
            {
              "name": "delay"
            },
            {
              "name": "...args",
              "optional": true
            }
          ]
        }
      ],
      "desc": "<p><a href=\"timers.html#settimeoutcallback-delay-args\"><code>setTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>",
      "source": "doc/api/globals.md"
    },
    {
      "textRaw": "`structuredClone(value[, options])`",
      "name": "structuredClone",
      "type": "method",
      "meta": {
        "added": [
          "v17.0.0"
        ],
        "changes": []
      },
      "signatures": [
        {
          "params": [
            {
              "name": "value"
            },
            {
              "name": "options",
              "optional": true
            }
          ]
        }
      ],
      "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone\"><code>structuredClone</code></a> method.</p>",
      "source": "doc/api/globals.md"
    }
  ]
}